Commit 1b45e6db authored by Bela Bodecs's avatar Bela Bodecs Committed by Nicolas George

avformat/unix: fix handling of EOF in case of SOCK_STREAM.

When recv() returns 0 in case of SOCK_STREAM type, it means EOF and with
this patch returns value accordingly.
Signed-off-by: 's avatarBela Bodecs <bodecsb@vivanet.hu>
parent 36cf3eb7
...@@ -111,6 +111,8 @@ static int unix_read(URLContext *h, uint8_t *buf, int size) ...@@ -111,6 +111,8 @@ static int unix_read(URLContext *h, uint8_t *buf, int size)
return ret; return ret;
} }
ret = recv(s->fd, buf, size, 0); ret = recv(s->fd, buf, size, 0);
if (!ret && s->type == SOCK_STREAM)
return AVERROR_EOF;
return ret < 0 ? ff_neterrno() : ret; return ret < 0 ? ff_neterrno() : ret;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment