Sfoglia il codice sorgente

Code should be C89/C90 compliant, and add some CGI tests

bel2125 7 anni fa
parent
commit
f0445b5de8
3 ha cambiato i file con 24 aggiunte e 1 eliminazioni
  1. 3 1
      src/civetweb.c
  2. 20 0
      test/delayed.cgi
  3. 1 0
      test/hello.cgi

+ 3 - 1
src/civetweb.c

@@ -6903,12 +6903,14 @@ interpret_uri(struct mg_connection *conn, /* in/out: request (must be valid) */
 				/* some intermediate directory has an index file */
 				if (extention_matches_script(conn, tmp_str)) {
 
+					char *tmp_str2;
+
 					DEBUG_TRACE("Substitute script %s serving path %s",
 					            tmp_str,
 					            filename);
 
 					/* this index file is a script */
-					char *tmp_str2 = mg_strdup(filename + sep_pos + 1);
+					tmp_str2 = mg_strdup(filename + sep_pos + 1);
 					mg_snprintf(conn,
 					            &truncated,
 					            filename,

+ 20 - 0
test/delayed.cgi

@@ -0,0 +1,20 @@
+#!/bin/sh
+
+sleep 2
+
+echo "Content-Type: text/plain"
+
+sleep 2
+
+echo
+
+sleep 2
+
+echo "Query string:"
+
+sleep 2
+
+echo $QUERY_STRING
+
+sleep 2
+

+ 1 - 0
test/hello.cgi

@@ -3,4 +3,5 @@
 echo "Content-Type: text/plain"
 echo
 
+echo "Query string:"
 echo $QUERY_STRING