/unit/src/ |
H A D | nxt_sprintf.c | 253 buf = nxt_integer(&spf, buf, err); in nxt_vsprintf() 260 buf = nxt_strerror(err, buf, end - buf); in nxt_vsprintf() 413 buf = nxt_number(&spf, buf, i); in nxt_vsprintf() 423 buf = nxt_integer(&spf, buf, frac); in nxt_vsprintf() 552 buf = nxt_integer(&spf, buf, ui64); in nxt_vsprintf() 567 buf = nxt_cpymem(buf, p, length); in nxt_vsprintf() 571 return buf; in nxt_vsprintf() 680 *buf++ = *p++; in nxt_integer() 683 return buf; in nxt_integer() 721 *buf++ = *p++; in nxt_number() [all …]
|
H A D | nxt_app_log.c | 12 static u_char *nxt_log_error_time(u_char *buf, nxt_realtime_t *now, 15 static u_char *nxt_log_debug_time(u_char *buf, nxt_realtime_t *now, 112 nxt_log_error_time(u_char *buf, nxt_realtime_t *now, struct tm *tm, size_t size, in nxt_log_error_time() argument 115 return nxt_sprintf(buf, buf + size, format, in nxt_log_error_time() 132 nxt_log_debug_time(u_char *buf, nxt_realtime_t *now, struct tm *tm, size_t size, in nxt_log_debug_time() argument 135 return nxt_sprintf(buf, buf + size, format, in nxt_log_debug_time()
|
H A D | nxt_file.c | 109 n = pwrite(file->fd, buf, size, offset); in nxt_file_write() 116 file->fd, buf, size, offset, n); in nxt_file_write() 137 n = pread(file->fd, buf, size, offset); in nxt_file_read() 166 u_char buf; in nxt_file_read_ahead() local 228 u_char buf; in nxt_file_read_ahead() local 248 u_char buf; in nxt_file_read_ahead() local 250 (void) nxt_file_read(file, &buf, 1, offset); in nxt_file_read_ahead() 453 n = write(fd, buf, size); in nxt_fd_write() 473 n = read(fd, buf, size); in nxt_fd_read() 686 nxt_dir_current(char *buf, size_t len) in nxt_dir_current() argument [all …]
|
H A D | nxt_http_websocket.c | 33 nxt_buf_t *out, *buf, **out_tail, *b, *next; in nxt_http_websocket_client() local 55 buf = NULL; in nxt_http_websocket_client() 67 if (buf == NULL || buf_free_size == 0) { in nxt_http_websocket_client() 70 buf = nxt_port_mmap_get_buf(task, &req_rpc_data->app->outgoing, in nxt_http_websocket_client() 73 *out_tail = buf; in nxt_http_websocket_client() 74 out_tail = &buf->next; in nxt_http_websocket_client() 79 buf->mem.free = nxt_cpymem(buf->mem.free, b->mem.pos, in nxt_http_websocket_client()
|
H A D | nxt_unit.c | 1430 l += b->buf.end - b->buf.free; in nxt_unit_process_req_body() 2648 buf = &mmap_buf->buf; in nxt_unit_mmap_buf_send() 2688 buf->free = buf->start; in nxt_unit_mmap_buf_send() 3042 buf = &mmap_buf.buf; in nxt_unit_response_write_cb() 3227 copy = buf->end - buf->free; in nxt_unit_buf_read() 3243 buf = nxt_unit_buf_next(buf); in nxt_unit_buf_read() 3358 buf = &mmap_buf.buf; in nxt_unit_websocket_sendv() 3406 if (buf->free > buf->start) { in nxt_unit_websocket_sendv() 3453 size = ws_impl->buf->buf.end - ws_impl->buf->buf.start; in nxt_unit_websocket_retain() 3464 ws_impl->buf->buf.start = b; in nxt_unit_websocket_retain() [all …]
|
H A D | nxt_cgroup.c | 96 char *buf, *ptr; in nxt_mk_cgpath_relative() local 108 buf = NULL; in nxt_mk_cgpath_relative() 110 while ((nread = getline(&buf, &size, fp)) != -1) { in nxt_mk_cgpath_relative() 111 if (strncmp(buf, "0::", 3) == 0) { in nxt_mk_cgpath_relative() 124 buf[nread - 1] = '\0'; /* lose the trailing '\n' */ in nxt_mk_cgpath_relative() 125 ptr = buf; in nxt_mk_cgpath_relative() 141 nxt_free(buf); in nxt_mk_cgpath_relative()
|
H A D | nxt_linux_sendfile.c | 39 static ssize_t nxt_linux_send(nxt_event_conn_t *c, void *buf, size_t size, 58 sb.buf = b; in nxt_linux_event_conn_io_sendfile() 71 fb = (sb.buf != NULL && nxt_buf_is_file(sb.buf)) ? sb.buf : NULL; in nxt_linux_event_conn_io_sendfile() 143 nxt_linux_send(nxt_event_conn_t *c, void *buf, size_t size, nxt_uint_t flags) in nxt_linux_send() argument 148 n = send(c->socket.fd, buf, size, flags); in nxt_linux_send() 153 c->socket.fd, buf, size, flags, n); in nxt_linux_send() 169 c->socket.fd, buf, size, flags, err); in nxt_linux_send()
|
H A D | nxt_external.c | 63 u_char buf[256]; in nxt_external_start() local 119 end = buf + sizeof(buf); in nxt_external_start() 121 p = nxt_sprintf(buf, end, in nxt_external_start() 142 nxt_debug(task, "update "NXT_UNIT_INIT_ENV"=%s", buf); in nxt_external_start() 144 rc = setenv(NXT_UNIT_INIT_ENV, (char *) buf, 1); in nxt_external_start() 146 nxt_alert(task, "setenv("NXT_UNIT_INIT_ENV", %s) failed %E", buf, in nxt_external_start()
|
H A D | nxt_file.h | 155 NXT_EXPORT ssize_t nxt_file_write(nxt_file_t *file, const u_char *buf, 157 NXT_EXPORT ssize_t nxt_file_read(nxt_file_t *file, u_char *buf, size_t size, 185 NXT_EXPORT ssize_t nxt_fd_write(nxt_fd_t fd, u_char *buf, size_t size); 186 NXT_EXPORT ssize_t nxt_fd_read(nxt_fd_t fd, u_char *buf, size_t size); 203 #define nxt_write_console(fd, buf, size) \ argument 204 write(fd, buf, size) 214 NXT_EXPORT size_t nxt_dir_current(char *buf, size_t len);
|
/unit/src/java/ |
H A D | nxt_jni_OutputStream.c | 92 if (buf == NULL) { in nxt_java_OutputStream_writeByte() 96 *buf->free++ = b; in nxt_java_OutputStream_writeByte() 98 if ((uint32_t) (buf->free - buf->start) >= data->buf_size) { in nxt_java_OutputStream_writeByte() 155 buf = data->buf; in nxt_java_OutputStream_req_buf() 157 if (buf == NULL || buf->free >= buf->end) { in nxt_java_OutputStream_req_buf() 161 if (buf == NULL) { in nxt_java_OutputStream_req_buf() 167 data->buf = buf; in nxt_java_OutputStream_req_buf() 170 return buf; in nxt_java_OutputStream_req_buf() 196 copy = buf->end - buf->free; in nxt_java_OutputStream_write() 205 if ((uint32_t) (buf->free - buf->start) >= data->buf_size) { in nxt_java_OutputStream_write() [all …]
|
H A D | nxt_jni_InputStream.c | 167 nxt_unit_buf_t *buf; in nxt_java_InputStream_skip() local 174 buf = req->content_buf; in nxt_java_InputStream_skip() 176 while (buf != NULL) { in nxt_java_InputStream_skip() 177 b_size = buf->end - buf->free; in nxt_java_InputStream_skip() 180 buf->free += b_size; in nxt_java_InputStream_skip() 184 if (buf->end == buf->free) { in nxt_java_InputStream_skip() 185 buf = nxt_unit_buf_next(buf); in nxt_java_InputStream_skip() 191 buf = nxt_unit_buf_next(buf); in nxt_java_InputStream_skip()
|
/unit/src/test/ |
H A D | nxt_unit_websocket_chat.c | 33 static void ws_chat_broadcast(const char *buf, size_t size); 49 static char buf[1024]; in ws_chat_request_handler() local 83 buf_size = snprintf(buf, sizeof(buf), "Guest #%d has joined.", data->id); in ws_chat_request_handler() 85 ws_chat_broadcast(buf, buf_size); in ws_chat_request_handler() 142 ws_chat_broadcast(const char *buf, size_t size) in ws_chat_broadcast() argument 164 static char buf[1024]; in ws_chat_websocket_handler() local 173 buf_size = snprintf(buf, sizeof(buf), "Guest #%d: ", data->id); in ws_chat_websocket_handler() 179 ws_chat_broadcast(buf, buf_size); in ws_chat_websocket_handler() 189 static char buf[1024]; in ws_chat_close_handler() local 193 buf_size = snprintf(buf, sizeof(buf), "Guest #%d has disconnected.", in ws_chat_close_handler() [all …]
|
H A D | nxt_sprintf_test.c | 30 nxt_sprintf_test_double(u_char *buf, u_char *end, const char *fmt, in nxt_sprintf_test_double() argument 35 p = nxt_sprintf(buf, end, fmt, n); in nxt_sprintf_test_double() 38 return nxt_strcmp(buf, test); in nxt_sprintf_test_double() 47 u_char *end, buf[64]; in nxt_sprintf_test() local 51 end = buf + 64; in nxt_sprintf_test() 55 ret = nxt_sprintf_test_double(buf, end, double_test[i].format, in nxt_sprintf_test() 64 double_test[i].format, double_test[i].test, buf); in nxt_sprintf_test()
|
H A D | nxt_unit_websocket_echo.c | 59 static uint8_t *buf = NULL; in ws_echo_websocket_handler() local 62 buf = realloc(buf, ws->content_length); in ws_echo_websocket_handler() 74 size = nxt_unit_websocket_read(ws, buf, ws->content_length); in ws_echo_websocket_handler() 76 nxt_unit_websocket_send(req, opcode, ws->header->fin, buf, size); in ws_echo_websocket_handler()
|
H A D | nxt_http_parse_test.c | 635 nxt_buf_mem_t buf; in nxt_http_parse_test_run() local 637 buf.start = request->start; in nxt_http_parse_test_run() 640 buf.pos = buf.start; in nxt_http_parse_test_run() 641 buf.free = buf.pos + 1; in nxt_http_parse_test_run() 644 buf.free++; in nxt_http_parse_test_run() 645 rc = nxt_http_parse_request(rp, &buf); in nxt_http_parse_test_run() 646 } while (buf.free < buf.end && rc == NXT_AGAIN); in nxt_http_parse_test_run() 659 nxt_buf_mem_t buf; in nxt_http_parse_test_bench() local 666 buf.start = request->start; in nxt_http_parse_test_bench() 684 buf.pos = buf.start; in nxt_http_parse_test_bench() [all …]
|
H A D | nxt_utf8_file_name_test.c | 43 u_char *p, test[4], buf[32]; in nxt_utf8_file_name_test() local 138 p = nxt_sprintf(buf, buf + 32, "%04uXD; C; %04uXD;%n", uc, lc); in nxt_utf8_file_name_test() 140 nxt_fd_write(nxt_stdout, buf, p - buf); in nxt_utf8_file_name_test()
|
/unit/go/ |
H A D | unit.go | 25 func buf_ref(buf []byte) C.uintptr_t { 26 if len(buf) == 0 { 44 func (buf *cbuf) init_bytes(b []byte) { 45 buf.b = buf_ref(b) 46 buf.s = C.size_t(len(b)) 55 func (buf *cbuf) GoBytes() []byte { 56 if buf == nil { 62 Data: unsafe.Pointer(uintptr(buf.b)), 63 Len: int(buf.s), 64 Cap: int(buf.s), [all …]
|
H A D | nxt_cgo_lib.c | 14 const void *buf, size_t buf_size, const void *oob, size_t oob_size); 16 void *buf, size_t buf_size, void *oob, size_t *oob_size); 52 const void *buf, size_t buf_size, const void *oob, size_t oob_size) in nxt_cgo_port_send() argument 55 (void *) buf, buf_size, (void *) oob, oob_size); in nxt_cgo_port_send() 61 void *buf, size_t buf_size, void *oob, size_t *oob_size) in nxt_cgo_port_recv() argument 64 buf, buf_size, oob, oob_size); in nxt_cgo_port_recv()
|
/unit/test/ruby/input_gets_all/ |
H A D | config.ru | 3 buf = '' 5 buf = env['rack.input'].gets 6 break if buf == nil 7 body += buf
|
/unit/src/ruby/ |
H A D | nxt_ruby_stream_io.c | 94 VALUE buf; in nxt_ruby_stream_io_gets() local 111 buf = rb_str_buf_new(res); in nxt_ruby_stream_io_gets() 113 if (nxt_slow_path(buf == Qnil)) { in nxt_ruby_stream_io_gets() 117 res = nxt_unit_request_read(req, RSTRING_PTR(buf), res); in nxt_ruby_stream_io_gets() 119 rb_str_set_len(buf, res); in nxt_ruby_stream_io_gets() 121 return buf; in nxt_ruby_stream_io_gets() 151 VALUE buf; in nxt_ruby_stream_io_read() local 175 buf = rb_str_buf_new(copy_size); in nxt_ruby_stream_io_read() 177 if (nxt_slow_path(buf == Qnil)) { in nxt_ruby_stream_io_read() 189 rb_str_set_len(buf, copy_size); in nxt_ruby_stream_io_read() [all …]
|
/unit/test/go/mirror/ |
H A D | app.go | 11 var buf [32768]byte 12 len, _ := r.Body.Read(buf[:]) 15 io.WriteString(w, string(buf[:len]))
|
/unit/auto/ |
H A D | clang | 18 char buf[4]; 20 buf[0] = '0'; 21 set(0, buf, \"%d\", 1); 23 if (buf[0] == '1') 41 char buf[4]; 43 buf[0] = '0'; 44 set(0, buf, \"%d\", 1); 46 if (buf[0] == '1')
|
H A D | unix | 17 char buf[4]; 19 if (getrandom(buf, 4, 0) < 0) { 39 char buf[4]; 41 if (syscall(SYS_getrandom, buf, 4, 0) < 0) { 60 char buf[4]; 62 if (getentropy(buf, 4) == -1) { 82 char buf[4]; 84 if (getentropy(buf, 4) == -1) {
|
/unit/src/java/nginx/unit/websocket/ |
H A D | WsSession.java | 826 rawFragments.put(buf); in processFrame() 828 buf = rawFragments; in processFrame() 847 final ByteBuffer b = buf; in processFrame() 863 if (buf.remaining() >= 2) { in processFrame() 878 onMessage(buf, last); in processFrame() 931 buf.flip(); in onMessage() 937 buf.clear(); in onMessage() 944 if (buf == rawFragments) { in updateRawFragments() 945 buf.compact(); in updateRawFragments() 950 rawFragments.put(buf); in updateRawFragments() [all …]
|
/unit/test/go/variables/ |
H A D | app.go | 11 var buf [4096]byte 12 len, _ := r.Body.Read(buf[:]) 24 io.WriteString(w, string(buf[:len]))
|