pthread_key_t ThreadSSL; /* Per-thread SSL context */
+void ssl_lock(int mode, int n, const char *file, int line);
+
static unsigned long id_callback(void)
{
return (unsigned long) pthread_self();
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();
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));
}
/*
/* 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);
* }
*/
/*
* 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;
long nbytes;
char junk[1];
- if (THREADSSL == NULL) return;
+ if (THREADSSL == NULL) return -1;
nbytes = nremain = StrLength(Buf);
buf = ChrPtr(Buf);
syslog(LOG_WARNING, "errno is %d\n", errno);
}
endtls();
- return;
+ return -1;
}
nremain -= retval;
}
+ return 0;
}