diff options
Diffstat (limited to 'stream/librtsp/rtsp_session.c')
-rw-r--r-- | stream/librtsp/rtsp_session.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/stream/librtsp/rtsp_session.c b/stream/librtsp/rtsp_session.c index 8aaace4a01..a5c6655cf5 100644 --- a/stream/librtsp/rtsp_session.c +++ b/stream/librtsp/rtsp_session.c @@ -208,6 +208,8 @@ int rtsp_session_read (rtsp_session_t *this, char *data, int len) { (char *) (this->real_session->recv + this->real_session->recv_read); int fill = this->real_session->recv_size - this->real_session->recv_read; + if(this->real_session->rdteof) + return -1; if (len < 0) return 0; if (this->real_session->recv_size < 0) return -1; while (to_copy > fill) { @@ -218,8 +220,10 @@ int rtsp_session_read (rtsp_session_t *this, char *data, int len) { this->real_session->recv_read = 0; this->real_session->recv_size = real_get_rdt_chunk (this->s, (char **)&(this->real_session->recv)); - if (this->real_session->recv_size < 0) - return -1; + if (this->real_session->recv_size < 0) { + this->real_session->rdteof = 1; + this->real_session->recv_size = 0; + } source = (char *) this->real_session->recv; fill = this->real_session->recv_size; |