2 * Client-side IPC functions
4 * Copyright (c) 1987-2018 by the citadel.org team
6 * This program is open source software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 3.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
16 #include "textclient.h"
19 /* Note that some of these functions may not work with multiple instances. */
21 static void (*deathHook) (void) = NULL;
22 int (*error_printf) (char *s, ...) = (int (*)(char *, ...)) printf;
24 void setIPCDeathHook(void (*hook) (void))
29 void setIPCErrorPrintf(int (*func) (char *s, ...))
34 void connection_died(CtdlIPC * ipc, int using_ssl)
36 if (deathHook != NULL) {
40 stty_ctdl(SB_RESTORE);
41 fprintf(stderr, "\r\n\n\n");
42 fprintf(stderr, "Your connection to %s is broken.\n", ipc->ServInfo.humannode);
46 fprintf(stderr, "Last error: %s\n", ERR_reason_error_string(ERR_get_error()));
51 fprintf(stderr, "Last error: %s\n", strerror(errno));
53 fprintf(stderr, "Please re-connect and log in again.\n");
56 shutdown(ipc->sock, 2);