X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fcrypto.c;h=6925dfa8f362eccce3bab46133b8eb85fa3ee369;hb=b70796f1d877f1c50cd5cf7903ad606777303691;hp=d7b460cdef1864651e515eba86b7230456ec94b2;hpb=156d3eaa1b5d85cb70a79046bd874ab832df6ff1;p=citadel.git diff --git a/webcit/crypto.c b/webcit/crypto.c index d7b460cde..6925dfa8f 100644 --- a/webcit/crypto.c +++ b/webcit/crypto.c @@ -29,6 +29,8 @@ char *ssl_cipher_list = DEFAULT_SSL_CIPHER_LIST; 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(); @@ -501,7 +503,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 +511,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 +537,11 @@ void client_write_ssl(const StrBuf *Buf) syslog(LOG_WARNING, "errno is %d\n", errno); } endtls(); - return; + return -1; } nremain -= retval; } + return 0; }