Commit 1fac44bc authored by Graham Leggett's avatar Graham Leggett
Browse files

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
parent 3f6143a4
Loading
Loading
Loading
Loading
+5 −0
Changes for CHANGES: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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 <nikke acc.umu.se>]
  *) mod_disk_cache: Do away with the write-to-file-then-move-in-place
     mentality. [Niklas Edmundsson <nikke acc.umu.se>]
+6 −6
Changes for server/core_filters.c: 6 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -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);