added fix
[oweals/gnunet.git] / src / transport / test_quota_compliance.c
index a4a6692f06b7c2de192ec17345f1f20cd32986db..5b070f48b3167c44d8cc1f4423fdc67a8acb0a26 100644 (file)
@@ -361,7 +361,7 @@ measurement_end (void *cls,
           const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   static int strike_counter;
-  static int failed_measurement_counter;
+  static int failed_measurement_counter = 1;
   unsigned long long  quota_allowed = 0;
   int delta = 0;
 
@@ -415,11 +415,11 @@ measurement_end (void *cls,
                  GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                                  "\nQuota measurement failed and no free strike: %i\n",failed_measurement_counter);
                  end();
+                 return;
          }
          else
                  GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                                  "\nQuota measurement failed and %i free strikes\n",failed_measurement_counter);
-         return;
   }
 
   /* Throughput is bigger than allowed quota + some extra*/
@@ -441,11 +441,11 @@ measurement_end (void *cls,
                  GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                                  "\nQuota measurement failed and no free strike: %i\n",failed_measurement_counter);
                  end();
+                 return;
          }
          else
                  GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                                  "\nQuota measurement failed and %i free strikes\n",failed_measurement_counter);
-         return;
   }
   else
   {
@@ -623,6 +623,11 @@ setup_peer (struct PeerContext *p, const char *cfgname)
   GNUNET_assert (p->th != NULL);
 }
 
+static size_t
+notify_ready_connect (void *cls, size_t size, void *buf)
+{
+  return 0;
+}
 
 static void
 exchange_hello_last (void *cls,
@@ -638,6 +643,14 @@ exchange_hello_last (void *cls,
   GNUNET_assert (GNUNET_OK ==
                  GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *)
                                       message, &me->id));
+
+  GNUNET_assert(NULL != (transmit_handle = GNUNET_TRANSPORT_notify_transmit_ready (p2.th,
+                                          &p1.id,
+                                          sizeof (struct GNUNET_MessageHeader), 0,
+                                          TIMEOUT,
+                                          &notify_ready_connect,
+                                          NULL)));
+
   /* both HELLOs exchanged, get ready to test transmission! */
 }