(no commit message)
authorMatthias Wachs <wachs@net.in.tum.de>
Mon, 14 Jun 2010 14:22:10 +0000 (14:22 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Mon, 14 Jun 2010 14:22:10 +0000 (14:22 +0000)
src/transport/plugin_transport_http.c
src/transport/test_plugin_transport_http.c

index 104f8de03e5a67d5b590a1894dea9ec49120676c..fd813b75fc0555f1f9b990b705d51b35b6daa161 100644 (file)
@@ -538,7 +538,7 @@ accessHandlerCallback (void *cls,
         if ( GNUNET_YES  == res)
         {
           /* existing session for this address found */
-          GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Session `%s' found\n",address);
+          GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Session for peer `%s' found\n",GNUNET_i2s(&cs->sender));
           break;
         }
         cs = cs->next;
@@ -1017,7 +1017,7 @@ static void send_execute (void *cls,
                   else
                   {
                     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                                "Send to %s completed.\n", cs->ip);
+                                "Send to peer `%s' completed.\n", GNUNET_i2s(&cs->sender));
                     if (GNUNET_OK != remove_http_message(cs, cs->pending_outbound_msg))
                       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Message could not be removed from session `%s'", GNUNET_i2s(&cs->sender));
 
@@ -1164,7 +1164,6 @@ http_plugin_send (void *cls,
   {
     /* create new session object */
 
-    /*FIXME: what is const void * really? Assuming struct sockaddr_in * ! */
     ses = create_session(NULL, (struct sockaddr_in *) addr, target);
     ses->is_active = GNUNET_YES;
 
index 5f262bf5ddc5b8872a71e89795d0eba1571bac7a..5540e7fae60dfa8a9b8abbf77639cde84c99ec35 100644 (file)
@@ -324,6 +324,11 @@ static struct HTTP_Transfer test_valid_ident;
  */
 static int fail;
 
+/**
+ * Number of local addresses
+ */
+static unsigned int count_str_addr;
+
 CURL *curl_handle;
 
 /**
@@ -348,7 +353,7 @@ shutdown_clean ()
   /* Evaluate results  */
   if ((fail_notify_address == GNUNET_NO) && (fail_pretty_printer == GNUNET_NO) && (fail_addr_to_str == GNUNET_NO) &&
       (test_no_ident.test_failed == GNUNET_NO) && (test_too_short_ident.test_failed == GNUNET_NO) && (test_too_long_ident.test_failed == GNUNET_NO) &&
-      (test_valid_ident.test_failed == GNUNET_NO) && (fail_transmit_to_local_addrs == GNUNET_NO))
+      (test_valid_ident.test_failed == GNUNET_NO) && (fail_transmit_to_local_addrs == count_str_addr))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Tests successful\n");
     fail = 0;
@@ -420,9 +425,14 @@ static void task_send_cont (void *cls,
     tmp_addr = tmp_addr->next;
   }
 
-  if (cls == tmp_addr)
+  if (cls != NULL)
   {
-    fail_transmit_to_local_addrs = GNUNET_NO;
+    fail_transmit_to_local_addrs++;
+  }
+  if (fail_transmit_to_local_addrs == count_str_addr)
+
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Message sent to %u addresses!\n",fail_transmit_to_local_addrs);
     shutdown_clean();
   }
 
@@ -980,7 +990,7 @@ run (void *cls,
   struct Plugin_Address * cur;
   const char * addr_str;
 
-  unsigned int count_str_addr;
+
   unsigned int suggest_res;
 
   fail_pretty_printer = GNUNET_YES;