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

Function evalShaCommand

src/scripting.cpp:1755–1773  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1753}
1754
1755void evalShaCommand(client *c) {
1756 /* Explicitly feed monitor here so that lua commands appear after their
1757 * script command. */
1758 replicationFeedMonitors(c,g_pserver->monitors,c->db->id,c->argv,c->argc);
1759 if (sdslen((sds)ptrFromObj(c->argv[1])) != 40) {
1760 /* We know that a match is not possible if the provided SHA is
1761 * not the right length. So we return an error ASAP, this way
1762 * evalGenericCommand() can be implemented without string length
1763 * sanity check */
1764 addReplyErrorObject(c, shared.noscripterr);
1765 return;
1766 }
1767 if (!(c->flags & CLIENT_LUA_DEBUG))
1768 evalGenericCommand(c,1);
1769 else {
1770 addReplyError(c,"Please use EVAL instead of EVALSHA for debugging");
1771 return;
1772 }
1773}
1774
1775void scriptCommand(client *c) {
1776 if (c->argc == 2 && !strcasecmp((const char*)ptrFromObj(c->argv[1]),"help")) {

Callers

nothing calls this directly

Calls 6

replicationFeedMonitorsFunction · 0.85
sdslenFunction · 0.85
ptrFromObjFunction · 0.85
addReplyErrorObjectFunction · 0.85
evalGenericCommandFunction · 0.85
addReplyErrorFunction · 0.85

Tested by

no test coverage detected