summaryrefslogtreecommitdiffstats
path: root/src/common.c
diff options
context:
space:
mode:
authorDavid Troy <dave@popvox.com>2006-04-02 19:04:27 +0000
committerDavid Troy <dave@popvox.com>2006-04-02 19:04:27 +0000
commit7885ebaa4f79cf908adb9e2a7fb252493c10026b (patch)
tree6008972bb9cbfc2ae9398360ed76526ab2a8c680 /src/common.c
parent7d5a0b34c0f7d35bbdf7ab62672d84c733c00bdd (diff)
downloadastmanproxy-7885ebaa4f79cf908adb9e2a7fb252493c10026b.tar.gz
astmanproxy-7885ebaa4f79cf908adb9e2a7fb252493c10026b.tar.xz
astmanproxy-7885ebaa4f79cf908adb9e2a7fb252493c10026b.zip
git-svn-id: http://svncommunity.digium.com/svn/astmanproxy/branches/1.20pre@67 f02b47b9-160a-0410-81a6-dc3441afb0ec
Diffstat (limited to 'src/common.c')
-rw-r--r--src/common.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/common.c b/src/common.c
index 8ec016d..0855ac9 100644
--- a/src/common.c
+++ b/src/common.c
@@ -11,7 +11,8 @@ int get_input(struct mansession *s, char *output)
struct pollfd fds[1];
char iabuf[INET_ADDRSTRLEN];
- debugmsg("in get_input");
+ if (debug > 3)
+ debugmsg("in get_input");
/* Look for \r\n from the front, our preferred end of line */
for (x=0;x<s->inlen;x++) {
@@ -36,19 +37,22 @@ int get_input(struct mansession *s, char *output)
debugmsg("Warning: Got long line with no end from %s: %s\n", ast_inet_ntoa(iabuf, sizeof(iabuf), s->sin.sin_addr), s->inbuf);
s->inlen = 0;
}
- debugmsg("attempting poll operation");
+ if (debug > 3)
+ debugmsg("attempting poll operation");
/* 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");
+ if (debug > 3)
+ debugmsg("returned from poll op");
+
if (res < 0 && debug) {
debugmsg("Select returned error");
} else if (res > 0) {
- pthread_mutex_lock(&s->lock);
debugmsg("attempting socket read in get_input...");
+ pthread_mutex_lock(&s->lock);
/* 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);