End a debugging session after the EVAL call with debugging enabled * returned. */
| 2015 | /* End a debugging session after the EVAL call with debugging enabled |
| 2016 | * returned. */ |
| 2017 | void ldbEndSession(client *c) { |
| 2018 | /* Emit the remaining logs and an <endsession> mark. */ |
| 2019 | ldbLog(sdsnew("<endsession>")); |
| 2020 | ldbSendLogs(); |
| 2021 | |
| 2022 | /* If it's a fork()ed session, we just exit. */ |
| 2023 | if (ldb.forked) { |
| 2024 | writeToClient(c,0); |
| 2025 | serverLog(LL_WARNING,"Lua debugging session child exiting"); |
| 2026 | exitFromChild(0); |
| 2027 | } else { |
| 2028 | serverLog(LL_WARNING, |
| 2029 | "Redis synchronous debugging eval session ended"); |
| 2030 | } |
| 2031 | |
| 2032 | /* Otherwise let's restore client's state. */ |
| 2033 | connNonBlock(ldb.conn); |
| 2034 | connSendTimeout(ldb.conn,0); |
| 2035 | |
| 2036 | /* Close the client connection after sending the final EVAL reply |
| 2037 | * in order to signal the end of the debugging session. */ |
| 2038 | c->flags |= CLIENT_CLOSE_AFTER_REPLY; |
| 2039 | |
| 2040 | /* Cleanup. */ |
| 2041 | sdsfreesplitres(ldb.src,ldb.lines); |
| 2042 | ldb.lines = 0; |
| 2043 | ldb.active = 0; |
| 2044 | } |
| 2045 | |
| 2046 | /* If the specified pid is among the list of children spawned for |
| 2047 | * forked debugging sessions, it is removed from the children list. |
no test coverage detected