httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ic...@apache.org
Subject svn commit: r1737003 - in /httpd/test/mod_h2/trunk: conf/httpd.conf configure.ac mh2fuzz/Makefile.am mh2fuzz/h2c_conn.c mh2fuzz/h2c_feed.c mh2fuzz/h2c_session.c mh2fuzz/h2c_session.h mh2fuzz/h2c_worker.c mh2fuzz/mh2f_version.h test/test_frames.sh
Date Tue, 29 Mar 2016 12:53:21 GMT
Author: icing
Date: Tue Mar 29 12:53:21 2016
New Revision: 1737003

URL: http://svn.apache.org/viewvc?rev=1737003&view=rev
Log:
rework for more reliable connection teardown in test client

Modified:
    httpd/test/mod_h2/trunk/conf/httpd.conf
    httpd/test/mod_h2/trunk/configure.ac
    httpd/test/mod_h2/trunk/mh2fuzz/Makefile.am
    httpd/test/mod_h2/trunk/mh2fuzz/h2c_conn.c
    httpd/test/mod_h2/trunk/mh2fuzz/h2c_feed.c
    httpd/test/mod_h2/trunk/mh2fuzz/h2c_session.c
    httpd/test/mod_h2/trunk/mh2fuzz/h2c_session.h
    httpd/test/mod_h2/trunk/mh2fuzz/h2c_worker.c
    httpd/test/mod_h2/trunk/mh2fuzz/mh2f_version.h
    httpd/test/mod_h2/trunk/test/test_frames.sh

Modified: httpd/test/mod_h2/trunk/conf/httpd.conf
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/conf/httpd.conf?rev=1737003&r1=1737002&r2=1737003&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/conf/httpd.conf (original)
+++ httpd/test/mod_h2/trunk/conf/httpd.conf Tue Mar 29 12:53:21 2016
@@ -75,12 +75,8 @@ DocumentRoot "SUBST_SERVER_ROOT_SUBST/ht
 
 <IfModule proxy_module>
     ProxyStatus on
-    SSLProxyEngine on
-    SSLProxyProtocol +TLSv1.2
     ProxyTimeout 30
-    # don't do this at home, kids
-    SSLProxyVerify none
-    SSLProxyCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK
   
+    SSLProxyEngine on
     <Proxy "balancer://http-local">
         BalancerMember "http://127.0.0.1:SUBST_PORT_HTTP_SUBST"
     </Proxy>
@@ -153,21 +149,32 @@ DocumentRoot "SUBST_SERVER_ROOT_SUBST/ht
 # SSL Setup
 ################################################################################
 <IfModule ssl_module>
-    SSLProtocol +TLSv1 +TLSv1.1 +TLSv1.2
-    SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK
   
-    SSLHonorCipherOrder on
-    SSLPassPhraseDialog  builtin
-    SSLSessionCache        "shmcb:logs/ssl_scache(512000)"
-    SSLSessionCacheTimeout  300
-    
     SSLRandomSeed startup builtin
     SSLRandomSeed connect builtin
 
     Listen SUBST_PORT_HTTPS_SUBST
 
-    SSLUseStapling On
-    SSLStaplingCache shmcb:logs/ssl_stapling(32768)
+    SSLProtocol             all -SSLv3 -TLSv1 -TLSv1.1
+    SSLCipherSuite          ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256
+    SSLHonorCipherOrder     on
+    SSLCompression          off
+    SSLSessionTickets       off
+
+    SSLPassPhraseDialog  builtin
+    SSLSessionCache        "shmcb:logs/ssl_scache(512000)"
+    SSLSessionCacheTimeout  300
     
+    # OCSP Stapling, only in httpd 2.3.3 and later
+    SSLUseStapling          on
+    SSLStaplingResponderTimeout 5
+    SSLStaplingReturnResponderErrors off
+    SSLStaplingCache        shmcb:logs/ssl_stapling(32768)
+
+    SSLProxyProtocol        all -SSLv3 -TLSv1 -TLSv1.1
+    # don't do this at home, kids
+    SSLProxyVerify none
+    SSLProxyCipherSuite ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256
   
+
 </IfModule>
 
 ################################################################################

