was not checked properly. This affects mod_usertrack and
core. PR 28218. [André Malo]
- *) No longer breaks mod_dav, frontpage and others. Backs out
- a patch which prevented discarding the request body for requests
+ *) No longer breaks mod_dav, frontpage and others. Repair a patch
+ in 1.3.31 which prevented discarding the request body for requests
that will be keptalive but are not currently keptalive. PR 29237.
+ [Jim Jagielski]
*) COMPATIBILITY: Added new compile-time flag: UCN_OFF_HONOR_PHYSICAL_PORT.
It controls how UseCanonicalName Off determines the port value if
int wimpy = ap_find_token(r->pool,
ap_table_get(r->headers_out, "Connection"), "close");
const char *conn = ap_table_get(r->headers_in, "Connection");
+ const char *herebefore = ap_table_get(r->notes, "ap_set_keepalive-called");
/* The following convoluted conditional determines whether or not
* the current connection should remain persistent after this response
int left = r->server->keep_alive_max - r->connection->keepalives;
r->connection->keepalive = 1;
- r->connection->keepalives++;
+ /*
+ * ap_set_keepalive could be called multiple times (eg: in
+ * ap_die() followed by ap_send_http_header()) during this
+ * one single request. To ensure that we don't incorrectly
+ * increment the keepalives counter for each call, we
+ * use notes to store a state flag.
+ */
+ if (!herebefore) {
+ r->connection->keepalives++;
+ ap_table_setn(r->notes, "ap_set_keepalive-called", "1");
+ }
/* If they sent a Keep-Alive token, send one back */
if (ka_sent) {
r->status = HTTP_PROXY_AUTHENTICATION_REQUIRED;
}
+ /*
+ * We need to ensure that r->connection->keepalive is valid in
+ * order to determine if we can discard the request body below.
+ */
+ ap_set_keepalive(r);
+
/*
* If we want to keep the connection, be sure that the request body
* (if any) has been read.
*/
if ((r->status != HTTP_NOT_MODIFIED) && (r->status != HTTP_NO_CONTENT)
&& !ap_status_drops_connection(r->status)
- && r->connection && (r->connection->keepalive != -1)) {
+ && r->connection && (r->connection->keepalive > 0)) {
(void) ap_discard_request_body(r);
}