Commit 6c8e0d4d authored by Philip Gladstone's avatar Philip Gladstone

Fix a very nasty problem with extra bytes appearing in TCP data streams.

Whenever there was an EINTR/EAGAIN return, then a byte in the data stream
would be duplicated!! This fix should allow ffserver to work again.

Originally committed as revision 2317 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 05ab0b76
...@@ -200,12 +200,16 @@ static int tcp_write(URLContext *h, uint8_t *buf, int size) ...@@ -200,12 +200,16 @@ static int tcp_write(URLContext *h, uint8_t *buf, int size)
#else #else
ret = write(s->fd, buf, size); ret = write(s->fd, buf, size);
#endif #endif
if (ret < 0 && errno != EINTR && errno != EAGAIN) if (ret < 0) {
if (errno != EINTR && errno != EAGAIN) {
#ifdef __BEOS__ #ifdef __BEOS__
return errno; return errno;
#else #else
return -errno; return -errno;
#endif #endif
}
continue;
}
size -= ret; size -= ret;
buf += ret; buf += 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