minor changes, with any luck test cases will pass (literally luck though)
authorNathan S. Evans <evans@in.tum.de>
Thu, 4 Feb 2010 10:50:24 +0000 (10:50 +0000)
committerNathan S. Evans <evans@in.tum.de>
Thu, 4 Feb 2010 10:50:24 +0000 (10:50 +0000)
src/core/core_api.c
src/core/test_core_api_peer1.conf
src/core/test_core_api_peer2.conf

index 77c13db86cb2155f5c30bff894f9e86cb8b92b97..d875157410b8dd7f276734b7065b5adbff05e51c 100644 (file)
@@ -309,7 +309,10 @@ request_start (void *cls, size_t size, void *buf)
   struct GNUNET_CORE_Handle *h = cls;
   struct GNUNET_CORE_TransmitHandle *th;
   size_t ret;
-
+#if DEBUG_CORE
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "request_start called\n");
+#endif
   h->th = NULL;
   th = h->pending_head;
   if (buf == NULL)
@@ -348,7 +351,11 @@ trigger_next_request (struct GNUNET_CORE_Handle *h)
   struct GNUNET_CORE_TransmitHandle *th;
 
   if (h->currently_down)
-    return;                     /* connection temporarily down */
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                  "\nIn trigger_next_request, connection currently down...\n");
+      return;                     /* connection temporarily down */
+    }
   if (NULL == (th = h->pending_head))
     return;                     /* no requests pending */
   GNUNET_assert (NULL == h->th);
@@ -845,12 +852,17 @@ produce_send (void *cls, size_t size, void *buf)
   dt = notify (notify_cls, size - sizeof (struct SendMessage), &sm[1]);
   if (0 == dt)
     {
+#if DEBUG_CORE
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Size of clients message to peer %s is 0!\n",
+              GNUNET_i2s(&th->peer));
+#endif
       /* client decided to send nothing! */
       return 0;
     }
   GNUNET_assert (dt >= sizeof (struct GNUNET_MessageHeader));
   sm->header.size = htons (dt + sizeof (struct SendMessage));
-  GNUNET_assert (dt + sizeof (struct SendMessage) < size);
+  GNUNET_assert (dt + sizeof (struct SendMessage) <= size);
   return dt + sizeof (struct SendMessage);
 }
 
index 42533cebb126be9ab0454ff05b9051ba38835192..e1a1bb9ed4bb773b622336abf97838576b145f10 100644 (file)
@@ -10,7 +10,8 @@ PORT = 12464
 PORT = 12465
 PLUGINS = tcp
 #PREFIX = xterm -T transport1 -e
-#PREFIX = xterm -T transport1 -e gdb -x cmd --args
+#PREFIX= xterm -e xterm -T transport1 -e gdb --args
+#PREFIX = xterm -T transport1 -e gdb --args
 #PREFIX = xterm -T transport1 -e valgrind --tool=memcheck
 DEBUG = YES
 
@@ -37,7 +38,7 @@ PORT = 12469
 PORT = 12470
 #PREFIX = xterm -T core1 -e valgrind --tool=memcheck
 #OPTIONS = -l log-core-1
-#PREFIX = xterm -T core1 -e gdb -x cmd --args
+#PREFIX = xterm -e xterm -T core1 -e gdb --args
 #PREFIX = xterm -T core1 -e 
 DEBUG = YES
 
index 2d27bf6c54bc6f642e94ff265a32db00698ced43..fd0521543d8b31587217a117db034143875990ad 100644 (file)
@@ -9,6 +9,8 @@ PORT = 22464
 [transport]
 PORT = 22465
 PLUGINS = tcp
+#PREFIX = xterm -T transport2 -e gdb --args
+#PREFIX = xterm -e xterm -T transport2 -e gdb --args
 #PREFIX = xterm -T transport2 -e
 #PREFIX = xterm -T transport2 -e valgrind --tool=memcheck
 DEBUG = YES