Commit 6155d385 authored by philipjsg's avatar philipjsg

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.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@2317 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 1fb92cbc
......@@ -200,12 +200,16 @@ static int tcp_write(URLContext *h, uint8_t *buf, int size)
#else
ret = write(s->fd, buf, size);
#endif
if (ret < 0 && errno != EINTR && errno != EAGAIN)
if (ret < 0) {
if (errno != EINTR && errno != EAGAIN) {
#ifdef __BEOS__
return errno;
return errno;
#else
return -errno;
return -errno;
#endif
}
continue;
}
size -= 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