]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Refactored CONN_STATE_WRITE_COMPLETION handling.
authorBrian Pane <brianp@apache.org>
Sun, 9 Oct 2005 08:15:40 +0000 (08:15 +0000)
committerBrian Pane <brianp@apache.org>
Sun, 9 Oct 2005 08:15:40 +0000 (08:15 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/async-dev@307380 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/experimental/event/event.c

index 6bee16cb07f622316e41d8e28fa0327d44d2e7ae..fb73e20d2a6c83e4fd30fc30d506b0a1f012afa4 100644 (file)
@@ -644,9 +644,21 @@ static int process_socket(apr_pool_t * p, apr_socket_t * sock,
          */
         apr_bucket_brigade *bb = apr_brigade_create(c->pool, c->bucket_alloc);
         apr_bucket *b = apr_bucket_flush_create(c->bucket_alloc);
+        ap_filter_t *output_filter = c->output_filters;
+        apr_status_t rv;
         APR_BRIGADE_INSERT_HEAD(bb, b);
-        ap_pass_brigade(c->output_filters, bb);
-        if (c->keepalive != AP_CONN_KEEPALIVE || c->aborted || 
+        while (output_filter->next != NULL) {
+            output_filter = output_filter->next;
+        }
+        rv = output_filter->frec->filter_func.out_func(output_filter, bb);
+        if (rv != APR_SUCCESS) {
+            /* XXX log error */
+            cs->state = CONN_STATE_LINGER;
+        }
+        else if (c->data_in_output_filters) {
+            cs->state = CONN_STATE_WRITE_COMPLETION;
+        }
+        else if (c->keepalive != AP_CONN_KEEPALIVE || c->aborted || 
             ap_graceful_stop_signalled()) {
             c->cs->state = CONN_STATE_LINGER;
         }