Commit 05027d74 authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Remove call to SES_Reserve_proto_priv in h2_init_sess

h2_init_sess can only be reached through H1 with either previous knowledge
or opportunistic upgrade. Because of this the proto_priv session attribute
will always be set before entry. This patch simplifies and removes dead
code containing a call to SES_Reserve_proto_priv.

Note: Better diff with the --ignore-all-space option
parent 613fa433
...@@ -101,41 +101,37 @@ h2_init_sess(const struct worker *wrk, struct sess *sp, ...@@ -101,41 +101,37 @@ h2_init_sess(const struct worker *wrk, struct sess *sp,
uintptr_t *up; uintptr_t *up;
struct h2_sess *h2; struct h2_sess *h2;
if (SES_Get_proto_priv(sp, &up)) { /* proto_priv session attribute will always have been set up by H1
/* Already reserved if we came via H1 */ * before reaching here. */
XXXAN(SES_Reserve_proto_priv(sp, &up)); AZ(SES_Get_proto_priv(sp, &up));
*up = 0; assert(*up == 0);
}
if (*up == 0) { if (srq == NULL)
if (srq == NULL) srq = Req_New(wrk, sp);
srq = Req_New(wrk, sp); AN(srq);
AN(srq); h2 = h2s;
h2 = h2s; AN(h2);
AN(h2); INIT_OBJ(h2, H2_SESS_MAGIC);
INIT_OBJ(h2, H2_SESS_MAGIC); h2->srq = srq;
h2->srq = srq; h2->htc = srq->htc;
h2->htc = srq->htc; h2->ws = srq->ws;
h2->ws = srq->ws; h2->vsl = srq->vsl;
h2->vsl = srq->vsl; VSL_Flush(h2->vsl, 0);
VSL_Flush(h2->vsl, 0); h2->vsl->wid = sp->vxid;
h2->vsl->wid = sp->vxid; h2->htc->rfd = &sp->fd;
h2->htc->rfd = &sp->fd; h2->sess = sp;
h2->sess = sp; h2->rxthr = pthread_self();
h2->rxthr = pthread_self(); AZ(pthread_cond_init(h2->winupd_cond, NULL));
AZ(pthread_cond_init(h2->winupd_cond, NULL)); VTAILQ_INIT(&h2->streams);
VTAILQ_INIT(&h2->streams); VTAILQ_INIT(&h2->txqueue);
VTAILQ_INIT(&h2->txqueue); h2_local_settings(&h2->local_settings);
h2_local_settings(&h2->local_settings); h2->remote_settings = H2_proto_settings;
h2->remote_settings = H2_proto_settings; h2->decode = decode;
h2->decode = decode;
AZ(VHT_Init(h2->dectbl, h2->local_settings.header_table_size));
AZ(VHT_Init(h2->dectbl,
h2->local_settings.header_table_size)); *up = (uintptr_t)h2;
*up = (uintptr_t)h2;
}
AN(up);
CAST_OBJ_NOTNULL(h2, (void*)(*up), H2_SESS_MAGIC);
return (h2); return (h2);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment