Lines Matching refs:r

47     nxt_http_request_t *r, nxt_http_action_t *action);
48 static void nxt_http_static_iterate(nxt_task_t *task, nxt_http_request_t *r,
52 static void nxt_http_static_next(nxt_task_t *task, nxt_http_request_t *r,
189 nxt_http_static(nxt_task_t *task, nxt_http_request_t *r, in nxt_http_static() argument
195 if (nxt_slow_path(!nxt_str_eq(r->method, "GET", 3))) { in nxt_http_static()
197 if (!nxt_str_eq(r->method, "HEAD", 4)) { in nxt_http_static()
202 nxt_http_request_error(task, r, NXT_HTTP_METHOD_NOT_ALLOWED); in nxt_http_static()
212 ctx = nxt_mp_zget(r->mem_pool, sizeof(nxt_http_static_ctx_t)); in nxt_http_static()
214 nxt_http_request_error(task, r, NXT_HTTP_INTERNAL_SERVER_ERROR); in nxt_http_static()
221 nxt_http_static_iterate(task, r, ctx); in nxt_http_static()
228 nxt_http_static_iterate(nxt_task_t *task, nxt_http_request_t *r, in nxt_http_static_iterate() argument
272 nxt_http_static_send_ready(task, r, ctx); in nxt_http_static_iterate()
275 ret = nxt_var_query_init(&r->var_query, r, r->mem_pool); in nxt_http_static_iterate()
277 nxt_http_request_error(task, r, NXT_HTTP_INTERNAL_SERVER_ERROR); in nxt_http_static_iterate()
281 nxt_var_query(task, r->var_query, share->var, &ctx->share); in nxt_http_static_iterate()
285 nxt_var_query(task, r->var_query, conf->chroot, &ctx->chroot); in nxt_http_static_iterate()
289 nxt_var_query_resolve(task, r->var_query, ctx, in nxt_http_static_iterate()
312 nxt_http_request_t *r; in nxt_http_static_send_ready() local
317 r = obj; in nxt_http_static_send_ready()
321 rtcf = r->conf->socket_conf->router_conf; in nxt_http_static_send_ready()
334 fname = nxt_mp_nget(r->mem_pool, length + 1); in nxt_http_static_send_ready()
352 ret = nxt_http_route_test_rule(r, conf->types, mtype->start, in nxt_http_static_send_ready()
359 nxt_http_static_next(task, r, ctx, NXT_HTTP_FORBIDDEN); in nxt_http_static_send_ready()
488 nxt_http_static_next(task, r, ctx, status); in nxt_http_static_send_ready()
495 f = nxt_mp_get(r->mem_pool, sizeof(nxt_file_t)); in nxt_http_static_send_ready()
509 r->status = NXT_HTTP_OK; in nxt_http_static_send_ready()
510 r->resp.content_length_n = nxt_file_size(&fi); in nxt_http_static_send_ready()
512 field = nxt_list_zero_add(r->resp.fields); in nxt_http_static_send_ready()
519 p = nxt_mp_nget(r->mem_pool, NXT_HTTP_DATE_LEN); in nxt_http_static_send_ready()
529 field = nxt_list_zero_add(r->resp.fields); in nxt_http_static_send_ready()
538 p = nxt_mp_nget(r->mem_pool, length); in nxt_http_static_send_ready()
558 field = nxt_list_zero_add(r->resp.fields); in nxt_http_static_send_ready()
570 fb = nxt_mp_zget(r->mem_pool, NXT_BUF_FILE_SIZE); in nxt_http_static_send_ready()
578 r->out = fb; in nxt_http_static_send_ready()
597 nxt_http_static_next(task, r, ctx, NXT_HTTP_NOT_FOUND); in nxt_http_static_send_ready()
603 r->status = NXT_HTTP_MOVED_PERMANENTLY; in nxt_http_static_send_ready()
604 r->resp.content_length_n = 0; in nxt_http_static_send_ready()
606 field = nxt_list_zero_add(r->resp.fields); in nxt_http_static_send_ready()
613 encode = nxt_encode_uri(NULL, r->path->start, r->path->length); in nxt_http_static_send_ready()
614 length = r->path->length + encode * 2 + 1; in nxt_http_static_send_ready()
616 if (r->args->length > 0) { in nxt_http_static_send_ready()
617 length += 1 + r->args->length; in nxt_http_static_send_ready()
620 p = nxt_mp_nget(r->mem_pool, length); in nxt_http_static_send_ready()
629 p = (u_char *) nxt_encode_uri(p, r->path->start, r->path->length); in nxt_http_static_send_ready()
632 p = nxt_cpymem(p, r->path->start, r->path->length); in nxt_http_static_send_ready()
637 if (r->args->length > 0) { in nxt_http_static_send_ready()
639 nxt_memcpy(p, r->args->start, r->args->length); in nxt_http_static_send_ready()
645 nxt_http_request_header_send(task, r, body_handler, NULL); in nxt_http_static_send_ready()
647 r->state = &nxt_http_static_send_state; in nxt_http_static_send_ready()
656 nxt_http_request_error(task, r, NXT_HTTP_INTERNAL_SERVER_ERROR); in nxt_http_static_send_ready()
663 nxt_http_request_t *r; in nxt_http_static_var_error() local
665 r = obj; in nxt_http_static_var_error()
667 nxt_http_request_error(task, r, NXT_HTTP_INTERNAL_SERVER_ERROR); in nxt_http_static_var_error()
672 nxt_http_static_next(nxt_task_t *task, nxt_http_request_t *r, in nxt_http_static_next() argument
684 nxt_http_static_iterate(task, r, ctx); in nxt_http_static_next()
689 nxt_http_request_action(task, r, action->fallback); in nxt_http_static_next()
693 nxt_http_request_error(task, r, status); in nxt_http_static_next()
790 nxt_http_request_t *r; in nxt_http_static_body_handler() local
792 r = obj; in nxt_http_static_body_handler()
793 fb = r->out; in nxt_http_static_body_handler()
803 b = nxt_buf_mem_alloc(r->mem_pool, alloc, 0); in nxt_http_static_body_handler()
809 b->parent = r; in nxt_http_static_body_handler()
811 nxt_mp_retain(r->mem_pool); in nxt_http_static_body_handler()
831 nxt_mp_free(r->mem_pool, b); in nxt_http_static_body_handler()
832 nxt_mp_release(r->mem_pool); in nxt_http_static_body_handler()
850 nxt_http_request_t *r; in nxt_http_static_buf_completion() local
853 r = data; in nxt_http_static_buf_completion()
857 fb = r->out; in nxt_http_static_buf_completion()
859 if (nxt_slow_path(fb == NULL || r->error)) { in nxt_http_static_buf_completion()
876 nxt_http_request_error_handler(task, r, r->proto.any); in nxt_http_static_buf_completion()
884 r->out = NULL; in nxt_http_static_buf_completion()
886 b->next = nxt_http_buf_last(r); in nxt_http_static_buf_completion()
896 nxt_http_request_send(task, r, b); in nxt_http_static_buf_completion()
910 nxt_mp_free(r->mem_pool, b); in nxt_http_static_buf_completion()
911 nxt_mp_release(r->mem_pool); in nxt_http_static_buf_completion()
918 r->out = NULL; in nxt_http_static_buf_completion()