summaryrefslogtreecommitdiff
path: root/main/tcptls.c
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2008-01-23 17:35:54 +0000
committerRussell Bryant <russell@russellbryant.com>2008-01-23 17:35:54 +0000
commit6100ec9e7dc422cca6486555e4d73d0d0af7efd5 (patch)
tree21a1e4cb1cf873db14900c63e7feb418043e3a11 /main/tcptls.c
parent0b2239deae67694ed2657bfeed5ac3f12fe431b0 (diff)
Fix tcptls build when openssl isn't installed
(closes issue #11813) Reported by: tzafrir Patches: asterisk-tcptls.diff.txt uploaded by jamesgolovich (license 176) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@99922 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/tcptls.c')
-rw-r--r--main/tcptls.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/main/tcptls.c b/main/tcptls.c
index 98b6d829e..f9c18ac49 100644
--- a/main/tcptls.c
+++ b/main/tcptls.c
@@ -83,22 +83,20 @@ static int ssl_close(void *cookie)
HOOK_T server_read(struct server_instance *ser, void *buf, size_t count)
{
- if (!ser->ssl)
- return read(ser->fd, buf, count);
#ifdef DO_SSL
- else
+ if (ser->ssl)
return ssl_read(ser->ssl, buf, count);
#endif
+ return read(ser->fd, buf, count);
}
HOOK_T server_write(struct server_instance *ser, void *buf, size_t count)
{
- if (!ser->ssl)
- return write(ser->fd, buf, count);
#ifdef DO_SSL
- else
+ if (ser->ssl)
return ssl_write(ser->ssl, buf, count);
#endif
+ return write(ser->fd, buf, count);
}
void *server_root(void *data)
@@ -356,9 +354,11 @@ void server_stop(struct server_args *desc)
void *ast_make_file_from_fd(void *data)
{
struct server_instance *ser = data;
+#ifdef DO_SSL
int (*ssl_setup)(SSL *) = (ser->client) ? SSL_connect : SSL_accept;
int ret;
char err[256];
+#endif
/*
* open a FILE * as appropriate.