Skip to content
This repository was archived by the owner on Feb 16, 2026. It is now read-only.

Commit c3b64c8

Browse files
committed
http1: Reserve session workspace for the protocol private pointer only once
This allows to re-use http1_new_session from custom implementations, in that it can serve as an entry point into the state machine also for existing sessions (without requiting 8 bytes of session workspace for each request served).
1 parent d05d20e commit c3b64c8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

bin/varnishd/http1/cache_http1_fsm.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,10 @@ http1_new_session(struct worker *wrk, void *arg)
114114
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
115115

116116
HTC_RxInit(req->htc, req->ws);
117-
if (!SES_Reserve_proto_priv(sp, &u, &sz)) {
117+
118+
sz = sizeof u;
119+
if (SES_Get_proto_priv(sp, &u) &&
120+
!SES_Reserve_proto_priv(sp, &u, &sz)) {
118121
/* Out of session workspace. Free the req, close the sess,
119122
* and do not set a new task func, which will exit the
120123
* worker thread. */

0 commit comments

Comments
 (0)