httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ic...@apache.org
Subject svn commit: r1729439 - in /httpd/httpd/trunk/modules/http2: h2_conn_io.c h2_io.h h2_mplx.c
Date Tue, 09 Feb 2016 19:17:45 GMT
Author: icing
Date: Tue Feb  9 19:17:45 2016
New Revision: 1729439

URL: http://svn.apache.org/viewvc?rev=1729439&view=rev
Log:
adding flush bucket on every main connection buffer flushes

Modified:
    httpd/httpd/trunk/modules/http2/h2_conn_io.c
    httpd/httpd/trunk/modules/http2/h2_io.h
    httpd/httpd/trunk/modules/http2/h2_mplx.c

Modified: httpd/httpd/trunk/modules/http2/h2_conn_io.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_conn_io.c?rev=1729439&r1=1729438&r2=1729439&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_conn_io.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_conn_io.c Tue Feb  9 19:17:45 2016
@@ -171,56 +171,6 @@ static apr_status_t bucketeer_buffer(h2_
     return APR_SUCCESS;
 }
 
-apr_status_t h2_conn_io_write(h2_conn_io *io, 
-                              const char *buf, size_t length)
-{
-    apr_status_t status = APR_SUCCESS;
-    pass_out_ctx ctx;
-    
-    ctx.c = io->connection;
-    ctx.io = io;
-    io->unflushed = 1;
-    if (io->bufsize > 0) {
-        ap_log_cerror(APLOG_MARK, APLOG_TRACE4, 0, io->connection,
-                      "h2_conn_io: buffering %ld bytes", (long)length);
-                      
-        if (!APR_BRIGADE_EMPTY(io->output)) {
-            status = h2_conn_io_pass(io);
-            io->unflushed = 1;
-        }
-        
-        while (length > 0 && (status == APR_SUCCESS)) {
-            apr_size_t avail = io->bufsize - io->buflen;
-            if (avail <= 0) {
-                
-                bucketeer_buffer(io);
-                status = pass_out(io->output, &ctx);
-                io->buflen = 0;
-            }
-            else if (length > avail) {
-                memcpy(io->buffer + io->buflen, buf, avail);
-                io->buflen += avail;
-                length -= avail;
-                buf += avail;
-            }
-            else {
-                memcpy(io->buffer + io->buflen, buf, length);
-                io->buflen += length;
-                length = 0;
-                break;
-            }
-        }
-        
-    }
-    else {
-        ap_log_cerror(APLOG_MARK, APLOG_TRACE4, status, io->connection,
-                      "h2_conn_io: writing %ld bytes to brigade", (long)length);
-        status = apr_brigade_write(io->output, pass_out, &ctx, buf, length);
-    }
-    
-    return status;
-}
-
 apr_status_t h2_conn_io_writeb(h2_conn_io *io, apr_bucket *b)
 {
     APR_BRIGADE_INSERT_TAIL(io->output, b);
@@ -300,3 +250,50 @@ apr_status_t h2_conn_io_pass(h2_conn_io
     return h2_conn_io_flush_int(io, 0, 0);
 }
 
+apr_status_t h2_conn_io_write(h2_conn_io *io, 
+                              const char *buf, size_t length)
+{
+    apr_status_t status = APR_SUCCESS;
+    pass_out_ctx ctx;
+    
+    ctx.c = io->connection;
+    ctx.io = io;
+    io->unflushed = 1;
+    if (io->bufsize > 0) {
+        ap_log_cerror(APLOG_MARK, APLOG_TRACE4, 0, io->connection,
+                      "h2_conn_io: buffering %ld bytes", (long)length);
+                      
+        if (!APR_BRIGADE_EMPTY(io->output)) {
+            status = h2_conn_io_pass(io);
+            io->unflushed = 1;
+        }
+        
+        while (length > 0 && (status == APR_SUCCESS)) {
+            apr_size_t avail = io->bufsize - io->buflen;
+            if (avail <= 0) {
+                h2_conn_io_flush_int(io, 1, 0);
+            }
+            else if (length > avail) {
+                memcpy(io->buffer + io->buflen, buf, avail);
+                io->buflen += avail;
+                length -= avail;
+                buf += avail;
+            }
+            else {
+                memcpy(io->buffer + io->buflen, buf, length);
+                io->buflen += length;
+                length = 0;
+                break;
+            }
+        }
+        
+    }
+    else {
+        ap_log_cerror(APLOG_MARK, APLOG_TRACE4, status, io->connection,
+                      "h2_conn_io: writing %ld bytes to brigade", (long)length);
+        status = apr_brigade_write(io->output, pass_out, &ctx, buf, length);
+    }
+    
+    return status;
+}
+

Modified: httpd/httpd/trunk/modules/http2/h2_io.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_io.h?rev=1729439&r1=1729438&r2=1729439&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_io.h (original)
+++ httpd/httpd/trunk/modules/http2/h2_io.h Tue Feb  9 19:17:45 2016
@@ -48,8 +48,8 @@ struct h2_io {
     apr_bucket_brigade *tmp;         /* temporary data for chunking */
 
     unsigned int orphaned       : 1; /* h2_stream is gone for this io */    
-    unsigned int worker_started : 1; /* h2_worker started processing for this io */
-    unsigned int worker_done    : 1; /* h2_worker finished for this io */
+    unsigned int processing_started : 1; /* h2_worker started processing for this io */
+    unsigned int processing_done: 1; /* h2_worker finished for this io */
     unsigned int request_body   : 1; /* iff request has body */
     unsigned int eos_in         : 1; /* input eos has been seen */
     unsigned int eos_in_written : 1; /* input eos has been forwarded */

Modified: httpd/httpd/trunk/modules/http2/h2_mplx.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_mplx.c?rev=1729439&r1=1729438&r2=1729439&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_mplx.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_mplx.c Tue Feb  9 19:17:45 2016
@@ -291,7 +291,7 @@ static int io_stream_done(h2_mplx *m, h2
 {
     /* Remove io from ready set, we will never submit it */
     h2_io_set_remove(m->ready_ios, io);
-    if (!io->worker_started || io->worker_done) {
+    if (!io->processing_started || io->processing_done) {
         /* already finished or not even started yet */
         h2_tq_remove(m->q, io->id);
         io_destroy(m, io, 1);
@@ -406,7 +406,7 @@ static const h2_request *pop_request(h2_
         h2_io *io = h2_io_set_get(m->stream_ios, sid);
         if (io) {
             req = io->request;
-            io->worker_started = 1;
+            io->processing_started = 1;
             if (sid > m->max_stream_started) {
                 m->max_stream_started = sid;
             }
@@ -425,7 +425,7 @@ void h2_mplx_request_done(h2_mplx **pm,
         ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, m->c,
                       "h2_mplx(%ld): request(%d) done", m->id, stream_id);
         if (io) {
-            io->worker_done = 1;
+            io->processing_done = 1;
             if (io->orphaned) {
                 io_destroy(m, io, 0);
                 if (m->join_wait) {
@@ -672,7 +672,7 @@ h2_stream *h2_mplx_next_submit(h2_mplx *
                               "resetting io to close request processing",
                               m->id, io->id);
                 h2_io_make_orphaned(io, H2_ERR_STREAM_CLOSED);
-                if (!io->worker_started || io->worker_done) {
+                if (!io->processing_started || io->processing_done) {
                     io_destroy(m, io, 1);
                 }
                 else {



Mime
View raw message