slightly polish the previous two commits

instead of overriding ctx.ws spefically, just let the Req2Ctx settings
win

This also moves pipe logging to the client side where it belongs.
parent 16e98e96
......@@ -206,9 +206,8 @@ VDI_Http1Pipe(struct req *req, struct busyobj *bo)
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
INIT_OBJ(ctx, VRT_CTX_MAGIC);
VCL_Req2Ctx(ctx, req);
VCL_Bo2Ctx(ctx, bo);
ctx->ws = req->ws;
VCL_Req2Ctx(ctx, req);
d = VDI_Resolve(ctx);
if (d == NULL || d->vdir->methods->http1pipe == NULL) {
......
......@@ -451,22 +451,20 @@ vcl_call_method(struct worker *wrk, struct req *req, struct busyobj *bo,
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
INIT_OBJ(&ctx, VRT_CTX_MAGIC);
if (bo != NULL) {
CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
CHECK_OBJ_NOTNULL(bo->vcl, VCL_MAGIC);
VCL_Bo2Ctx(&ctx, bo);
}
if (req != NULL) {
if (bo != NULL)
assert(method == VCL_MET_PIPE);
CHECK_OBJ(req, REQ_MAGIC);
CHECK_OBJ_NOTNULL(req->sp, SESS_MAGIC);
CHECK_OBJ_NOTNULL(req->vcl, VCL_MAGIC);
CHECK_OBJ_NOTNULL(req->top, REQTOP_MAGIC);
VCL_Req2Ctx(&ctx, req);
}
if (bo != NULL) {
CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
CHECK_OBJ_NOTNULL(bo->vcl, VCL_MAGIC);
VCL_Bo2Ctx(&ctx, bo);
if (req) {
assert(method == VCL_MET_PIPE);
ctx.ws = req->ws;
}
}
assert(ctx.now != 0);
ctx.specific = specific;
ctx.method = method;
......
......@@ -158,9 +158,6 @@ logexpect l2 -v v1 -g vxid -q "vxid == 1012" {
expect 0 = BereqHeader {^X-Forwarded-For: }
expect 0 = BereqHeader {^X-Varnish: 1011}
expect 0 = BereqHeader {^Connection: close}
expect 0 = VCL_call {^PIPE}
expect 0 = VCL_Error {^Forced failure}
expect 0 = VCL_return {^fail}
expect 0 = BereqAcct {^0 0 0 0 0 0}
expect 0 = End
} -start
......@@ -182,6 +179,9 @@ logexpect l3 -v v1 -g vxid -q "vxid == 1011" {
expect 0 = VCL_call {^HASH}
expect 0 = VCL_return {^lookup}
expect 0 = Link {^bereq 1012 pipe}
expect 0 = VCL_call {^PIPE}
expect 0 = VCL_Error {^Forced failure}
expect 0 = VCL_return {^fail}
expect 0 = RespProtocol {^HTTP/1.1}
expect 0 = RespStatus {^503}
expect 0 = RespReason {^VCL failed}
......
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