]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
try this
authorBrian West <brian@freeswitch.org>
Mon, 5 Oct 2009 17:38:46 +0000 (17:38 +0000)
committerBrian West <brian@freeswitch.org>
Mon, 5 Oct 2009 17:38:46 +0000 (17:38 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15094 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_utils.c

index d278db6b678257afc1673031437489b21670b4a3..fa94ced56620b19c671106ff5b800716f9d64018 100644 (file)
@@ -473,31 +473,40 @@ SWITCH_DECLARE(switch_bool_t) switch_simple_email(const char *to,
        if ((fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0644))) {
                if (file) {
                        if ((ifd = open(file, O_RDONLY | O_BINARY)) < 1) {
-                               rval = SWITCH_FALSE; goto end;
+                               rval = SWITCH_FALSE;
+                               goto end;
                        }
                }
                switch_snprintf(buf, B64BUFFLEN, "MIME-Version: 1.0\nContent-Type: multipart/mixed; boundary=\"%s\"\n", bound);
                if (!write_buf(fd, buf)) {
-                       rval = SWITCH_FALSE; goto end;
+                       rval = SWITCH_FALSE;
+                       goto end;
                }
 
-               if (headers && !write_buf(fd, headers))
-                       rval = SWITCH_FALSE; goto end;
+               if (headers && !write_buf(fd, headers)) {
+                       rval = SWITCH_FALSE;
+                       goto end;
+               }
 
-               if (!write_buf(fd, "\n\n"))
-                       rval = SWITCH_FALSE; goto end;
+               if (!write_buf(fd, "\n\n")) {
+                       rval = SWITCH_FALSE;
+                       goto end;
+               }
 
                if (body && switch_stristr("content-type", body)) {
                        switch_snprintf(buf, B64BUFFLEN, "--%s\n", bound);
                } else {
                        switch_snprintf(buf, B64BUFFLEN, "--%s\nContent-Type: text/plain\n\n", bound);
                }
-               if (!write_buf(fd, buf))
-                       rval = SWITCH_FALSE; goto end;
+               if (!write_buf(fd, buf)) {
+                       rval = SWITCH_FALSE; 
+                       goto end;
+               }
 
                if (body) {
                        if (!write_buf(fd, body)) {
-                               rval = SWITCH_FALSE; goto end;
+                               rval = SWITCH_FALSE;
+                               goto end;
                        }
                }
 
@@ -519,8 +528,10 @@ SWITCH_DECLARE(switch_bool_t) switch_simple_email(const char *to,
                                                        "Content-Transfer-Encoding: base64\n"
                                                        "Content-Description: Sound attachment.\n"
                                                        "Content-Disposition: attachment; filename=\"%s\"\n\n", bound, mime_type, stipped_file, stipped_file);
-                       if (!write_buf(fd, buf))
-                               rval = SWITCH_FALSE; goto end;
+                       if (!write_buf(fd, buf)) {
+                               rval = SWITCH_FALSE;
+                               goto end;
+                       }
 
                        while ((ilen = read(ifd, in, B64BUFFLEN))) {
                                for (x = 0; x < ilen; x++) {
@@ -555,8 +566,11 @@ SWITCH_DECLARE(switch_bool_t) switch_simple_email(const char *to,
                }
 
                switch_snprintf(buf, B64BUFFLEN, "\n\n--%s--\n.\n", bound);
-               if (!write_buf(fd, buf))
-                       rval = SWITCH_FALSE; goto end;
+
+               if (!write_buf(fd, buf)) {
+                       rval = SWITCH_FALSE;
+                       goto end;
+               }
        }
 
        if (fd) {