summaryrefslogtreecommitdiffstats
path: root/src/common.c
diff options
context:
space:
mode:
authorDavid Troy <dave@popvox.com>2006-04-02 16:43:05 +0000
committerDavid Troy <dave@popvox.com>2006-04-02 16:43:05 +0000
commit08192d2b732eaaff203012c0acda210b40261885 (patch)
tree59c98652dec47199680095daf58ae14d1ffe9d8e /src/common.c
parent55a533edf2e466a34179e12bf36e239902aad5fc (diff)
downloadastmanproxy-08192d2b732eaaff203012c0acda210b40261885.tar.gz
astmanproxy-08192d2b732eaaff203012c0acda210b40261885.tar.xz
astmanproxy-08192d2b732eaaff203012c0acda210b40261885.zip
git-svn-id: http://svncommunity.digium.com/svn/astmanproxy/branches/1.20pre@58 f02b47b9-160a-0410-81a6-dc3441afb0ec
Diffstat (limited to 'src/common.c')
-rw-r--r--src/common.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/common.c b/src/common.c
index 8da909c..b52ee59 100644
--- a/src/common.c
+++ b/src/common.c
@@ -37,7 +37,9 @@ int get_input(struct mansession *s, char *output)
s->inlen = 0;
}
debugmsg("attempting poll operation");
- fds[0].fd = s->fd;
+ /* get actual fd, even if a negative SSL fd */
+ fds[0].fd = get_real_fd(s->fd);
+
fds[0].events = POLLIN;
res = poll(fds, 1, -1);
debugmsg("returned from poll op");
@@ -46,7 +48,9 @@ int get_input(struct mansession *s, char *output)
} else if (res > 0) {
pthread_mutex_lock(&s->lock);
debugmsg("attempting socket read in get_input...");
- res = read(s->fd, s->inbuf + s->inlen, sizeof(s->inbuf) - 1 - s->inlen);
+
+ /* read from socket; SSL or otherwise */
+ res = m_recv(s->fd, s->inbuf + s->inlen, sizeof(s->inbuf) - 1 - s->inlen, 0);
pthread_mutex_unlock(&s->lock);
if (res < 1)
return -1;