[master] 1084cfcbb polish: Further simplify V1F_SendReq() error handling

Nils Goroll nils.goroll at uplex.de
Thu Oct 31 10:38:05 UTC 2024


commit 1084cfcbb574a62a72cdfdd0f74bd0b6b1f5dc04
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Thu Oct 31 11:34:53 2024 +0100

    polish: Further simplify V1F_SendReq() error handling
    
    Nice polish proposed by Dridi, thank you.
    
    BTW, I can no longer read 'Valid Obj' as that, it's now always and forever
    WALID_OBJ now. All our objects are belong to him.

diff --git a/bin/varnishd/http1/cache_http1_fetch.c b/bin/varnishd/http1/cache_http1_fetch.c
index 3e1c8507a..2f431bd6d 100644
--- a/bin/varnishd/http1/cache_http1_fetch.c
+++ b/bin/varnishd/http1/cache_http1_fetch.c
@@ -114,7 +114,7 @@ V1F_SendReq(struct worker *wrk, struct busyobj *bo, uint64_t *ctr_hdrbytes,
 	if (err != NULL) {
 		if (wrk->v1l != NULL)
 			(void) V1L_Close(wrk, &bytes);
-		if (vdc->magic != 0)
+		if (VALID_OBJ(vdc, VDP_CTX_MAGIC))
 			(void) VDP_Close(vdc, NULL, NULL);
 		VSLb(bo->vsl, SLT_FetchError, "%s", err);
 		VSLb_ts_busyobj(bo, "Bereq", W_TIM_real(wrk));


More information about the varnish-commit mailing list