Fix compiler warnings in the textclient by evaluating returnvalues and removing unuse...
[citadel.git] / citadel / utillib / citadel_ipc.c
index 6ed0cf671565377ff41582860ea2d2f47d7b2f51..41b5a3877872f69e318beb17471777bff8189f44 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$ 
- *
+/*
  * Copyright (c) 1987-2009 by the citadel.org team
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -364,8 +363,6 @@ int CtdlIPCGetConfig(CtdlIPC *ipc, struct ctdluser **uret, char *cret)
 
        ret = CtdlIPCGenericCommand(ipc, "GETU", NULL, 0, NULL, NULL, cret);
        if (ret / 100 == 2) {
-               uret[0]->USscreenwidth = extract_int(cret, 0);
-               uret[0]->USscreenheight = extract_int(cret, 1);
                uret[0]->flags = extract_int(cret, 2);
        }
        return ret;
@@ -380,9 +377,10 @@ int CtdlIPCSetConfig(CtdlIPC *ipc, struct ctdluser *uret, char *cret)
        if (!uret) return -2;
        if (!cret) return -2;
 
-       sprintf(aaa, "SETU %d|%d|%d",
-                       uret->USscreenwidth, uret->USscreenheight,
-                       uret->flags);
+       sprintf(aaa,
+               "SETU 80|24|%d",
+               uret->flags
+       );
        return CtdlIPCGenericCommand(ipc, aaa, NULL, 0, NULL, NULL, cret);
 }
 
@@ -756,6 +754,8 @@ int CtdlIPCServerInfo(CtdlIPC *ipc, char *cret)
                                        break;
                        case 22:        strcpy(ipc->ServInfo.svn_revision, buf);
                                        break;
+                       case 24:        ipc->ServInfo.guest_logins = atoi(buf);
+                                       break;
                        }
                }
 
@@ -2493,15 +2493,10 @@ int CtdlIPCGenericCommand(CtdlIPC *ipc,
 {
        char buf[SIZ];
        register int ret;
-       int watch_ssl = 0;
 
        if (!command) return -2;
        if (!proto_response) return -2;
 
-#ifdef HAVE_OPENSSL
-       if (ipc->ssl) watch_ssl = 1;
-#endif
-
        CtdlIPC_lock(ipc);
        CtdlIPC_putline(ipc, command);
        while (1) {
@@ -2866,7 +2861,7 @@ static void ssl_lock(int mode, int n, const char *file, int line)
 static void CtdlIPC_init_OpenSSL(void)
 {
        int a;
-       SSL_METHOD *ssl_method;
+       const SSL_METHOD *ssl_method;
        DH *dh;
        
        /* already done init */
@@ -2956,7 +2951,7 @@ int
 ReadNetworkChunk(CtdlIPC* ipc)
 {
        fd_set read_fd;
-       int tries;
+/*     int tries;*/
        int ret = 0;
        int err = 0;
        struct timeval tv;
@@ -2964,7 +2959,7 @@ ReadNetworkChunk(CtdlIPC* ipc)
 
        tv.tv_sec = 1;
        tv.tv_usec = 1000;
-       tries = 0;
+       /*tries = 0; */
        n = 0;
        while (1)
        {
@@ -3251,7 +3246,7 @@ CtdlIPC* CtdlIPC_new(int argc, char **argv, char *hostbuf, char *portbuf)
        /* If we're using a unix domain socket we can do a bunch of stuff */
        if (!strcmp(cithost, UDS)) {
                if (!strcasecmp(citport, DEFAULT_PORT)) {
-                       snprintf(sockpath, sizeof sockpath, file_citadel_socket);
+                       snprintf(sockpath, sizeof sockpath, "%s", file_citadel_socket);
                }
                else {
                        snprintf(sockpath, sizeof sockpath, "%s/%s", citport, "citadel.socket");