| 337 | * -------------------------------------------------------------------------- */ |
| 338 | |
| 339 | void _clientAsyncReplyBufferReserve(client *c, size_t len) { |
| 340 | if (c->replyAsync != nullptr) |
| 341 | return; |
| 342 | size_t newsize = std::max(len, (size_t)PROTO_ASYNC_REPLY_CHUNK_BYTES); |
| 343 | clientReplyBlock *replyNew = (clientReplyBlock*)zmalloc(sizeof(clientReplyBlock) + newsize); |
| 344 | replyNew->size = zmalloc_usable_size(replyNew) - sizeof(clientReplyBlock); |
| 345 | replyNew->used = 0; |
| 346 | c->replyAsync = replyNew; |
| 347 | } |
| 348 | |
| 349 | /* Attempts to add the reply to the static buffer in the client struct. |
| 350 | * Returns C_ERR if the buffer is full, or the reply list is not empty, |
nothing calls this directly
no test coverage detected