[master] b191057 Let h2_tx_rst take the stream id as an argument

Dag Haavi Finstad daghf at varnish-software.com
Wed Mar 14 10:29:10 UTC 2018


commit b1910571538484c03bbc1447f2f01da30caff5cd
Author: Dag Haavi Finstad <daghf at varnish-software.com>
Date:   Tue Mar 13 18:02:19 2018 +0100

    Let h2_tx_rst take the stream id as an argument

diff --git a/bin/varnishd/http2/cache_http2_proto.c b/bin/varnishd/http2/cache_http2_proto.c
index 14d381f..9aa487c 100644
--- a/bin/varnishd/http2/cache_http2_proto.c
+++ b/bin/varnishd/http2/cache_http2_proto.c
@@ -829,7 +829,8 @@ h2_frame_complete(struct http_conn *htc)
 /**********************************************************************/
 
 static h2_error
-h2_tx_rst(struct worker *wrk, struct h2_sess *h2, h2_error h2e)
+h2_tx_rst(struct worker *wrk, struct h2_sess *h2,
+    uint32_t stream, h2_error h2e)
 {
 	h2_error ret;
 	char b[4];
@@ -837,13 +838,13 @@ h2_tx_rst(struct worker *wrk, struct h2_sess *h2, h2_error h2e)
 	CHECK_OBJ_NOTNULL(h2, H2_SESS_MAGIC);
 
 	Lck_Lock(&h2->sess->mtx);
-	VSLb(h2->vsl, SLT_Debug, "H2: stream %u: %s", h2->rxf_stream, h2e->txt);
+	VSLb(h2->vsl, SLT_Debug, "H2: stream %u: %s", stream, h2e->txt);
 	Lck_Unlock(&h2->sess->mtx);
 	vbe32enc(b, h2e->val);
 
 	H2_Send_Get(wrk, h2, h2->req0);
 	ret = H2_Send_Frame(wrk, h2, H2_F_RST_STREAM,
-	    0, sizeof b, h2->rxf_stream, b);
+	    0, sizeof b, stream, b);
 	H2_Send_Rel(h2, h2->req0);
 
 	return (ret);
@@ -892,7 +893,8 @@ h2_procframe(struct worker *wrk, struct h2_sess *h2,
 			     "H2: stream %u: Hit maximum number of "
 			     "concurrent streams", h2->rxf_stream);
 			// rfc7540,l,1200,1205
-			return (h2_tx_rst(wrk, h2, H2SE_REFUSED_STREAM));
+			return (h2_tx_rst(wrk, h2, h2->rxf_stream,
+				H2SE_REFUSED_STREAM));
 		}
 		h2->highest_stream = h2->rxf_stream;
 		r2 = h2_new_req(wrk, h2, h2->rxf_stream, NULL);
@@ -909,7 +911,7 @@ h2_procframe(struct worker *wrk, struct h2_sess *h2,
 	if (h2->rxf_stream == 0 || h2e->connection)
 		return (h2e);	// Connection errors one level up
 
-	return (h2_tx_rst(wrk, h2, h2e));
+	return (h2_tx_rst(wrk, h2, h2->rxf_stream, h2e));
 }
 
 static int


More information about the varnish-commit mailing list