* Removed the last couple of places where forms were submitted using
authorArt Cancro <ajc@citadel.org>
Tue, 19 Jul 2005 17:05:23 +0000 (17:05 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 19 Jul 2005 17:05:23 +0000 (17:05 +0000)
  the GET method.  POST is just so technologically cleaner that we should
  use it all the time.
* Fixed a bug in the MIME parser that was causing it to not be 8-bit
  clean.

webcit/ChangeLog
webcit/listsub.c
webcit/mime_parser.c
webcit/roomops.c
webcit/webcit.c

index 8a0e2811a2d4a3cd8e61e98509362f548430aa28..ae98bc8d13d42e0850ab59c592069e9dae54b8cb 100644 (file)
@@ -1,4 +1,11 @@
 $Log$
+Revision 619.27  2005/07/19 17:05:23  ajc
+* Removed the last couple of places where forms were submitted using
+  the GET method.  POST is just so technologically cleaner that we should
+  use it all the time.
+* Fixed a bug in the MIME parser that was causing it to not be 8-bit
+  clean.
+
 Revision 619.26  2005/07/19 14:23:04  ajc
 * mime_parser.c: don't default Content-type: to text/plain, because when
   an HTTP POST operation is performed, the content type is expected to
@@ -2712,3 +2719,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 b5982f9e4bae88c481c8d6997dddde3c6943affb..c37a4836e8db631f56dd326354873775d34d0d4c 100644 (file)
@@ -168,7 +168,7 @@ void do_listsub(void)
         * Any other (invalid) command causes the form to be displayed
         */
        else {
-FORM:          wprintf("<FORM METHOD=\"GET\" ACTION=\"/listsub\">\n"
+FORM:          wprintf("<FORM METHOD=\"POST\" ACTION=\"/listsub\">\n"
                        "<TABLE BORDER=0>\n"
                );
 
index 9315f94e1a0066cb8eb350a2120c39548ae786dc..ed6719cefa903ed1a2f21a8684e27963b01507f7 100644 (file)
@@ -20,6 +20,7 @@
 #include <errno.h>
 
 #include "webcit.h"
+#include "webserver.h"
 
 #include "mime_parser.h"
 
@@ -268,11 +269,13 @@ void the_mime_parser(char *partnum,
 {
 
        char *ptr;
+       char *srch = NULL;
        char *part_start, *part_end = NULL;
        char buf[SIZ];
        char *header;
        char *boundary;
        char *startary;
+       size_t startary_len = 0;
        char *endary;
        char *next_boundary;
        char *content_type;
@@ -402,10 +405,20 @@ void the_mime_parser(char *partnum,
                /* Figure out where the boundaries are */
                snprintf(startary, SIZ, "--%s", boundary);
                snprintf(endary, SIZ, "--%s--", boundary);
+               startary_len = strlen(startary);
 
                part_start = NULL;
                do {
-                       next_boundary = bmstrstr(ptr, startary, strncmp);
+       
+                       /* next_boundary = bmstrstr(ptr, startary, memcmp); */
+                       next_boundary = NULL;
+                       for (srch=ptr; srch<content_end; ++srch) {
+                               if (!memcmp(srch, startary, startary_len)) {
+                                       next_boundary = srch;
+                                       srch = content_end;
+                               }
+                       }
+
                        if ( (part_start != NULL) && (next_boundary != NULL) ) {
                                part_end = next_boundary;
                                --part_end;
@@ -431,8 +444,8 @@ void the_mime_parser(char *partnum,
                        }
 
                        if (next_boundary != NULL) {
-                               /* If we pass out of scope, don't attempt to read
-                                * past the end boundary. */
+                               /* If we pass out of scope, don't attempt to
+                                * read past the end boundary. */
                                if (!strcmp(next_boundary, endary)) {
                                        ptr = content_end;
                                }
index ad23c2c75d57c0487de35321b533b25515444d25..c3807b4c045b0aaf69cc5d357c414c2a150122b2 100644 (file)
@@ -1995,7 +1995,7 @@ void display_private(char *rname, int req_pass)
        wprintf("so you don't have to keep returning here.\n");
        wprintf("<br /><br />");
 
-       wprintf("<FORM METHOD=\"GET\" ACTION=\"/goto_private\">\n");
+       wprintf("<FORM METHOD=\"POST\" ACTION=\"/goto_private\">\n");
 
        wprintf("<table border=\"0\" cellspacing=\"5\" "
                "cellpadding=\"5\" BGCOLOR=\"#EEEEEE\">\n"
@@ -2071,7 +2071,7 @@ void display_zap(void)
        wprintf("disappear from your room list.  Is this what you wish ");
        wprintf("to do?<br />\n");
 
-       wprintf("<FORM METHOD=\"GET\" ACTION=\"/zap\">\n");
+       wprintf("<FORM METHOD=\"POST\" ACTION=\"/zap\">\n");
        wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
        wprintf("&nbsp;");
        wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
index 6c29b38e08949234851850d23811aff9e80e7736..3dc05c5fd969c8d559104c3b6060a0bd9f0dd4da 100644 (file)
@@ -822,6 +822,9 @@ void upload_handler(char *name, char *filename, char *partnum, char *disp,
 {
        struct urlcontent *u;
 
+       lprintf(9, "upload_handler() name=%s, type=%s, len=%d\n",
+               name, cbtype, length);
+
        /* Form fields */
        if ( (length > 0) && (strlen(cbtype) == 0) ) {
                u = (struct urlcontent *) malloc(sizeof(struct urlcontent));