Mailing List Archive

[master] 47e12f219 http2_send: Move h2_errcheck() at the top
commit 47e12f219108b011f41e4f6cd8c8c6262154045e
Author: Dridi Boukelmoune <dridi.boukelmoune@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 a31d99248..de4f2850d 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)
_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit