diff options
author | Justin Erenkrantz <jerenkrantz@apache.org> | 2002-06-26 21:45:07 +0200 |
---|---|---|
committer | Justin Erenkrantz <jerenkrantz@apache.org> | 2002-06-26 21:45:07 +0200 |
commit | 001b387bcdb1644aea9d7c523dedf5ac04f3c4b4 (patch) | |
tree | 50cf13c57153893234bd5bf3611dc183ab6ee5f3 /server/core.c | |
parent | Fix mod_ext_filter to look in the main server for filter definitions (diff) | |
download | apache2-001b387bcdb1644aea9d7c523dedf5ac04f3c4b4.tar.xz apache2-001b387bcdb1644aea9d7c523dedf5ac04f3c4b4.zip |
Change conn_rec->keepalive to an enumerated value of
AP_CONN_UNKNOWN
AP_CONN_CLOSE
AP_CONN_KEEPALIVE
This also fixes a problem where ap_discard_request_body would not discard
the body when keepalive was 0. This actually meant the keepalive status
was unknown *not* closed, but no one ever remembered that.
This problem was seen with mod_dav sending error responses (as reported by
Karl Fogel).
Suggested by: Greg "this isn't the '80s" Stein
Reviewed by: Greg Ames
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95891 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/core.c')
-rw-r--r-- | server/core.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/server/core.c b/server/core.c index 901a6f0c69..cc988e737c 100644 --- a/server/core.c +++ b/server/core.c @@ -3293,7 +3293,7 @@ static int net_time_filter(ap_filter_t *f, apr_bucket_brigade *b, ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes) { - int keptalive = f->c->keepalive == 1; + int keptalive = f->c->keepalive == AP_CONN_KEEPALIVE; apr_socket_t *csd = ap_get_module_config(f->c->conn_config, &core_module); int *first_line = f->ctx; @@ -3755,7 +3755,8 @@ static apr_status_t core_output_filter(ap_filter_t *f, apr_bucket_brigade *b) && (nbytes + flen < AP_MIN_BYTES_TO_WRITE) && !APR_BUCKET_IS_FLUSH(last_e)) || (nbytes + flen < AP_MIN_BYTES_TO_WRITE - && APR_BUCKET_IS_EOS(last_e) && c->keepalive)) { + && APR_BUCKET_IS_EOS(last_e) + && c->keepalive == AP_CONN_KEEPALIVE)) { /* NEVER save an EOS in here. If we are saving a brigade with * an EOS bucket, then we are doing keepalive connections, and @@ -3824,7 +3825,7 @@ static apr_status_t core_output_filter(ap_filter_t *f, apr_bucket_brigade *b) } #if APR_HAS_SENDFILE - if (!c->keepalive && APR_BUCKET_IS_EOS(last_e)) { + if (c->keepalive == AP_CONN_CLOSE && APR_BUCKET_IS_EOS(last_e)) { /* Prepare the socket to be reused */ flags |= APR_SENDFILE_DISCONNECT_SOCKET; } |