Lines Matching refs:res
2272 int res; local
2324 res = strlen(buf);
2328 if (res + 2 <= it->nbytes && it->refcount == 2) { /* replace in-place */
2337 memcpy(ITEM_data(it), buf, res);
2338 memset(ITEM_data(it) + res, ' ', it->nbytes - res - 2);
2344 new_it = do_item_alloc(ITEM_key(it), it->nkey, flags, it->exptime, res + 2);
2349 memcpy(ITEM_data(new_it), buf, res);
2350 memcpy(ITEM_data(new_it) + res, "\r\n", 2);
2419 int res; local
2424 res = recvfrom(c->sfd, c->rbuf, c->rsize,
2427 if (res > 8) {
2430 c->thread->stats.bytes_read += res;
2442 res -= 8;
2443 memmove(c->rbuf, c->rbuf + 8, res);
2445 c->rbytes = res;
2466 int res; local
2501 res = c->read(c, c->rbuf + c->rbytes, avail);
2502 if (res > 0) {
2504 c->thread->stats.bytes_read += res;
2507 c->rbytes += res;
2508 if (res == avail && c->rbuf_malloced) {
2515 if (res == 0) {
2519 if (res == -1) {
2657 static void _transmit_post(conn *c, ssize_t res) { argument
2669 if (res >= resp->tosend) {
2670 res -= resp->tosend;
2678 if (res >= iov->iov_len) {
2680 res -= iov->iov_len;
2688 iov->iov_base = (char *)iov->iov_base + res;
2690 iov->iov_len -= res;
2691 resp->tosend -= res;
2692 res = 0;
2735 ssize_t res; local
2737 res = c->sendmsg(c, &msg, 0);
2738 if (res >= 0) {
2740 c->thread->stats.bytes_written += res;
2744 _transmit_post(c, res);
2753 if (res == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)) {
2870 ssize_t res; local
2873 res = sendmsg(c->sfd, &msg, 0);
2874 if (res >= 0) {
2876 c->thread->stats.bytes_written += res;
2880 res -= UDP_HEADER_SIZE;
2883 _transmit_post(c, res);
2892 if (res == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)) {
2917 int res; local
2960 res = c->read(c, ch->data + ch->used,
2962 if (res > 0) {
2964 c->thread->stats.bytes_read += res;
2966 ch->used += res;
2967 total += res;
2968 c->rlbytes -= res;
2971 total = res;
3000 int res; local
3066 res = write(sfd, str, strlen(str));
3105 res = try_read_network(c);
3108 res = try_read_udp(c);
3111 switch (res) {
3203 res = c->read(c, c->ritem, c->rlbytes);
3204 if (res > 0) {
3206 c->thread->stats.bytes_read += res;
3209 c->rcurr += res;
3211 c->ritem += res;
3212 c->rlbytes -= res;
3216 res = read_into_chunked_item(c);
3217 if (res > 0)
3221 if (res == 0) { /* end of stream */
3227 if (res == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)) {
3239 if (res == -2) {
3279 res = c->read(c, c->rbuf, c->rsize > c->sbytes ? c->sbytes : c->rsize);
3280 if (res > 0) {
3282 c->thread->stats.bytes_read += res;
3284 c->sbytes -= res;
3287 if (res == 0) { /* end of stream */
3292 if (res == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)) {
5896 int res = mlockall(MCL_CURRENT | MCL_FUTURE); local
5897 if (res != 0) {