summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Troy <dave@popvox.com>2006-04-01 17:55:39 +0000
committerDavid Troy <dave@popvox.com>2006-04-01 17:55:39 +0000
commit003236f73567a285b35fc8d571ac94fb0bc51278 (patch)
tree205367ccb2b0efd7e22ae84895c493653c205e9a /src
parent291633f8cb612e222fc6a8209ebbbd6904bcf3de (diff)
downloadastmanproxy-003236f73567a285b35fc8d571ac94fb0bc51278.tar.gz
astmanproxy-003236f73567a285b35fc8d571ac94fb0bc51278.tar.xz
astmanproxy-003236f73567a285b35fc8d571ac94fb0bc51278.zip
git-svn-id: http://svncommunity.digium.com/svn/astmanproxy/branches/1.20pre@50 f02b47b9-160a-0410-81a6-dc3441afb0ec
Diffstat (limited to 'src')
-rw-r--r--src/config.c4
-rw-r--r--src/csv.c4
-rw-r--r--src/standard.c12
-rw-r--r--src/xml.c6
4 files changed, 13 insertions, 13 deletions
diff --git a/src/config.c b/src/config.c
index 50b0896..2ffdd1a 100644
--- a/src/config.c
+++ b/src/config.c
@@ -226,6 +226,10 @@ int ReadConfig() {
fclose(FP);
+ if (!pc.asteriskwritetimeout)
+ pc.asteriskwritetimeout = 100;
+ if (!pc.clientwritetimeout)
+ pc.clientwritetimeout = 100;
return 0;
}
diff --git a/src/csv.c b/src/csv.c
index bf8e800..fb26f3b 100644
--- a/src/csv.c
+++ b/src/csv.c
@@ -20,9 +20,9 @@ int _write(struct mansession *s, struct message *m) {
sprintf(outstring, "\"%s\"", m->headers[i]);
if (i<m->hdrcount-1)
strcat(outstring, ", ");
- write(s->fd, outstring, strlen(outstring));
+ ast_carefulwrite(s->fd, outstring, strlen(outstring), s->writetimeout);
}
- write(s->fd, "\r\n\r\n", 4);
+ ast_carefulwrite(s->fd, "\r\n\r\n", 4, s->writetimeout);
pthread_mutex_unlock(&s->lock);
return 0;
diff --git a/src/standard.c b/src/standard.c
index 5933e45..26cd4a8 100644
--- a/src/standard.c
+++ b/src/standard.c
@@ -49,14 +49,10 @@ int _write(struct mansession *s, struct message *m) {
if (debug) debugmsg("in standard_write module...");
pthread_mutex_lock(&s->lock);
for (i=0; i<m->hdrcount; i++) {
- if( strncasecmp( m->headers[i], "CallerID: <unknown>", 19 ) == 0 ) {
- write(s->fd, "CallerID: ", 10);
- } else {
- write(s->fd, m->headers[i], strlen(m->headers[i]) );
- }
- write(s->fd, "\r\n", 2);
+ ast_carefulwrite(s->fd, m->headers[i], strlen(m->headers[i]) , s->writetimeout);
+ ast_carefulwrite(s->fd, "\r\n", 2, s->writetimeout);
}
- write(s->fd, "\r\n", 2);
+ ast_carefulwrite(s->fd, "\r\n", 2, s->writetimeout);
pthread_mutex_unlock(&s->lock);
return 0;
@@ -68,7 +64,7 @@ int _onconnect(struct mansession *s, struct message *m) {
sprintf(banner, "%s/%s\r\n", PROXY_BANNER, PROXY_VERSION);
pthread_mutex_lock(&s->lock);
- write(s->fd, banner, strlen(banner));
+ ast_carefulwrite(s->fd, banner, strlen(banner), s->writetimeout);
pthread_mutex_unlock(&s->lock);
return 0;
diff --git a/src/xml.c b/src/xml.c
index 0d6737b..2f3f9d0 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -74,7 +74,7 @@ int _write(struct mansession *s, struct message *m) {
sprintf(buf, "<%s>\r\n", xmldoctag);
pthread_mutex_lock(&s->lock);
- write(s->fd, buf, strlen(buf));
+ ast_carefulwrite(s->fd, buf, strlen(buf), s->writetimeout);
for (i=0; i<m->hdrcount; i++) {
memset(xmlescaped, 0, sizeof xmlescaped);
@@ -89,10 +89,10 @@ int _write(struct mansession *s, struct message *m) {
strcat(outstring, "\"/>\r\n");
} else
sprintf(outstring, " <%s Value=\"%s\"/>\r\n", XML_UNPARSED, lpos);
- write(s->fd, outstring, strlen(outstring) );
+ ast_carefulwrite(s->fd, outstring, strlen(outstring), s->writetimeout);
}
sprintf(buf, "</%s>\r\n\r\n", xmldoctag);
- write(s->fd, buf, strlen(buf));
+ ast_carefulwrite(s->fd, buf, strlen(buf), s->writetimeout);
pthread_mutex_unlock(&s->lock);
return 0;