From 4ee40c000c463773a0060dc58d1598e0e1097ef4 Mon Sep 17 00:00:00 2001 From: robs Date: Fri, 7 Jun 2002 00:54:13 +0000 Subject: [PATCH] [WIN32] Don't read from a potentially closed named pipe. Philip Gladstone [philip@okena.com] --- CHANGES | 3 +++ mod_fastcgi.c | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 8cb9cd7..2e1b00f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ 2.2.13 + *) [WIN32] Don't read from a potentially closed named pipe. + Philip Gladstone [philip@okena.com] + *) Require the Apache version 1.3.6 or later to eliminate some signal handling funk. diff --git a/mod_fastcgi.c b/mod_fastcgi.c index 8330358..cc0aea5 100644 --- a/mod_fastcgi.c +++ b/mod_fastcgi.c @@ -3,7 +3,7 @@ * * Apache server module for FastCGI. * - * $Id: mod_fastcgi.c,v 1.131 2002/03/13 23:32:19 robs Exp $ + * $Id: mod_fastcgi.c,v 1.132 2002/06/07 00:54:13 robs Exp $ * * Copyright (c) 1995-1996 Open Market, Inc. * @@ -1497,7 +1497,13 @@ SERVER_SEND: case STATE_SERVER_RECV: - if (! recv_pending && BufferFree(fr->serverInputBuffer)) + /* + * Only get more data when the serverInputBuffer is empty. + * Otherwise we may already have the END_REQUEST buffered + * (but not processed) and a read on a closed named pipe + * results in an error that is normally abnormal. + */ + if (! recv_pending && BufferLength(fr->serverInputBuffer) == 0) { Buffer * b = fr->serverInputBuffer; DWORD rcvd, len; -- 2.11.4.GIT