]> granicus.if.org Git - apache/commitdiff
mod_http2: simpler flushing on master out
authorStefan Eissing <icing@apache.org>
Fri, 11 Mar 2016 14:18:18 +0000 (14:18 +0000)
committerStefan Eissing <icing@apache.org>
Fri, 11 Mar 2016 14:18:18 +0000 (14:18 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1734571 13f79535-47bb-0310-9956-ffa450edef68

modules/http2/h2_conn_io.c
modules/http2/h2_conn_io.h
modules/http2/h2_session.c

index 56d01e6732c523d33a462d7d98120208f036fe58..84c953e26ac7ad111e0ac02906ef8bcd21670c3a 100644 (file)
@@ -208,11 +208,6 @@ static apr_status_t h2_conn_io_flush_int(h2_conn_io *io, int force, int eoc)
     return APR_SUCCESS;
 }
 
-apr_status_t h2_conn_io_pass(h2_conn_io *io, int flush)
-{
-    return h2_conn_io_flush_int(io, flush, 0);
-}
-
 apr_status_t h2_conn_io_flush(h2_conn_io *io)
 {
     /* make sure we always write a flush, even if our buffers are empty.
@@ -232,7 +227,7 @@ apr_status_t h2_conn_io_consider_pass(h2_conn_io *io)
     }
     len += io->buflen;
     if (len >= WRITE_BUFFER_SIZE) {
-        return h2_conn_io_pass(io, 0);
+        return h2_conn_io_flush_int(io, 0, 0);
     }
     return APR_SUCCESS;
 }
@@ -259,13 +254,13 @@ apr_status_t h2_conn_io_write(h2_conn_io *io,
                       "h2_conn_io: buffering %ld bytes", (long)length);
                       
         if (!APR_BRIGADE_EMPTY(io->output)) {
-            status = h2_conn_io_pass(io, 0);
+            status = h2_conn_io_flush_int(io, 0, 0);
         }
         
         while (length > 0 && (status == APR_SUCCESS)) {
             apr_size_t avail = io->bufsize - io->buflen;
             if (avail <= 0) {
-                h2_conn_io_pass(io, 0);
+                h2_conn_io_flush_int(io, 0, 0);
             }
             else if (length > avail) {
                 memcpy(io->buffer + io->buflen, buf, avail);
index 8d71fffcd7b1c92eb3f5686a6428a24d1bb0b183..9c40ae615f259404dd9a01b05138cf99efcd58ed 100644 (file)
@@ -77,7 +77,6 @@ apr_status_t h2_conn_io_write_eoc(h2_conn_io *io, struct h2_session *session);
  * @param io the connection io
  * @param flush if a flush bucket should be appended to any output
  */
-apr_status_t h2_conn_io_pass(h2_conn_io *io, int flush);
 apr_status_t h2_conn_io_flush(h2_conn_io *io);
 
 /**
index 78b91efccfdb7e0ae1d3d5d9683b452b8a059971..d24ac0e90e01daed74cf3887d069e391ed7cad0a 100644 (file)
@@ -686,7 +686,7 @@ static apr_status_t h2_session_shutdown(h2_session *session, int reason,
                           h2_mplx_get_max_stream_started(session->mplx), 
                           reason, (uint8_t*)err, err? strlen(err):0);
     status = nghttp2_session_send(session->ngh2);
-    h2_conn_io_pass(&session->io, 1);
+    h2_conn_io_flush(&session->io);
     ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, session->c, APLOGNO(03069)
                   "session(%ld): sent GOAWAY, err=%d, msg=%s", 
                   session->id, reason, err? err : "");
@@ -1018,7 +1018,6 @@ static apr_status_t h2_session_start(h2_session *session, int *rv)
         }
     }
     
-    h2_conn_io_pass(&session->io, 1);
     return status;
 }
 
@@ -2019,7 +2018,6 @@ apr_status_t h2_session_process(h2_session *session, int async)
                 update_child_status(session, (no_streams? SERVER_BUSY_KEEPALIVE
                                               : SERVER_BUSY_READ), "idle");
                 /* make certain, the client receives everything before we idle */
-                h2_conn_io_flush(&session->io);
                 if (!session->keep_sync_until 
                     && async && no_streams && !session->r && session->requests_received) {
                     ap_log_cerror( APLOG_MARK, APLOG_TRACE1, status, c,
@@ -2183,8 +2181,6 @@ apr_status_t h2_session_process(h2_session *session, int async)
                                   "h2_session: wait for data, %ld micros", 
                                   (long)session->wait_us);
                 }
-                /* make certain, the client receives everything before we idle */
-                h2_conn_io_flush(&session->io);
                 status = h2_mplx_out_trywait(session->mplx, session->wait_us, 
                                              session->iowait);
                 if (status == APR_SUCCESS) {
@@ -2217,7 +2213,7 @@ apr_status_t h2_session_process(h2_session *session, int async)
                 break;
         }
 
-        h2_conn_io_pass(&session->io, 1);
+        h2_conn_io_flush(&session->io);
         if (!nghttp2_session_want_read(session->ngh2) 
                  && !nghttp2_session_want_write(session->ngh2)) {
             dispatch_event(session, H2_SESSION_EV_NGH2_DONE, 0, NULL);