Commit fb5cd028 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

minor polish

parent f2e4b033
...@@ -188,6 +188,7 @@ V1D_Deliver(struct req *req) ...@@ -188,6 +188,7 @@ V1D_Deliver(struct req *req)
CHECK_OBJ_NOTNULL(req, REQ_MAGIC); CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
CHECK_OBJ_NOTNULL(req->obj, OBJECT_MAGIC); CHECK_OBJ_NOTNULL(req->obj, OBJECT_MAGIC);
CHECK_OBJ_NOTNULL(req->obj->objcore, OBJCORE_MAGIC);
while (req->obj->objcore->busyobj) while (req->obj->objcore->busyobj)
(void)usleep(10000); (void)usleep(10000);
...@@ -221,7 +222,8 @@ V1D_Deliver(struct req *req) ...@@ -221,7 +222,8 @@ V1D_Deliver(struct req *req)
!RFC2616_Req_Gzip(req->http)) { !RFC2616_Req_Gzip(req->http)) {
/* /*
* We don't know what it uncompresses to * We don't know what it uncompresses to
* XXX: we could cache that * XXX: we could cache that, but would still deliver
* XXX: with multiple writes because of the gunzip buffer
*/ */
req->res_mode &= ~RES_LEN; req->res_mode &= ~RES_LEN;
req->res_mode |= RES_GUNZIP; req->res_mode |= RES_GUNZIP;
...@@ -246,8 +248,7 @@ V1D_Deliver(struct req *req) ...@@ -246,8 +248,7 @@ V1D_Deliver(struct req *req)
if (req->res_mode & RES_GUNZIP) if (req->res_mode & RES_GUNZIP)
http_Unset(req->resp, H_Content_Encoding); http_Unset(req->resp, H_Content_Encoding);
if (req->obj->objcore != NULL if (!(req->obj->objcore->flags & OC_F_PASS)
&& !(req->obj->objcore->flags & OC_F_PASS)
&& req->obj->response == 200 && req->obj->response == 200
&& req->http->conds && RFC2616_Do_Cond(req)) { && req->http->conds && RFC2616_Do_Cond(req)) {
req->wantbody = 0; req->wantbody = 0;
...@@ -256,14 +257,15 @@ V1D_Deliver(struct req *req) ...@@ -256,14 +257,15 @@ V1D_Deliver(struct req *req)
} else if (req->res_mode & RES_CHUNKED) } else if (req->res_mode & RES_CHUNKED)
http_SetHeader(req->resp, "Transfer-Encoding: chunked"); http_SetHeader(req->resp, "Transfer-Encoding: chunked");
http_PrintfHeader(req->resp, "Connection: %s", http_SetHeader(req->resp,
req->doclose ? "close" : "keep-alive"); req->doclose ? "Connection: close" : "Connection: keep-alive");
/* /*
* If nothing special planned, we can attempt Range support * If nothing special planned, we can attempt Range support
*/ */
low = 0; low = 0;
high = req->obj->len - 1; high = req->obj->len - 1;
if ( if (
req->wantbody && req->wantbody &&
(req->res_mode & RES_LEN) && (req->res_mode & RES_LEN) &&
...@@ -279,8 +281,7 @@ V1D_Deliver(struct req *req) ...@@ -279,8 +281,7 @@ V1D_Deliver(struct req *req)
* Send HTTP protocol header, unless interior ESI object * Send HTTP protocol header, unless interior ESI object
*/ */
if (!(req->res_mode & RES_ESI_CHILD)) if (!(req->res_mode & RES_ESI_CHILD))
req->acct_req.hdrbytes += req->acct_req.hdrbytes += HTTP1_Write(req->wrk, req->resp, 1);
HTTP1_Write(req->wrk, req->resp, 1);
if (!req->wantbody) if (!req->wantbody)
req->res_mode &= ~RES_CHUNKED; req->res_mode &= ~RES_CHUNKED;
......
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