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
This commit is contained in:
parent
05ab0b76b7
commit
6c8e0d4d46
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user