diff options
author | David Troy <dave@popvox.com> | 2006-07-01 15:43:37 +0000 |
---|---|---|
committer | David Troy <dave@popvox.com> | 2006-07-01 15:43:37 +0000 |
commit | 5d52864609b3750bfeb7cda411802900aa190fc3 (patch) | |
tree | a7989cf5de2e99955310d8508582e6d19e8712d0 /src/csv.c | |
parent | 926f2742b7295cc83b2377535ebcaca2ad09936d (diff) | |
download | astmanproxy-5d52864609b3750bfeb7cda411802900aa190fc3.tar.gz astmanproxy-5d52864609b3750bfeb7cda411802900aa190fc3.tar.xz astmanproxy-5d52864609b3750bfeb7cda411802900aa190fc3.zip |
Cleanup 1.21pre into 1.21 (release)
git-svn-id: http://svncommunity.digium.com/svn/astmanproxy/trunk@129 f02b47b9-160a-0410-81a6-dc3441afb0ec
Diffstat (limited to 'src/csv.c')
-rw-r--r-- | src/csv.c | 39 |
1 files changed, 20 insertions, 19 deletions
@@ -1,10 +1,11 @@ -/* Asterisk Manager Proxy - Copyright (c) 2005 David C. Troy <dave@popvox.com> +/* Asterisk Manager Proxy + Copyright (c) 2005-2006 David C. Troy <dave@popvox.com> - This program is free software, distributed under the terms of - the GNU General Public License. + This program is free software, distributed under the terms of + the GNU General Public License. - CSV I/O Handler + csv.c + CSV I/O Handler */ #include "astmanproxy.h" @@ -12,19 +13,19 @@ /* TODO: catch and expand/handle commas in output */ int _write(struct mansession *s, struct message *m) { - int i; - char outstring[MAX_LEN]; - - pthread_mutex_lock(&s->lock); - for (i=0; i<m->hdrcount; i++) { - sprintf(outstring, "\"%s\"", m->headers[i]); - if (i<m->hdrcount-1) - strcat(outstring, ", "); - ast_carefulwrite(s->fd, outstring, strlen(outstring), s->writetimeout); - } - ast_carefulwrite(s->fd, "\r\n\r\n", 4, s->writetimeout); - pthread_mutex_unlock(&s->lock); - - return 0; + int i; + char outstring[MAX_LEN]; + + pthread_mutex_lock(&s->lock); + for (i=0; i<m->hdrcount; i++) { + sprintf(outstring, "\"%s\"", m->headers[i]); + if (i<m->hdrcount-1) + strcat(outstring, ", "); + ast_carefulwrite(s->fd, outstring, strlen(outstring), s->writetimeout); + } + ast_carefulwrite(s->fd, "\r\n\r\n", 4, s->writetimeout); + pthread_mutex_unlock(&s->lock); + + return 0; } |