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

Function ldbEndSession

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

End a debugging session after the EVAL call with debugging enabled * returned. */

Source from the content-addressed store, hash-verified

1993/* End a debugging session after the EVAL call with debugging enabled
1994 * returned. */
1995void ldbEndSession(client *c) {
1996 /* Emit the remaining logs and an <endsession> mark. */
1997 ldbLog(sdsnew("<endsession>"));
1998 ldbSendLogs();
1999
2000 /* If it's a fork()ed session, we just exit. */
2001 if (ldb.forked) {
2002 writeToClient(c,0);
2003 serverLog(LL_WARNING,"Lua debugging session child exiting");
2004 exitFromChild(0);
2005 } else {
2006 serverLog(LL_WARNING,
2007 "Redis synchronous debugging eval session ended");
2008 }
2009
2010 /* Otherwise let's restore client's state. */
2011 connNonBlock(ldb.conn);
2012 connSendTimeout(ldb.conn,0);
2013
2014 /* Close the client connection after sending the final EVAL reply
2015 * in order to signal the end of the debugging session. */
2016 c->flags |= CLIENT_CLOSE_AFTER_REPLY;
2017
2018 /* Cleanup. */
2019 sdsfreesplitres(ldb.src,ldb.lines);
2020 ldb.lines = 0;
2021 ldb.active = 0;
2022}
2023
2024/* If the specified pid is among the list of children spawned for
2025 * forked debugging sessions, it is removed from the children list.

Callers 1

Calls 8

ldbLogFunction · 0.85
sdsnewFunction · 0.85
ldbSendLogsFunction · 0.85
writeToClientFunction · 0.85
exitFromChildFunction · 0.85
connNonBlockFunction · 0.85
connSendTimeoutFunction · 0.85
sdsfreesplitresFunction · 0.85

Tested by

no test coverage detected