1 // Client-side IPC functions
3 // Copyright (c) 1987-2018 by the citadel.org team
5 // This program is open source software. Use, duplication, and/or
6 // disclosure are subject to the GNU General Purpose License version 3.
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
14 #include "textclient.h"
17 /* Note that some of these functions may not work with multiple instances. */
19 static void (*deathHook) (void) = NULL;
20 int (*error_printf) (char *s, ...) = (int (*)(char *, ...)) printf;
22 void setIPCDeathHook(void (*hook) (void))
27 void setIPCErrorPrintf(int (*func) (char *s, ...))
32 void connection_died(CtdlIPC * ipc, int using_ssl)
34 if (deathHook != NULL) {
38 stty_ctdl(SB_RESTORE);
39 fprintf(stderr, "\r\n\n\n");
40 fprintf(stderr, "Your connection to %s is broken.\n", ipc->ServInfo.humannode);
44 fprintf(stderr, "Last error: %s\n", ERR_reason_error_string(ERR_get_error()));
49 fprintf(stderr, "Last error: %s\n", strerror(errno));
51 fprintf(stderr, "Please re-connect and log in again.\n");
54 shutdown(ipc->sock, 2);