gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r11191 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r11191 - gnunet/src/transport
Date: Wed, 5 May 2010 11:54:57 +0200

Author: wachs
Date: 2010-05-05 11:54:57 +0200 (Wed, 05 May 2010)
New Revision: 11191

Modified:
   gnunet/src/transport/plugin_transport_http.c
Log:


Modified: gnunet/src/transport/plugin_transport_http.c
===================================================================
--- gnunet/src/transport/plugin_transport_http.c        2010-05-05 09:46:08 UTC 
(rev 11190)
+++ gnunet/src/transport/plugin_transport_http.c        2010-05-05 09:54:57 UTC 
(rev 11191)
@@ -48,6 +48,13 @@
 #define HTTP_TIMEOUT 600
 
 /**
+ * Text of the response sent back after the last bytes of a PUT
+ * request have been received (just to formally obey the HTTP
+ * protocol).
+ */
+#define HTTP_PUT_RESPONSE "Thank you!"
+
+/**
  * Encapsulation of all of the state of the plugin.
  */
 struct Plugin;
@@ -274,7 +281,7 @@
 acceptPolicyCallback (void *cls,
                       const struct sockaddr *addr, socklen_t addr_len)
 {
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG," Incoming connection \n");
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Incoming connection \n");
   /* Currently all incoming connections are accepted, so nothing to do here */
   return MHD_YES;
 }
@@ -295,6 +302,8 @@
                        const char *upload_data,
                        size_t * upload_data_size, void **httpSessionCache)
 {
+  struct MHD_Response *response;
+
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"HTTP Daemon has an incoming `%s' 
request from \n",method);
 
   /* Find out if session exists, otherwise create one */
@@ -313,6 +322,11 @@
     GNUNET_STATISTICS_update( plugin->env->stats , gettext_noop("# GET 
requests"), 1, GNUNET_NO);
   }
 
+  response = MHD_create_response_from_data (strlen (HTTP_PUT_RESPONSE),
+                                   HTTP_PUT_RESPONSE, MHD_NO, MHD_NO);
+  MHD_queue_response (session, MHD_HTTP_OK, response);
+  MHD_destroy_response (response);
+
   return MHD_YES;
 }
 
@@ -472,16 +486,10 @@
                                          port,
                                          &acceptPolicyCallback,
                                          NULL, &accessHandlerCallback, NULL,
-                                         MHD_OPTION_CONNECTION_TIMEOUT,
-                                         (unsigned int) HTTP_TIMEOUT,
-                                         MHD_OPTION_CONNECTION_MEMORY_LIMIT,
-                                         (unsigned int) 
GNUNET_SERVER_MAX_MESSAGE_SIZE,
-                                         MHD_OPTION_CONNECTION_LIMIT,
-                                         (unsigned int) 128,
-                                         MHD_OPTION_PER_IP_CONNECTION_LIMIT,
-                                         (unsigned int) 8,
-                                         MHD_OPTION_NOTIFY_COMPLETED,
-                                         &requestCompletedCallback, NULL,
+                                         MHD_OPTION_CONNECTION_LIMIT, 
(unsigned int) 16,
+                                         MHD_OPTION_PER_IP_CONNECTION_LIMIT, 
(unsigned int) 1,
+                                         MHD_OPTION_CONNECTION_TIMEOUT, 
(unsigned int) 16,
+                                         MHD_OPTION_CONNECTION_MEMORY_LIMIT, 
(size_t) (16 * 1024),
                                          MHD_OPTION_END);
         }
       else
@@ -491,16 +499,10 @@
                                          port,
                                          &acceptPolicyCallback,
                                          NULL, &accessHandlerCallback, NULL,
-                                         MHD_OPTION_CONNECTION_TIMEOUT,
-                                         (unsigned int) HTTP_TIMEOUT,
-                                         MHD_OPTION_CONNECTION_MEMORY_LIMIT,
-                                         (unsigned int) 
GNUNET_SERVER_MAX_MESSAGE_SIZE,
-                                         MHD_OPTION_CONNECTION_LIMIT,
-                                         (unsigned int) 128,
-                                         MHD_OPTION_PER_IP_CONNECTION_LIMIT,
-                                         (unsigned int) 8,
-                                         MHD_OPTION_NOTIFY_COMPLETED,
-                                         &requestCompletedCallback, NULL,
+                                         MHD_OPTION_CONNECTION_LIMIT, 
(unsigned int) 16,
+                                         MHD_OPTION_PER_IP_CONNECTION_LIMIT, 
(unsigned int) 1,
+                                         MHD_OPTION_CONNECTION_TIMEOUT, 
(unsigned int) 16,
+                                         MHD_OPTION_CONNECTION_MEMORY_LIMIT, 
(size_t) (16 * 1024),
                                          MHD_OPTION_END);
         }
     }





reply via email to

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