rbb 99/03/15 10:22:33
Modified: pthreads/src/main buff.c Log: Fix recv and send withtimeout. I used recv and send instead or read and write. Revision Changes Path 1.5 +7 -6 apache-apr/pthreads/src/main/buff.c Index: buff.c =================================================================== RCS file: /home/cvs/apache-apr/pthreads/src/main/buff.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- buff.c 1999/03/15 14:26:49 1.4 +++ buff.c 1999/03/15 18:22:31 1.5 @@ -238,10 +238,11 @@ tv.tv_sec = sec; if (tv.tv_sec == 0) { - return (send(sock, buf, len, flags)); + return (write(sock, buf, len)); } ap_bnonblock(sock); - rv = send(sock, buf, len, flags); + rv = write(sock, buf, len); + if (rv == -1) { err = errno; if (err == EAGAIN || errno == EINTR) { @@ -255,7 +256,7 @@ err = errno; } else { - rv = send(sock, buf, len, flags); + rv = write(sock, buf, len); } } } @@ -272,10 +273,10 @@ tv.tv_sec = sec; if (tv.tv_sec == 0) { - return (recv(sock, buf, len, flags)); + return (read(sock, buf, len)); } ap_bnonblock(sock); - rv = recv(sock, buf, len, flags); + rv = read(sock, buf, len); if (rv == -1) { err = errno; if (err == EAGAIN || errno == EINTR) { @@ -289,7 +290,7 @@ err = errno; } else { - rv = recv(sock, buf, len, flags); + rv = read(sock, buf, len); if (rv == -1) err = errno; }