aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2010-02-04 10:50:24 +0000
committerNathan S. Evans <evans@in.tum.de>2010-02-04 10:50:24 +0000
commitc604393646fddb6c18fc3fe26f40f91d4c0836ce (patch)
tree5f3f84b22f80dcf10865c43e64c0195c1494e6f6 /src
parentb5aa0a257534ae85626811c0426fe27213d4f178 (diff)
downloadgnunet-c604393646fddb6c18fc3fe26f40f91d4c0836ce.tar.gz
gnunet-c604393646fddb6c18fc3fe26f40f91d4c0836ce.zip
minor changes, with any luck test cases will pass (literally luck though)
Diffstat (limited to 'src')
-rw-r--r--src/core/core_api.c18
-rw-r--r--src/core/test_core_api_peer1.conf5
-rw-r--r--src/core/test_core_api_peer2.conf2
3 files changed, 20 insertions, 5 deletions
diff --git a/src/core/core_api.c b/src/core/core_api.c
index 77c13db86..d87515741 100644
--- a/src/core/core_api.c
+++ b/src/core/core_api.c
@@ -309,7 +309,10 @@ request_start (void *cls, size_t size, void *buf)
309 struct GNUNET_CORE_Handle *h = cls; 309 struct GNUNET_CORE_Handle *h = cls;
310 struct GNUNET_CORE_TransmitHandle *th; 310 struct GNUNET_CORE_TransmitHandle *th;
311 size_t ret; 311 size_t ret;
312 312#if DEBUG_CORE
313 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
314 "request_start called\n");
315#endif
313 h->th = NULL; 316 h->th = NULL;
314 th = h->pending_head; 317 th = h->pending_head;
315 if (buf == NULL) 318 if (buf == NULL)
@@ -348,7 +351,11 @@ trigger_next_request (struct GNUNET_CORE_Handle *h)
348 struct GNUNET_CORE_TransmitHandle *th; 351 struct GNUNET_CORE_TransmitHandle *th;
349 352
350 if (h->currently_down) 353 if (h->currently_down)
351 return; /* connection temporarily down */ 354 {
355 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
356 "\nIn trigger_next_request, connection currently down...\n");
357 return; /* connection temporarily down */
358 }
352 if (NULL == (th = h->pending_head)) 359 if (NULL == (th = h->pending_head))
353 return; /* no requests pending */ 360 return; /* no requests pending */
354 GNUNET_assert (NULL == h->th); 361 GNUNET_assert (NULL == h->th);
@@ -845,12 +852,17 @@ produce_send (void *cls, size_t size, void *buf)
845 dt = notify (notify_cls, size - sizeof (struct SendMessage), &sm[1]); 852 dt = notify (notify_cls, size - sizeof (struct SendMessage), &sm[1]);
846 if (0 == dt) 853 if (0 == dt)
847 { 854 {
855#if DEBUG_CORE
856 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
857 "Size of clients message to peer %s is 0!\n",
858 GNUNET_i2s(&th->peer));
859#endif
848 /* client decided to send nothing! */ 860 /* client decided to send nothing! */
849 return 0; 861 return 0;
850 } 862 }
851 GNUNET_assert (dt >= sizeof (struct GNUNET_MessageHeader)); 863 GNUNET_assert (dt >= sizeof (struct GNUNET_MessageHeader));
852 sm->header.size = htons (dt + sizeof (struct SendMessage)); 864 sm->header.size = htons (dt + sizeof (struct SendMessage));
853 GNUNET_assert (dt + sizeof (struct SendMessage) < size); 865 GNUNET_assert (dt + sizeof (struct SendMessage) <= size);
854 return dt + sizeof (struct SendMessage); 866 return dt + sizeof (struct SendMessage);
855} 867}
856 868
diff --git a/src/core/test_core_api_peer1.conf b/src/core/test_core_api_peer1.conf
index 42533cebb..e1a1bb9ed 100644
--- a/src/core/test_core_api_peer1.conf
+++ b/src/core/test_core_api_peer1.conf
@@ -10,7 +10,8 @@ PORT = 12464
10PORT = 12465 10PORT = 12465
11PLUGINS = tcp 11PLUGINS = tcp
12#PREFIX = xterm -T transport1 -e 12#PREFIX = xterm -T transport1 -e
13#PREFIX = xterm -T transport1 -e gdb -x cmd --args 13#PREFIX= xterm -e xterm -T transport1 -e gdb --args
14#PREFIX = xterm -T transport1 -e gdb --args
14#PREFIX = xterm -T transport1 -e valgrind --tool=memcheck 15#PREFIX = xterm -T transport1 -e valgrind --tool=memcheck
15DEBUG = YES 16DEBUG = YES
16 17
@@ -37,7 +38,7 @@ PORT = 12469
37PORT = 12470 38PORT = 12470
38#PREFIX = xterm -T core1 -e valgrind --tool=memcheck 39#PREFIX = xterm -T core1 -e valgrind --tool=memcheck
39#OPTIONS = -l log-core-1 40#OPTIONS = -l log-core-1
40#PREFIX = xterm -T core1 -e gdb -x cmd --args 41#PREFIX = xterm -e xterm -T core1 -e gdb --args
41#PREFIX = xterm -T core1 -e 42#PREFIX = xterm -T core1 -e
42DEBUG = YES 43DEBUG = YES
43 44
diff --git a/src/core/test_core_api_peer2.conf b/src/core/test_core_api_peer2.conf
index 2d27bf6c5..fd0521543 100644
--- a/src/core/test_core_api_peer2.conf
+++ b/src/core/test_core_api_peer2.conf
@@ -9,6 +9,8 @@ PORT = 22464
9[transport] 9[transport]
10PORT = 22465 10PORT = 22465
11PLUGINS = tcp 11PLUGINS = tcp
12#PREFIX = xterm -T transport2 -e gdb --args
13#PREFIX = xterm -e xterm -T transport2 -e gdb --args
12#PREFIX = xterm -T transport2 -e 14#PREFIX = xterm -T transport2 -e
13#PREFIX = xterm -T transport2 -e valgrind --tool=memcheck 15#PREFIX = xterm -T transport2 -e valgrind --tool=memcheck
14DEBUG = YES 16DEBUG = YES