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

Function ldbSendLogs

app/redis-6.2.6/src/scripting.c:1910–1927  ·  view source on GitHub ↗

Send ldb.logs to the debugging client as a multi-bulk reply * consisting of simple strings. Log entries which include newlines have them * replaced with spaces. The entries sent are also consumed. */

Source from the content-addressed store, hash-verified

1908 * consisting of simple strings. Log entries which include newlines have them
1909 * replaced with spaces. The entries sent are also consumed. */
1910void ldbSendLogs(void) {
1911 sds proto = sdsempty();
1912 proto = sdscatfmt(proto,"*%i\r\n", (int)listLength(ldb.logs));
1913 while(listLength(ldb.logs)) {
1914 listNode *ln = listFirst(ldb.logs);
1915 proto = sdscatlen(proto,"+",1);
1916 sdsmapchars(ln->value,"\r\n"," ",2);
1917 proto = sdscatsds(proto,ln->value);
1918 proto = sdscatlen(proto,"\r\n",2);
1919 listDelNode(ldb.logs,ln);
1920 }
1921 if (connWrite(ldb.conn,proto,sdslen(proto)) == -1) {
1922 /* Avoid warning. We don't check the return value of write()
1923 * since the next read() will catch the I/O error and will
1924 * close the debugging session. */
1925 }
1926 sdsfree(proto);
1927}
1928
1929/* Start a debugging session before calling EVAL implementation.
1930 * The technique we use is to capture the client socket file descriptor,

Callers 3

ldbEndSessionFunction · 0.85
ldbReplFunction · 0.85
luaLdbLineHookFunction · 0.85

Calls 9

sdsemptyFunction · 0.85
sdscatfmtFunction · 0.85
sdscatlenFunction · 0.85
sdsmapcharsFunction · 0.85
sdscatsdsFunction · 0.85
listDelNodeFunction · 0.85
connWriteFunction · 0.85
sdslenFunction · 0.85
sdsfreeFunction · 0.85

Tested by

no test coverage detected