From 64b6b6b1aec95dcfa69f8892ad8a72c1a2379252 Mon Sep 17 00:00:00 2001 From: robs Date: Thu, 5 Dec 2002 02:41:26 +0000 Subject: [PATCH] [WIN32] Fix a delay in handling large POSTs to named pipe based servers. Philip Gladstone [philip@okena.com] --- CHANGES | 3 +++ mod_fastcgi.c | 34 +++++++++++++++++++--------------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/CHANGES b/CHANGES index dfcf0ef..86109aa 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ 2.2.13 + *) [WIN32] Fix a delay in handling large POSTs to named pipe based + servers. Philip Gladstone [philip@okena.com] + *) [*nix/AP2] Prevent the module from being initalized twice at startup (resulting in confusing error messages to the log). diff --git a/mod_fastcgi.c b/mod_fastcgi.c index 1951ec5..7609291 100644 --- a/mod_fastcgi.c +++ b/mod_fastcgi.c @@ -3,7 +3,7 @@ * * Apache server module for FastCGI. * - * $Id: mod_fastcgi.c,v 1.145 2002/10/22 01:02:18 robs Exp $ + * $Id: mod_fastcgi.c,v 1.146 2002/12/05 02:41:26 robs Exp $ * * Copyright (c) 1995-1996 Open Market, Inc. * @@ -1616,8 +1616,8 @@ SERVER_SEND: if (WriteFile((HANDLE) fr->fd, b->begin, len, &sent, &sov)) { + /* sov.hEvent is set */ fcgi_buf_removed(b, sent); - ResetEvent(sov.hEvent); } else if (GetLastError() == ERROR_IO_PENDING) { @@ -1817,21 +1817,25 @@ SERVER_SEND: if (i == 0) { - DWORD sent; - - if (GetOverlappedResult((HANDLE) fr->fd, &sov, &sent, FALSE)) - { - send_pending = 0; - ResetEvent(sov.hEvent); - fcgi_buf_removed(fr->serverOutputBuffer, sent); - } - else + if (send_pending) { - ap_log_rerror(FCGI_LOG_ERR, r, "FastCGI: comm with server " - "\"%s\" aborted: GetOverlappedResult() failed", fr->fs_path); - state = STATE_ERROR; - break; + DWORD sent; + + if (GetOverlappedResult((HANDLE) fr->fd, &sov, &sent, FALSE)) + { + send_pending = 0; + fcgi_buf_removed(fr->serverOutputBuffer, sent); + } + else + { + ap_log_rerror(FCGI_LOG_ERR, r, "FastCGI: comm with server " + "\"%s\" aborted: GetOverlappedResult() failed", fr->fs_path); + state = STATE_ERROR; + break; + } } + + ResetEvent(sov.hEvent); } else { -- 2.11.4.GIT