Lines Matching refs:buf
43 ssize_t (*read)(struct conn *c, void *buf, size_t count);
44 ssize_t (*write)(struct conn *c, const void *buf, size_t count);
49 static ssize_t tcp_read(struct conn *c, void *buf, size_t count);
50 static ssize_t tcp_write(struct conn *c, const void *buf, size_t count);
52 static ssize_t ssl_read(struct conn *c, void *buf, size_t count);
53 static ssize_t ssl_write(struct conn *c, const void *buf, size_t count);
56 ssize_t tcp_read(struct conn *c, void *buf, size_t count) { in tcp_read() argument
58 return read(c->sock, buf, count); in tcp_read()
61 ssize_t tcp_write(struct conn *c, const void *buf, size_t count) { in tcp_write() argument
63 return write(c->sock, buf, count); in tcp_write()
66 ssize_t ssl_read(struct conn *c, void *buf, size_t count) { in ssl_read() argument
68 return SSL_read(c->ssl, buf, count); in ssl_read()
71 ssize_t ssl_write(struct conn *c, const void *buf, size_t count) { in ssl_write() argument
73 return SSL_write(c->ssl, buf, count); in ssl_write()
310 char *buf; in test_stats_prefix_dump() local
317 assert(strcmp("END\r\n", (buf = stats_prefix_dump(&length))) == 0); in test_stats_prefix_dump()
320 free(buf); in test_stats_prefix_dump()
322 assert(strcmp(expected, (buf = stats_prefix_dump(&length))) == 0); in test_stats_prefix_dump()
325 free(buf); in test_stats_prefix_dump()
327 assert(strcmp(expected, (buf = stats_prefix_dump(&length))) == 0); in test_stats_prefix_dump()
330 free(buf); in test_stats_prefix_dump()
332 assert(strcmp(expected, (buf = stats_prefix_dump(&length))) == 0); in test_stats_prefix_dump()
335 free(buf); in test_stats_prefix_dump()
337 assert(strcmp(expected, (buf = stats_prefix_dump(&length))) == 0); in test_stats_prefix_dump()
341 free(buf); in test_stats_prefix_dump()
344 buf = stats_prefix_dump(&length); in test_stats_prefix_dump()
345 assert(strstr(buf, "PREFIX abc get 2 hit 1 set 1 del 1\r\n") != NULL); in test_stats_prefix_dump()
346 assert(strstr(buf, "PREFIX def get 0 hit 0 set 0 del 1\r\n") != NULL); in test_stats_prefix_dump()
347 assert(strstr(buf, "END\r\n") != NULL); in test_stats_prefix_dump()
348 free(buf); in test_stats_prefix_dump()
362 buf = stats_prefix_dump(&length); in test_stats_prefix_dump()
363 assert(strstr(buf, "PREFIX abc get 2 hit 1 set 1 del 1\r\n") != NULL); in test_stats_prefix_dump()
364 assert(strstr(buf, "PREFIX def get 0 hit 0 set 0 del 1\r\n") != NULL); in test_stats_prefix_dump()
365 assert(strstr(buf, "END\r\n") != NULL); in test_stats_prefix_dump()
367 assert(strstr(buf, tmp) != NULL); in test_stats_prefix_dump()
368 free(buf); in test_stats_prefix_dump()
763 char buf[80] = { 0 }; in test_vperror() local
766 char *prv = fgets(buf, sizeof(buf), efile); in test_vperror()
782 return strcmp(expected, buf) == 0 ? TEST_PASS : TEST_FAIL; in test_vperror()
785 static void send_ascii_command(const char *buf) { in send_ascii_command() argument
787 const char* ptr = buf; in send_ascii_command()
788 size_t len = strlen(buf); in send_ascii_command()
972 static void safe_send(const void* buf, size_t len, bool hickup) in safe_send() argument
975 const char* ptr = buf; in safe_send()
1013 static bool safe_recv(void *buf, size_t len) { in safe_recv() argument
1019 ssize_t nr = con->read(con, ((char*)buf) + offset, len - offset); in safe_recv()
1037 static bool safe_recv_packet(void *buf, size_t size) { in safe_recv_packet() argument
1038 protocol_binary_response_no_extras *response = buf; in safe_recv_packet()
1049 char *ptr = buf; in safe_recv_packet()
1057 ptr = buf; in safe_recv_packet()
1074 static off_t storage_command(char*buf, in storage_command() argument
1084 protocol_binary_request_set *request = (void*)buf; in storage_command()
1099 memcpy(buf + key_offset, key, keylen); in storage_command()
1101 memcpy(buf + key_offset + keylen, dta, dtalen); in storage_command()
1107 static off_t ext_command(char* buf, in ext_command() argument
1116 protocol_binary_request_no_extras *request = (void*)buf; in ext_command()
1132 memcpy(buf + ext_offset, ext, extlen); in ext_command()
1135 memcpy(buf + key_offset, key, keylen); in ext_command()
1138 memcpy(buf + dta_offset, dta, dtalen); in ext_command()
1144 static off_t raw_command(char* buf, in raw_command() argument
1152 return ext_command(buf, bufsz, cmd, NULL, 0, key, keylen, dta, dtalen); in raw_command()
1155 static off_t flush_command(char* buf, size_t bufsz, uint8_t cmd, uint32_t exptime, bool use_extra) { in flush_command() argument
1156 protocol_binary_request_flush *request = (void*)buf; in flush_command()
1177 static off_t touch_command(char* buf, in touch_command() argument
1183 protocol_binary_request_touch *request = (void*)buf; in touch_command()
1199 memcpy(buf + key_offset, key, keylen); in touch_command()
1203 static off_t arithmetic_command(char* buf, in arithmetic_command() argument
1211 protocol_binary_request_incr *request = (void*)buf; in arithmetic_command()
1227 memcpy(buf + key_offset, key, keylen); in arithmetic_command()