Populate the length object and try gluing it to the next chunk. */
| 631 | |
| 632 | /* Populate the length object and try gluing it to the next chunk. */ |
| 633 | void setDeferredAggregateLen(client *c, void *node, long length, char prefix) { |
| 634 | serverAssert(length >= 0); |
| 635 | |
| 636 | /* Abort when *node is NULL: when the client should not accept writes |
| 637 | * we return NULL in addReplyDeferredLen() */ |
| 638 | if (node == NULL) return; |
| 639 | |
| 640 | char lenstr[128]; |
| 641 | size_t lenstr_len = sprintf(lenstr, "%c%ld\r\n", prefix, length); |
| 642 | setDeferredReply(c, node, lenstr, lenstr_len); |
| 643 | } |
| 644 | |
| 645 | void setDeferredArrayLen(client *c, void *node, long length) { |
| 646 | setDeferredAggregateLen(c,node,length,'*'); |
no test coverage detected