/unit/src/ |
H A D | nxt_buf.c | 47 b->mem.pos = b->mem.start; in nxt_buf_mem_alloc() 48 b->mem.free = b->mem.start; in nxt_buf_mem_alloc() 49 b->mem.end = b->mem.start + size; in nxt_buf_mem_alloc() 78 b->mem.pos = b->mem.start; in nxt_buf_mem_ts_alloc() 79 b->mem.free = b->mem.start; in nxt_buf_mem_ts_alloc() 80 b->mem.end = b->mem.start + size; in nxt_buf_mem_ts_alloc() 113 b->mem.pos = b->mem.start; in nxt_buf_file_alloc() 114 b->mem.free = b->mem.start; in nxt_buf_file_alloc() 115 b->mem.end = b->mem.start + size; in nxt_buf_file_alloc() 170 for (b = *head; b != NULL; b = b->next) { in nxt_buf_chain_add() [all …]
|
H A D | nxt_buf_pool.c | 13 nxt_buf_t *b; in nxt_buf_pool_mem_alloc() local 15 b = bp->current; in nxt_buf_pool_mem_alloc() 17 if (b != NULL && b->mem.free < b->mem.end) { in nxt_buf_pool_mem_alloc() 21 b = bp->free; in nxt_buf_pool_mem_alloc() 23 if (b != NULL) { in nxt_buf_pool_mem_alloc() 57 if (b != NULL && b->mem.free < b->mem.end) { in nxt_buf_pool_file_alloc() 61 b = bp->free; in nxt_buf_pool_file_alloc() 141 nxt_mem_unmap(b->mem.start, &b->mmap, size); in nxt_buf_pool_free() 161 b->mem.pos = b->mem.start; in nxt_buf_pool_free() 162 b->mem.free = b->mem.start; in nxt_buf_pool_free() [all …]
|
H A D | nxt_buf.h | 121 ((b)->is_file) 124 (b)->is_file = 1 127 (b)->is_file = 0 131 ((b)->is_mmap) 134 (b)->is_mmap = 1 151 ((b)->is_sync) 161 ((b)->is_nobuf) 171 ((b)->is_flush) 181 ((b)->is_last) 210 (nxt_buf_is_file(b) ? (b)->file_end - (b)->file_pos: \ [all …]
|
H A D | nxt_sendbuf.c | 29 for (b = sb->buf; b != NULL && total < sb->limit; b = b->next) { in nxt_sendbuf_mem_coalesce0() 39 size = b->mem.free - b->mem.pos; in nxt_sendbuf_mem_coalesce0() 99 for (b = sb->buf; b != NULL && total < sb->limit; b = b->next) { in nxt_sendbuf_mem_coalesce() 109 size = b->mem.free - b->mem.pos; in nxt_sendbuf_mem_coalesce() 180 size = b->file_end - b->file_pos; in nxt_sendbuf_file_coalesce() 190 b = b->next; in nxt_sendbuf_file_coalesce() 192 if (b == NULL || !nxt_buf_is_file(b)) { in nxt_sendbuf_file_coalesce() 307 size = b->mem.free - b->mem.pos; in nxt_sendbuf_copy() 322 b = b->next; in nxt_sendbuf_copy() 363 b->mem.pos = b->mem.free; in nxt_sendbuf_update() [all …]
|
H A D | nxt_recvbuf.c | 16 nxt_buf_t *b; in nxt_recvbuf_mem_coalesce() local 22 for (b = rb->buf; b != NULL; b = b->next) { in nxt_recvbuf_mem_coalesce() 24 nxt_prefetch(b->next); in nxt_recvbuf_mem_coalesce() 26 size = b->mem.end - b->mem.free; in nxt_recvbuf_mem_coalesce() 28 if (b->mem.free != last) { in nxt_recvbuf_mem_coalesce() 45 last = b->mem.end; in nxt_recvbuf_mem_coalesce() 65 nxt_prefetch(b->next); in nxt_recvbuf_update() 67 if (!nxt_buf_is_sync(b)) { in nxt_recvbuf_update() 69 size = b->mem.end - b->mem.free; in nxt_recvbuf_update() 76 b->mem.free = b->mem.end; in nxt_recvbuf_update() [all …]
|
H A D | nxt_websocket.c | 12 nxt_ntoh16(const uint8_t *b) in nxt_ntoh16() argument 14 return ((uint16_t) b[0]) << 8 | ((uint16_t) b[1]); in nxt_ntoh16() 21 b[0] = (v >> 8); in nxt_hton16() 22 b[1] = (v & 0xFFu); in nxt_hton16() 27 nxt_ntoh64(const uint8_t *b) in nxt_ntoh64() argument 43 b[0] = (v >> 56); in nxt_hton64() 44 b[1] = (v >> 48) & 0xFFu; in nxt_hton64() 45 b[2] = (v >> 40) & 0xFFu; in nxt_hton64() 46 b[3] = (v >> 32) & 0xFFu; in nxt_hton64() 47 b[4] = (v >> 24) & 0xFFu; in nxt_hton64() [all …]
|
H A D | nxt_sha1.c | 22 ctx->b = 0xefcdab89; in nxt_sha1_init() 100 result[6] = (u_char) (ctx->b >> 8); in nxt_sha1_final() 101 result[7] = (u_char) ctx->b; 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 167 b = ctx->b; in nxt_sha1_body() 174 saved_b = b; in nxt_sha1_body() 279 b += saved_b; in nxt_sha1_body() [all …]
|
H A D | nxt_http_chunk_parse.c | 49 for (b = in; b != NULL; b = next) { in nxt_http_chunk_parse() 176 b->completion_handler, task, b, b->parent); in nxt_http_chunk_parse() 204 nxt_buf_t *b; in nxt_http_chunk_buffer() local 214 **tail = b; in nxt_http_chunk_buffer() 215 *tail = &b->next; in nxt_http_chunk_buffer() 220 b->parent = in; in nxt_http_chunk_buffer() 222 b->mem.pos = p; in nxt_http_chunk_buffer() 223 b->mem.start = p; in nxt_http_chunk_buffer() 254 b = obj; in nxt_http_chunk_buf_completion() 256 nxt_debug(task, "buf completion: %p %p", b, b->mem.start); in nxt_http_chunk_buf_completion() [all …]
|
H A D | nxt_http_websocket.c | 60 b = r->ws_frame; in nxt_http_websocket_client() 62 while (b != NULL && frame_size > 0) { in nxt_http_websocket_client() 88 next = b->next; in nxt_http_websocket_client() 89 b->next = NULL; in nxt_http_websocket_client() 93 b->completion_handler, task, b, b->parent); in nxt_http_websocket_client() 98 b = next; in nxt_http_websocket_client() 109 b = r->ws_frame; in nxt_http_websocket_client() 111 if (b != NULL) { in nxt_http_websocket_client() 115 nxt_memmove(b->mem.start, b->mem.pos, used_size); in nxt_http_websocket_client() 117 b->mem.pos = b->mem.start; in nxt_http_websocket_client() [all …]
|
H A D | nxt_event_conn_job_sendfile.c | 69 sb.iobuf = &b; in nxt_event_conn_job_sendfile_start() 110 b = jbs->out; in nxt_event_conn_job_sendfile_handler() 126 b = nxt_sendbuf_update(b, ret); in nxt_event_conn_job_sendfile_handler() 182 b = jbs->out; in nxt_event_conn_job_sendfile_return() 188 b = nxt_event_conn_job_sendfile_completion(task, c, b); in nxt_event_conn_job_sendfile_return() 239 nxt_buf_t *b) in nxt_event_conn_job_sendfile_completion() argument 245 if (nxt_buf_is_mem(b) && b->mem.pos != b->mem.free) { in nxt_event_conn_job_sendfile_completion() 248 } else if (nxt_buf_is_file(b) && b->file_pos != b->file_end) { in nxt_event_conn_job_sendfile_completion() 253 b->completion_handler, task, b, b->parent); in nxt_event_conn_job_sendfile_completion() 255 b = b->next; in nxt_event_conn_job_sendfile_completion() [all …]
|
H A D | nxt_port_memory.c | 132 b = obj; in nxt_port_mmap_buf_completion() 149 if (b->is_port_mmap_sent && b->mem.pos > b->mem.start) { in nxt_port_mmap_buf_completion() 166 "%PI->%PI,%d,%d", b, b->mem.start, b->mem.end - b->mem.start, in nxt_port_mmap_buf_completion() 585 b->mem.pos = b->mem.start; in nxt_port_mmap_get_buf() 586 b->mem.free = b->mem.start; in nxt_port_mmap_get_buf() 590 b, b->mem.start, b->mem.end - b->mem.start, in nxt_port_mmap_get_buf() 695 b->mem.pos = b->mem.start; in nxt_port_mmap_get_incoming_buf() 696 b->mem.free = b->mem.start + mmap_msg->size; in nxt_port_mmap_get_incoming_buf() 703 b, b->mem.start, b->mem.end - b->mem.start, in nxt_port_mmap_get_incoming_buf() 773 for (b = msg->buf; b != NULL; b = b->next) { in nxt_port_mmap_read() [all …]
|
H A D | nxt_port_socket.c | 214 b->mem.pos = b->mem.free; in nxt_port_socket_write2() 217 b->completion_handler, task, b, b->parent); in nxt_port_socket_write2() 660 b->mem.pos = b->mem.free; in nxt_port_buf_completion() 663 b->file_pos = b->file_end; in nxt_port_buf_completion() 670 nxt_work_queue_add(wq, b->completion_handler, task, b, b->parent); in nxt_port_buf_completion() 677 return b; in nxt_port_buf_completion() 1290 b->completion_handler, task, b, b->parent); in nxt_port_read_msg_process() 1313 b->mem.pos = b->mem.start; in nxt_port_buf_alloc() 1314 b->mem.free = b->mem.start; in nxt_port_buf_alloc() 1363 for (b = msg->buf; b != NULL; b = next) { in nxt_port_error_handler() [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 38 return nxt_event_conn_io_sendbuf(c, b, limit); in nxt_solaris_event_conn_io_sendfilev() 43 size = nxt_solaris_buf_coalesce(b, sfv, &nsfv, &sync, limit); in nxt_solaris_event_conn_io_sendfilev() 103 for (total = 0; b != NULL && total < limit; b = b->next) { in nxt_solaris_buf_coalesce() 105 if (nxt_buf_is_file(b)) { in nxt_solaris_buf_coalesce() 107 fd = b->file->fd; in nxt_solaris_buf_coalesce() 108 pos = b->file_pos; in nxt_solaris_buf_coalesce() 109 size = b->file_end - pos; in nxt_solaris_buf_coalesce() 119 } else if (nxt_buf_is_mem(b)) { in nxt_solaris_buf_coalesce() 122 pos = (uintptr_t) b->mem.pos; in nxt_solaris_buf_coalesce() [all …]
|
H A D | nxt_sendbuf.h | 72 ssize_t nxt_linux_event_conn_io_sendfile(nxt_conn_t *c, nxt_buf_t *b, 78 ssize_t nxt_freebsd_event_conn_io_sendfile(nxt_conn_t *c, nxt_buf_t *b, 84 ssize_t nxt_solaris_event_conn_io_sendfilev(nxt_conn_t *c, nxt_buf_t *b, 90 ssize_t nxt_macosx_event_conn_io_sendfile(nxt_conn_t *c, nxt_buf_t *b, 96 ssize_t nxt_aix_event_conn_io_send_file(nxt_conn_t *c, nxt_buf_t *b, 102 ssize_t nxt_hpux_event_conn_io_sendfile(nxt_conn_t *c, nxt_buf_t *b, 106 ssize_t nxt_event_conn_io_sendbuf(nxt_conn_t *c, nxt_buf_t *b, 123 nxt_buf_t *b, size_t limit); 125 nxt_buf_t *nxt_sendbuf_update(nxt_buf_t *b, size_t sent); 127 nxt_buf_t *b); [all …]
|
/unit/test/python/variables/ |
H A D | asgi.py | 4 body = b'' 7 body += m.get('body', b'') 18 return b', '.join(res) 25 (b'content-type', get_header(b'content-type')), 26 (b'content-length', str(len(body)).encode()), 27 (b'request-method', scope['method'].encode()), 28 (b'request-uri', scope['path'].encode()), 29 (b'http-host', get_header(b'host')), 30 (b'http-version', scope['http_version'].encode()), 33 (b'scheme', scope['scheme'].encode()), [all …]
|
/unit/test/python/targets/ |
H A D | asgi.py | 8 'headers': [(b'content-length', b'0')], 20 'headers': [(b'content-length', b'0')], 33 (b'content-length', b'0'), 34 (b'prefix', scope.get('root_path', 'NULL').encode()), 39 await send({'type': 'http.response.body', 'body': b''}) 53 'headers': [(b'content-length', b'0')], 69 'headers': [(b'content-length', b'0')],
|
/unit/src/java/nginx/unit/ |
H A D | OutputStream.java | 17 public void write(int b) throws IOException in write() argument 19 write(req_info_ptr, b); in write() 22 private static native void write(long req_info_ptr, int b); in write() argument 26 public void write(byte b[], int off, int len) throws IOException in write() argument 28 if (b == null) { in write() 30 } else if ((off < 0) || (off > b.length) || (len < 0) || in write() 31 ((off + len) > b.length) || ((off + len) < 0)) { in write() 37 write(req_info_ptr, b, off, len); in write() 40 private static native void write(long req_info_ptr, byte b[], int off, int len); in write() argument
|
H A D | InputStream.java | 18 public int readLine(byte[] b, int off, int len) throws IOException { in readLine() argument 23 return readLine(req_info_ptr, b, off, len); in readLine() 26 private static native int readLine(long req_info_ptr, byte[] b, int off, int len); in readLine() argument 61 public int read(byte b[], int off, int len) throws IOException { in read() argument 62 if (b == null) { in read() 64 } else if (off < 0 || len < 0 || len > b.length - off) { in read() 70 return read(req_info_ptr, b, off, len); in read() 73 private static native int read(long req_info_ptr, byte b[], int off, int len); in read() argument
|
/unit/test/python/prefix/ |
H A D | asgi.py | 9 (b'content-length', b'0'), 10 (b'prefix', scope.get('root_path', 'NULL').encode()), 15 await send({'type': 'http.response.body', 'body': b''})
|
/unit/go/ |
H A D | unit.go | 21 b C.uintptr_t member 44 func (buf *cbuf) init_bytes(b []byte) { 45 buf.b = buf_ref(b) 46 buf.s = C.size_t(len(b)) 57 var b [0]byte 58 return b[:0] 62 Data: unsafe.Pointer(uintptr(buf.b)), 82 b := uintptr(p) + uintptr(*(*C.uint32_t)(p)) 84 return C.GoStringN((*C.char)(unsafe.Pointer(b)), l)
|
/unit/test/ |
H A D | test_configuration.py | 88 b"""\xEF\xBB\xBF 104 b""" 124 b""" 147 assert 'error' in client.conf(b'/{}', 'applications'), 'slash' 148 assert 'error' in client.conf(b'//{}', 'applications'), 'comment' 149 assert 'error' in client.conf(b'{} /', 'applications'), 'slash end' 150 assert 'error' in client.conf(b'/*{}', 'applications'), 'slash star' 151 assert 'error' in client.conf(b'{} /*', 'applications'), 'slash star end' 218 assert 'success' in client.conf(b'{ \n\r\t}', 'applications'), 'skip spaces'
|
/unit/test/python/threads/ |
H A D | asgi.py | 16 delay = float(get_header(b'x-delay', 0)) 25 (b'content-length', b'0'), 26 (b'x-thread', str(threading.currentThread().ident).encode()),
|
/unit/test/python/body_array/ |
H A D | wsgi.py | 3 return [b'0123', b'4567', b'89']
|
/unit/test/python/delayed/ |
H A D | asgi.py | 7 body = b'' 10 body += m.get('body', b'') 22 parts = int(get_header(b'x-parts', 1)) 23 delay = int(get_header(b'x-delay', 0)) 36 'headers': [(b'content-length', str(len(body)).encode()),],
|
/unit/test/python/write/ |
H A D | wsgi.py | 3 write(b'012') 4 write(b'345') 5 return b'6789'
|