changeset 1679:b974e9823aa1

vsource use a_Dpip_dsh_write_str when possible
author corvid <corvid@lavabit.com>
date Sun, 06 Jun 2010 18:51:29 +0000
parents 2b3cba462b23
children 4041b4b18682
files dpi/vsource.c
diffstat 1 files changed, 12 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/dpi/vsource.c	Sun Jun 06 18:38:36 2010 +0000
+++ b/dpi/vsource.c	Sun Jun 06 18:51:29 2010 +0000
@@ -35,9 +35,9 @@
 
 void send_dpip_tag(Dsh *sh, char *dpip_tag)
 {
-   a_Dpip_dsh_printf(sh, 0, "\nDpip tag received: ");
-   a_Dpip_dsh_printf(sh, 0, dpip_tag ? dpip_tag : "None");
-   a_Dpip_dsh_printf(sh, 1, "\n\n");
+   a_Dpip_dsh_write_str(sh, 0, "\nDpip tag received: ");
+   a_Dpip_dsh_write_str(sh, 0, dpip_tag ? dpip_tag : "None");
+   a_Dpip_dsh_write_str(sh, 1, "\n\n");
 }
 
 /*
@@ -49,7 +49,7 @@
    char *src_str;
 
    /* Send HTTP header for plain text MIME type */
-   a_Dpip_dsh_printf(sh, 0, "Content-type: text/plain\n\n");
+   a_Dpip_dsh_write_str(sh, 0, "Content-type: text/plain\n\n");
 
    while (bytes_read < data_size &&
           (src_str = a_Dpip_dsh_read_token(sh, 1))) {
@@ -68,7 +68,7 @@
    char *p, *q, *src_str, line_str[32];
 
    /* Send HTTP header for plain text MIME type */
-   a_Dpip_dsh_printf(sh, 0, "Content-type: text/plain\n\n");
+   a_Dpip_dsh_write_str(sh, 0, "Content-type: text/plain\n\n");
 
    while (bytes_read < data_size &&
           (src_str = a_Dpip_dsh_read_token(sh, 1))) {
@@ -105,9 +105,9 @@
       url += 14;
 
    /* Send HTTP header for plain text MIME type */
-   a_Dpip_dsh_printf(sh, 0, "Content-type: text/html\n\n");
+   a_Dpip_dsh_write_str(sh, 0, "Content-type: text/html\n\n");
 
-   a_Dpip_dsh_printf(sh, 0, DOCTYPE);
+   a_Dpip_dsh_write_str(sh, 0, DOCTYPE);
    a_Dpip_dsh_printf(sh, 0,
                      "\n"
                      "<html><head>\n"
@@ -152,8 +152,8 @@
    }
 
    if (data_size > 0)
-      a_Dpip_dsh_printf(sh, 0, "</pre>");
-   a_Dpip_dsh_printf(sh, 1, "</table></body></html>");
+      a_Dpip_dsh_write_str(sh, 0, "</pre>");
+   a_Dpip_dsh_write_str(sh, 1, "</table></body></html>");
 }
 
 /*
@@ -218,8 +218,9 @@
          send_html_text(sh, url, data_size);
       } else if (strcmp(cmd2, "DpiError") == 0) {
          /* Dillo detected an error (other failures just close the socket) */
-         a_Dpip_dsh_printf(sh, 0, "Content-type: text/plain\n\n");
-         a_Dpip_dsh_printf(sh, 1, "[vsource dpi]: ERROR: Page not cached.\n");
+         a_Dpip_dsh_write_str(sh, 0, "Content-type: text/plain\n\n");
+         a_Dpip_dsh_write_str(sh, 1, "[vsource dpi]: "
+                                     "ERROR: Page not cached.\n");
       }
       dFree(cmd2);
    }