/unit/src/ |
H A D | nxt_http.h | 248 nxt_http_request_t *r, 266 void (*body_read)(nxt_task_t *task, nxt_http_request_t *r); 337 nxt_buf_t *nxt_http_buf_last(nxt_http_request_t *r); 348 nxt_array_t *nxt_http_arguments_parse(nxt_http_request_t *r); 349 nxt_array_t *nxt_http_cookies_parse(nxt_http_request_t *r); 369 nxt_int_t nxt_http_route_addr_rule(nxt_http_request_t *r, 373 nxt_int_t nxt_http_route_test_rule(nxt_http_request_t *r, 392 nxt_int_t nxt_http_set_headers(nxt_http_request_t *r); 406 nxt_http_request_t *r, nxt_http_action_t *action); 410 nxt_http_request_t *r, nxt_upstream_t *upstream); [all …]
|
H A D | nxt_http_error.c | 35 if (r->header_sent || r->error) { in nxt_http_request_error() 41 r->status = status; in nxt_http_request_error() 43 r->resp.fields = nxt_list_create(r->mem_pool, 8, sizeof(nxt_http_field_t)); in nxt_http_request_error() 55 r->resp.content_length = NULL; in nxt_http_request_error() 60 nxt_http_request_header_send(task, r, in nxt_http_request_error() 66 nxt_http_request_error_handler(task, r, r->proto.any); in nxt_http_request_error() 81 nxt_http_request_t *r; in nxt_http_request_send_error_body() local 83 r = obj; in nxt_http_request_send_error_body() 93 r->status, r->status); in nxt_http_request_send_error_body() 95 out->next = nxt_http_buf_last(r); in nxt_http_request_send_error_body() [all …]
|
H A D | nxt_http_js.c | 118 if (r == NULL) { in nxt_http_js_ext_uri() 134 if (r == NULL) { in nxt_http_js_ext_host() 150 if (r == NULL) { in nxt_http_js_ext_remote_addr() 171 if (r == NULL) { in nxt_http_js_ext_get_args() 179 r->args->start + r->args->length, args); in nxt_http_js_ext_get_args() 201 if (r == NULL) { in nxt_http_js_ext_get_header() 242 if (r == NULL) { in nxt_http_js_ext_keys_header() 275 if (r == NULL) { in nxt_http_js_ext_get_cookie() 324 if (r == NULL) { in nxt_http_js_ext_keys_cookie() 364 if (r == NULL) { in nxt_http_js_ext_get_var() [all …]
|
H A D | nxt_http_proxy.c | 137 r->peer = peer; in nxt_upstream_proxy_handler() 208 r = obj; in nxt_http_proxy_header_send() 230 r = obj; in nxt_http_proxy_header_sent() 253 r = obj; in nxt_http_proxy_header_read() 299 r = obj; in nxt_http_proxy_send_body() 347 r = data; in nxt_http_proxy_buf_mem_completion() 349 peer = r->peer; in nxt_http_proxy_buf_mem_completion() 381 r = obj; in nxt_http_proxy_error() 388 nxt_http_request_error(&r->task, r, peer->status); in nxt_http_proxy_error() 397 r = ctx; in nxt_http_proxy_date() [all …]
|
H A D | nxt_http_request.c | 89 r = ctx; in nxt_http_request_host() 206 r = ctx; in nxt_http_request_field() 221 r = ctx; in nxt_http_request_content_length() 289 return r; in nxt_http_request_create() 314 r = obj; in nxt_http_request_start() 549 r = obj; in nxt_http_request_ready() 600 r->server_name = r->host; in nxt_http_application_handler() 805 r = obj; in nxt_http_request_error_handler() 813 nxt_http_proto[r->protocol].discard(task, r, nxt_http_buf_last(r)); in nxt_http_request_error_handler() 849 if (r->body != NULL && nxt_buf_is_file(r->body) in nxt_http_request_close_handler() [all …]
|
H A D | nxt_http_response.c | 49 nxt_http_request_t *r; in nxt_http_response_status() local 51 r = ctx; in nxt_http_response_status() 59 r->status = status; in nxt_http_response_status() 80 nxt_http_request_t *r; in nxt_http_response_field() local 82 r = ctx; in nxt_http_response_field() 84 nxt_value_at(nxt_http_field_t *, r, offset) = field; in nxt_http_response_field()
|
H A D | nxt_http_return.c | 24 nxt_http_request_t *r, nxt_http_action_t *action); 115 r->status = conf->status; in nxt_http_return() 116 r->resp.content_length_n = 0; in nxt_http_return() 123 nxt_http_return_send_ready(task, r, ctx); in nxt_http_return() 126 rtcf = r->conf->socket_conf->router_conf; in nxt_http_return() 129 &r->tstr_cache, r, r->mem_pool); in nxt_http_return() 181 nxt_http_request_t *r; in nxt_http_return_send_ready() local 184 r = obj; in nxt_http_return_send_ready() 207 r->state = &nxt_http_return_send_state; in nxt_http_return_send_ready() 222 nxt_http_request_t *r; in nxt_http_return_send_error() local [all …]
|
H A D | nxt_http_rewrite.c | 38 action = r->action; in nxt_http_rewrite() 51 &r->tstr_cache, r, r->mem_pool); in nxt_http_rewrite() 65 rp.mem_pool = r->mem_pool; in nxt_http_rewrite() 80 if (r->args->length == 0) { in nxt_http_rewrite() 81 r->target = encoded_path; in nxt_http_rewrite() 93 nxt_memcpy(p, r->args->start, r->args->length); in nxt_http_rewrite() 95 r->target = target; in nxt_http_rewrite() 96 r->args->start = p; in nxt_http_rewrite() 99 r->path = nxt_mp_alloc(r->mem_pool, sizeof(nxt_str_t)); in nxt_http_rewrite() 104 *r->path = rp.path; in nxt_http_rewrite() [all …]
|
H A D | nxt_http_route.c | 1333 ret = nxt_tstr_query_init(&r->tstr_query, rtcf->tstr_state, &r->tstr_cache, in nxt_http_pass_var() 1334 r, r->mem_pool); in nxt_http_pass_var() 1367 nxt_http_request_t *r; in nxt_http_pass_query_ready() local 1369 r = obj; in nxt_http_pass_query_ready() 1394 r = obj; in nxt_http_pass_query_error() 1619 ret = nxt_http_route_addr_rule(r, test->addr_rule, r->remote); in nxt_http_route_match() 1622 if (r->local == NULL && nxt_fast_path(r->proto.any != NULL)) { in nxt_http_route_match() 1623 nxt_http_proto[r->protocol].local_addr(task, r); in nxt_http_route_match() 1626 ret = nxt_http_route_addr_rule(r, test->addr_rule, r->local); in nxt_http_route_match() 2024 return nxt_http_route_test_rule(r, rule, r->args_decoded.start, in nxt_http_route_query() [all …]
|
H A D | nxt_http_set_headers.c | 76 nxt_list_each(f, r->resp.fields) { in nxt_http_resp_header_find() 95 nxt_http_set_headers(nxt_http_request_t *r) in nxt_http_set_headers() argument 105 action = r->action; in nxt_http_set_headers() 111 if ((r->status < NXT_HTTP_OK || r->status >= NXT_HTTP_BAD_REQUEST)) { in nxt_http_set_headers() 115 rtcf = r->conf->socket_conf->router_conf; in nxt_http_set_headers() 120 value = nxt_mp_zalloc(r->mem_pool, sizeof(nxt_str_t) * n); in nxt_http_set_headers() 136 ret = nxt_tstr_query_init(&r->tstr_query, rtcf->tstr_state, in nxt_http_set_headers() 137 &r->tstr_cache, r, r->mem_pool); in nxt_http_set_headers() 142 nxt_tstr_query(&r->task, r->tstr_query, hv->value, &value[i]); in nxt_http_set_headers() 144 if (nxt_slow_path(nxt_tstr_query_failed(r->tstr_query))) { in nxt_http_set_headers() [all …]
|
H A D | nxt_http_static.c | 280 &r->tstr_cache, r, r->mem_pool); in nxt_http_static_iterate() 322 r = obj; in nxt_http_static_send_ready() 618 encode = nxt_encode_uri(NULL, r->path->start, r->path->length); in nxt_http_static_send_ready() 637 p = nxt_cpymem(p, r->path->start, r->path->length); in nxt_http_static_send_ready() 644 nxt_memcpy(p, r->args->start, r->args->length); in nxt_http_static_send_ready() 670 r = obj; in nxt_http_static_send_error() 802 r = obj; in nxt_http_static_body_handler() 803 fb = r->out; in nxt_http_static_body_handler() 863 r = data; in nxt_http_static_buf_completion() 867 fb = r->out; in nxt_http_static_buf_completion() [all …]
|
H A D | nxt_http_variables.c | 245 r = ctx; in nxt_http_var_request_time() 269 r = ctx; in nxt_http_var_method() 283 r = ctx; in nxt_http_var_request_uri() 296 r = ctx; in nxt_http_var_uri() 309 r = ctx; in nxt_http_var_host() 323 r = ctx; in nxt_http_var_remote_addr() 346 r = ctx; in nxt_http_var_time_local() 395 r = ctx; in nxt_http_var_request_line() 410 r = ctx; in nxt_http_var_request_id() 437 r = ctx; in nxt_http_var_body_bytes_sent() [all …]
|
H A D | nxt_http_websocket.c | 35 nxt_http_request_t *r; in nxt_http_websocket_client() local 39 r = obj; in nxt_http_websocket_client() 40 req_rpc_data = r->req_rpc_data; in nxt_http_websocket_client() 50 wsh = (nxt_websocket_header_t *) r->ws_frame->mem.pos; in nxt_http_websocket_client() 60 b = r->ws_frame; in nxt_http_websocket_client() 95 r->ws_frame = next; in nxt_http_websocket_client() 109 b = r->ws_frame; in nxt_http_websocket_client() 122 nxt_http_request_ws_frame_start(task, r, r->ws_frame); in nxt_http_websocket_client() 129 nxt_http_request_t *r; in nxt_http_websocket_error_handler() local 134 r = obj; in nxt_http_websocket_error_handler() [all …]
|
H A D | nxt_php_sapi.c | 965 p = nxt_cpymem(p, nxt_unit_sptr_get(&r->path), r->path_length); in nxt_php_do_301() 1190 f = r->fields + r->content_type_field; 1196 f = r->fields + r->cookie_field; 1202 f = r->fields + r->authorization_field; 1451 nxt_php_set_sptr(req, "PHP_SELF", &r->path, r->path_length, 1491 nxt_php_set_sptr(req, "REQUEST_URI", &r->target, r->target_length, 1493 nxt_php_set_sptr(req, "QUERY_STRING", &r->query, r->query_length, 1505 if (r->tls) { 1509 f_end = r->fields + r->fields_count; 1518 f = r->fields + r->content_length_field; [all …]
|
H A D | nxt_port_rpc.c | 260 nxt_port_rpc_reg_t *r; in nxt_port_rpc_remove_from_peers() local 283 r = nxt_queue_link_data(reg->link.next, nxt_port_rpc_reg_t, link); in nxt_port_rpc_remove_from_peers() 284 r->link_first = 1; in nxt_port_rpc_remove_from_peers()
|
H A D | nxt_random.c | 41 r->i = 0; in nxt_random_start_schedule() 42 r->j = 0; in nxt_random_start_schedule() 124 val = r->s[r->i]; in nxt_random_add() 127 r->s[r->i] = r->s[r->j]; in nxt_random_add() 128 r->s[r->j] = val; in nxt_random_add() 134 r->i--; in nxt_random_add() 136 r->j = r->i; in nxt_random_add() 166 si = r->s[r->i]; in nxt_random_byte() 169 sj = r->s[r->j]; in nxt_random_byte() 170 r->s[r->i] = sj; in nxt_random_byte() [all …]
|
H A D | nxt_random.h | 19 void nxt_random_init(nxt_random_t *r); 20 uint32_t nxt_random(nxt_random_t *r);
|
H A D | nxt_router.c | 4379 r = obj; in nxt_http_request_send_body() 4580 nxt_event_engine_post(r->engine, &r->err_work); in nxt_router_app_port_error() 5177 r->err_work.obj = r; in nxt_router_process_http_request() 5203 r = obj; in nxt_router_http_request_error() 5222 r = data; in nxt_router_http_request_done() 5230 nxt_http_request_close_handler(task, r, r->proto.any); in nxt_router_http_request_done() 5408 + (r->path->start != r->target.start ? r->path->length + 1 : 0); in nxt_router_prepare_msg() 5448 p = nxt_cpymem(p, r->method->start, r->method->length); in nxt_router_prepare_msg() 5453 p = nxt_cpymem(p, r->version.start, r->version.length); in nxt_router_prepare_msg() 5484 p = nxt_cpymem(p, r->target.start, r->target.length); in nxt_router_prepare_msg() [all …]
|
H A D | nxt_router.h | 236 void (*handler)(nxt_task_t *task, nxt_http_request_t *r, 245 void nxt_router_process_http_request(nxt_task_t *task, nxt_http_request_t *r,
|
H A D | nxt_router_access_log.c | 27 nxt_http_request_t *r, nxt_router_access_log_t *access_log, 166 nxt_router_access_log_writer(nxt_task_t *task, nxt_http_request_t *r, in nxt_router_access_log_writer() argument 183 nxt_router_access_log_write_ready(task, r, ctx); in nxt_router_access_log_writer() 186 rtcf = r->conf->socket_conf->router_conf; in nxt_router_access_log_writer() 188 ret = nxt_tstr_query_init(&r->tstr_query, rtcf->tstr_state, in nxt_router_access_log_writer() 189 &r->tstr_cache, r, r->mem_pool); in nxt_router_access_log_writer() 194 nxt_tstr_query(task, r->tstr_query, format, &ctx->text); in nxt_router_access_log_writer() 195 nxt_tstr_query_resolve(task, r->tstr_query, ctx, in nxt_router_access_log_writer() 205 nxt_http_request_t *r; in nxt_router_access_log_write_ready() local 208 r = obj; in nxt_router_access_log_write_ready() [all …]
|
H A D | nxt_unit.c | 1290 nxt_unit_request_t *r; in nxt_unit_process_req_headers() local 1328 r = req->request; in nxt_unit_process_req_headers() 1330 req->content_length = r->content_length; in nxt_unit_process_req_headers() 1357 (int) r->method_length, in nxt_unit_process_req_headers() 1359 (int) r->target_length, in nxt_unit_process_req_headers() 1949 nxt_unit_request_t *r; in nxt_unit_request_group_dup_fields() local 1957 r = req->request; in nxt_unit_request_group_dup_fields() 1958 fields = r->fields; in nxt_unit_request_group_dup_fields() 1960 for (i = 0; i < r->fields_count; i++) { in nxt_unit_request_group_dup_fields() 1979 r->content_type_field = i; in nxt_unit_request_group_dup_fields() [all …]
|
H A D | nxt_upstream.c | 13 nxt_http_request_t *r, nxt_http_action_t *action); 141 nxt_upstream_handler(nxt_task_t *task, nxt_http_request_t *r, in nxt_upstream_handler() argument 146 u = r->conf->upstreams[action->u.upstream_number]; in nxt_upstream_handler() 150 return nxt_upstream_proxy_handler(task, r, u); in nxt_upstream_handler()
|
/unit/src/perl/ |
H A D | nxt_perl_psgi.c | 620 r = req->request; in nxt_perl_psgi_env_create() 626 &r->method, r->method_length)); in nxt_perl_psgi_env_create() 628 &r->target, r->target_length)); in nxt_perl_psgi_env_create() 630 &r->path, r->path_length)); in nxt_perl_psgi_env_create() 669 &r->query, r->query_length)); in nxt_perl_psgi_env_create() 671 &r->version, r->version_length)); in nxt_perl_psgi_env_create() 673 &r->remote, r->remote_length)); in nxt_perl_psgi_env_create() 675 &r->local_addr, r->local_addr_length)); in nxt_perl_psgi_env_create() 678 &r->server_name, r->server_name_length)); in nxt_perl_psgi_env_create() 690 f = r->fields + r->content_length_field; in nxt_perl_psgi_env_create() [all …]
|
/unit/src/python/ |
H A D | nxt_python_asgi.c | 648 nxt_unit_request_t *r; in nxt_py_asgi_create_http_scope() local 664 r = req->request; in nxt_py_asgi_create_http_scope() 666 if (r->websocket_handshake) { in nxt_py_asgi_create_http_scope() 681 path_length = r->path_length; in nxt_py_asgi_create_http_scope() 682 p = nxt_unit_sptr_get(&r->path); in nxt_py_asgi_create_http_scope() 706 v = PyUnicode_DecodeUTF8(nxt_unit_sptr_get(&r->path), r->path_length, in nxt_py_asgi_create_http_scope() 719 if (r->query.offset != 0) { in nxt_py_asgi_create_http_scope() 744 v = nxt_py_asgi_create_address(&r->remote, r->remote_length, 0); in nxt_py_asgi_create_http_scope() 753 v = nxt_py_asgi_create_address(&r->local_addr, r->local_addr_length, 80); in nxt_py_asgi_create_http_scope() 771 f = r->fields + i; in nxt_py_asgi_create_http_scope() [all …]
|
H A D | nxt_python_wsgi.c | 601 nxt_unit_request_t *r; in nxt_python_get_environ() local 603 r = pctx->req->request; in nxt_python_get_environ() 618 r->query_length)); in nxt_python_get_environ() 621 path_length = r->path_length; in nxt_python_get_environ() 622 path = nxt_unit_sptr_get(&r->path); in nxt_python_get_environ() 642 if (r->tls) { in nxt_python_get_environ() 659 for (i = 0; i < r->fields_count;) { in nxt_python_get_environ() 660 f = r->fields + i; in nxt_python_get_environ() 664 f2 = r->fields + j; in nxt_python_get_environ() 681 f = r->fields + r->content_length_field; in nxt_python_get_environ() [all …]
|