httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ic...@apache.org
Subject svn commit: r1723737 - in /httpd/test/mod_h2/trunk: mh2fuzz/h2c_conn.c mh2fuzz/h2c_session.c test/test_frames.sh
Date Fri, 08 Jan 2016 15:26:16 GMT
Author: icing
Date: Fri Jan  8 15:26:16 2016
New Revision: 1723737

URL: http://svn.apache.org/viewvc?rev=1723737&view=rev
Log:
normalized frame output for testing

Modified:
    httpd/test/mod_h2/trunk/mh2fuzz/h2c_conn.c
    httpd/test/mod_h2/trunk/mh2fuzz/h2c_session.c
    httpd/test/mod_h2/trunk/test/test_frames.sh

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=1723737&r1=1723736&r2=1723737&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/mh2fuzz/h2c_conn.c (original)
+++ httpd/test/mod_h2/trunk/mh2fuzz/h2c_conn.c Fri Jan  8 15:26:16 2016
@@ -419,12 +419,14 @@ apr_status_t h2c_conn_shutdown(h2c_conn
             status = apr_socket_shutdown(c->socket, APR_SHUTDOWN_WRITE);
         }
         
-        apr_socket_timeout_set(c->socket, apr_time_from_msec(250));
         h2c_conn_want_io(c, H2C_CONN_READ);
 
         if (c->ssl) {
             c->read = tls_shutdown_read;
         }
+        
+        status = c->read(c);
+        status = h2c_conn_close(c);
     }
     return status;
 }

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=1723737&r1=1723736&r2=1723737&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/mh2fuzz/h2c_session.c (original)
+++ httpd/test/mod_h2/trunk/mh2fuzz/h2c_session.c Fri Jan  8 15:26:16 2016
@@ -103,12 +103,27 @@ static void log_frame(h2c_session *s, co
     char scratch[128];
     size_t s_len = sizeof(scratch)/sizeof(scratch[0]);
     size_t len;
+    int eof;
 
     switch (frame->hd.type) {
         case NGHTTP2_DATA:
-            fprintf(f, "%ld: %s DATA[length=%d, flags=%d, stream=%d, padlen=%d]\n",
-                    s->c->id, msg, (int)frame->hd.length, frame->hd.flags,
-                    frame->hd.stream_id, (int)frame->data.padlen);
+            if (s->c->verbose == 1 && frame->hd.length > 0) {
+                /* normalized output for testing */
+                eof = frame->hd.flags & NGHTTP2_FLAG_END_STREAM;
+                fprintf(f, "%ld: %s DATA[length=%d, flags=%d, stream=%d, padlen=%d]\n",
+                        s->c->id, msg, (int)frame->hd.length, 
+                        (frame->hd.flags & ~NGHTTP2_FLAG_END_STREAM),
+                        frame->hd.stream_id, (int)frame->data.padlen);
+                if (eof) {
+                    fprintf(f, "%ld: %s DATA[length=0, flags=%d, stream=%d, padlen=0]\n",
+                            s->c->id, msg, NGHTTP2_FLAG_END_STREAM, frame->hd.stream_id);
+                }
+            }
+            else {
+                fprintf(f, "%ld: %s DATA[length=%d, flags=%d, stream=%d, padlen=%d]\n",
+                        s->c->id, msg, (int)frame->hd.length, frame->hd.flags,
+                        frame->hd.stream_id, (int)frame->data.padlen);
+            }
             break;
             
         case NGHTTP2_HEADERS:

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=1723737&r1=1723736&r2=1723737&view=diff
==============================================================================
--- httpd/test/mod_h2/trunk/test/test_frames.sh (original)
+++ httpd/test/mod_h2/trunk/test/test_frames.sh Fri Jan  8 15:26:16 2016
@@ -27,10 +27,10 @@ mh2fuzz_check_frames index.html "frames
 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=1, stream=1, padlen=0]
+0: recv DATA[length=2005, flags=0, stream=1, padlen=0]
+0: recv DATA[length=0, flags=1, stream=1, padlen=0]
 -->     0:00001 GET /index.html -> 200 2005
 0: send GOAWAY[error=0, last_stream=0, reason='']
-0: recv GOAWAY[error=0, last_stream=1, reason='']
 1/0/0/0/0 (2/3/4/5/0xx)
 EOF
 
@@ -41,10 +41,10 @@ mh2fuzz_check_frames not-there "frames G
 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=1, stream=1, padlen=0]
+0: recv DATA[length=207, flags=0, stream=1, padlen=0]
+0: recv DATA[length=0, flags=1, stream=1, padlen=0]
 -->     0:00001 GET /not-there -> 404 207
 0: send GOAWAY[error=0, last_stream=0, reason='']
-0: recv GOAWAY[error=0, last_stream=1, reason='']
 0/0/1/0/0 (2/3/4/5/0xx)
 EOF
 
@@ -57,10 +57,10 @@ ALPN: selected h2
 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=1, stream=1, padlen=0]
+0: recv DATA[length=2005, flags=0, stream=1, padlen=0]
+0: recv DATA[length=0, flags=1, stream=1, padlen=0]
 -->     0:00001 GET /index.html -> 200 2005
 0: send GOAWAY[error=0, last_stream=0, reason='']
-0: recv GOAWAY[error=0, last_stream=1, reason='']
 1/0/0/0/0 (2/3/4/5/0xx)
 EOF
 
@@ -72,10 +72,10 @@ ALPN: selected h2
 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=1, stream=1, padlen=0]
+0: recv DATA[length=207, flags=0, stream=1, padlen=0]
+0: recv DATA[length=0, flags=1, stream=1, padlen=0]
 -->     0:00001 GET /not-there -> 404 207
 0: send GOAWAY[error=0, last_stream=0, reason='']
-0: recv GOAWAY[error=0, last_stream=1, reason='']
 0/0/1/0/0 (2/3/4/5/0xx)
 EOF
 



Mime
View raw message