summaryrefslogtreecommitdiffstats
path: root/src/standard.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/standard.c')
-rw-r--r--src/standard.c12
1 files changed, 4 insertions, 8 deletions
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;