mirror of https://git.ffmpeg.org/ffmpeg.git
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
|
#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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue