gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r23886 - gnunet/src/transport
Date: Tue, 18 Sep 2012 15:32:46 +0200

Author: wachs
Date: 2012-09-18 15:32:46 +0200 (Tue, 18 Sep 2012)
New Revision: 23886

Modified:
   gnunet/src/transport/gnunet-service-transport.c
   gnunet/src/transport/plugin_transport_http_client.c
   gnunet/src/transport/test_transport_api_http_reverse_peer1.conf
Log:
- fixes for http reverse proxying


Modified: gnunet/src/transport/gnunet-service-transport.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport.c     2012-09-18 13:29:39 UTC 
(rev 23885)
+++ gnunet/src/transport/gnunet-service-transport.c     2012-09-18 13:32:46 UTC 
(rev 23886)
@@ -579,6 +579,7 @@
     GNUNET_CRYPTO_rsa_key_free (GST_my_private_key);
     GST_my_private_key = NULL;
   }
+  GST_server = NULL;
 }
 
 
@@ -644,7 +645,10 @@
                         &neighbours_address_notification);
   GST_clients_start (GST_server);
   GST_validation_start ();
-  GNUNET_SERVER_resume (GST_server);
+  GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+              _("SERVER %p\n"), GST_server);
+  if (NULL != GST_server)
+    GNUNET_SERVER_resume (GST_server);
 }
 
 

Modified: gnunet/src/transport/plugin_transport_http_client.c
===================================================================
--- gnunet/src/transport/plugin_transport_http_client.c 2012-09-18 13:29:39 UTC 
(rev 23885)
+++ gnunet/src/transport/plugin_transport_http_client.c 2012-09-18 13:32:46 UTC 
(rev 23886)
@@ -988,6 +988,7 @@
 {
   struct HTTP_Client_Plugin *plugin = cls;
   int running;
+  int http_statuscode;
   CURLMcode mret;
 
   GNUNET_assert (cls != NULL);
@@ -1033,27 +1034,46 @@
       GNUNET_assert (s != NULL);
       if (msg->msg == CURLMSG_DONE)
       {
+        curl_easy_getinfo (easy_h, CURLINFO_RESPONSE_CODE, &http_statuscode);
         if (easy_h == s->client_put)
         {
-            GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
-                "Session %p/connection %p: PUT connection to `%s' ended with 
reason %i: `%s'\n",
-                s, msg->easy_handle, GNUNET_i2s (&s->target),
-                msg->data.result,
-                curl_easy_strerror (msg->data.result));
+            if  ((0 != msg->data.result) || (http_statuscode != 200))
+            {
+                GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
+                  "Session %p/connection %p: PUT connection to `%s' ended with 
status %i reason %i: `%s'\n",
+                  s, msg->easy_handle, GNUNET_i2s (&s->target),
+                  http_statuscode,
+                  msg->data.result,
+                  curl_easy_strerror (msg->data.result));
+            }
+            else
+              GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
+                "Session %p/connection %p: PUT connection to `%s' ended 
normal\n",
+                s, msg->easy_handle, GNUNET_i2s (&s->target));
             if (s->client_get == NULL)
             {
               /* Disconnect other transmission direction and tell transport */
-              //client_disconnect (s);
             }
+            curl_multi_remove_handle(plugin->curl_multi_handle, easy_h);
+            curl_easy_cleanup(easy_h);
+            s->client_put = NULL;
         }
         if (easy_h == s->client_get)
         {
-            GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
-                "Session %p/connection %p: GET connection to `%s' ended with 
reason %i: `%s'\n",
+            if  ((0 != msg->data.result) || (http_statuscode != 200))
+            {
+              GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
+                "Session %p/connection %p: GET connection to `%s' ended with 
status %i reason %i: `%s'\n",
                 s, msg->easy_handle, GNUNET_i2s (&s->target),
+                http_statuscode,
                 msg->data.result,
                 curl_easy_strerror (msg->data.result));
 
+            }
+            else
+              GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
+                "Session %p/connection %p: GET connection to `%s' ended 
normal\n",
+                s, msg->easy_handle, GNUNET_i2s (&s->target));
             /* Disconnect other transmission direction and tell transport */
             client_disconnect (s);
         }
@@ -1113,7 +1133,8 @@
 {
   CURLMcode mret;
   /* create put connection */
-  s->client_put = curl_easy_init ();
+  if (NULL == s->client_put)
+    s->client_put = curl_easy_init ();
 #if VERBOSE_CURL
   curl_easy_setopt (s->client_put, CURLOPT_VERBOSE, 1L);
   curl_easy_setopt (s->client_put, CURLOPT_DEBUGFUNCTION, &client_log);

Modified: gnunet/src/transport/test_transport_api_http_reverse_peer1.conf
===================================================================
--- gnunet/src/transport/test_transport_api_http_reverse_peer1.conf     
2012-09-18 13:29:39 UTC (rev 23885)
+++ gnunet/src/transport/test_transport_api_http_reverse_peer1.conf     
2012-09-18 13:32:46 UTC (rev 23886)
@@ -32,3 +32,11 @@
 PREFIX = valgrind --leak-check=full
 #PREFIX = xterm -geometry 100x85 -T peer1 -e gdb --args
 
+
+[ats]
+#DEBUG = YES
+WAN_QUOTA_IN = unlimited
+WAN_QUOTA_OUT = unlimited
+PORT = 12006
+UNIXPATH = /tmp/gnunet-http_reserver_p1-service-ats.sock
+




reply via email to

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