httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r468941 - /httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c
Date Sun, 29 Oct 2006 17:05:40 GMT
Author: mturk
Date: Sun Oct 29 09:05:40 2006
New Revision: 468941

URL: http://svn.apache.org/viewvc?view=rev&rev=468941
Log:
When Servlet container sends AJP body message with size 0, this means that Servlet container
has asked for an  explicit flush.
Create flush bucket in that case.

Modified:
    httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c?view=diff&rev=468941&r1=468940&r2=468941
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c Sun Oct 29 09:05:40 2006
@@ -327,21 +327,30 @@
                 /* AJP13_SEND_BODY_CHUNK: piece of data */
                 status = ajp_parse_data(r, conn->data, &size, &buff);
                 if (status == APR_SUCCESS) {
-                    e = apr_bucket_transient_create(buff, size,
-                                                    r->connection->bucket_alloc);
-                    APR_BRIGADE_INSERT_TAIL(output_brigade, e);
-
-                    if ( (conn->worker->flush_packets == flush_on) ||
-                         ( (conn->worker->flush_packets == flush_auto) &&
-                           (apr_poll(conn_poll, 1, &conn_poll_fd,
-                                     conn->worker->flush_wait)
-                             == APR_TIMEUP) ) ) {
+                    if (size == 0) {
+                        /* AJP13_SEND_BODY_CHUNK with zero length
+                         * is explicit flush message
+                         */
                         e = apr_bucket_flush_create(r->connection->bucket_alloc);
                         APR_BRIGADE_INSERT_TAIL(output_brigade, e);
                     }
-                    apr_brigade_length(output_brigade, 0, &bb_len);
-                    if (bb_len != -1)
-                        conn->worker->s->read += bb_len;
+                    else {
+                        e = apr_bucket_transient_create(buff, size,
+                                                    r->connection->bucket_alloc);
+                        APR_BRIGADE_INSERT_TAIL(output_brigade, e);
+
+                        if ((conn->worker->flush_packets == flush_on) ||
+                            ((conn->worker->flush_packets == flush_auto) &&
+                            (apr_poll(conn_poll, 1, &conn_poll_fd,
+                                      conn->worker->flush_wait)
+                                        == APR_TIMEUP) ) ) {
+                            e = apr_bucket_flush_create(r->connection->bucket_alloc);
+                            APR_BRIGADE_INSERT_TAIL(output_brigade, e);
+                        }
+                        apr_brigade_length(output_brigade, 0, &bb_len);
+                        if (bb_len != -1)
+                            conn->worker->s->read += bb_len;
+                    }
                     if (ap_pass_brigade(r->output_filters,
                                         output_brigade) != APR_SUCCESS) {
                         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,



Mime
View raw message