]> code.citadel.org Git - citadel.git/commitdiff
* Shuffled some code and comments around; minor cleanup
authorArt Cancro <ajc@citadel.org>
Wed, 29 Jan 2003 22:32:07 +0000 (22:32 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 29 Jan 2003 22:32:07 +0000 (22:32 +0000)
webcit/ChangeLog
webcit/serv_func.c
webcit/tools.c
webcit/webserver.c

index 778d74b161c3cf2dee2ef0597607eb52b5203c17..43ee2698b3a28f2db845ea8f2d1b5a87abfc4951 100644 (file)
@@ -1,4 +1,7 @@
 $Log$
+Revision 400.88  2003/01/29 22:32:07  ajc
+* Shuffled some code and comments around; minor cleanup
+
 Revision 400.87  2003/01/28 15:37:12  ajc
 * All functions which read binary data from the server now make use of the
   read_server_binary() function in tools.c
@@ -1258,3 +1261,4 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
+
index d8c41ad3904e3ff67481406ac2f547b0a8673017..a6b3d608e98814cb3d0638503968925262acb330 100644 (file)
@@ -1,6 +1,10 @@
-/* $Id$ */
-
-
+/*
+ * serv_func.c
+ *
+ * Handles various types of data transfer operations with the Citadel service.
+ *
+ * $Id$
+ */
 
 #include <ctype.h>
 #include <stdlib.h>
 #include <pthread.h>
 #include <signal.h>
 #include "webcit.h"
-
-
-
-
-
-
+#include "webserver.h"
 
 struct serv_info serv_info;
 
@@ -152,8 +151,6 @@ void fmout(FILE * fp)
 
 
 
-
-
 /*
  * Transmit message text (in memory) to the server.
  * If convert_to_html is set to 1, the message is converted into something
@@ -210,9 +207,6 @@ void text_to_server(char *ptr, int convert_to_html)
 
 
 
-
-
-
 /*
  * translate server message output to text
  * (used for editing room info files and such)
@@ -231,3 +225,37 @@ void server_to_text()
                ++count;
        }
 }
+
+
+
+/*
+ * Read binary data from server into memory using a series of
+ * server READ commands.
+ */
+void read_server_binary(char *buffer, size_t total_len) {
+       char buf[SIZ];
+       size_t bytes = 0;
+       size_t thisblock = 0;
+
+       memset(buffer, 0, total_len);
+       while (bytes < total_len) {
+               thisblock = 4095;
+               if ((total_len - bytes) < thisblock) {
+                       thisblock = total_len - bytes;
+                       if (thisblock == 0) return;
+               }
+               serv_printf("READ %d|%d", (int)bytes, (int)thisblock);
+               serv_gets(buf);
+               if (buf[0] == '6') {
+                       thisblock = (size_t)atoi(&buf[4]);
+                       serv_read(&buffer[bytes], thisblock);
+                       bytes += thisblock;
+               }
+               else {
+                       lprintf(3, "Error: %s\n", &buf[4]);
+                       return;
+               }
+       }
+}
+
+
index b640141567da488278593e4e14dca50313ab5ccc..a38e86c795a0ebf5eb7ed98e2bbaec7f49425f3a 100644 (file)
@@ -2,8 +2,6 @@
  * tools.c -- Miscellaneous routines 
  */
 
-
-
 #include <ctype.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -350,39 +348,6 @@ int is_msg_in_mset(char *mset, long msgnum) {
 }
 
 
-
-/*
- * Read binary data from server into memory using a series of
- * server READ commands.
- */
-void read_server_binary(char *buffer, size_t total_len) {
-       char buf[SIZ];
-       size_t bytes = 0;
-       size_t thisblock = 0;
-
-       memset(buffer, 0, total_len);
-       while (bytes < total_len) {
-               thisblock = 4095;
-               if ((total_len - bytes) < thisblock) {
-                       thisblock = total_len - bytes;
-                       if (thisblock == 0) return;
-               }
-               serv_printf("READ %d|%d", (int)bytes, (int)thisblock);
-               serv_gets(buf);
-               if (buf[0] == '6') {
-                       thisblock = (size_t)atoi(&buf[4]);
-                       serv_read(&buffer[bytes], thisblock);
-                       bytes += thisblock;
-               }
-               else {
-                       lprintf(3, "Error: %s<BR>\n", &buf[4]);
-                       return;
-               }
-       }
-}
-
-
-
 /*
  * Strip a boundarized substring out of a string (for example, remove
  * parentheses and anything inside them).
index 7cc4f3f9674aea93b1913efb630dcb22592d89de..64bfd56855eee7b6710a7a955ef308ca1b54acd0 100644 (file)
@@ -271,7 +271,7 @@ int main(int argc, char **argv)
        }
        /* Tell 'em who's in da house */
        lprintf(1, SERVER "\n"
-"Copyright (C) 1996-2002 by the Citadel/UX development team.\n"
+"Copyright (C) 1996-2003 by the Citadel/UX development team.\n"
 "This software is distributed under the terms of the GNU General Public\n"
 "License.  If you paid for this software, someone is ripping you off.\n\n");