[5.1] 4204414 Move a bunch of SES_ functions to cache_transport.h, they are not for casual calling.

Poul-Henning Kamp phk at FreeBSD.org
Mon Apr 10 13:59:04 CEST 2017


commit 4204414270572f997fb28625ae830b8363b63731
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Mar 22 07:40:11 2017 +0000

    Move a bunch of SES_ functions to cache_transport.h, they are not
    for casual calling.

diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index c45cc5e..cfed8b4 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -944,15 +944,10 @@ enum req_fsm_nxt CNT_Request(struct worker *, struct req *);
 void CNT_AcctLogCharge(struct dstat *, struct req *);
 
 /* cache_session.c [SES] */
-struct sess *SES_New(struct pool *);
-void SES_Close(struct sess *, enum sess_close reason);
 void SES_Wait(struct sess *, const struct transport *);
-void SES_Delete(struct sess *, enum sess_close reason, double now);
 void SES_Ref(struct sess *sp);
 void SES_Rel(struct sess *sp);
 int SES_Reschedule_Req(struct req *);
-void SES_SetTransport(struct worker *, struct sess *, struct req *,
-    const struct transport *);
 
 enum htc_status_e {
 	HTC_S_JUNK =		-5,
diff --git a/bin/varnishd/cache/cache_transport.h b/bin/varnishd/cache/cache_transport.h
index 22c10b2..3433959 100644
--- a/bin/varnishd/cache/cache_transport.h
+++ b/bin/varnishd/cache/cache_transport.h
@@ -75,3 +75,10 @@ void H2_OU_Sess(struct worker *, struct sess *, struct req *);
 
 const struct transport *XPORT_ByNumber(uint16_t no);
 void VPX_Send_Proxy(int fd, int version, const struct sess *);
+
+/* cache_session.c */
+struct sess *SES_New(struct pool *);
+void SES_Delete(struct sess *, enum sess_close reason, double now);
+void SES_Close(struct sess *, enum sess_close reason);
+void SES_SetTransport(struct worker *, struct sess *, struct req *,
+    const struct transport *);
diff --git a/bin/varnishd/http1/cache_http1_deliver.c b/bin/varnishd/http1/cache_http1_deliver.c
index 0833f49..3f19bdf 100644
--- a/bin/varnishd/http1/cache_http1_deliver.c
+++ b/bin/varnishd/http1/cache_http1_deliver.c
@@ -136,7 +136,7 @@ V1D_Deliver(struct req *req, struct boc *boc, int sendbody)
 	}
 
 	if ((V1L_FlushRelease(req->wrk) || err) && req->sp->fd >= 0)
-		SES_Close(req->sp, SC_REM_CLOSE);
+		Req_Fail(req, SC_REM_CLOSE);
 	AZ(req->wrk->v1l);
 	VDP_close(req);
 }



More information about the varnish-commit mailing list