Lines Matching refs:task

19 static void nxt_h1p_conn_ws_keepalive(nxt_task_t *task, void *obj, void *data);
20 static void nxt_h1p_conn_ws_frame_header_read(nxt_task_t *task, void *obj,
22 static void nxt_h1p_conn_ws_keepalive_disable(nxt_task_t *task,
24 static void nxt_h1p_conn_ws_keepalive_enable(nxt_task_t *task,
26 static void nxt_h1p_conn_ws_frame_process(nxt_task_t *task, nxt_conn_t *c,
28 static void nxt_h1p_conn_ws_error(nxt_task_t *task, void *obj, void *data);
29 static ssize_t nxt_h1p_ws_io_read_handler(nxt_task_t *task, nxt_conn_t *c);
30 static void nxt_h1p_conn_ws_timeout(nxt_task_t *task, void *obj, void *data);
31 static void nxt_h1p_conn_ws_frame_payload_read(nxt_task_t *task, void *obj,
33 static void hxt_h1p_send_ws_error(nxt_task_t *task, nxt_http_request_t *r,
35 static void nxt_h1p_conn_ws_error_sent(nxt_task_t *task, void *obj, void *data);
36 static void nxt_h1p_conn_ws_pong(nxt_task_t *task, void *obj, void *data);
73 nxt_h1p_websocket_first_frame_start(nxt_task_t *task, nxt_http_request_t *r, in nxt_h1p_websocket_first_frame_start() argument
81 nxt_debug(task, "h1p ws first frame start"); in nxt_h1p_websocket_first_frame_start()
87 nxt_conn_tcp_nodelay_on(task, c); in nxt_h1p_websocket_first_frame_start()
96 hxt_h1p_send_ws_error(task, r, &nxt_ws_err_out_of_memory); in nxt_h1p_websocket_first_frame_start()
105 timer->task = &c->task; in nxt_h1p_websocket_first_frame_start()
106 timer->work_queue = &task->thread->engine->fast_work_queue; in nxt_h1p_websocket_first_frame_start()
112 nxt_h1p_websocket_frame_start(task, r, ws_frame); in nxt_h1p_websocket_first_frame_start()
117 nxt_h1p_websocket_frame_start(nxt_task_t *task, nxt_http_request_t *r, in nxt_h1p_websocket_frame_start() argument
125 nxt_debug(task, "h1p ws frame start"); in nxt_h1p_websocket_frame_start()
136 nxt_h1p_complete_buffers(task, h1p, 0); in nxt_h1p_websocket_frame_start()
142 nxt_conn_read(task->thread->engine, c); in nxt_h1p_websocket_frame_start()
143 nxt_h1p_conn_ws_keepalive_enable(task, h1p); in nxt_h1p_websocket_frame_start()
148 nxt_debug(task, "h1p read client ws frame"); in nxt_h1p_websocket_frame_start()
155 nxt_h1p_conn_ws_frame_header_read(task, c, h1p); in nxt_h1p_websocket_frame_start()
161 nxt_h1p_conn_ws_keepalive(nxt_task_t *task, void *obj, void *data) in nxt_h1p_conn_ws_keepalive() argument
170 nxt_debug(task, "h1p conn ws keepalive"); in nxt_h1p_conn_ws_keepalive()
181 out = nxt_http_buf_mem(task, r, 2); in nxt_h1p_conn_ws_keepalive()
183 nxt_http_request_error_handler(task, r, r->proto.any); in nxt_h1p_conn_ws_keepalive()
196 nxt_http_request_send(task, r, out); in nxt_h1p_conn_ws_keepalive()
217 nxt_h1p_conn_ws_frame_header_read(nxt_task_t *task, void *obj, void *data) in nxt_h1p_conn_ws_frame_header_read() argument
230 nxt_h1p_conn_ws_keepalive_disable(task, h1p); in nxt_h1p_conn_ws_frame_header_read()
234 engine = task->thread->engine; in nxt_h1p_conn_ws_frame_header_read()
237 nxt_debug(task, "h1p conn ws frame header read %z", size); in nxt_h1p_conn_ws_frame_header_read()
240 nxt_h1p_conn_ws_keepalive_enable(task, h1p); in nxt_h1p_conn_ws_frame_header_read()
250 nxt_debug(task, "h1p conn ws frame header read %z < %z", size, hsize); in nxt_h1p_conn_ws_frame_header_read()
253 nxt_h1p_conn_ws_keepalive_enable(task, h1p); in nxt_h1p_conn_ws_frame_header_read()
266 hxt_h1p_send_ws_error(task, r, &nxt_ws_err_not_masked); in nxt_h1p_conn_ws_frame_header_read()
272 hxt_h1p_send_ws_error(task, r, &nxt_ws_err_ctrl_fragmented); in nxt_h1p_conn_ws_frame_header_read()
280 hxt_h1p_send_ws_error(task, r, &nxt_ws_err_invalid_opcode, in nxt_h1p_conn_ws_frame_header_read()
286 hxt_h1p_send_ws_error(task, r, &nxt_ws_err_ctrl_too_big, in nxt_h1p_conn_ws_frame_header_read()
294 hxt_h1p_send_ws_error(task, r, &nxt_ws_err_invalid_close_len); in nxt_h1p_conn_ws_frame_header_read()
301 hxt_h1p_send_ws_error(task, r, &nxt_ws_err_cont_expected, in nxt_h1p_conn_ws_frame_header_read()
310 hxt_h1p_send_ws_error(task, r, &nxt_ws_err_invalid_opcode, in nxt_h1p_conn_ws_frame_header_read()
326 hxt_h1p_send_ws_error(task, r, &nxt_ws_err_too_big, payload_len); in nxt_h1p_conn_ws_frame_header_read()
334 nxt_debug(task, "h1p conn ws frame header read: %z, %z", size, frame_size); in nxt_h1p_conn_ws_frame_header_read()
337 nxt_h1p_conn_ws_frame_process(task, c, h1p, wsh); in nxt_h1p_conn_ws_frame_header_read()
353 nxt_h1p_conn_ws_keepalive_enable(task, h1p); in nxt_h1p_conn_ws_frame_header_read()
358 nxt_h1p_conn_ws_keepalive_disable(nxt_task_t *task, nxt_h1proto_t *h1p) in nxt_h1p_conn_ws_keepalive_disable() argument
369 nxt_debug(task, "h1p ws keepalive disable: scheduled ws shutdown"); in nxt_h1p_conn_ws_keepalive_disable()
373 nxt_timer_disable(task->thread->engine, timer); in nxt_h1p_conn_ws_keepalive_disable()
378 nxt_h1p_conn_ws_keepalive_enable(nxt_task_t *task, nxt_h1proto_t *h1p) in nxt_h1p_conn_ws_keepalive_enable() argument
389 nxt_debug(task, "h1p ws keepalive enable: scheduled ws shutdown"); in nxt_h1p_conn_ws_keepalive_enable()
393 nxt_timer_add(task->thread->engine, timer, in nxt_h1p_conn_ws_keepalive_enable()
399 nxt_h1p_conn_ws_frame_process(nxt_task_t *task, nxt_conn_t *c, in nxt_h1p_conn_ws_frame_process() argument
412 nxt_h1p_conn_ws_pong(task, r, NULL); in nxt_h1p_conn_ws_frame_process()
428 hxt_h1p_send_ws_error(task, r, &nxt_ws_err_invalid_close_code, in nxt_h1p_conn_ws_frame_process()
437 r->state->ready_handler(task, r, NULL); in nxt_h1p_conn_ws_frame_process()
442 nxt_h1p_conn_ws_error(nxt_task_t *task, void *obj, void *data) in nxt_h1p_conn_ws_error() argument
449 nxt_debug(task, "h1p conn ws error"); in nxt_h1p_conn_ws_error()
456 r->state->error_handler(task, r, h1p); in nxt_h1p_conn_ws_error()
462 nxt_h1p_ws_io_read_handler(nxt_task_t *task, nxt_conn_t *c) in nxt_h1p_ws_io_read_handler() argument
496 nxt_h1p_conn_ws_timeout(nxt_task_t *task, void *obj, void *data) in nxt_h1p_conn_ws_timeout() argument
505 nxt_debug(task, "h1p conn ws timeout"); in nxt_h1p_conn_ws_timeout()
523 hxt_h1p_send_ws_error(task, r, &nxt_ws_err_going_away); in nxt_h1p_conn_ws_timeout()
542 nxt_h1p_conn_ws_frame_payload_read(nxt_task_t *task, void *obj, void *data) in nxt_h1p_conn_ws_frame_payload_read() argument
553 nxt_h1p_conn_ws_keepalive_disable(task, h1p); in nxt_h1p_conn_ws_frame_payload_read()
555 nxt_debug(task, "h1p conn ws frame read"); in nxt_h1p_conn_ws_frame_payload_read()
565 nxt_h1p_conn_ws_frame_process(task, c, h1p, wsh); in nxt_h1p_conn_ws_frame_payload_read()
570 engine = task->thread->engine; in nxt_h1p_conn_ws_frame_payload_read()
573 nxt_h1p_conn_ws_keepalive_enable(task, h1p); in nxt_h1p_conn_ws_frame_payload_read()
578 hxt_h1p_send_ws_error(nxt_task_t *task, nxt_http_request_t *r, in hxt_h1p_send_ws_error() argument
601 nxt_log(task, NXT_LOG_INFO, "websocket error %d: %V", err->code, &desc); in hxt_h1p_send_ws_error()
603 out = nxt_http_buf_mem(task, r, 2 + sizeof(err->code) + desc.length); in hxt_h1p_send_ws_error()
605 nxt_http_request_error_handler(task, r, r->proto.any); in hxt_h1p_send_ws_error()
628 nxt_http_request_send(task, r, out); in hxt_h1p_send_ws_error()
633 nxt_h1p_conn_ws_error_sent(nxt_task_t *task, void *obj, void *data) in nxt_h1p_conn_ws_error_sent() argument
639 nxt_debug(task, "h1p conn ws error sent"); in nxt_h1p_conn_ws_error_sent()
641 r->state->error_handler(task, r, r->proto.any); in nxt_h1p_conn_ws_error_sent()
646 nxt_h1p_conn_ws_pong(nxt_task_t *task, void *obj, void *data) in nxt_h1p_conn_ws_pong() argument
654 nxt_debug(task, "h1p conn ws pong"); in nxt_h1p_conn_ws_pong()
668 out = nxt_http_buf_mem(task, r, 2 + payload_len); in nxt_h1p_conn_ws_pong()
670 nxt_http_request_error_handler(task, r, r->proto.any); in nxt_h1p_conn_ws_pong()
688 nxt_work_queue_add(&task->thread->engine->fast_work_queue, in nxt_h1p_conn_ws_pong()
689 b->completion_handler, task, b, b->parent); in nxt_h1p_conn_ws_pong()
699 nxt_http_request_send(task, r, out); in nxt_h1p_conn_ws_pong()
701 nxt_http_request_ws_frame_start(task, r, r->ws_frame); in nxt_h1p_conn_ws_pong()