]> code.citadel.org Git - citadel.git/commitdiff
* Reduce the number of socket writes when doing fixed_output() to avoid
authorArt Cancro <ajc@citadel.org>
Thu, 16 May 2002 04:44:58 +0000 (04:44 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 16 May 2002 04:44:58 +0000 (04:44 +0000)
  getting killed by overhead.  (Thanks to IO for the insight)

citadel/ChangeLog
citadel/msgbase.c

index ca6cc4f7da44d5813b16d76ecd62fcb8d769a191..2781953b6b33a8cce69a2462f308041b6cdd4daa 100644 (file)
@@ -1,4 +1,8 @@
  $Log$
+ Revision 591.27  2002/05/16 04:44:58  ajc
+ * Reduce the number of socket writes when doing fixed_output() to avoid
+   getting killed by overhead.  (Thanks to IO for the insight)
+
  Revision 591.26  2002/05/14 15:25:34  error
  * room_ops.c: clarified aide message when room aide is removed
 
@@ -3660,4 +3664,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
-
index 20846b54bece913c535828ad9ab765a7a46f54ca..f1c066b0303a9237adc7622960018419616a119f 100644 (file)
@@ -895,17 +895,13 @@ void fixed_output(char *name, char *filename, char *partnum, char *disp,
        
                if ( (!strcasecmp(cbtype, "text/plain")) 
                   || (strlen(cbtype)==0) ) {
-                       wlen = length;
                        wptr = content;
-                       while (wlen--) {
-                               ch = *wptr++;
-                               /**********
-                               if (ch==10) cprintf("\r\n");
-                               else cprintf("%c", ch);
-                                **********/
-                               cprintf("%c", ch);
+                       if (length > 0) {
+                               client_write(wptr, length);
+                               if (wptr[length-1] != '\n') {
+                                       cprintf("\n");
+                               }
                        }
-                       if (ch != '\n') cprintf("\n");
                }
                else if (!strcasecmp(cbtype, "text/html")) {
                        ptr = html_to_ascii(content, 80, 0);