diff options
author | David Troy <dave@popvox.com> | 2006-04-03 01:15:22 +0000 |
---|---|---|
committer | David Troy <dave@popvox.com> | 2006-04-03 01:15:22 +0000 |
commit | 86d13969f343e282a421acaa00796f9ffb95faed (patch) | |
tree | 645c7f7fa4f9bf5a075e19de14ae65d13c932711 | |
parent | 09255fbd6f7e0bd81f5de30f580928a94e1834d7 (diff) | |
download | astmanproxy-86d13969f343e282a421acaa00796f9ffb95faed.tar.gz astmanproxy-86d13969f343e282a421acaa00796f9ffb95faed.tar.xz astmanproxy-86d13969f343e282a421acaa00796f9ffb95faed.zip |
git-svn-id: http://svncommunity.digium.com/svn/astmanproxy/branches/1.20pre@69 f02b47b9-160a-0410-81a6-dc3441afb0ec
-rw-r--r-- | src/astmanproxy.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/astmanproxy.c b/src/astmanproxy.c index 282a33e..3c976e6 100644 --- a/src/astmanproxy.c +++ b/src/astmanproxy.c @@ -153,7 +153,6 @@ void destroy_session(struct mansession *s) else sessions = cur->next; debugmsg("Connection closed: %s", ast_inet_ntoa(iabuf, sizeof(iabuf), s->sin.sin_addr)); - close_sock(s->fd); /* close tcp/ssl socket */ pthread_mutex_destroy(&s->lock); free(s); @@ -169,7 +168,7 @@ void destroy_session(struct mansession *s) } int WriteClients(struct message *m) { - struct mansession *c; + struct mansession *c, *d; char *actionid; c = sessions; @@ -182,8 +181,12 @@ int WriteClients(struct message *m) { } } else c->output->write(c, m); - if ( c->input->autodisconnect && c->input->autodisconnect() ) - destroy_session(c); + if ( c->input->autodisconnect && c->input->autodisconnect() ) { + d = c; /* session to disconnect */ + c = c->next; + destroy_session(d); + continue; + } } c = c->next; } |