Home
last modified time | relevance | path

Searched refs:nread (Results 1 – 25 of 311) sorted by relevance

12345678910>>...13

/third_party/node/test/parallel/
Dtest-net-onread-static-buffer.js20 callback: function(nread, buf) { argument
22 received += nread;
23 buffers.push(Buffer.from(buf.slice(0, nread)));
44 callback: function(nread, buf) { argument
46 received += nread;
47 const newIncoming = new Uint8Array(incoming.length + nread);
49 newIncoming.set(buf.slice(0, nread), incoming.length);
77 callback: function(nread, buf) { argument
79 received += nread;
80 incoming.push(Buffer.from(buf.slice(0, nread)));
[all …]
Dtest-tls-onread-static-buffer.js32 callback: function(nread, buf) { argument
34 received += nread;
35 buffers.push(Buffer.from(buf.slice(0, nread)));
57 callback: function(nread, buf) { argument
59 received += nread;
60 const newIncoming = new Uint8Array(incoming.length + nread);
62 newIncoming.set(buf.slice(0, nread), incoming.length);
91 callback: function(nread, buf) { argument
93 received += nread;
94 incoming.push(Buffer.from(buf.slice(0, nread)));
[all …]
/third_party/libsoup/libsoup/
Dsoup-body-input-stream.c128 gssize nread; in soup_body_input_stream_read_raw() local
130 nread = g_pollable_stream_read (bistream->priv->base_stream, in soup_body_input_stream_read_raw()
134 if (nread == 0) { in soup_body_input_stream_read_raw()
143 return nread; in soup_body_input_stream_read_raw()
156 gssize nread; in soup_body_input_stream_read_chunked() local
162 nread = soup_filter_input_stream_read_line ( in soup_body_input_stream_read_chunked()
165 if (nread <= 0) in soup_body_input_stream_read_chunked()
166 return nread; in soup_body_input_stream_read_chunked()
182 nread = soup_body_input_stream_read_raw ( in soup_body_input_stream_read_chunked()
186 if (nread > 0) { in soup_body_input_stream_read_chunked()
[all …]
Dsoup-multipart-input-stream.c136 gssize nread = 0; in soup_multipart_input_stream_read_real() local
148 nread = g_pollable_stream_read (G_INPUT_STREAM (priv->base_stream), in soup_multipart_input_stream_read_real()
152 if (nread > 0) in soup_multipart_input_stream_read_real()
153 priv->remaining_bytes -= nread; in soup_multipart_input_stream_read_real()
155 return nread; in soup_multipart_input_stream_read_real()
161 nread = soup_filter_input_stream_read_until (priv->base_stream, buffer, count, in soup_multipart_input_stream_read_real()
166 if (nread <= 0) in soup_multipart_input_stream_read_real()
167 return nread; in soup_multipart_input_stream_read_real()
170 return nread; in soup_multipart_input_stream_read_real()
175 if (nread == 1) { in soup_multipart_input_stream_read_real()
[all …]
Dsoup-content-sniffer-stream.c105 gssize nread; in read_and_sniff() local
110 nread = g_pollable_stream_read (G_FILTER_INPUT_STREAM (stream)->base_stream, in read_and_sniff()
114 if (nread <= 0) in read_and_sniff()
116 priv->buffer_nread += nread; in read_and_sniff()
154 gssize nread; in read_internal() local
163 nread = read_and_sniff (stream, blocking, cancellable, error); in read_internal()
164 if (nread <= 0) in read_internal()
165 return nread; in read_internal()
169 nread = MIN (count, sniffer->priv->buffer_nread); in read_internal()
171 memcpy (buffer, sniffer->priv->buffer, nread); in read_internal()
[all …]
/third_party/libuv/docs/code/multi-echo-server/
Dworker.c34 void echo_read(uv_stream_t *client, ssize_t nread, const uv_buf_t *buf) { in echo_read() argument
35 if (nread > 0) { in echo_read()
37 req->buf = uv_buf_init(buf->base, nread); in echo_read()
42 if (nread < 0) { in echo_read()
43 if (nread != UV_EOF) in echo_read()
44 fprintf(stderr, "Read error %s\n", uv_err_name(nread)); in echo_read()
51 void on_new_connection(uv_stream_t *q, ssize_t nread, const uv_buf_t *buf) { in on_new_connection() argument
52 if (nread < 0) { in on_new_connection()
53 if (nread != UV_EOF) in on_new_connection()
54 fprintf(stderr, "Read error %s\n", uv_err_name(nread)); in on_new_connection()
/third_party/libuv/test/
Dtest-ipc.c144 ssize_t nread, in on_read() argument
153 if (nread == 0) { in on_read()
159 if (nread < 0) { in on_read()
160 if (nread == UV_EOF) { in on_read()
165 printf("error recving on channel: %s\n", uv_strerror(nread)); in on_read()
169 fprintf(stderr, "got %d bytes\n", (int)nread); in on_read()
174 ASSERT_GT(nread, 0); in on_read()
193 ASSERT_MEM_EQ("hello\n", buf->base, nread); in on_read()
201 } else if (memcmp("accepted_connection\n", buf->base, nread) == 0) { in on_read()
214 ssize_t nread, in on_read_listen_after_bound_twice() argument
[all …]
Dtest-udp-send-and-recv.c63 ssize_t nread, in cl_recv_cb() argument
70 if (nread < 0) { in cl_recv_cb()
74 if (nread == 0) { in cl_recv_cb()
81 ASSERT(nread == 4); in cl_recv_cb()
82 ASSERT(!memcmp("PONG", buf->base, nread)); in cl_recv_cb()
117 ssize_t nread, in sv_recv_cb() argument
125 if (nread < 0) { in sv_recv_cb()
129 if (nread == 0) { in sv_recv_cb()
139 ASSERT(nread == 4); in sv_recv_cb()
140 ASSERT(!memcmp("PING", rcvbuf->base, nread)); in sv_recv_cb()
Dtest-udp-ipv6.c110 ssize_t nread, in ipv6_recv_fail() argument
114 printf("got %d %.*s\n", (int) nread, nread > 0 ? (int) nread : 0, buf->base); in ipv6_recv_fail()
115 if (!is_from_client(addr) || (nread == 0 && addr == NULL)) in ipv6_recv_fail()
122 ssize_t nread, in ipv6_recv_ok() argument
128 printf("got %d %.*s\n", (int) nread, nread > 0 ? (int) nread : 0, buf->base); in ipv6_recv_ok()
129 if (!is_from_client(addr) || (nread == 0 && addr == NULL)) in ipv6_recv_ok()
132 ASSERT(nread == 9); in ipv6_recv_ok()
Decho-server.c43 static void after_read(uv_stream_t*, ssize_t nread, const uv_buf_t* buf);
79 ssize_t nread, in after_read() argument
86 if (nread < 0) { in after_read()
88 ASSERT_EQ(nread, UV_EOF); in after_read()
98 if (nread == 0) { in after_read()
110 for (i = 0; i < nread; i++) { in after_read()
112 if (i + 1 < nread && buf->base[i + 1] == 'S') { in after_read()
114 if (i + 2 < nread && buf->base[i + 2] == 'S') in after_read()
116 if (i + 2 < nread && buf->base[i + 2] == 'H') in after_read()
135 wr->buf = uv_buf_init(buf->base, nread); in after_read()
[all …]
/third_party/node/src/
Dstring_decoder.cc70 size_t nread = *nread_ptr; in DecodeData() local
88 for (size_t i = 0; i < nread && i < MissingBytes(); ++i) { in DecodeData()
98 nread -= i; in DecodeData()
105 std::min(nread, static_cast<size_t>(MissingBytes())); in DecodeData()
111 nread -= found_bytes; in DecodeData()
134 if (UNLIKELY(nread == 0)) { in DecodeData()
144 if (Encoding() == UTF8 && data[nread - 1] & 0x80) { in DecodeData()
148 for (size_t i = nread - 1; ; --i) { in DecodeData()
149 DCHECK_LT(i, nread); in DecodeData()
194 if ((nread % 2) == 1) { in DecodeData()
[all …]
/third_party/curl/lib/
Dtransfer.c163 size_t nread; in Curl_fillreadbuffer() local
247 nread = readfunc(data->req.upload_fromhere, 1, in Curl_fillreadbuffer()
251 if(nread == CURL_READFUNC_ABORT) { in Curl_fillreadbuffer()
256 if(nread == CURL_READFUNC_PAUSE) { in Curl_fillreadbuffer()
277 else if(nread > buffersize) { in Curl_fillreadbuffer()
323 "%zx%s", nread, endofline_native); in Curl_fillreadbuffer()
327 nread += hexlen; in Curl_fillreadbuffer()
335 if((nread-hexlen) == 0 && in Curl_fillreadbuffer()
343 memcpy(data->req.upload_fromhere + nread, in Curl_fillreadbuffer()
356 length = nread; in Curl_fillreadbuffer()
[all …]
Dfile.c302 size_t nread; in file_upload() local
312 nread = readcount; in file_upload()
316 if((curl_off_t)nread <= data->state.resume_from) { in file_upload()
317 data->state.resume_from -= nread; in file_upload()
318 nread = 0; in file_upload()
323 nread -= (size_t)data->state.resume_from; in file_upload()
331 nwrite = write(fd, buf2, nread); in file_upload()
332 if(nwrite != nread) { in file_upload()
337 bytecount += nread; in file_upload()
507 ssize_t nread; in file_do() local
[all …]
Dmqtt.c357 ssize_t nread; in mqtt_verify_connack() local
359 result = Curl_read(data, sockfd, (char *)readbuf, MQTT_CONNACK_LEN, &nread); in mqtt_verify_connack()
363 Curl_debug(data, CURLINFO_HEADER_IN, (char *)readbuf, (size_t)nread); in mqtt_verify_connack()
366 if(nread < MQTT_CONNACK_LEN) { in mqtt_verify_connack()
447 ssize_t nread; in mqtt_verify_suback() local
450 result = Curl_read(data, sockfd, (char *)readbuf, MQTT_SUBACK_LEN, &nread); in mqtt_verify_suback()
454 Curl_debug(data, CURLINFO_HEADER_IN, (char *)readbuf, (size_t)nread); in mqtt_verify_suback()
457 if(nread < MQTT_SUBACK_LEN) { in mqtt_verify_suback()
586 ssize_t nread; in mqtt_read_publish() local
643 result = Curl_read(data, sockfd, (char *)pkt, rest, &nread); in mqtt_read_publish()
[all …]
/third_party/libinput/src/
Dbuilddir.h40 ssize_t nread; in builddir_lookup() local
47 nread = readlink("/proc/self/exe", execdir, sizeof(execdir) - 1); in builddir_lookup()
48 if (nread <= 0 || nread == sizeof(execdir) - 1) in builddir_lookup()
53 execdir[nread] = '\0'; in builddir_lookup()
/third_party/toybox/toys/posix/
Dstrings.c41 int nread, i, wlen = TT.n, count = 0; local
52 for (i = nread = 0; ;i++) {
53 if (i >= nread) {
54 nread = read(fd, toybuf, sizeof(toybuf));
56 if (nread < 0) perror_msg_raw(filename);
57 if (nread < 1) {
/third_party/libuv/docs/code/dns/
Dmain.c13 void on_read(uv_stream_t *client, ssize_t nread, const uv_buf_t *buf) { in on_read() argument
14 if (nread < 0) { in on_read()
15 if (nread != UV_EOF) in on_read()
16 fprintf(stderr, "Read error %s\n", uv_err_name(nread)); in on_read()
23 char *data = (char*) malloc(sizeof(char) * (nread+1)); in on_read()
24 data[nread] = '\0'; in on_read()
25 strncpy(data, buf->base, nread); in on_read()
/third_party/glib/gio/
Dgbufferedinputstream.c653 gssize nread; in g_buffered_input_stream_real_fill() local
671 nread = g_input_stream_read (base_stream, in g_buffered_input_stream_real_fill()
677 if (nread > 0) in g_buffered_input_stream_real_fill()
678 priv->end += nread; in g_buffered_input_stream_real_fill()
680 return nread; in g_buffered_input_stream_real_fill()
694 gssize nread; in g_buffered_input_stream_skip() local
725 nread = g_input_stream_skip (base_stream, in g_buffered_input_stream_skip()
730 if (nread < 0 && bytes_skipped == 0) in g_buffered_input_stream_skip()
733 if (nread > 0) in g_buffered_input_stream_skip()
734 bytes_skipped += nread; in g_buffered_input_stream_skip()
[all …]
/third_party/libsoup/tests/
Dresource-test.c34 gssize nread; in test_read_ready() local
37 nread = g_input_stream_read_finish (in, result, &error); in test_read_ready()
38 if (nread == -1) { in test_read_ready()
44 } else if (nread == 0) { in test_read_ready()
50 g_string_append_len (data->body, data->buffer, nread); in test_read_ready()
98 gssize nread; in do_sync_request() local
110 nread = g_input_stream_read (in, buffer, sizeof (buffer), in do_sync_request()
112 if (nread == -1) { in do_sync_request()
117 g_string_append_len (body, buffer, nread); in do_sync_request()
118 } while (nread > 0); in do_sync_request()
/third_party/node/test/common/
Ddns.js29 return { nread: 1, domain: '' };
34 const { nread, domain } = readDomainFromPacket(buffer, offset + length);
36 nread: 1 + length + nread,
45 nread: 2,
69 const { nread, domain } = readDomainFromPacket(buffer, offset);
70 offset += nread;
119 const { nread, domain } = readDomainFromPacket(buffer, offset);
121 assert.strictEqual(nread, dataLength);
128 const { nread, domain } = readDomainFromPacket(buffer, offset);
130 assert.strictEqual(nread, dataLength);
[all …]
/third_party/nghttp2/src/
Dmemchunk_test.cc112 size_t nread; in test_memchunks_append() local
114 nread = chunks.remove(buf, 8); in test_memchunks_append()
116 CU_ASSERT(8 == nread); in test_memchunks_append()
117 CU_ASSERT(0 == memcmp("01234567", buf, nread)); in test_memchunks_append()
120 nread = chunks.remove(buf, sizeof(buf)); in test_memchunks_append()
122 CU_ASSERT(9 == nread); in test_memchunks_append()
123 CU_ASSERT(0 == memcmp("89abcdef@", buf, nread)); in test_memchunks_append()
136 size_t nread; in test_memchunks_drain() local
138 nread = chunks.drain(3); in test_memchunks_drain()
140 CU_ASSERT(3 == nread); in test_memchunks_drain()
[all …]
Dasio_server_http2_handler.h129 auto nread = nghttp2_session_mem_send(session_, &data); in on_write() local
130 if (nread < 0) { in on_write()
134 if (nread == 0) { in on_write()
138 if (len + nread > buffer.size()) { in on_write()
140 buflen_ = nread; in on_write()
145 std::copy_n(data, nread, std::begin(buffer) + len); in on_write()
147 len += nread; in on_write()
/third_party/libuv/docs/code/tcp-echo-server/
Dmain.c39 void echo_read(uv_stream_t *client, ssize_t nread, const uv_buf_t *buf) { in echo_read() argument
40 if (nread > 0) { in echo_read()
42 req->buf = uv_buf_init(buf->base, nread); in echo_read()
46 if (nread < 0) { in echo_read()
47 if (nread != UV_EOF) in echo_read()
48 fprintf(stderr, "Read error %s\n", uv_err_name(nread)); in echo_read()
/third_party/libuv/docs/code/pipe-echo-server/
Dmain.c37 void echo_read(uv_stream_t *client, ssize_t nread, const uv_buf_t *buf) { in echo_read() argument
38 if (nread > 0) { in echo_read()
40 req->buf = uv_buf_init(buf->base, nread); in echo_read()
45 if (nread < 0) { in echo_read()
46 if (nread != UV_EOF) in echo_read()
47 fprintf(stderr, "Read error %s\n", uv_err_name(nread)); in echo_read()
/third_party/libuv/docs/code/uvtee/
Dmain.c44 void read_stdin(uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf) { in read_stdin() argument
45 if (nread < 0){ in read_stdin()
46 if (nread == UV_EOF){ in read_stdin()
52 } else if (nread > 0) { in read_stdin()
53 write_data((uv_stream_t *)&stdout_pipe, nread, *buf, on_stdout_write); in read_stdin()
54 write_data((uv_stream_t *)&file_pipe, nread, *buf, on_file_write); in read_stdin()

12345678910>>...13