Lua debugger: clear end of session protocol.

When the debugger exits now it produces an <endsession> tag that informs
redis-cli (or other debugging clients) that the session terminated.
This way the client knows there is yet another reply to read (the one of
the EVAL script itself), and can switch to non-debugging mode ASAP.
This commit is contained in:
antirez
2015-11-12 08:48:59 +01:00
parent 8f8c6b3b17
commit 629acd61b8
2 changed files with 23 additions and 9 deletions

View File

@ -1593,6 +1593,10 @@ int ldbStartSession(client *c) {
/* End a debugging session after the EVAL call with debugging enabled
* returned. */
void ldbEndSession(client *c) {
/* Emit the remaining logs and an <endsession> mark. */
ldbLog(sdsnew("<endsession>"));
ldbSendLogs();
/* If it's a fork()ed session, we just exit. */
if (ldb.forked) {
writeToClient(c->fd, c, 0);