[7.3] f946bd160 http2_send: Move h2_errcheck() at the top

Simon Stridsberg simon.stridsberg at varnish-software.com
Mon Mar 18 18:23:06 UTC 2024


commit f946bd160f8342aa5229e2f9efde32762dcb545e
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Mon Oct 23 16:40:26 2023 +0200

    http2_send: Move h2_errcheck() at the top

diff --git a/bin/varnishd/http2/cache_http2_send.c b/bin/varnishd/http2/cache_http2_send.c
index a8d2d5b36..57c1b0f6f 100644
--- a/bin/varnishd/http2/cache_http2_send.c
+++ b/bin/varnishd/http2/cache_http2_send.c
@@ -43,6 +43,19 @@
 
 #define H2_SEND_HELD(h2, r2) (VTAILQ_FIRST(&(h2)->txqueue) == (r2))
 
+static h2_error
+h2_errcheck(const struct h2_req *r2, const struct h2_sess *h2)
+{
+	CHECK_OBJ_NOTNULL(r2, H2_REQ_MAGIC);
+	CHECK_OBJ_NOTNULL(h2, H2_SESS_MAGIC);
+
+	if (r2->error != NULL)
+		return (r2->error);
+	if (h2->error != NULL && r2->stream > h2->goaway_last_stream)
+		return (h2->error);
+	return (NULL);
+}
+
 static int
 h2_cond_wait(pthread_cond_t *cond, struct h2_sess *h2, struct h2_req *r2)
 {
@@ -232,19 +245,6 @@ h2_win_charge(struct h2_req *r2, const struct h2_sess *h2, uint32_t w)
 	h2->req0->t_window -= w;
 }
 
-static h2_error
-h2_errcheck(const struct h2_req *r2, const struct h2_sess *h2)
-{
-	CHECK_OBJ_NOTNULL(r2, H2_REQ_MAGIC);
-	CHECK_OBJ_NOTNULL(h2, H2_SESS_MAGIC);
-
-	if (r2->error != NULL)
-		return (r2->error);
-	if (h2->error != NULL && r2->stream > h2->goaway_last_stream)
-		return (h2->error);
-	return (NULL);
-}
-
 static int64_t
 h2_do_window(struct worker *wrk, struct h2_req *r2,
     struct h2_sess *h2, int64_t wanted)


More information about the varnish-commit mailing list