Modified: httpd/test/mod_h2/trunk/configure.ac
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/configure.ac?rev=1737003&r1=1737002&r2=1737003&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/configure.ac (original)
+++ httpd/test/mod_h2/trunk/configure.ac Tue Mar 29 12:53:21 2016
@@ -14,7 +14,7 @@
 #
 
 AC_PREREQ([2.67])
-AC_INIT([mod_h2_test], [1.0.15-DEV], [stefan.eissing@greenbytes.de])
+AC_INIT([mod_h2_test], [1.4.5-DEV], [stefan.eissing@greenbytes.de])
 
 LT_PREREQ([2.2.6])
 LT_INIT()
@@ -52,7 +52,7 @@ AC_ARG_WITH([serverdir], [AS_HELP_STRING
     [Use serverdir directory for setup [default=gen/apache]])],
     [request_serverdir=$withval], [request_serverdir=$PWD/gen/apache])
 
-NGHTTP2_VERSION=1.8.0
+NGHTTP2_VERSION=1.9.1
 
 AC_ARG_WITH([nghttp2-version], [AS_HELP_STRING([--with-nghttp2-version],
     [Use nghttp2 of specified version [default=<ignore>]])],

Modified: httpd/test/mod_h2/trunk/mh2fuzz/Makefile.am
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/mh2fuzz/Makefile.am?rev=1737003&r1=1737002&r2=1737003&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/mh2fuzz/Makefile.am (original)
+++ httpd/test/mod_h2/trunk/mh2fuzz/Makefile.am Tue Mar 29 12:53:21 2016
@@ -18,7 +18,7 @@ ACLOCAL_AMFLAGS = -I m4
 AUTOMAKE_OPTIONS = foreign
 
 CFLAGS= -g
-LDFLAGS=-L@LIB_DIR@ -lapr-1 -laprutil-1 -lssl -lcrypto
+LDFLAGS=-L@LIB_DIR@ -lapr-1 -laprutil-1 -lssl -lcrypto -lnghttp2
 
 bin_PROGRAMS = mh2fuzz
 

Modified: httpd/test/mod_h2/trunk/mh2fuzz/h2c_conn.c
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/mh2fuzz/h2c_conn.c?rev=1737003&r1=1737002&r2=1737003&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/mh2fuzz/h2c_conn.c (original)
+++ httpd/test/mod_h2/trunk/mh2fuzz/h2c_conn.c Tue Mar 29 12:53:21 2016
@@ -13,6 +13,7 @@
  * limitations under the License.
  */
 
+#include <assert.h>
 #include <apr.h>
 #include <apr_strings.h>
 #include <apr_poll.h>
@@ -47,14 +48,17 @@ static apr_status_t on_connect(h2c_conn
 static apr_status_t on_before_read(h2c_conn *c)
 {
     apr_status_t status = APR_SUCCESS;
-    if (c->connected) {
-        h2c_conn_obs *obs = c->obs;
-        while (obs && status == APR_SUCCESS) {
-            if (obs->before_read) {
-                status = obs->before_read(c, obs);
-            }
-            obs = obs->next;
+    h2c_conn_obs *obs;
+    if (!c->connected) {
+        return APR_EBADF;
+    }
+        
+    obs = c->obs;
+    while (obs && status == APR_SUCCESS) {
+        if (obs->before_read) {
+            status = obs->before_read(c, obs);
         }
+        obs = obs->next;
     }
     return status;
 }
@@ -62,14 +66,17 @@ static apr_status_t on_before_read(h2c_c
 static apr_status_t on_read(h2c_conn *c, const char *data, apr_size_t len)
 {
     apr_status_t status = APR_SUCCESS;
-    if (c->connected) {
-        h2c_conn_obs *obs = c->obs;
-        while (obs && status == APR_SUCCESS) {
-            if (obs->on_read) {
-                status = obs->on_read(c, data, len, obs);
-            }
-            obs = obs->next;
+    h2c_conn_obs *obs;
+    if (!c->connected) {
+        return APR_EBADF;
+    }
+        
+    obs = c->obs;
+    while (obs && status == APR_SUCCESS) {
+        if (obs->on_read) {
+            status = obs->on_read(c, data, len, obs);
         }
+        obs = obs->next;
     }
     return status;
 }
@@ -77,14 +84,17 @@ static apr_status_t on_read(h2c_conn *c,
 static apr_status_t on_write(h2c_conn *c)
 {
     apr_status_t status = APR_SUCCESS;
-    if (c->connected) {
-        h2c_conn_obs *obs = c->obs;
-        while (obs && status == APR_SUCCESS) {
-            if (obs->on_write) {
-                status = obs->on_write(c, obs);
-            }
-            obs = obs->next;
+    h2c_conn_obs *obs;
+    if (!c->connected) {
+        return APR_EBADF;
+    }
+        
+    obs = c->obs;
+    while (obs && status == APR_SUCCESS) {
+        if (obs->on_write) {
+            status = obs->on_write(c, obs);
         }
+        obs = obs->next;
     }
     return status;
 }
@@ -92,14 +102,17 @@ static apr_status_t on_write(h2c_conn *c
 static apr_status_t on_before_shutdown(h2c_conn *c)
 {
     apr_status_t status = APR_SUCCESS;
-    if (c->connected) {
-        h2c_conn_obs *obs = c->obs;
-        while (obs && status == APR_SUCCESS) {
-            if (obs->before_shutdown) {
-                status = obs->before_shutdown(c, obs);
-            }
-            obs = obs->next;
+    h2c_conn_obs *obs;
+    if (!c->connected) {
+        return APR_EBADF;
+    }
+        
+    obs = c->obs;
+    while (obs && status == APR_SUCCESS) {
+        if (obs->before_shutdown) {
+            status = obs->before_shutdown(c, obs);
         }
+        obs = obs->next;
     }
     return status;
 }
@@ -107,14 +120,17 @@ static apr_status_t on_before_shutdown(h
 static apr_status_t on_before_close(h2c_conn *c)
 {
     apr_status_t status = APR_SUCCESS;
-    if (c->connected) {
-        h2c_conn_obs *obs = c->obs;
-        while (obs && status == APR_SUCCESS) {
-            if (obs->before_close) {
-                status = obs->before_close(c, obs);
-            }
-            obs = obs->next;
+    h2c_conn_obs *obs;
+    if (!c->connected) {
+        return APR_EBADF;
+    }
+        
+    obs = c->obs;
+    while (obs && status == APR_SUCCESS) {
+        if (obs->before_close) {
+            status = obs->before_close(c, obs);
         }
+        obs = obs->next;
     }
     return status;
 }
@@ -127,7 +143,7 @@ static apr_status_t read_plain(h2c_conn
     
     while (status == APR_SUCCESS) {
         if (!c->socket) {
-            return APR_EOF;
+            return APR_ECONNABORTED;
         }
         status = on_before_read(c);
         if (status == APR_SUCCESS) {
@@ -148,11 +164,12 @@ static apr_status_t write_plain(h2c_conn
 {
     apr_status_t status = APR_SUCCESS;
 
-    if (!c->socket) {
-        return APR_EOF;
-    }
     while (c->buf_len > 0) {
         apr_size_t len = c->buf_len;
+        if (!c->socket) {
+            c->buf_len = 0;
+            return APR_ECONNABORTED;
+        }
         status = apr_socket_send(c->socket, c->buffer + c->buf_head, &len);
         if (len > 0) {
             c->buf_head += len;
@@ -486,7 +503,7 @@ apr_status_t h2c_conn_write(h2c_conn *c)
 
 apr_status_t h2c_conn_flush(h2c_conn *c)
 {
-    c->write(c);
+    /*c->write(c);*/
     if (c->ssl) {
         int rv;
         ERR_clear_error();
@@ -512,15 +529,14 @@ apr_status_t h2c_conn_shutdown(h2c_conn
         on_before_shutdown(c);
         
         status = c->write(c);
-        if (!c->ssl) {
-            status = apr_socket_shutdown(c->socket, APR_SHUTDOWN_WRITE);
-        }
-        
-        h2c_conn_want_io(c, H2C_CONN_READ|H2C_CONN_WRITE);
-
         if (c->ssl) {
             c->read = tls_shutdown_read;
+            status = c->read(c);
+        }
+        else {
+            status = apr_socket_shutdown(c->socket, APR_SHUTDOWN_WRITE);
         }
+        
     }
     return status;
 }
@@ -539,6 +555,7 @@ apr_status_t h2c_conn_close(h2c_conn *c)
         if (status == APR_SUCCESS) {
             status = apr_socket_close(c->socket);
             c->socket = NULL;
+            c->connected = 0;
         }
         if (c->verbose > 1) {
             fprintf(stderr, "h2c_conn(%ld): closed\n", c->id);

Modified: httpd/test/mod_h2/trunk/mh2fuzz/h2c_feed.c
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/mh2fuzz/h2c_feed.c?rev=1737003&r1=1737002&r2=1737003&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/mh2fuzz/h2c_feed.c (original)
+++ httpd/test/mod_h2/trunk/mh2fuzz/h2c_feed.c Tue Mar 29 12:53:21 2016
@@ -29,9 +29,7 @@ static apr_status_t repeat_next(h2c_requ
         *pr = feed->x.repeat.r[feed->x.repeat.n % feed->x.repeat.rlen];
         return APR_SUCCESS;
     }
-    else {
-        return APR_EOF;
-    }
+    return APR_EOF;
 }
 
 apr_status_t h2c_feed_repeat_create(h2c_feed **pf, apr_pool_t *p, 

Modified: httpd/test/mod_h2/trunk/mh2fuzz/h2c_session.c
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/mh2fuzz/h2c_session.c?rev=1737003&r1=1737002&r2=1737003&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/mh2fuzz/h2c_session.c (original)
+++ httpd/test/mod_h2/trunk/mh2fuzz/h2c_session.c Tue Mar 29 12:53:21 2016
@@ -13,6 +13,7 @@
  * limitations under the License.
  */
 
+#include <assert.h>
 #include <apr.h>
 #include <apr_uri.h>
 
@@ -70,6 +71,7 @@ static apr_status_t h2c_session_close(h2
             nghttp2_session_send(s->ngh2);
         }
         s->closed = 1;
+        h2c_conn_shutdown(s->c);
     }
     return APR_SUCCESS;
 }
@@ -318,23 +320,55 @@ static int on_data_chunk_recv(nghttp2_se
     return 0;
 }
 
+static apr_status_t check_submit(h2c_session *s)
+{
+    apr_status_t status = APR_SUCCESS;
+    
+    if (s->ngh2 && s->c->connected && s->feed 
+        && s->max_streams > s->open_streams
+        && !s->no_more_requests) {
+        h2c_request *r = NULL;
+        
+        status = h2c_feed_next(&r, s->feed, s);
+        if (status == APR_SUCCESS) {
+            status = h2c_session_submit(s, r, NULL);
+        }
+        else if (APR_STATUS_IS_EOF(status)) {
+            s->no_more_requests = 1;
+            if (!s->open_streams) {
+                h2c_session_close(s);
+            }
+        }
+    }
+    return status;
+}
+
 static apr_status_t check_io_sense(h2c_session *s, apr_status_t status)
 {
     int io_sense = 0;
 
     if (s->ngh2) {
-        if (status == APR_SUCCESS && s->feed && s->max_streams >
s->open_streams) {
+        if (status == APR_SUCCESS
+            && s->c->connected
+            && s->feed 
+            && s->max_streams > s->open_streams) {
             apr_status_t s2;
-            h2c_request *r;
+            h2c_request *r = NULL;
             
-            s2 = h2c_feed_next(&r, s->feed, s);
-            if (s2 == APR_SUCCESS) {
-                status = h2c_session_submit(s, r, NULL);
-                io_sense |= H2C_CONN_WRITE;
-            }
-            else if (APR_STATUS_IS_EOF(s2) && s->open_streams == 0) {
-                io_sense |= H2C_CONN_READ;
-                status = APR_EOF;
+            if (!s->no_more_requests) {
+                s2 = h2c_feed_next(&r, s->feed, s);
+                if (s2 == APR_SUCCESS) {
+                    status = h2c_session_submit(s, r, NULL);
+                    io_sense |= H2C_CONN_WRITE;
+                }
+                else if (APR_STATUS_IS_EOF(s2)) {
+                    s->no_more_requests = 1;
+                    if (!s->open_streams) {
+                        io_sense |= H2C_CONN_READ;
+                        h2c_session_close(s);
+                        status = APR_EOF;
+                    }
+                }
             }
         }
         
@@ -345,11 +379,10 @@ static apr_status_t check_io_sense(h2c_s
             io_sense |= H2C_CONN_WRITE;
         }
         if (!io_sense) {
-            return APR_EOF;
+            status = APR_EOF;
         }
         h2c_conn_want_io(s->c, io_sense);
     }
-    
     return status;
 }
 
@@ -366,14 +399,13 @@ static int on_stream_close(nghttp2_sessi
         fprintf(stderr, "closed STREAM[%d]\n", stream_id);
     }
     
-    --s->open_streams;
-    
     stream = nghttp2_session_get_stream_user_data(ngh2, stream_id);
     if (!stream) {
         fprintf(stderr, "stream %d not found", stream_id);
         return 0;
     }
     
+    --(s->open_streams);
     obs = s->obs;
     while (obs) {
         if (obs->before_stream_close) {
@@ -381,7 +413,6 @@ static int on_stream_close(nghttp2_sessi
         }
         obs = obs->next;
     }
-    
     h2c_stream_close(stream);
     
     if (!pushed && s->feed) {
@@ -435,6 +466,7 @@ static apr_status_t on_conn_read(h2c_con
         if (rv < 0) {
             return APR_ECONNRESET;
         }
+        check_submit(s);
         return check_io_sense(s, APR_SUCCESS);
     }
     return APR_SUCCESS;
@@ -511,7 +543,7 @@ apr_status_t h2c_session_submit(h2c_sess
     apr_status_t status;
     h2c_session_obs *obs;
     
-    if (s->closed) {
+    if (s->closed || !s->ngh2) {
         return APR_EOF;
     }
     
@@ -524,6 +556,7 @@ apr_status_t h2c_session_submit(h2c_sess
         return status;
     }
     
+    ++s->open_streams;
     obs = s->obs;
     while (obs) {
         if (obs->before_submit) {
@@ -541,12 +574,16 @@ apr_status_t h2c_session_submit(h2c_sess
     }
     
     s->max_stream_sent = H2_MAX(s->max_stream_sent, stream_id);
-    ++s->open_streams;
     stream->id = stream_id;
     
+    if (s->c->verbose > 1) {
+        fprintf(stderr, "%ld: submit STREAM[%d]\n", s->c->id, stream_id);
+    }
+    
     if (pid) {
         *pid =  stream_id;
     }
-    return APR_SUCCESS;
+    
+    return h2c_conn_write(s->c);
 }
 

Modified: httpd/test/mod_h2/trunk/mh2fuzz/h2c_session.h
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/mh2fuzz/h2c_session.h?rev=1737003&r1=1737002&r2=1737003&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/mh2fuzz/h2c_session.h (original)
+++ httpd/test/mod_h2/trunk/mh2fuzz/h2c_session.h Tue Mar 29 12:53:21 2016
@@ -42,6 +42,7 @@ struct h2c_session {
     
     unsigned int push : 1;
     unsigned int closed : 1;
+    unsigned int no_more_requests : 1;
     unsigned int goaway_recvd : 1;
     
     int max_stream_recv;

Modified: httpd/test/mod_h2/trunk/mh2fuzz/h2c_worker.c
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/mh2fuzz/h2c_worker.c?rev=1737003&r1=1737002&r2=1737003&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/mh2fuzz/h2c_worker.c (original)
+++ httpd/test/mod_h2/trunk/mh2fuzz/h2c_worker.c Tue Mar 29 12:53:21 2016
@@ -72,6 +72,7 @@ apr_status_t h2c_worker_run(h2c_worker *
     apr_pollset_t *pollset;
     apr_status_t status;
     int i, live_conns = 0;
+    apr_time_t wait_until, timeout;
     
     status = apr_pollset_create(&pollset, w->num_conns, w->p, APR_POLLSET_NOCOPY);
     if (status != APR_SUCCESS) {
@@ -126,25 +127,31 @@ apr_status_t h2c_worker_run(h2c_worker *
         }
     }
     
+    timeout = apr_time_from_sec(60);
+    wait_until = apr_time_now() + timeout;
+    
     while (live_conns > 0) {
         apr_int32_t numdesc;
         const apr_pollfd_t *pdesc;
         const char *op;
 
-        status = apr_pollset_poll(pollset, apr_time_from_sec(60),
+        status = apr_pollset_poll(pollset, apr_time_from_msec(500),
                                   &numdesc, &pdesc);
                                   
         if (status != APR_SUCCESS) {
             if (APR_STATUS_IS_TIMEUP(status)) {
-                fprintf(stderr, "timeup polling\n");
-                break;
+                if (apr_time_now() >= wait_until) {
+                    fprintf(stderr, "timeup polling\n");
+                    break;
+                }
+                continue;
             }
             else if (APR_STATUS_IS_EINTR(status)) {
                 continue;
             }
-            fprintf(stderr, "error %d on poll()\n", status);
             return status;
         }
+        wait_until = apr_time_now() + timeout;
         
         for (i = 0; i < numdesc; ++i) {
             const apr_pollfd_t *pfd = &pdesc[i];
@@ -153,9 +160,6 @@ apr_status_t h2c_worker_run(h2c_worker *
             if (pfd->rtnevents & APR_POLLIN) {
                 op = "reading";
                 status = h2c_conn_read(c);
-                if (status == APR_SUCCESS) {
-                    status = h2c_conn_write(c);
-                }
             }
             if (pfd->rtnevents & APR_POLLOUT) {
                 op = "writing";
@@ -164,10 +168,14 @@ apr_status_t h2c_worker_run(h2c_worker *
             if (pfd->rtnevents & APR_POLLHUP) {
                 op = "closed";
                 status = h2c_conn_close(c);
+                apr_pollset_remove(pollset, pfd);
+                --live_conns;
             }
             if (pfd->rtnevents & APR_POLLNVAL) {
                 op = "invalid";
                 status = h2c_conn_close(c);
+                apr_pollset_remove(pollset, pfd);
+                --live_conns;
             }
             
             if (status != APR_SUCCESS && !APR_STATUS_IS_EAGAIN(status)) {
@@ -177,25 +185,31 @@ apr_status_t h2c_worker_run(h2c_worker *
                     }
                     else {
                         h2c_conn_close(c);
+                        apr_pollset_remove(pollset, pfd);
                     }
                 }
                 else {
-                    fprintf(stderr, "closing %ld, status %d %s\n", c->id, status, op);
+                    /*fprintf(stderr, "closing %ld, status %d %s\n", c->id, status, op);*/
+                    apr_pollset_remove(pollset, pfd);
                     h2c_conn_close(c);
                 }
             }
             
-            if (!c->socket) {
-                apr_pollset_remove(pollset, pfd);
-                --live_conns;
-                conn_destroy(w, c);
-            }
-            else if (pfd->reqevents != c->pfd->reqevents) {
+            if (pfd->reqevents != c->pfd->reqevents) {
                 /* change in events this connection waits for */
                 apr_pollset_remove(pollset, pfd);
                 apr_pollset_add(pollset, c->pfd);
             }
         }
+        
+        for (i = 0; i < w->num_conns; ++i) {
+            h2c_conn *c = w->connections[i];
+            if (c && !c->socket) {
+                apr_pollset_remove(pollset, c->pfd);
+                --live_conns;
+            }
+        }
+
     }
     
     for (i = 0; i < w->num_conns; ++i) {

Modified: httpd/test/mod_h2/trunk/mh2fuzz/mh2f_version.h
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/mh2fuzz/mh2f_version.h?rev=1737003&r1=1737002&r2=1737003&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/mh2fuzz/mh2f_version.h (original)
+++ httpd/test/mod_h2/trunk/mh2fuzz/mh2f_version.h Tue Mar 29 12:53:21 2016
@@ -26,7 +26,7 @@
  * @macro
  * Version number of the http2 module as c string
  */
-#define MH2F_VERSION "1.0.15-DEV"
+#define MH2F_VERSION "1.4.5-DEV"
 
 /**
  * @macro
@@ -34,7 +34,7 @@
  * release. This is a 24 bit number with 8 bits for major number, 8 bits
  * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.
  */
-#define MH2F_VERSION_NUM 0x01000f
+#define MH2F_VERSION_NUM 0x010405
 
 
 #endif /* mh2f_version_h */

Modified: httpd/test/mod_h2/trunk/test/test_frames.sh
URL: http://svn.apache.org/viewvc/httpd/test/mod_h2/trunk/test/test_frames.sh?rev=1737003&r1=1737002&r2=1737003&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test_frames.sh (original)
+++ httpd/test/mod_h2/trunk/test/test_frames.sh Tue Mar 29 12:53:21 2016
@@ -23,9 +23,9 @@ URL_PREFIX="$HTTP_URL"
 mh2fuzz_check_frames index.html "frames GET $URL_PREFIX" -f submit-delay100 <<EOF
 0: send SETTINGS[length=12, stream=0]
 0: send WINDOW_UPDATE[stream=0, inc=1073676288]
+0: send HEADERS[count=4, hend=1, stream=1, eos=1]
 0: recv SETTINGS[length=6, stream=0]
 0: recv WINDOW_UPDATE[stream=0, inc=2147418112]
-0: send HEADERS[count=4, hend=1, stream=1, eos=1]
 0: recv HEADERS[count=0, hend=1, stream=1, eos=0]
 0: recv DATA[length=2005, flags=0, stream=1, padlen=0]
 0: recv DATA[length=0, flags=1, stream=1, padlen=0]
@@ -37,9 +37,9 @@ EOF
 mh2fuzz_check_frames not-there "frames GET $URL_PREFIX" -f submit-delay100 <<EOF
 0: send SETTINGS[length=12, stream=0]
 0: send WINDOW_UPDATE[stream=0, inc=1073676288]
+0: send HEADERS[count=4, hend=1, stream=1, eos=1]
 0: recv SETTINGS[length=6, stream=0]
 0: recv WINDOW_UPDATE[stream=0, inc=2147418112]
-0: send HEADERS[count=4, hend=1, stream=1, eos=1]
 0: recv HEADERS[count=0, hend=1, stream=1, eos=0]
 0: recv DATA[length=207, flags=0, stream=1, padlen=0]
 0: recv DATA[length=0, flags=1, stream=1, padlen=0]
@@ -53,10 +53,10 @@ if min_version 2.4.19; then
 URL_PREFIX="$HTTPS_URL"
 mh2fuzz_check_frames index.html "frames GET $URL_PREFIX" -f submit-delay100 <<EOF
 ALPN: selected h2
-0: send SETTINGS[length=12, stream=0]
-0: send WINDOW_UPDATE[stream=0, inc=1073676288]
 0: recv SETTINGS[length=6, stream=0]
 0: recv WINDOW_UPDATE[stream=0, inc=2147418112]
+0: send SETTINGS[length=12, stream=0]
+0: send WINDOW_UPDATE[stream=0, inc=1073676288]
 0: send HEADERS[count=4, hend=1, stream=1, eos=1]
 0: recv HEADERS[count=0, hend=1, stream=1, eos=0]
 0: recv DATA[length=2005, flags=0, stream=1, padlen=0]
@@ -68,10 +68,10 @@ EOF
 
 mh2fuzz_check_frames not-there "frames GET $URL_PREFIX" -f submit-delay100 <<EOF
 ALPN: selected h2
-0: send SETTINGS[length=12, stream=0]
-0: send WINDOW_UPDATE[stream=0, inc=1073676288]
 0: recv SETTINGS[length=6, stream=0]
 0: recv WINDOW_UPDATE[stream=0, inc=2147418112]
+0: send SETTINGS[length=12, stream=0]
+0: send WINDOW_UPDATE[stream=0, inc=1073676288]
 0: send HEADERS[count=4, hend=1, stream=1, eos=1]
 0: recv HEADERS[count=0, hend=1, stream=1, eos=0]
 0: recv DATA[length=207, flags=0, stream=1, padlen=0]



Mime
View raw message