[master] 049ce0e73 Fix h2 error handling in varnishtest

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Tue Oct 29 17:19:07 UTC 2019


commit 049ce0e73250ee12e2d4e3e3370f4dacce4c07cd
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Tue Oct 29 17:32:17 2019 +0100

    Fix h2 error handling in varnishtest
    
    If varnish closes the connection while a client is waiting for an
    rxsomething command you may run into this kind of scenario:
    
        ***  c1   HTTP2 rx failed (fd:20 read: Connection reset by peer)
        ***  c1   rx: stream: 0, type: DATA (0), flags: 0x00, size: 0
        **** c1   s0 - no data
        ---- c1   Wrong frame type DATA (0) wanted SETTINGS
    
    This was already done correctly for the frame body.

diff --git a/bin/varnishtest/vtc_http2.c b/bin/varnishtest/vtc_http2.c
index 0e7bdea7f..049d7dd1b 100644
--- a/bin/varnishtest/vtc_http2.c
+++ b/bin/varnishtest/vtc_http2.c
@@ -710,7 +710,7 @@ receive_frame(void *priv)
 		}
 		AZ(pthread_mutex_unlock(&hp->mtx));
 
-		if (!get_bytes(hp, hdr, 9)) {
+		if (get_bytes(hp, hdr, sizeof hdr) <= 0) {
 			AZ(pthread_mutex_lock(&hp->mtx));
 			VTAILQ_FOREACH(s, &hp->streams, list)
 				AZ(pthread_cond_signal(&s->cond));


More information about the varnish-commit mailing list