1 // Client-side IPC functions
3 // Copyright (c) 1987-2018 by the citadel.org team
5 // This program is open source software. Use, duplication, or disclosure is subject to the GNU General Public License version 3.
7 #include "textclient.h"
10 /* Note that some of these functions may not work with multiple instances. */
12 static void (*deathHook)(void) = NULL;
13 int (*error_printf)(char *s, ...) = (int (*)(char *, ...)) printf;
15 void setIPCDeathHook(void (*hook)(void)) {
19 void setIPCErrorPrintf(int (*func)(char *s, ...)) {
23 void connection_died(CtdlIPC * ipc, int using_ssl) {
24 if (deathHook != NULL) {
28 stty_ctdl(SB_RESTORE);
29 fprintf(stderr, "\r\n\n\n");
30 fprintf(stderr, "Your connection to %s is broken.\n", ipc->ServInfo.humannode);
34 fprintf(stderr, "Last error: %s\n", ERR_reason_error_string(ERR_get_error()));
40 fprintf(stderr, "Last error: %s\n", strerror(errno));
42 fprintf(stderr, "Please re-connect and log in again.\n");
45 shutdown(ipc->sock, 2);