瀏覽代碼

-add patch from Eugenio Perez

Christian Grothoff 10 年之前
父節點
當前提交
77ffe1508f
共有 2 個文件被更改,包括 8 次插入2 次删除
  1. 3 1
      ChangeLog
  2. 5 1
      src/microhttpd/connection.c

+ 3 - 1
ChangeLog

@@ -1,7 +1,9 @@
 Tue Nov  3 23:24:52 CET 2015
 	Undoing change from Sun Oct 25 15:29:23 CET 2015
 	as the original code was counter-intuitive but
-	correct, and the new code does break pipelining. -CG
+	correct, and the new code does break pipelining.
+	Ignore empty lines at the beginning of an HTTP
+	request (more tolerant implementation). -CG
 	Releasing libmicrohttpd 0.9.45. -CG
 
 Sat Oct 31 15:52:52 CET 2015

+ 5 - 1
src/microhttpd/connection.c

@@ -2227,7 +2227,11 @@ MHD_connection_handle_idle (struct MHD_Connection *connection)
         {
         case MHD_CONNECTION_INIT:
           line = get_next_header_line (connection);
-          if (NULL == line)
+          /* Check for empty string, as we might want
+             to tolerate 'spurious' empty lines; also
+             NULL means we didn't get a full line yet. */
+          if ( (NULL == line) ||
+               (0 == strlen (line) ) )
             {
               if (MHD_CONNECTION_INIT != connection->state)
                 continue;