From: Dave West Date: Sat, 3 Nov 2007 22:57:56 +0000 (+0000) Subject: Fix thirty second delay in sendcommand when downing the server. X-Git-Tag: v7.86~2856 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=ea54db47ad2da9778d7d16737fd68a1929ed907e;p=citadel.git Fix thirty second delay in sendcommand when downing the server. We can not call cleanup() as it uses CtdlIPCQuit which sends a QUIT to the server that is no longer there and can't respond so it hangs. If downing the server just do nq_cleanup() instead. --- diff --git a/citadel/sendcommand.c b/citadel/sendcommand.c index f0da309c7..382e20927 100644 --- a/citadel/sendcommand.c +++ b/citadel/sendcommand.c @@ -247,6 +247,9 @@ int main(int argc, char **argv) CtdlIPC_chat_send(ipc, "000"); } fprintf(stderr, "sendcommand: processing ended.\n"); - cleanup(0); + if (stricmp(cmd, "DOWN")) + cleanup(0); + else /* If we downed the server we can't to do CtdlIPCQuit in cleanup()*/ + nq_cleanup(0); return 0; }