It is with pleasure that I announce the return of rawman support through the HTTP...
authorJoshua Colp <jcolp@digium.com>
Thu, 8 Feb 2007 20:39:41 +0000 (20:39 +0000)
committerJoshua Colp <jcolp@digium.com>
Thu, 8 Feb 2007 20:39:41 +0000 (20:39 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@53635 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/manager.c

index a96818e..decc65e 100644 (file)
@@ -2809,16 +2809,17 @@ static struct ast_str *generic_http_callback(enum output_format format,
        if (s->f != NULL) {     /* have temporary output */
                char *buf;
                size_t l = ftell(s->f);
-
-               if (format == FORMAT_XML || format == FORMAT_HTML) {
-                       if (l) {
-                               if ((buf = mmap(NULL, l, PROT_READ | PROT_WRITE, MAP_SHARED, s->fd, 0))) {
+               
+               if (l) {
+                       if ((buf = mmap(NULL, l, PROT_READ | PROT_WRITE, MAP_SHARED, s->fd, 0))) {
+                               if (format == FORMAT_XML || format == FORMAT_HTML)
                                        xml_translate(&out, buf, params, format);
-                                       munmap(buf, l);
-                               }
-                       } else {
-                               xml_translate(&out, "", params, format);
+                               else
+                                       ast_str_append(&out, 0, buf);
+                               munmap(buf, l);
                        }
+               } else if (format == FORMAT_XML || format == FORMAT_HTML) {
+                       xml_translate(&out, "", params, format);
                }
                fclose(s->f);
                s->f = NULL;