MCPcopy Create free account
hub / github.com/F-Stack/f-stack / addReplyErrorFormat

Function addReplyErrorFormat

app/redis-6.2.6/src/networking.c:500–513  ·  view source on GitHub ↗

See addReplyErrorLength for expectations from the formatted string. * The formatted string is safe to contain \r and \n anywhere. */

Source from the content-addressed store, hash-verified

498/* See addReplyErrorLength for expectations from the formatted string.
499 * The formatted string is safe to contain \r and \n anywhere. */
500void addReplyErrorFormat(client *c, const char *fmt, ...) {
501 va_list ap;
502 va_start(ap,fmt);
503 sds s = sdscatvprintf(sdsempty(),fmt,ap);
504 va_end(ap);
505 /* Trim any newlines at the end (ones will be added by addReplyErrorLength) */
506 s = sdstrim(s, "\r\n");
507 /* Make sure there are no newlines in the middle of the string, otherwise
508 * invalid protocol is emitted. */
509 s = sdsmapchars(s, "\r\n", " ", 2);
510 addReplyErrorLength(c,s,sdslen(s));
511 afterErrorReply(c,s,sdslen(s));
512 sdsfree(s);
513}
514
515void addReplyStatusLength(client *c, const char *s, size_t len) {
516 addReplyProto(c,"+",1);

Callers 15

configSetCommandFunction · 0.85
configCommandFunction · 0.85
luaReplyToRedisReplyFunction · 0.85
luaCreateFunctionFunction · 0.85
evalGenericCommandFunction · 0.85
sentinelConfigSetCommandFunction · 0.85
sentinelCommandFunction · 0.85
sentinelSetCommandFunction · 0.85
expireGenericCommandFunction · 0.85
hsetCommandFunction · 0.85
replconfCommandFunction · 0.85
extractLongLatOrReplyFunction · 0.85

Calls 8

sdscatvprintfFunction · 0.85
sdsemptyFunction · 0.85
sdstrimFunction · 0.85
sdsmapcharsFunction · 0.85
addReplyErrorLengthFunction · 0.85
sdslenFunction · 0.85
afterErrorReplyFunction · 0.85
sdsfreeFunction · 0.85

Tested by

no test coverage detected