End a debugging session after the EVAL call with debugging enabled * returned. */
| 1993 | /* End a debugging session after the EVAL call with debugging enabled |
| 1994 | * returned. */ |
| 1995 | void 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. |
no test coverage detected