gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r6680 - in libmicrohttpd: . src/daemon src/testcurl


From: gnunet
Subject: [GNUnet-SVN] r6680 - in libmicrohttpd: . src/daemon src/testcurl
Date: Sat, 12 Apr 2008 15:16:30 -0600 (MDT)

Author: grothoff
Date: 2008-04-12 15:16:28 -0600 (Sat, 12 Apr 2008)
New Revision: 6680

Modified:
   libmicrohttpd/ChangeLog
   libmicrohttpd/src/daemon/connection.c
   libmicrohttpd/src/testcurl/daemontest_long_header.c
Log:
msgs

Modified: libmicrohttpd/ChangeLog
===================================================================
--- libmicrohttpd/ChangeLog     2008-04-12 20:49:59 UTC (rev 6679)
+++ libmicrohttpd/ChangeLog     2008-04-12 21:16:28 UTC (rev 6680)
@@ -1,3 +1,15 @@
+Sat Apr 12 15:14:05 MDT 2008
+        Restructured the code (curl-testcases and zzuf testcases
+        are now in different directories; code examples are in
+        src/examples/).
+        Fixed a problem (introduced in 0.2.3) with handling very 
+        large requests (the code did not return proper error code).
+        If "--enable-messages" is specified, the code now includes
+        reasonable default HTML webpages for various build-in
+        errors (such as request too large and malformed requests).
+        Without that flag, the webpages returned will still be
+        empty.
+
 Fri Apr 11 20:20:34 MDT 2008
         I hereby dub libmicrohttpd a GNU package. -Richard Stallman
 

Modified: libmicrohttpd/src/daemon/connection.c
===================================================================
--- libmicrohttpd/src/daemon/connection.c       2008-04-12 20:49:59 UTC (rev 
6679)
+++ libmicrohttpd/src/daemon/connection.c       2008-04-12 21:16:28 UTC (rev 
6680)
@@ -50,7 +50,11 @@
  * Intentionally empty here to keep our memory footprint
  * minimal.
  */
+#if HAVE_MESSAGES
+#define REQUEST_TOO_BIG "<html><head><title>Request too 
big</title></head><body>Your HTTP header was too big for the memory constraints 
of this webserver.</body></html>"
+#else
 #define REQUEST_TOO_BIG ""
+#endif
 
 /**
  * Response text used when the request (http header) does not
@@ -59,7 +63,11 @@
  * Intentionally empty here to keep our memory footprint
  * minimal.
  */
+#if HAVE_MESSAGES
+#define REQUEST_LACKS_HOST "<html><head><title>&quot;Host:&quot; header 
required</title></head><body>In HTTP 1.1, requests must include a 
&quot;Host:&quot; header, and your HTTP 1.1 request lacked such a 
header.</body></html>"
+#else
 #define REQUEST_LACKS_HOST ""
+#endif
 
 /**
  * Response text used when the request (http header) is
@@ -68,7 +76,11 @@
  * Intentionally empty here to keep our memory footprint
  * minimal.
  */
+#if HAVE_MESSAGES
+#define REQUEST_MALFORMED "<html><head><title>Request 
malformed</title></head><body>Your HTTP request was syntactically 
incorrect.</body></html>"
+#else
 #define REQUEST_MALFORMED ""
+#endif
 
 #define EXTRA_CHECKS MHD_YES
 
@@ -1627,6 +1639,8 @@
           line = get_next_header_line (connection);
           if (line == NULL)
            {
+             if (connection->state != MHD_CONNECTION_INIT)
+               continue;
              if (connection->read_closed)
                {
                  connection->state = MHD_CONNECTION_CLOSED;
@@ -1643,6 +1657,8 @@
           line = get_next_header_line (connection);
           if (line == NULL)
            {
+             if (connection->state != MHD_CONNECTION_URL_RECEIVED)
+               continue;
              if (connection->read_closed)
                {
                  connection->state = MHD_CONNECTION_CLOSED;
@@ -1668,6 +1684,8 @@
           line = get_next_header_line (connection);
           if (line == NULL)
            {
+             if (connection->state != MHD_CONNECTION_HEADER_PART_RECEIVED)
+               continue;
              if (connection->read_closed)
                {
                  connection->state = MHD_CONNECTION_CLOSED;
@@ -1734,6 +1752,8 @@
           line = get_next_header_line (connection);
           if (line == NULL)
            {
+             if (connection->state != MHD_CONNECTION_BODY_RECEIVED)
+               continue;
              if (connection->read_closed)
                {
                  connection->state = MHD_CONNECTION_CLOSED;
@@ -1759,6 +1779,8 @@
           line = get_next_header_line (connection);
           if (line == NULL)
            {
+             if (connection->state != MHD_CONNECTION_FOOTER_PART_RECEIVED)
+               continue;
              if (connection->read_closed)
                {
                  connection->state = MHD_CONNECTION_CLOSED;

Modified: libmicrohttpd/src/testcurl/daemontest_long_header.c
===================================================================
--- libmicrohttpd/src/testcurl/daemontest_long_header.c 2008-04-12 20:49:59 UTC 
(rev 6679)
+++ libmicrohttpd/src/testcurl/daemontest_long_header.c 2008-04-12 21:16:28 UTC 
(rev 6680)
@@ -99,7 +99,7 @@
   cbc.buf = buf;
   cbc.size = 2048;
   cbc.pos = 0;
-  d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY /* | MHD_USE_DEBUG */ ,
+  d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY /* | MHD_USE_DEBUG */,
                         1080,
                         &apc_all,
                         NULL,
@@ -219,7 +219,7 @@
   MHD_stop_daemon (d);
   free (url);
   if (code != MHD_HTTP_REQUEST_ENTITY_TOO_LARGE)
-    return 128;
+    return 128;    
   return 0;
 }
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]