summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Troy <dave@popvox.com>2006-04-01 17:41:56 +0000
committerDavid Troy <dave@popvox.com>2006-04-01 17:41:56 +0000
commitb4846e8daffe14658826c638a843aea45606ca79 (patch)
tree70149e0672b4dc7bea1da85cc4fe9bae6cd9b617 /src
parent7800c64a9f385d4cd3092afb10bb94704ccb24e6 (diff)
downloadastmanproxy-b4846e8daffe14658826c638a843aea45606ca79.tar.gz
astmanproxy-b4846e8daffe14658826c638a843aea45606ca79.tar.xz
astmanproxy-b4846e8daffe14658826c638a843aea45606ca79.zip
git-svn-id: http://svncommunity.digium.com/svn/astmanproxy/branches/1.20pre@47 f02b47b9-160a-0410-81a6-dc3441afb0ec
Diffstat (limited to 'src')
-rw-r--r--src/ssl.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/ssl.c b/src/ssl.c
index c912435..5570790 100644
--- a/src/ssl.c
+++ b/src/ssl.c
@@ -54,13 +54,8 @@
#include <netinet/in.h>
#include <netinet/tcp.h>
-#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 15611 $")
-
-#include "asterisk/logger.h"
-#include "asterisk/options.h"
-#include "asterisk/config.h"
-#include "asterisk/ssl_addon.h"
+#include "astmanproxy.h"
+#include "ssl.h"
SSL_CTX *sctx;
static long rec_bytes;
@@ -174,7 +169,7 @@ int saccept(int s)
} while( err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE);
SSL_set_mode(ssl, SSL_MODE_ENABLE_PARTIAL_WRITE);
- ast_log(LOG_DEBUG, "ssl_addon: Connection accepted");
+ debugmsg("ssl_addon: Connection accepted");
err=1;
@@ -219,8 +214,8 @@ int m_recv(int s, void *buf, size_t len, int flags)
if (ret > 0)
rec_bytes += ret;
- if (option_debug > 2)
- ast_log(LOG_DEBUG, "Received data from SSL socket - %d\n", ret);
+ if (debug)
+ debugmsg("Received data from SSL socket - %d\n", ret);
return ret;
}
@@ -255,7 +250,7 @@ int close_sock(int socket)
*/
int errexit(char s[])
{
- ast_log(LOG_ERROR, "SSL critical error: %s", s);
+ debugmsg("SSL critical error: %s", s);
return -1;
}
@@ -283,7 +278,7 @@ int is_encrypt_request(int sslclhellotimeout, int fd)
ready_fdescriptors = select (fd + 1, &listeners, NULL, NULL, &tv);
if (ready_fdescriptors < 0 ) {
- ast_log(LOG_ERROR, "select returned error, This should not happen: \n");
+ debugmsg("select returned error, This should not happen: \n");
return 0;
} else if (ready_fdescriptors == 0) {
return 0;
@@ -295,12 +290,12 @@ int is_encrypt_request(int sslclhellotimeout, int fd)
/* for tls buf[0x02] = 0x01 and ssl v3 buf[0x02] = 0x02 */
((buf[0x02] == 0x00) || (buf[0x02] == 0x01))) {
if (option_debug > 1)
- ast_log(LOG_DEBUG, "Received a SSL request\n");
+ debugmsg("Received a SSL request\n");
return 1;
/* check for sslv23_client_method */
} else if ((buf[0x02] == 0x01) && (buf[0x03] == 0x03) && (buf[0x04] == 0x01)) {
if (option_debug > 1)
- ast_log(LOG_DEBUG, "Received a SSL request for SSLv23_client_method()\n");
+ debugmsg("Received a SSL request for SSLv23_client_method()\n");
return 1;
}
/* check for sslv2 and return -1 */