[master] f279c0c96 http1: Do not reset the transport pointer

Nils Goroll nils.goroll at uplex.de
Mon Nov 18 14:41:03 UTC 2024


commit f279c0c96c1d39e21ac0dd181c71a1b76faaf1d3
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Tue Nov 5 19:14:26 2024 +0100

    http1: Do not reset the transport pointer
    
    This allows code-reuse from custom implementations where only the deliver
    deliver callback differs.

diff --git a/bin/varnishd/http1/cache_http1_fsm.c b/bin/varnishd/http1/cache_http1_fsm.c
index ed60f5d5b..1d9efb1aa 100644
--- a/bin/varnishd/http1/cache_http1_fsm.c
+++ b/bin/varnishd/http1/cache_http1_fsm.c
@@ -82,7 +82,6 @@ http1_req(struct worker *wrk, void *arg)
 	CAST_OBJ_NOTNULL(req, arg, REQ_MAGIC);
 
 	THR_SetRequest(req);
-	req->transport = &HTTP1_transport;
 	assert(!WS_IsReserved(wrk->aws));
 	HTTP1_Session(wrk, req);
 	AZ(wrk->v1l);
@@ -309,8 +308,7 @@ HTTP1_Session(struct worker *wrk, struct req *req)
 	 */
 	if (http1_getstate(sp) == H1NEWREQ)
 		VTCP_blocking(sp->fd);
-
-	req->transport = &HTTP1_transport;
+	req->transport = XPORT_ByNumber(sp->sattr[SA_TRANSPORT]);
 
 	while (1) {
 		st = http1_getstate(sp);


More information about the varnish-commit mailing list