Lines Matching refs:used
887 int todo = (len > ch->used) ? ch->used : len; in add_chunked_item_iovs()
1025 assert(ch->used != 0); in complete_nread_ascii()
1029 if (ch->used > 1) { in complete_nread_ascii()
1030 buf[0] = ch->data[ch->used - 2]; in complete_nread_ascii()
1031 buf[1] = ch->data[ch->used - 1]; in complete_nread_ascii()
1034 assert(ch->used == 1); in complete_nread_ascii()
1035 buf[0] = ch->prev->data[ch->prev->used - 1]; in complete_nread_ascii()
1036 buf[1] = ch->data[ch->used - 1]; in complete_nread_ascii()
1363 if (ch->size == ch->used) in complete_update_bin()
1365 if (ch->size - ch->used > 1) { in complete_update_bin()
1366 ch->data[ch->used + 1] = '\r'; in complete_update_bin()
1367 ch->data[ch->used + 2] = '\n'; in complete_update_bin()
1368 ch->used += 2; in complete_update_bin()
1370 ch->data[ch->used + 1] = '\r'; in complete_update_bin()
1372 ch->used++; in complete_update_bin()
1373 ch->next->used++; in complete_update_bin()
1374 assert(ch->size == ch->used); in complete_update_bin()
2481 while (dch->size == dch->used) { in _store_item_copy_chunks()
2493 assert(dch->used <= dch->size); in _store_item_copy_chunks()
2494 int todo = (dch->size - dch->used < sch->used - copied) in _store_item_copy_chunks()
2495 ? dch->size - dch->used : sch->used - copied; in _store_item_copy_chunks()
2498 memcpy(dch->data + dch->used, sch->data + copied, todo); in _store_item_copy_chunks()
2499 dch->used += todo; in _store_item_copy_chunks()
2502 assert(dch->used <= dch->size); in _store_item_copy_chunks()
2503 if (dch->size == dch->used) { in _store_item_copy_chunks()
2506 assert(copied <= sch->used); in _store_item_copy_chunks()
2507 if (copied == sch->used) { in _store_item_copy_chunks()
2518 int todo = (dch->size - dch->used < len - done) in _store_item_copy_chunks()
2519 ? dch->size - dch->used : len - done; in _store_item_copy_chunks()
2520 assert(dch->size - dch->used != 0); in _store_item_copy_chunks()
2521 memcpy(dch->data + dch->used, ITEM_data(s_it) + done, todo); in _store_item_copy_chunks()
2523 dch->used += todo; in _store_item_copy_chunks()
2524 assert(dch->used <= dch->size); in _store_item_copy_chunks()
2525 if (dch->size == dch->used) in _store_item_copy_chunks()
4418 int unused = ch->size - ch->used; in read_into_chunked_item()
4425 memmove(ch->data + ch->used, c->rcurr, tocopy); in read_into_chunked_item()
4431 ch->used += tocopy; in read_into_chunked_item()
4437 res = read(c->sfd, ch->data + ch->used, in read_into_chunked_item()
4443 ch->used += res; in read_into_chunked_item()
4453 assert(ch->used <= ch->size); in read_into_chunked_item()
4454 if (ch->size == ch->used) { in read_into_chunked_item()