]> code.citadel.org Git - citadel.git/blobdiff - webcit/crypto.c
continuing war on unnecessary include of sys/time.h
[citadel.git] / webcit / crypto.c
index aa509887b733f9afb3a61d759460a0ddb1db2cc0..f2752fd576ca1c321e05f2616074d94c9c837604 100644 (file)
@@ -83,7 +83,7 @@ void init_ssl(void)
                for (a = 0; a < CRYPTO_num_locks(); a++) {
                        SSLCritters[a] = malloc(sizeof(pthread_mutex_t));
                        if (!SSLCritters[a]) {
-                               syslog(1,
+                               syslog(LOG_EMERG,
                                        "citserver: can't allocate memory!!\n");
                                /** Nothing's been initialized, just die */
                                ShutDownWebcit();
@@ -130,13 +130,13 @@ void init_ssl(void)
        if (!strcasecmp(ctdlhost, "uds")) {
                sprintf(buf, "%s/keys/citadel.key", ctdlport);
                rv = symlink(buf, CTDL_KEY_PATH);
-               if (!rv) syslog(1, "%s\n", strerror(errno));
+               if (!rv) syslog(LOG_DEBUG, "%s\n", strerror(errno));
                sprintf(buf, "%s/keys/citadel.csr", ctdlport);
                rv = symlink(buf, CTDL_CSR_PATH);
-               if (!rv) syslog(1, "%s\n", strerror(errno));
+               if (!rv) syslog(LOG_DEBUG, "%s\n", strerror(errno));
                sprintf(buf, "%s/keys/citadel.cer", ctdlport);
                rv = symlink(buf, CTDL_CER_PATH);
-               if (!rv) syslog(1, "%s\n", strerror(errno));
+               if (!rv) syslog(LOG_DEBUG, "%s\n", strerror(errno));
        }
 
        /*
@@ -475,7 +475,7 @@ void endtls(void)
        /* I don't think this is needed, and it crashes the server anyway
         *
         *      if (ctx != NULL) {
-        *              syslog(9, "Freeing CTX at %x\n", (int)ctx );
+        *              syslog(LOG_DEBUG, "Freeing CTX at %x\n", (int)ctx );
         *              SSL_CTX_free(ctx);
         *      }
         */
@@ -501,7 +501,7 @@ void ssl_lock(int mode, int n, const char *file, int line)
 /*
  * Send binary data to the client encrypted.
  */
-void client_write_ssl(const StrBuf *Buf)
+int client_write_ssl(const StrBuf *Buf)
 {
        const char *buf;
        int retval;
@@ -509,7 +509,7 @@ void client_write_ssl(const StrBuf *Buf)
        long nbytes;
        char junk[1];
 
-       if (THREADSSL == NULL) return;
+       if (THREADSSL == NULL) return -1;
 
        nbytes = nremain = StrLength(Buf);
        buf = ChrPtr(Buf);
@@ -535,10 +535,11 @@ void client_write_ssl(const StrBuf *Buf)
                                syslog(LOG_WARNING, "errno is %d\n", errno);
                        }
                        endtls();
-                       return;
+                       return -1;
                }
                nremain -= retval;
        }
+       return 0;
 }