Mercurial > libavformat.hg
diff tcp.c @ 261:5f27f90ed496 libavformat
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.
| author | philipjsg |
|---|---|
| date | Mon, 29 Sep 2003 01:41:30 +0000 |
| parents | b0771ae979e3 |
| children | 2f56d366a787 |
line wrap: on
line diff
--- a/tcp.c Sun Sep 28 22:53:25 2003 +0000 +++ b/tcp.c Mon Sep 29 01:41:30 2003 +0000 @@ -200,12 +200,16 @@ #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; }
