/unit/auto/ |
H A D | sources | 7 src/nxt_lib.c \ 8 src/nxt_gmtime.c \ 9 src/nxt_errno.c \ 10 src/nxt_time.c \ 11 src/nxt_malloc.c \ 12 src/nxt_file.c \ 14 src/nxt_socket.c \ 25 src/nxt_port.c \ 30 src/nxt_mp.c \ 36 src/nxt_var.c \ [all …]
|
/unit/src/ |
H A D | nxt_conn_read.c | 17 c->socket.fd, c->socket.read_ready); in nxt_conn_wait() 24 c->socket.task, c, c->socket.data); in nxt_conn_wait() 31 nxt_conn_timer(engine, c, state, &c->read_timer); in nxt_conn_wait() 46 c = obj; in nxt_conn_io_read() 49 c->socket.fd, c->socket.read_ready, c->socket.closed, in nxt_conn_io_read() 50 c->socket.error, c->block_read); in nxt_conn_io_read() 52 if (c->socket.error != 0 || c->block_read) { in nxt_conn_io_read() 62 c->socket.read_handler = c->io->read; in nxt_conn_io_read() 69 n = c->io->recvbuf(c, c->read); in nxt_conn_io_read() 114 nxt_conn_timer(engine, c, state, &c->read_timer); in nxt_conn_io_read() [all …]
|
H A D | nxt_conn_connect.c | 19 c = obj; in nxt_conn_sys_socket() 22 c->socket.write_work_queue = c->write_work_queue; in nxt_conn_sys_socket() 42 c = obj; in nxt_conn_io_connect() 46 switch (nxt_socket_connect(task, c->socket.fd, c->remote)) { in nxt_conn_io_connect() 59 nxt_conn_timer(engine, c, state, &c->write_timer); in nxt_conn_io_connect() 73 nxt_work_queue_add(c->write_work_queue, handler, task, c, data); in nxt_conn_io_connect() 93 c->sendfile = 1; in nxt_conn_socket() 125 nxt_conn_t *c; in nxt_conn_connect_test() local 127 c = obj; in nxt_conn_connect_test() 156 c = obj; in nxt_conn_connect_error() [all …]
|
H A D | nxt_conn.c | 45 nxt_conn_t *c; in nxt_conn_create() local 57 c->socket.log = &c->log; in nxt_conn_create() 70 c->task.log = &c->log; in nxt_conn_create() 71 c->task.ident = c->log.ident; in nxt_conn_create() 72 c->socket.task = &c->task; in nxt_conn_create() 73 c->read_timer.task = &c->task; in nxt_conn_create() 74 c->write_timer.task = &c->task; in nxt_conn_create() 83 nxt_conn_timer_init(&c->read_timer, c, c->socket.read_work_queue); in nxt_conn_create() 84 nxt_conn_timer_init(&c->write_timer, c, c->socket.write_work_queue); in nxt_conn_create() 88 return c; in nxt_conn_create() [all …]
|
H A D | nxt_conn_close.c | 31 c->socket.fd, c->socket.timedout); in nxt_conn_close() 37 c->write = NULL; in nxt_conn_close() 61 if (c->socket.error == 0 && !c->socket.closed && !c->socket.shutdown) { in nxt_conn_close() 70 nxt_work_queue_add(wq, handler, c->socket.task, c, engine); in nxt_conn_close() 80 c = obj; in nxt_conn_shutdown_handler() 101 c = obj; in nxt_conn_close_handler() 120 c->socket.fd = -1; in nxt_conn_close_handler() 122 if (c->idle) { in nxt_conn_close_handler() 129 task, c, c->socket.data); in nxt_conn_close_handler() 160 if (c->idle) { in nxt_conn_close_timer_handler() [all …]
|
H A D | nxt_event_conn_job_sendfile.c | 47 c = obj; in nxt_event_conn_job_sendfile_start() 54 c->write_state->error_handler(task, c, NULL); in nxt_event_conn_job_sendfile_start() 59 c->socket.error_handler = c->write_state->error_handler; in nxt_event_conn_job_sendfile_start() 61 jbs->job.data = c; in nxt_event_conn_job_sendfile_start() 105 c = data; in nxt_event_conn_job_sendfile_handler() 113 ret = c->io->old_sendbuf(c, b, jbs->limit); in nxt_event_conn_job_sendfile_handler() 172 c = data; in nxt_event_conn_job_sendfile_return() 178 c->sent += sent; in nxt_event_conn_job_sendfile_return() 215 nxt_conn_timer(task->thread->engine, c, c->write_state, in nxt_event_conn_job_sendfile_return() 223 task, c, c->socket.data); in nxt_event_conn_job_sendfile_return() [all …]
|
H A D | nxt_parse.c | 18 u_char c; in nxt_int_parse() local 32 c = c - '0'; in nxt_int_parse() 64 u_char c; in nxt_size_t_parse() local 78 c = c - '0'; in nxt_size_t_parse() 183 c = c - '0'; in nxt_off_t_parse() 232 c = *p; in nxt_str_int_parse() 235 c = c - '0'; in nxt_str_int_parse() 280 c = *p; in nxt_number_parse() 287 c = c - '0'; in nxt_number_parse() 324 c = *p; in nxt_number_parse() [all …]
|
H A D | nxt_gnutls.c | 326 nxt_gnutls_conn_handshake(thr, c, c->socket.data); in nxt_gnutls_conn_init() 332 c->read_state->error_handler, c, c->socket.data); in nxt_gnutls_conn_init() 358 c = data; in nxt_gnutls_pull() 379 c = data; in nxt_gnutls_push() 405 c = data; in nxt_gnutls_vec_push() 433 c = obj; in nxt_gnutls_conn_handshake() 478 c = obj; in nxt_gnutls_conn_io_read() 483 b = c->read; in nxt_gnutls_conn_io_read() 580 c = obj; in nxt_gnutls_conn_io_shutdown() 590 if (c->socket.timedout || c->socket.error != 0) { in nxt_gnutls_conn_io_shutdown() [all …]
|
H A D | nxt_cyassl.c | 24 nxt_event_conn_t *c); 217 nxt_cyassl_conn_handshake(thr, c, c->socket.data); in nxt_cyassl_conn_init() 223 c->read_state->error_handler, c, c->socket.data); in nxt_cyassl_conn_init() 249 c = data; in nxt_cyassl_io_recv() 277 c = data; in nxt_cyassl_io_send() 303 c = obj; in nxt_cyassl_conn_handshake() 349 c = obj; in nxt_cyassl_conn_io_read() 354 b = c->read; in nxt_cyassl_conn_io_read() 456 c = obj; in nxt_cyassl_conn_io_shutdown() 471 c->write_state->close_handler, c, data); in nxt_cyassl_conn_io_shutdown() [all …]
|
H A D | nxt_sha1.c | 23 ctx->c = 0x98badcfe; in nxt_sha1_init() 104 result[10] = (u_char) (ctx->c >> 8); in nxt_sha1_final() 105 result[11] = (u_char) ctx->c; in nxt_sha1_final() 125 #define F1(b, c, d) (((b) & (c)) | ((~(b)) & (d))) argument 126 #define F2(b, c, d) ((b) ^ (c) ^ (d)) argument 127 #define F3(b, c, d) (((b) & (c)) | ((b) & (d)) | ((c) & (d))) argument 158 uint32_t a, b, c, d, e, temp; in nxt_sha1_body() local 168 c = ctx->c; in nxt_sha1_body() 175 saved_c = c; in nxt_sha1_body() 280 c += saved_c; in nxt_sha1_body() [all …]
|
H A D | nxt_conn.h | 77 ssize_t (*writev)(nxt_conn_t *c, 230 nxt_conn_t *c); 242 nxt_conn_t *c); 246 void nxt_conn_wait(nxt_conn_t *c); 249 ssize_t nxt_conn_io_recvbuf(nxt_conn_t *c, nxt_buf_t *b); 260 size_t nxt_event_conn_write_limit(nxt_conn_t *c); 262 nxt_conn_t *c, size_t sent); 268 nxt_conn_t *c); 273 c->socket.task, c, c->socket.data) 283 c->socket.task, c, c->socket.data); \ [all …]
|
H A D | nxt_linux_sendfile.c | 113 c->socket.write_ready = 0; in nxt_linux_event_conn_io_sendfile() 120 c->socket.error = err; in nxt_linux_event_conn_io_sendfile() 135 c->socket.write_ready = 0; in nxt_linux_event_conn_io_sendfile() 159 c->socket.write_ready = 0; in nxt_linux_send() 166 c->socket.error = err; in nxt_linux_send() 180 c->socket.write_ready = 0; in nxt_linux_send() 203 n = sendmsg(c->socket.fd, &msg, flags); in nxt_linux_sendmsg() 208 c->socket.fd, niov, flags, n); in nxt_linux_sendmsg() 214 c->socket.write_ready = 0; in nxt_linux_sendmsg() 221 c->socket.error = err; in nxt_linux_sendmsg() [all …]
|
H A D | nxt_conn_write.c | 25 c = obj; in nxt_conn_io_write() 28 c->socket.fd, c->socket.error, c->block_write); in nxt_conn_io_write() 30 if (c->socket.error != 0 || c->block_write) { in nxt_conn_io_write() 34 if (!c->socket.write_ready || c->write == NULL) { in nxt_conn_io_write() 41 c->socket.error_handler = c->write_state->error_handler; in nxt_conn_io_write() 43 b = c->write; in nxt_conn_io_write() 51 sb.tls = c->u.tls; in nxt_conn_io_write() 113 nxt_conn_timer(engine, c, c->write_state, &c->write_timer); in nxt_conn_io_write() 149 nxt_conn_t *c; in nxt_conn_write_timer_handler() local 157 c->delayed = 0; in nxt_conn_write_timer_handler() [all …]
|
H A D | nxt_conn_accept.c | 145 c = lev->next; in nxt_conn_io_accept() 168 c->socket.fd = s; in nxt_conn_io_accept() 205 c->listen = lev; in nxt_conn_accept() 218 &c->task, c, lev); in nxt_conn_accept() 222 &c->task, c, lev); in nxt_conn_accept() 237 nxt_conn_t *c; in nxt_conn_accept_next() local 239 c = lev->next; in nxt_conn_accept_next() 241 if (c == NULL) { in nxt_conn_accept_next() 249 return c; in nxt_conn_accept_next() 297 c->socket.fd, c->socket.read_ready); in nxt_conn_accept_close_idle_handler() [all …]
|
H A D | nxt_port_memory_int.h | 91 ((m[FREE_IDX(c)] & FREE_MASK(c)) == 0) 94 nxt_port_mmap_set_chunk_busy(nxt_free_map_t *m, nxt_chunk_id_t c); 134 start = FREE_IDX(*c); in nxt_port_mmap_get_free_chunk() 135 mask = default_mask << ((*c) % FREE_BITS); in nxt_port_mmap_get_free_chunk() 150 *c = chunk; in nxt_port_mmap_get_free_chunk() 163 nxt_atomic_and_fetch(m + FREE_IDX(c), ~FREE_MASK(c)); in nxt_port_mmap_set_chunk_busy() 173 f = m + FREE_IDX(c); in nxt_port_mmap_chk_set_chunk_busy() 175 while ( (*f & FREE_MASK(c)) != 0 ) { in nxt_port_mmap_chk_set_chunk_busy() 177 free_val = *f | FREE_MASK(c); in nxt_port_mmap_chk_set_chunk_busy() 178 busy_val = free_val & ~FREE_MASK(c); in nxt_port_mmap_chk_set_chunk_busy() [all …]
|
H A D | nxt_h1proto.c | 220 c = obj; in nxt_http_conn_init() 294 n = c->io->recv(c, b->mem.pos, 16, MSG_PEEK); in nxt_http_idle_io_read_handler() 318 c = obj; in nxt_http_conn_test() 429 n = c->io->recvbuf(c, b); in nxt_h1p_idle_io_read_handler() 449 c = obj; in nxt_h1p_conn_proto_init() 476 c = obj; in nxt_h1p_conn_request_init() 555 c = obj; in nxt_h1p_conn_request_header_parse() 1035 c = obj; in nxt_h1p_conn_request_body_read() 1729 c = obj; in nxt_h1p_conn_sent() 2069 c->io->shutdown(task, c, NULL); in nxt_h1p_closing() [all …]
|
H A D | nxt_aix_send_file.c | 35 nhd = nxt_sendbuf_mem_coalesce(c->socket.task, &sb); in nxt_aix_event_conn_io_send_file() 42 return nxt_event_conn_io_writev(c, hd, nhd); in nxt_aix_event_conn_io_send_file() 50 return nxt_event_conn_io_writev(c, hd, nhd); in nxt_aix_event_conn_io_send_file() 56 ntr = nxt_sendbuf_mem_coalesce(c->socket.task, &sb); in nxt_aix_event_conn_io_send_file() 77 n = send_file(&c->socket.fd, &sfp, 0); in nxt_aix_event_conn_io_send_file() 82 nxt_debug(c->socket.task, "send_file(%d): %d sent:%O", in nxt_aix_event_conn_io_send_file() 83 c->socket.fd, n, sent); in nxt_aix_event_conn_io_send_file() 96 c->socket.write_ready = 0; in nxt_aix_event_conn_io_send_file() 103 c->socket.error = err; in nxt_aix_event_conn_io_send_file() 112 nxt_debug(c->socket.task, "sendfile() %E", err); in nxt_aix_event_conn_io_send_file() [all …]
|
H A D | nxt_macosx_sendfile.c | 48 nhd = nxt_sendbuf_mem_coalesce(c->socket.task, &sb); in nxt_macosx_event_conn_io_sendfile() 55 return nxt_event_conn_io_writev(c, hd, nhd); in nxt_macosx_event_conn_io_sendfile() 64 return nxt_event_conn_io_writev(c, hd, nhd); in nxt_macosx_event_conn_io_sendfile() 69 ntr = nxt_sendbuf_mem_coalesce(c->socket.task, &sb); in nxt_macosx_event_conn_io_sendfile() 104 nxt_log_debug(c->socket.log, in nxt_macosx_event_conn_io_sendfile() 109 n = nxt_sys_sendfile(fb->file->fd, c->socket.fd, in nxt_macosx_event_conn_io_sendfile() 120 c->socket.write_ready = 0; in nxt_macosx_event_conn_io_sendfile() 127 c->socket.error = err; in nxt_macosx_event_conn_io_sendfile() 136 nxt_debug(c->socket.task, "sendfile() %E", err); in nxt_macosx_event_conn_io_sendfile() 142 nxt_log(c->socket.task, NXT_LOG_ERR, in nxt_macosx_event_conn_io_sendfile() [all …]
|
H A D | nxt_freebsd_sendfile.c | 33 nxt_freebsd_event_conn_io_sendfile(nxt_event_conn_t *c, nxt_buf_t *b, in nxt_freebsd_event_conn_io_sendfile() argument 53 nhd = nxt_sendbuf_mem_coalesce(c->socket.task, &sb); in nxt_freebsd_event_conn_io_sendfile() 60 return nxt_event_conn_io_writev(c, hd, nhd); in nxt_freebsd_event_conn_io_sendfile() 68 return nxt_event_conn_io_writev(c, hd, nhd); in nxt_freebsd_event_conn_io_sendfile() 73 ntr = nxt_sendbuf_mem_coalesce(c->socket.task, &sb); in nxt_freebsd_event_conn_io_sendfile() 111 c->socket.write_ready = 0; in nxt_freebsd_event_conn_io_sendfile() 118 c->socket.error = err; in nxt_freebsd_event_conn_io_sendfile() 119 nxt_log(c->socket.task, nxt_socket_error_level(err), in nxt_freebsd_event_conn_io_sendfile() 127 nxt_debug(c->socket.task, "sendfile() %E", err); in nxt_freebsd_event_conn_io_sendfile() 132 nxt_log(c->socket.task, NXT_LOG_ERR, in nxt_freebsd_event_conn_io_sendfile() [all …]
|
H A D | nxt_hpux_sendfile.c | 12 ssize_t nxt_hpux_event_conn_io_sendfile(nxt_event_conn_t *c, nxt_buf_t *b, 51 nhd = nxt_sendbuf_mem_coalesce(c->socket.task, &sb); in nxt_hpux_event_conn_io_sendfile() 58 return nxt_event_conn_io_writev(c, iov, nhd); in nxt_hpux_event_conn_io_sendfile() 66 return nxt_event_conn_io_writev(c, iov, nhd); in nxt_hpux_event_conn_io_sendfile() 72 ntr = nxt_sendbuf_mem_coalesce(c->socket.task, &sb); in nxt_hpux_event_conn_io_sendfile() 105 nxt_debug(c->socket.task, "sendfile(): %uz", n); in nxt_hpux_event_conn_io_sendfile() 111 c->socket.write_ready = 0; in nxt_hpux_event_conn_io_sendfile() 118 c->socket.error = err; in nxt_hpux_event_conn_io_sendfile() 119 nxt_log(c->socket.task, nxt_socket_error_level(err), in nxt_hpux_event_conn_io_sendfile() 127 nxt_debug(c->socket.task, "sendfile() %E", err); in nxt_hpux_event_conn_io_sendfile() [all …]
|
H A D | nxt_openssl.c | 91 nxt_conn_t *c); 1189 tls->conn = c; 1209 nxt_openssl_conn_handshake(task, c, c->socket.data); 1216 task, c, c->socket.data); 1249 c = obj; 1275 state = (c->read_state != NULL) ? c->read_state : c->write_state; 1325 wq = (c->read_state != NULL) ? c->read_work_queue : c->write_work_queue; 1354 n = nxt_openssl_conn_test_error(c->socket.task, c, ret, err, 1434 c = obj; 1454 if (c->socket.timedout || c->socket.error != 0) { [all …]
|
H A D | nxt_solaris_sendfilev.c | 25 nxt_solaris_event_conn_io_sendfilev(nxt_event_conn_t *c, nxt_buf_t *b, in nxt_solaris_event_conn_io_sendfilev() argument 36 if (c->sendfile == 0) { in nxt_solaris_event_conn_io_sendfilev() 38 return nxt_event_conn_io_sendbuf(c, b, limit); in nxt_solaris_event_conn_io_sendfilev() 45 nxt_debug(c->socket.task, "sendfilev(%d, %D)", c->socket.fd, nsfv); in nxt_solaris_event_conn_io_sendfilev() 52 n = sendfilev(c->socket.fd, sfv, nsfv, &sent); in nxt_solaris_event_conn_io_sendfilev() 56 nxt_debug(c->socket.task, "sendfilev(): %d sent:%uz", n, sent); in nxt_solaris_event_conn_io_sendfilev() 62 c->socket.write_ready = 0; in nxt_solaris_event_conn_io_sendfilev() 69 c->socket.error = err; in nxt_solaris_event_conn_io_sendfilev() 70 nxt_log(c->socket.task, nxt_socket_error_level(err), in nxt_solaris_event_conn_io_sendfilev() 76 nxt_debug(c->socket.task, "sendfilev() %E", err); in nxt_solaris_event_conn_io_sendfilev() [all …]
|
H A D | nxt_h1proto_websocket.c | 84 c = h1p->conn; in nxt_h1p_websocket_first_frame_start() 133 c = h1p->conn; in nxt_h1p_websocket_frame_start() 138 in = c->read; in nxt_h1p_websocket_frame_start() 227 c = obj; in nxt_h1p_conn_ws_frame_header_read() 343 c->read->mem.end = c->read->mem.start + frame_size; in nxt_h1p_conn_ws_frame_header_read() 349 c->read = b; in nxt_h1p_conn_ws_frame_header_read() 409 c->read = NULL; in nxt_h1p_conn_ws_frame_process() 468 b = c->read; in nxt_h1p_ws_io_read_handler() 481 n = c->io->recvbuf(c, b); in nxt_h1p_ws_io_read_handler() 484 c->read = b; in nxt_h1p_ws_io_read_handler() [all …]
|
H A D | nxt_string.h | 11 #define nxt_lowcase(c) \ argument 12 (u_char) ((c >= 'A' && c <= 'Z') ? c | 0x20 : c) 14 #define nxt_upcase(c) \ argument 15 (u_char) ((c >= 'a' && c <= 'z') ? c & ~0x20 : c) 17 #define nxt_isdigit(c) \ argument 18 ((u_char) ((c) - '0') <= 9) 40 #define nxt_memset(buf, c, length) \ argument 41 (void) memset(buf, c, length) 143 #define nxt_strchr_eq(s, c) \ argument 144 (((s)->length == 1) && ((s)->start[0] == c)) [all …]
|
/unit/test/ |
H A D | test_tls_session.py | 93 assert True not in [c[-1] for c in clients], 'cache small all new' 95 clients_again = [self.connect(c[2], c[1]) for c in clients] 96 assert False in [c[-1] for c in clients_again], 'cache small no reuse' 103 assert True not in [c[-1] for c in clients], 'cache big all new' 105 clients_again = [self.connect(c[2], c[1]) for c in clients] 106 assert False not in [c[-1] for c in clients_again], 'cache big reuse'
|