return (NULL);
VSL_stats->n_vbe_conn++;
vbc->magic = VBE_CONN_MAGIC;
- vbc->http = &vbc->http_mem[0];
- vbc->http2 = &vbc->http_mem[1];
+ vbc->bereq = &vbc->http_mem[0];
+ vbc->beresp = &vbc->http_mem[1];
vbc->fd = -1;
p = (void *)(vbc + 1);
- http_Setup(vbc->http, p, space);
+ http_Setup(vbc->bereq, p, space);
p += space;
- http_Setup(vbc->http2, p, space);
+ http_Setup(vbc->beresp, p, space);
return (vbc);
}
AZ(close(vc->fd));
vc->fd = -1;
vc->backend = NULL;
- WS_Reset(vc->http->ws);
- WS_Reset(vc->http2->ws);
+ WS_Reset(vc->bereq->ws);
+ WS_Reset(vc->beresp->ws);
LOCK(&vbemtx);
TAILQ_INSERT_HEAD(&vbe_head, vc, list);
VSL_stats->backend_unused++;
assert(vc->fd >= 0);
AN(vc->backend);
WSL(w, SLT_BackendReuse, vc->fd, "%s", vc->backend->vcl_name);
- WS_Reset(vc->http->ws);
- WS_Reset(vc->http2->ws);
+ WS_Reset(vc->bereq->ws);
+ WS_Reset(vc->beresp->ws);
LOCK(&vbemtx);
VSL_stats->backend_recycle++;
TAILQ_INSERT_HEAD(&vc->backend->connlist, vc, list);
if (vc == NULL)
return (1);
- http_ClrHeader(vc->http);
- vc->http->logtag = HTTP_Tx;
- http_GetReq(w, vc->fd, vc->http, sp->http);
- http_FilterHeader(w, vc->fd, vc->http, sp->http, HTTPH_R_FETCH);
- http_PrintfHeader(w, vc->fd, vc->http, "X-Varnish: %u", sp->xid);
- http_PrintfHeader(w, vc->fd, vc->http,
+ http_ClrHeader(vc->bereq);
+ vc->bereq->logtag = HTTP_Tx;
+ http_GetReq(w, vc->fd, vc->bereq, sp->http);
+ http_FilterHeader(w, vc->fd, vc->bereq, sp->http, HTTPH_R_FETCH);
+ http_PrintfHeader(w, vc->fd, vc->bereq, "X-Varnish: %u", sp->xid);
+ http_PrintfHeader(w, vc->fd, vc->bereq,
"X-Forwarded-for: %s", sp->addr);
- if (!http_GetHdr(vc->http, H_Host, &b)) {
- http_PrintfHeader(w, vc->fd, vc->http, "Host: %s",
+ if (!http_GetHdr(vc->bereq, H_Host, &b)) {
+ http_PrintfHeader(w, vc->fd, vc->bereq, "Host: %s",
sp->backend->hostname);
}
WRK_Reset(w, &vc->fd);
- http_Write(w, vc->http, 0);
+ http_Write(w, vc->bereq, 0);
if (WRK_Flush(w)) {
/* XXX: cleanup */
return (1);
CHECK_OBJ_NOTNULL(sp->wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC);
- if (http_RecvHead(vc->http, vc->fd)) {
+ if (http_RecvHead(vc->bereq, vc->fd)) {
/* XXX: cleanup */
return (1);
}
- if (http_DissectResponse(sp->wrk, vc->http, vc->fd)) {
+ if (http_DissectResponse(sp->wrk, vc->bereq, vc->fd)) {
/* XXX: cleanup */
return (1);
}
assert(sp->obj->busy != 0);
- if (http_GetHdr(vc->http, H_Last_Modified, &b))
+ if (http_GetHdr(vc->bereq, H_Last_Modified, &b))
sp->obj->last_modified = TIM_parse(b);
- hp = vc->http2;
+ hp = vc->beresp;
http_ClrHeader(hp);
hp->logtag = HTTP_Obj;
- http_CopyResp(sp->wrk, sp->fd, hp, vc->http);
- http_FilterHeader(sp->wrk, sp->fd, hp, vc->http, HTTPH_A_INS);
+ http_CopyResp(sp->wrk, sp->fd, hp, vc->bereq);
+ http_FilterHeader(sp->wrk, sp->fd, hp, vc->bereq, HTTPH_A_INS);
if (body) {
- if (http_GetHdr(vc->http, H_Content_Length, &b))
- cls = fetch_straight(sp, vc->fd, vc->http, b);
- else if (http_HdrIs(vc->http, H_Transfer_Encoding, "chunked"))
- cls = fetch_chunked(sp, vc->fd, vc->http);
+ if (http_GetHdr(vc->bereq, H_Content_Length, &b))
+ cls = fetch_straight(sp, vc->fd, vc->bereq, b);
+ else if (http_HdrIs(vc->bereq, H_Transfer_Encoding, "chunked"))
+ cls = fetch_chunked(sp, vc->fd, vc->bereq);
else
- cls = fetch_eof(sp, vc->fd, vc->http);
+ cls = fetch_eof(sp, vc->fd, vc->bereq);
http_PrintfHeader(sp->wrk, sp->fd, hp,
"Content-Length: %u", sp->obj->len);
} else
http_CopyHttp(&sp->obj->http, hp);
- if (http_GetHdr(vc->http, H_Connection, &b) && !strcasecmp(b, "close"))
+ if (http_GetHdr(vc->bereq, H_Connection, &b) && !strcasecmp(b, "close"))
cls = 1;
if (cls)
vc = VBE_GetFd(sp);
if (vc == NULL)
return;
- vc->http->logtag = HTTP_Tx;
+ vc->bereq->logtag = HTTP_Tx;
- http_CopyReq(w, vc->fd, vc->http, sp->http);
- http_FilterHeader(w, vc->fd, vc->http, sp->http, HTTPH_R_PIPE);
- http_PrintfHeader(w, vc->fd, vc->http, "X-Varnish: %u", sp->xid);
- http_PrintfHeader(w, vc->fd, vc->http,
+ http_CopyReq(w, vc->fd, vc->bereq, sp->http);
+ http_FilterHeader(w, vc->fd, vc->bereq, sp->http, HTTPH_R_PIPE);
+ http_PrintfHeader(w, vc->fd, vc->bereq, "X-Varnish: %u", sp->xid);
+ http_PrintfHeader(w, vc->fd, vc->bereq,
"X-Forwarded-for: %s", sp->addr);
- if (!http_GetHdr(vc->http, H_Host, &b)) {
- http_PrintfHeader(w, vc->fd, vc->http, "Host: %s",
+ if (!http_GetHdr(vc->bereq, H_Host, &b)) {
+ http_PrintfHeader(w, vc->fd, vc->bereq, "Host: %s",
sp->backend->hostname);
}
WRK_Reset(w, &vc->fd);
- http_Write(w, vc->http, 0);
+ http_Write(w, vc->bereq, 0);
if (http_GetTail(sp->http, 0, &b, &e) && b != e)
WRK_Write(w, b, e - b);