# HG changeset patch # User philipjsg # Date 1064799690 0 # Node ID 5f27f90ed49662c0e1918e18c3912e8a91591269 # Parent f3b8a6e60e7175c99075dae7377654cce1e0653b 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. diff -r f3b8a6e60e71 -r 5f27f90ed496 tcp.c --- 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; }