From ec119dcfe4c01e7615283b1728d37f3d8c869c8a Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Tue, 10 Oct 2006 21:31:36 +0000 Subject: [PATCH] sendfile_nonblocking() takes the _brigade_ as an argument, gets the first bucket from the brigade, finds it not to be a FILE bucket and barfs. The fix is to pass a bucket rather than a brigade. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@462580 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ server/core_filters.c | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 41f9a83457..ff208c7e16 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,11 @@ Changes with Apache 2.3.0 [Remove entries to the current 2.0 and 2.2 section below, when backported] + *) sendfile_nonblocking() takes the _brigade_ as an argument, gets + the first bucket from the brigade, finds it not to be a FILE + bucket and barfs. The fix is to pass a bucket rather than a brigade. + [Niklas Edmundsson ] + *) mod_disk_cache: Do away with the write-to-file-then-move-in-place mentality. [Niklas Edmundsson ] diff --git a/server/core_filters.c b/server/core_filters.c index 7c48d8a56d..da58f3ec84 100644 --- a/server/core_filters.c +++ b/server/core_filters.c @@ -330,7 +330,7 @@ static apr_status_t writev_nonblocking(apr_socket_t *s, #if APR_HAS_SENDFILE static apr_status_t sendfile_nonblocking(apr_socket_t *s, - apr_bucket_brigade *bb, + apr_bucket *bucket, apr_size_t *cumulative_bytes_written, conn_rec *c); #endif @@ -567,7 +567,7 @@ static apr_status_t send_brigade_nonblocking(apr_socket_t *s, return rv; } } - rv = sendfile_nonblocking(s, bb, bytes_written, c); + rv = sendfile_nonblocking(s, bucket, bytes_written, c); if (nvec > 0) { (void)apr_socket_opt_set(s, APR_TCP_NOPUSH, 0); } @@ -730,21 +730,21 @@ static apr_status_t writev_nonblocking(apr_socket_t *s, #if APR_HAS_SENDFILE static apr_status_t sendfile_nonblocking(apr_socket_t *s, - apr_bucket_brigade *bb, + apr_bucket *bucket, apr_size_t *cumulative_bytes_written, conn_rec *c) { apr_status_t rv = APR_SUCCESS; - apr_bucket *bucket; apr_bucket_file *file_bucket; apr_file_t *fd; apr_size_t file_length; apr_off_t file_offset; apr_size_t bytes_written = 0; - bucket = APR_BRIGADE_FIRST(bb); if (!APR_BUCKET_IS_FILE(bucket)) { - /* XXX log a "this should never happen" message */ + ap_log_error(APLOG_MARK, APLOG_ERR, rv, c->base_server, + "core_filter: sendfile_nonblocking: " + "this should never happen"); return APR_EGENERAL; } file_bucket = (apr_bucket_file *)(bucket->data); -- 2.49.0