Home
last modified time | relevance | path

Searched refs:buf (Results 1 – 25 of 93) sorted by relevance

1234

/unit/src/
H A Dnxt_sprintf.c251 buf = nxt_integer(&spf, buf, err); in nxt_vsprintf()
258 buf = nxt_strerror(err, buf, end - buf); in nxt_vsprintf()
411 buf = nxt_number(&spf, buf, i); in nxt_vsprintf()
421 buf = nxt_integer(&spf, buf, frac); in nxt_vsprintf()
550 buf = nxt_integer(&spf, buf, ui64); in nxt_vsprintf()
557 buf = nxt_cpymem(buf, p, nxt_min((size_t) (end - buf), length)); in nxt_vsprintf()
561 return buf; in nxt_vsprintf()
670 *buf++ = *p++; in nxt_integer()
673 return buf; in nxt_integer()
711 *buf++ = *p++; in nxt_number()
[all …]
H A Dnxt_file.c109 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()
630 nxt_dir_current(char *buf, size_t len) in nxt_dir_current() argument
[all …]
H A Dnxt_app_log.c12 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 Dnxt_http_websocket.c33 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 Dnxt_unit.c1416 l += b->buf.end - b->buf.free; in nxt_unit_process_req_body()
2634 buf = &mmap_buf->buf; in nxt_unit_mmap_buf_send()
2675 buf->free = buf->start; in nxt_unit_mmap_buf_send()
3029 buf = &mmap_buf.buf; in nxt_unit_response_write_cb()
3215 copy = buf->end - buf->free; in nxt_unit_buf_read()
3231 buf = nxt_unit_buf_next(buf); in nxt_unit_buf_read()
3347 buf = &mmap_buf.buf; in nxt_unit_websocket_sendv()
3395 if (buf->free > buf->start) { in nxt_unit_websocket_sendv()
3442 size = ws_impl->buf->buf.end - ws_impl->buf->buf.start; in nxt_unit_websocket_retain()
3453 ws_impl->buf->buf.start = b; in nxt_unit_websocket_retain()
[all …]
H A Dnxt_linux_sendfile.c39 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 Dnxt_sockaddr.c455 return p - buf; in nxt_sockaddr_ntop()
460 p = buf; in nxt_sockaddr_ntop()
473 return p - buf; in nxt_sockaddr_ntop()
502 return p - buf; in nxt_sockaddr_ntop()
525 return buf; in nxt_inet6_ntop()
559 p = buf; in nxt_inet6_ntop()
1199 end = buf + length; in nxt_inet_addr()
1201 while (buf < end) { in nxt_inet_addr()
1203 c = *buf++; in nxt_inet_addr()
1247 buf++; in nxt_inet6_addr()
[all …]
H A Dnxt_external.c63 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 Dnxt_file.h155 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);
198 #define nxt_write_console(fd, buf, size) \ argument
199 write(fd, buf, size)
209 NXT_EXPORT size_t nxt_dir_current(char *buf, size_t len);
/unit/src/java/
H A Dnxt_jni_OutputStream.c92 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 Dnxt_jni_InputStream.c167 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 Dnxt_unit_websocket_chat.c33 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 Dnxt_sprintf_test.c30 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 Dnxt_unit_websocket_echo.c59 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 Dnxt_http_parse_test.c635 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 Dnxt_unit_app_test.c150 nxt_unit_buf_t *buf; in greeting_app_request_handler() local
183 buf = nxt_unit_response_buf_alloc(req, (req->request_buf->end in greeting_app_request_handler()
205 if (nxt_slow_path(buf == NULL)) { in greeting_app_request_handler()
211 p = buf->free; in greeting_app_request_handler()
260 res = nxt_unit_request_read(req, buf->free, buf->end - buf->free); in greeting_app_request_handler()
261 buf->free += res; in greeting_app_request_handler()
265 buf->free = p; in greeting_app_request_handler()
267 rc = nxt_unit_buf_send(buf); in greeting_app_request_handler()
H A Dnxt_utf8_file_name_test.c43 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 Dunit.go25 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 Dnxt_cgo_lib.c14 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 Dconfig.ru3 buf = ''
5 buf = env['rack.input'].gets
6 break if buf == nil
7 body += buf
/unit/src/ruby/
H A Dnxt_ruby_stream_io.c94 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 Dapp.go11 var buf [32768]byte
12 len, _ := r.Body.Read(buf[:])
15 io.WriteString(w, string(buf[:len]))
/unit/auto/
H A Dclang18 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')
/unit/src/java/nginx/unit/websocket/
H A DWsSession.java826 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 Dapp.go11 var buf [4096]byte
12 len, _ := r.Body.Read(buf[:])
24 io.WriteString(w, string(buf[:len]))

1234