4 * Client-side IPC functions
16 #include <sys/types.h>
17 #include <sys/socket.h>
18 #include <netinet/in.h>
19 #include <arpa/inet.h>
27 #include "citadel_ipc.h"
28 #include "citadel_decls.h"
35 * FIXME: rewrite all of Ford's stuff here, it won't work with multiple
39 static void (*deathHook)(void) = NULL;
40 int (*error_printf)(char *s, ...) = (int (*)(char *, ...))printf;
42 void setIPCDeathHook(void (*hook)(void)) {
46 void setIPCErrorPrintf(int (*func)(char *s, ...)) {
50 void connection_died(CtdlIPC *ipc) {
51 if (deathHook != NULL)
54 error_printf("\rYour connection to this Citadel server is broken.\n"
56 "Please re-connect and log in again.\n",
62 /* ...don't try to shut down a connection on a dead socket?
63 SSL_shutdown(ipc->ssl);
69 shutdown(ipc->sock, 2);
75 static void ipc_timeout(int signum)
77 error_printf("\rConnection timed out.\n");