From: Bill Stoddard Date: Sat, 9 Feb 2002 14:51:30 +0000 (+0000) Subject: Win32: Eliminate blocking network i/o in the Windows code paths. In practice X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70c7daf38d63511b5e9a82492b507ff0bd20332e;p=thirdparty%2Fapache%2Fhttpd.git Win32: Eliminate blocking network i/o in the Windows code paths. In practice only sends() were ever blocking. That any network i/o was ever blocking could be considered a bug in Apache. This patch seems to work around a bug in WinXP that causes network write data corruption. The bug appears to be tickled by the combined use of WSADuplicateSocket and blocking sends(). Allan Edwards is submitting a bug report to Microsoft. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@93353 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/CHANGES b/src/CHANGES index f23646a0558..04b63df4ad6 100644 --- a/src/CHANGES +++ b/src/CHANGES @@ -1,5 +1,10 @@ Changes with Apache 1.3.24 - + *) Win32: Work around a bug in Windows XP that caused data + corruption on writes to the network. The WinXP bug + is tickled by the combined use of WSADuplicateSocket + and blocking send() calls. + [Bill Stoddard, Bill Rowe, Allan Edwards, Szabolcs Szakacsits] + *) Add 'IgnoreCase' keyword to the IndexOptions directive; if active, upper- and lower-case letters are insignificant in ordering. In other words, all A* and a* files will be diff --git a/src/main/buff.c b/src/main/buff.c index 8c5fdc2a955..189e074af4a 100644 --- a/src/main/buff.c +++ b/src/main/buff.c @@ -137,8 +137,7 @@ API_EXPORT(int) ap_sendwithtimeout(int sock, const char *buf, int len, int flags int rv; int retry; - if (!(tv.tv_sec = ap_check_alarm())) - return (send(sock, buf, len, flags)); + tv.tv_sec = ap_check_alarm(); rv = ioctlsocket(sock, FIONBIO, (u_long*)&iostate); iostate = 0; @@ -204,8 +203,7 @@ API_EXPORT(int) ap_recvwithtimeout(int sock, char *buf, int len, int flags) int rv; int retry; - if (!(tv.tv_sec = ap_check_alarm())) - return (recv(sock, buf, len, flags)); + tv.tv_sec = ap_check_alarm(); rv = ioctlsocket(sock, FIONBIO, (u_long*)&iostate); iostate = 0;