MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / addReplyProto

Function addReplyProto

src/networking.cpp:483–487  ·  view source on GitHub ↗

This low level function just adds whatever protocol you send it to the * client buffer, trying the static buffer initially, and using the string * of objects if not possible. * * It is efficient because does not create an SDS object nor an Redis object * if not needed. The object will only be created by calling * _addReplyProtoToList() if we fail to extend the existing tail object * in the

Source from the content-addressed store, hash-verified

481 * _addReplyProtoToList() if we fail to extend the existing tail object
482 * in the list of objects. */
483void addReplyProto(client *c, const char *s, size_t len) {
484 if (prepareClientToWrite(c) != C_OK) return;
485 if (_addReplyToBuffer(c,s,len) != C_OK)
486 _addReplyProtoToList(c,s,len);
487}
488
489void addReplyProtoCString(client *c, const char *s) {
490 addReplyProto(c, s, strlen(s));

Callers 15

keysCommandCoreFunction · 0.85
sendTrackingMessageFunction · 0.85
replicationFeedSlaveFunction · 0.85
flushDataMethod · 0.85
processReplconfUuidFunction · 0.85
RM_ReplyWithSimpleStringFunction · 0.85
addReplyProtoCStringFunction · 0.85
addReplyErrorLengthFunction · 0.85
addReplyStatusLengthFunction · 0.85
addReplyDoubleFunction · 0.85
addReplyBigNumFunction · 0.85
addReplyHumanLongDoubleFunction · 0.85

Calls 3

prepareClientToWriteFunction · 0.85
_addReplyToBufferFunction · 0.85
_addReplyProtoToListFunction · 0.85

Tested by

no test coverage detected