Commit f835fb50 authored by Brian Pane's avatar Brian Pane
Browse files

New version of ap_core_output_filter...

The big change is that it now does nonblocking writes when possible.  The
goal of this redesign is to more cleanly support asynchronous write completion
in MPMs such as Event or Leader.  However, the nonblocking writes may also
help in Worker and Prefork by allowing more overlapping of handler and
output filter processing with network writes.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/async-dev@291377 13f79535-47bb-0310-9956-ffa450edef68
parent 28e5983a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
                                                        -*- coding: utf-8 -*-
Changes in Apache 2.3.0 async-dev R&D branch
  *) Rewrite of ap_core_output_filter to do nonblocking writes [Brian Pane]
  *) Added new connection states for handler and write completion
     [Brian Pane]
+3 −5
Original line number Diff line number Diff line
@@ -1198,11 +1198,9 @@ struct server_rec {
};

typedef struct core_output_filter_ctx {
    apr_bucket_brigade *b;
    /** subpool of c->pool used for resources 
     * which may outlive the request
     */
    apr_pool_t *deferred_write_pool;
    apr_bucket_brigade *buffered_bb;
    apr_size_t bytes_in;
    apr_size_t bytes_written;
} core_output_filter_ctx_t;
 
typedef struct core_filter_ctx {
+332 −546

File changed.

Preview size limit exceeded, changes collapsed.

+1 −6
Original line number Diff line number Diff line
@@ -168,9 +168,6 @@ static struct timeout_head_t timeout_head;

static apr_pollset_t *event_pollset;

extern apr_status_t ap_mpm_custom_write_filter(ap_filter_t *f,
                                                     apr_bucket_brigade *bb);

/* The structure used to pass unique initialization info to each thread */
typedef struct
{
@@ -340,7 +337,7 @@ AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result)
        *result = 1;
        return APR_SUCCESS;
    case AP_MPMQ_CUSTOM_WRITE:
        *result = 1;
        *result = 0;
        return APR_SUCCESS;
    case AP_MPMQ_HARD_LIMIT_DAEMONS:
        *result = server_limit;
@@ -2209,8 +2206,6 @@ static void event_hooks(apr_pool_t * p)
     * to retrieve it, so register as REALLY_FIRST
     */
    ap_hook_pre_config(worker_pre_config, NULL, NULL, APR_HOOK_REALLY_FIRST);

    APR_REGISTER_OPTIONAL_FN(ap_mpm_custom_write_filter);
}

static const char *set_daemons_to_start(cmd_parms *cmd, void *dummy,