Ok, how about this.
Add a call to ap_set_keepalive(r) in ap_die() before the check to see
if we should be discarding the request body. Then, since ap_set_keepalive
increments the keepalives counter on the connection if keepalive is
determined to be enabled, add a check to the calls in ap_send_http_header
and ap_send_error_response since these could be called after ap_die and
we don't want to increment the keepalives counter twice on this request.
Index: http_protocol.c
===================================================================
diff -u -r1.76 http_protocol.c
--- http_protocol.c 21 May 2004 11:43:31 -0000 1.76
+++ http_protocol.c 8 Jul 2004 16:49:03 -0000
@@ -2074,7 +2074,7 @@
PUSH_EBCDIC_OUTPUTCONVERSION_STATE_r(r, 1);
#endif /*CHARSET_EBCDIC*/
- ap_set_keepalive(r);
+ if(r->connection->keepalive != 1) ap_set_keepalive(r);
#ifdef YAHOO
#ifdef GZIP
@@ -3063,7 +3063,7 @@
ap_hard_timeout("send 304", r);
ap_basic_http_header(r);
- ap_set_keepalive(r);
+ if(r->connection->keepalive != 1) ap_set_keepalive(r);
ap_table_do((int (*)(void *, const char *, const char *))
ap_send_header_field,
(void *) r, r->headers_out,
Index: http_request.c
===================================================================
diff -u -r1.29 http_request.c
--- http_request.c 21 May 2004 11:43:31 -0000 1.29
+++ http_request.c 8 Jul 2004 16:49:03 -0000
@@ -1116,6 +1116,12 @@
}
/*
+ * We need r->connection->keepalive set correctly in order to determine if
+ * we can discard the request body in the next condition
+ */
+ ap_set_keepalive(r);
+
+ /*
* If we want to keep the connection, be sure that the request body
* (if any) has been read.
*/
On Tue, 6 Jul 2004, Jim Jagielski wrote:
> Yes, we do, and we're still waiting for a patch. However,
> I can't see us delaying 1.3.32 for an "unreasonable"
> amount of time.
>
> On Jul 5, 2004, at 10:54 AM, Rasmus Lerdorf wrote:
>
> > We still have that outstanding issue of conn->keepalive being bogus in
> > ap_die() because it hasn't been set yet and thus we can't discard the
> > request body in situations where we really need to. See my previous
> > long
> > explanation of that problem.
> >
> > -Rasmus
> >
> > On Sat, 3 Jul 2004, Jim Jagielski wrote:
> >
> >> Let's use STATUS :)
> >>
> >> =?ISO-8859-15?Q?Andr=E9?= Malo wrote:
> >>>
> >>> * Jeff Trawick <[EMAIL PROTECTED]> wrote:
> >>>
> >>>> well, if you're going to be that way then consider my simple Win32
> >>>> patch to
> >>>> fix reporting of proper error by spawnl(), which needs another +1 :)
> >>>>
> >>>> (see thread "[1.3 PATCH] restore failing errno for Win32 spawn
> >>>> errors" on
> >>>> this list)
> >>>
> >>> +1 from me for that errno patch ;)
> >>>
> >>> nd
> >>> --
> >>> "Umfassendes Werk (auch fuer Umsteiger vom Apache 1.3)"
> >>> -- aus einer Rezension
> >>>
> >>> <http://pub.perlig.de/books.html#apache2>
> >>>
> >>
> >>
> >> --
> >> ======================================================================
> >> =====
> >> Jim Jagielski [|] [EMAIL PROTECTED] [|]
> >> http://www.jaguNET.com/
> >> "A society that will trade a little liberty for a little order
> >> will lose both and deserve neither" - T.Jefferson
> >>
> >
> >
>