diff options
author | David Troy <dave@popvox.com> | 2006-04-03 18:14:45 +0000 |
---|---|---|
committer | David Troy <dave@popvox.com> | 2006-04-03 18:14:45 +0000 |
commit | ecc49089c697a2cb7331358def5ce7640fae65bf (patch) | |
tree | 70c13967ededb98deb4e28caffb80d7b4155154c | |
parent | f1ae22daac2c0e4fe9777942f50d5a3af0470744 (diff) | |
download | astmanproxy-ecc49089c697a2cb7331358def5ce7640fae65bf.tar.gz astmanproxy-ecc49089c697a2cb7331358def5ce7640fae65bf.tar.xz astmanproxy-ecc49089c697a2cb7331358def5ce7640fae65bf.zip |
git-svn-id: http://svncommunity.digium.com/svn/astmanproxy/branches/1.20pre@73 f02b47b9-160a-0410-81a6-dc3441afb0ec
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | src/astmanproxy.c | 11 | ||||
-rw-r--r-- | src/http.c | 5 | ||||
-rw-r--r-- | src/include/astmanproxy.h | 1 |
4 files changed, 6 insertions, 14 deletions
@@ -58,8 +58,7 @@ DEFINES+='-DMDIR="$(MODDIR)"' '-DPDIR="$(PERMDIR)"' '-DPFILE="$(PERMFILE)"' VPATH = src # Add -g below for debug/GDB symbols -#CFLAGS+= $(DEFINES) -Wall -O2 -dynamic -D_REENTRANT -fPIC -CFLAGS+= $(DEFINES) -Wall -O2 -D_REENTRANT -fPIC -Isrc/include -I/usr/include/openssl -I- +CFLAGS+= $(DEFINES) -g -Wall -O2 -D_REENTRANT -fPIC -Isrc/include -I/usr/include/openssl -I- # For printing only SRCS := $(MODS:%=%.c) diff --git a/src/astmanproxy.c b/src/astmanproxy.c index 853b8bf..457a3bf 100644 --- a/src/astmanproxy.c +++ b/src/astmanproxy.c @@ -181,12 +181,8 @@ int WriteClients(struct message *m) { } } else c->output->write(c, m); - if ( c->input->autodisconnect && c->input->autodisconnect() ) { - d = c; /* session to disconnect */ - c = c->next; - destroy_session(d); - continue; - } + if ( c->input->autodisconnect && c->input->autodisconnect() ) + c->dead = 1; } c = c->next; } @@ -298,7 +294,7 @@ void *session_do(struct mansession *s) destroy_session(s); if (debug) - debugmsg("Exiting session_do thread"); + debugmsg("--- exiting session_do thread ---"); pthread_exit(NULL); return NULL; } @@ -584,7 +580,6 @@ static void *accept_thread() s->fd = as; SetIOHandlers(s, pc.inputformat, pc.outputformat); s->autofilter = pc.autofilter; - s->inputcomplete = 0; s->server = NULL; pthread_mutex_lock(&sessionlock); @@ -66,8 +66,8 @@ int _read(struct mansession *s, struct message *m) { char line[MAX_LEN], method[10], formdata[MAX_LEN], header[MAX_LEN]; int res, clength = 0; - if (s->inputcomplete) - return 0; + if (s->dead) + return -1; memset(method, 0, sizeof method); memset(formdata, 0, sizeof formdata); @@ -107,7 +107,6 @@ int _read(struct mansession *s, struct message *m) { BuildHTTPHeader(header); pthread_mutex_lock(&s->lock); - s->inputcomplete = 1; ast_carefulwrite(s->fd, header, strlen(header), s->writetimeout); pthread_mutex_unlock(&s->lock); debugmsg("header: %s", header); diff --git a/src/include/astmanproxy.h b/src/include/astmanproxy.h index 4068299..fc80412 100644 --- a/src/include/astmanproxy.h +++ b/src/include/astmanproxy.h @@ -96,7 +96,6 @@ struct mansession { struct iohandler *input; struct iohandler *output; int autofilter; - int inputcomplete; int authenticated; int connected; int dead; /* Whether we are dead */ |