gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r19790 - gnunet/src/transport
Date: Mon, 13 Feb 2012 16:38:33 +0100

Author: wachs
Date: 2012-02-13 16:38:33 +0100 (Mon, 13 Feb 2012)
New Revision: 19790

Modified:
   gnunet/src/transport/gnunet-service-transport_validation.c
   gnunet/src/transport/plugin_transport_http.h
Log:
 new sending in validation


Modified: gnunet/src/transport/gnunet-service-transport_validation.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_validation.c  2012-02-13 
15:27:12 UTC (rev 19789)
+++ gnunet/src/transport/gnunet-service-transport_validation.c  2012-02-13 
15:38:33 UTC (rev 19790)
@@ -481,11 +481,24 @@
     else
     {
       GNUNET_assert (papi->send != NULL);
-      ret =
-          papi->send (papi->cls, pid, message_buf, tsize, PING_PRIORITY,
-                      ACCEPTABLE_PING_DELAY, NULL /* no session */ ,
-                      ve->address->address, ve->address->address_length,
-                      GNUNET_YES, NULL, NULL);
+      GNUNET_assert (papi->get_session != NULL);
+      struct Session * session = papi->get_session(papi->cls, ve->address);
+
+      if (session != NULL)
+      {
+        ret = papi->send_with_session (papi->cls, session,
+                          message_buf, tsize,
+                          PING_PRIORITY, ACCEPTABLE_PING_DELAY,
+                          NULL, NULL);
+      }
+      else
+      {
+        /* Could not get a valid session */
+        GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Could not get a valid session 
for `%s' %s\n",
+                    GNUNET_i2s (pid), GST_plugins_a2s (ve->address));
+        GNUNET_break (0);
+        ret = -1;
+      }
     }
   }
   if (-1 != ret)
@@ -727,10 +740,21 @@
   papi = GST_plugins_find (address->transport_name);
   if (papi == NULL)
     return;
-  (void) papi->send (papi->cls, &address->peer, (const char *) pong,
-                     ntohs (pong->header.size), PONG_PRIORITY,
-                     ACCEPTABLE_PING_DELAY, NULL, address->address,
-                     address->address_length, GNUNET_YES, NULL, NULL);
+
+  GNUNET_assert (papi->send != NULL);
+  GNUNET_assert (papi->get_session != NULL);
+
+  struct Session * session = papi->get_session(papi->cls, address);
+  if (session == NULL)
+  {
+     GNUNET_break (0);
+     return;
+  }
+
+  papi->send_with_session (papi->cls, session,
+              (const char *) pong, ntohs (pong->header.size),
+              PONG_PRIORITY, ACCEPTABLE_PING_DELAY,
+              NULL, NULL);
 }
 
 
@@ -862,11 +886,27 @@
   if (papi == NULL)
     ret = -1;
   else
-    ret =
-        papi->send (papi->cls, sender, (const char *) pong,
-                    ntohs (pong->header.size), PONG_PRIORITY,
-                    ACCEPTABLE_PING_DELAY, session, sender_address->address,
-                    sender_address->address_length, GNUNET_SYSERR, NULL, NULL);
+  {
+    GNUNET_assert (papi->send != NULL);
+    GNUNET_assert (papi->get_session != NULL);
+
+    if ((session == NULL) && (sender_address != NULL))
+    {
+      session = papi->get_session (papi->cls, sender_address);
+    }
+    if (session == NULL)
+    {
+      GNUNET_break (0);
+      ret = -1;
+    }
+    else
+    {
+      ret = papi->send_with_session (papi->cls, session,
+                        (const char *) pong, ntohs (pong->header.size),
+                        PONG_PRIORITY, ACCEPTABLE_PING_DELAY,
+                        NULL, NULL);
+    }
+  }
   if (ret != -1)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,

Modified: gnunet/src/transport/plugin_transport_http.h
===================================================================
--- gnunet/src/transport/plugin_transport_http.h        2012-02-13 15:27:12 UTC 
(rev 19789)
+++ gnunet/src/transport/plugin_transport_http.h        2012-02-13 15:38:33 UTC 
(rev 19790)
@@ -42,10 +42,10 @@
 #include <curl/curl.h>
 
 
-#define DEBUG_HTTP GNUNET_YES
+#define DEBUG_HTTP GNUNET_EXTRA_LOGGING
 #define VERBOSE_SERVER GNUNET_EXTRA_LOGGING
 #define VERBOSE_CLIENT GNUNET_EXTRA_LOGGING
-#define VERBOSE_CURL GNUNET_NO
+#define VERBOSE_CURL GNUNET_EXTRA_LOGGING
 
 #if BUILD_HTTPS
 #define LIBGNUNET_PLUGIN_TRANSPORT_INIT libgnunet_plugin_transport_https_init




reply via email to

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