void http_PutResponse(const struct http *to, const char *response) { http_PutField(to, HTTP_HDR_RESPONSE, response); if (to->hd[HTTP_HDR_RESPONSE].b == NULL) http_SetH(to, HTTP_HDR_RESPONSE, "Lost Response"); Tcheck(to->hd[HTTP_HDR_RESPONSE]); }
void http_PutProtocol(const struct http *to, const char *protocol) { http_PutField(to, HTTP_HDR_PROTO, protocol); if (to->hd[HTTP_HDR_PROTO].b == NULL) http_SetH(to, HTTP_HDR_PROTO, "HTTP/1.1"); Tcheck(to->hd[HTTP_HDR_PROTO]); }
void http_PutProtocol(struct worker *w, unsigned vsl_id, const struct http *to, const char *protocol) { http_PutField(w, vsl_id, to, HTTP_HDR_PROTO, protocol); if (to->hd[HTTP_HDR_PROTO].b == NULL) http_SetH(to, HTTP_HDR_PROTO, "HTTP/1.1"); Tcheck(to->hd[HTTP_HDR_PROTO]); }
void http_PutResponse(struct worker *w, unsigned vsl_id, const struct http *to, const char *response) { http_PutField(w, vsl_id, to, HTTP_HDR_RESPONSE, response); if (to->hd[HTTP_HDR_RESPONSE].b == NULL) http_SetH(to, HTTP_HDR_RESPONSE, "Lost Response"); Tcheck(to->hd[HTTP_HDR_RESPONSE]); }
void http_SetStatus(struct http *to, uint16_t status) { char buf[4]; CHECK_OBJ_NOTNULL(to, HTTP_MAGIC); /* * We allow people to use top digits for internal VCL * signalling, but strip them from the ASCII version. */ to->status = status; status %= 1000; assert(status >= 100); bprintf(buf, "%03d", status); http_PutField(to, HTTP_HDR_STATUS, buf); http_SetH(to, HTTP_HDR_REASON, http_Status2Reason(status)); }