Lines Matching refs:r
23 http_cgi_local_redir (request_st * const r) in http_cgi_local_redir() argument
46 size_t ulen = buffer_clen(&r->uri.path); in http_cgi_local_redir()
47 const buffer *vb = http_header_response_get(r, HTTP_HEADER_LOCATION, in http_cgi_local_redir()
51 && (0 != strncmp(vb->ptr, r->uri.path.ptr, ulen) in http_cgi_local_redir()
55 && 1 == r->resp_headers.used /*"Location"; no "Status" or NPH response*/ in http_cgi_local_redir()
56 && r->http_status >= 300 && r->http_status < 400) { in http_cgi_local_redir()
57 if (++r->loops_per_request > 5) { in http_cgi_local_redir()
58 log_error(r->conf.errh, __FILE__, __LINE__, in http_cgi_local_redir()
60 r->target_orig.ptr); in http_cgi_local_redir()
61 r->http_status = 500; /* Internal Server Error */ in http_cgi_local_redir()
62 r->resp_body_started = 0; in http_cgi_local_redir()
63 r->handler_module = NULL; in http_cgi_local_redir()
67 buffer_copy_buffer(&r->target, vb); in http_cgi_local_redir()
68 buffer_clear(&r->pathinfo); in http_cgi_local_redir()
70 if (r->reqbody_length) { in http_cgi_local_redir()
71 if (r->reqbody_length != r->reqbody_queue.bytes_in) in http_cgi_local_redir()
72 r->keep_alive = 0; in http_cgi_local_redir()
73 r->reqbody_length = 0; in http_cgi_local_redir()
74 chunkqueue_reset(&r->reqbody_queue); in http_cgi_local_redir()
77 if (r->http_status != 307 && r->http_status != 308) { in http_cgi_local_redir()
80 r->http_method = HTTP_METHOD_GET; in http_cgi_local_redir()
120 http_cgi_headers (request_st * const r, http_cgi_opts * const opts, http_cgi_header_append_cb cb, v… in http_cgi_headers() argument
128 buffer * const tb = r->tmp_buf; in http_cgi_headers()
136 buf, li_itostrn(buf,sizeof(buf),r->reqbody_length)); in http_cgi_headers()
138 n = buffer_clen(&r->uri.query); in http_cgi_headers()
140 n ? r->uri.query.ptr : "", n); in http_cgi_headers()
142 s = r->target_orig.ptr; in http_cgi_headers()
143 n = buffer_clen(&r->target_orig); in http_cgi_headers()
155 if (!buffer_is_equal(&r->target, &r->target_orig)) in http_cgi_headers()
157 BUF_PTR_LEN(&r->target)); in http_cgi_headers()
161 if (0 == r->error_handler_saved_status) in http_cgi_headers()
172 BUF_PTR_LEN(&r->uri.path)); in http_cgi_headers()
173 if (!buffer_is_blank(&r->pathinfo)) { in http_cgi_headers()
175 BUF_PTR_LEN(&r->pathinfo)); in http_cgi_headers()
181 : &r->physical.basedir; in http_cgi_headers()
183 BUF_PTR_LEN(&r->pathinfo)); in http_cgi_headers()
199 BUF_PTR_LEN(&r->uri.path)); in http_cgi_headers()
212 buffer_copy_path_len2(tb, BUF_PTR_LEN(&r->physical.path), in http_cgi_headers()
213 BUF_PTR_LEN(&r->pathinfo)); in http_cgi_headers()
219 BUF_PTR_LEN(&r->physical.path)); in http_cgi_headers()
221 BUF_PTR_LEN(&r->physical.basedir)); in http_cgi_headers()
224 const buffer * const m = http_method_buf(r->http_method); in http_cgi_headers()
227 s = get_http_version_name(r->http_version); in http_cgi_headers()
231 if (r->conf.server_tag) { in http_cgi_headers()
232 s = r->conf.server_tag->ptr; in http_cgi_headers()
233 n = buffer_clen(r->conf.server_tag); in http_cgi_headers()
245 BUF_PTR_LEN(&r->uri.scheme)); in http_cgi_headers()
247 if (buffer_is_equal_string(&r->uri.scheme, CONST_STR_LEN("https"))) in http_cgi_headers()
250 const connection * const con = r->con; in http_cgi_headers()
294 n = buffer_clen(r->server_name); in http_cgi_headers()
296 s = r->server_name->ptr; in http_cgi_headers()
309 BUF_PTR_LEN(r->dst_addr_buf)); in http_cgi_headers()
312 li_utostrn(buf, sizeof(buf), sock_addr_get_port(r->dst_addr))); in http_cgi_headers()
314 for (n = 0; n < r->rqst_headers.used; n++) { in http_cgi_headers()
315 data_string *ds = (data_string *)r->rqst_headers.data[n]; in http_cgi_headers()
333 con->srv->request_env(r); in http_cgi_headers()
335 for (n = 0; n < r->env.used; n++) { in http_cgi_headers()
336 data_string *ds = (data_string *)r->env.data[n]; in http_cgi_headers()