aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2009-06-10 04:28:52 +0000
committerChristian Grothoff <christian@grothoff.org>2009-06-10 04:28:52 +0000
commit1fe97282cb829d6b73c662b8af8d4a7edc0b78ba (patch)
tree4bd9a836a96f4d13a72e6997ec53b434bbfdca8d /src
parent9030612d393e7e6377ec3ddc2ee6812f1a4826bc (diff)
downloadgnunet-1fe97282cb829d6b73c662b8af8d4a7edc0b78ba.tar.gz
gnunet-1fe97282cb829d6b73c662b8af8d4a7edc0b78ba.zip
fixes
Diffstat (limited to 'src')
-rw-r--r--src/core/gnunet-service-core.c19
-rw-r--r--src/core/test_core_api.c2
2 files changed, 14 insertions, 7 deletions
diff --git a/src/core/gnunet-service-core.c b/src/core/gnunet-service-core.c
index 457d3f39b..5996a81bf 100644
--- a/src/core/gnunet-service-core.c
+++ b/src/core/gnunet-service-core.c
@@ -1381,7 +1381,7 @@ select_messages (struct Neighbour *n,
1381 } 1381 }
1382 /* guard against sending "tiny" messages with large headers without 1382 /* guard against sending "tiny" messages with large headers without
1383 urgent deadlines */ 1383 urgent deadlines */
1384 if ((slack > 1000) && (size > 4 * off)) 1384 if ( (slack > 1000) && (size > 4 * off) )
1385 { 1385 {
1386 /* less than 25% of message would be filled with 1386 /* less than 25% of message would be filled with
1387 deadlines still being met if we delay by one 1387 deadlines still being met if we delay by one
@@ -1496,19 +1496,23 @@ discard_expired_messages (struct Neighbour *n)
1496 struct MessageEntry *prev; 1496 struct MessageEntry *prev;
1497 struct MessageEntry *next; 1497 struct MessageEntry *next;
1498 struct MessageEntry *pos; 1498 struct MessageEntry *pos;
1499 struct GNUNET_TIME_Absolute cutoff; 1499 struct GNUNET_TIME_Absolute now;
1500 struct GNUNET_TIME_Relative delta;
1500 1501
1501 cutoff = GNUNET_TIME_relative_to_absolute(PAST_EXPIRATION_DISCARD_TIME); 1502 now = GNUNET_TIME_absolute_get ();
1502 prev = NULL; 1503 prev = NULL;
1503 pos = n->messages; 1504 pos = n->messages;
1504 while (pos != NULL) 1505 while (pos != NULL)
1505 { 1506 {
1506 next = pos->next; 1507 next = pos->next;
1507 if (pos->deadline.value < cutoff.value) 1508 delta = GNUNET_TIME_absolute_get_difference (pos->deadline, now);
1509 if (delta.value > PAST_EXPIRATION_DISCARD_TIME.value)
1508 { 1510 {
1511#if DEBUG_CORE
1509 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 1512 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
1510 "Message is %llu ms past due, discarding.\n", 1513 "Message is %llu ms past due, discarding.\n",
1511 cutoff.value - pos->deadline.value); 1514 delta.value);
1515#endif
1512 if (prev == NULL) 1516 if (prev == NULL)
1513 n->messages = next; 1517 n->messages = next;
1514 else 1518 else
@@ -1781,7 +1785,8 @@ handle_client_send (void *cls,
1781 "Core received `%s' request for `%4s', will try to establish connection within %llu ms\n", 1785 "Core received `%s' request for `%4s', will try to establish connection within %llu ms\n",
1782 "SEND", 1786 "SEND",
1783 GNUNET_i2s (&sm->peer), 1787 GNUNET_i2s (&sm->peer),
1784 sm->deadline.value); 1788 GNUNET_TIME_absolute_get_remaining
1789 (GNUNET_TIME_absolute_ntoh(sm->deadline)).value);
1785#endif 1790#endif
1786 msize += sizeof (struct SendMessage); 1791 msize += sizeof (struct SendMessage);
1787 /* ask transport to connect to the peer */ 1792 /* ask transport to connect to the peer */
@@ -2248,8 +2253,10 @@ handle_set_key (struct Neighbour *n, const struct SetKeyMessage *m)
2248#endif 2253#endif
2249 if (n->public_key == NULL) 2254 if (n->public_key == NULL)
2250 { 2255 {
2256#if DEBUG_CORE
2251 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2257 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2252 "Lacking public key for peer, trying to obtain one.\n"); 2258 "Lacking public key for peer, trying to obtain one.\n");
2259#endif
2253 m_cpy = GNUNET_malloc (sizeof (struct SetKeyMessage)); 2260 m_cpy = GNUNET_malloc (sizeof (struct SetKeyMessage));
2254 memcpy (m_cpy, m, sizeof (struct SetKeyMessage)); 2261 memcpy (m_cpy, m, sizeof (struct SetKeyMessage));
2255 /* lookup n's public key, then try again */ 2262 /* lookup n's public key, then try again */
diff --git a/src/core/test_core_api.c b/src/core/test_core_api.c
index d52b24a4f..8e572a583 100644
--- a/src/core/test_core_api.c
+++ b/src/core/test_core_api.c
@@ -34,7 +34,7 @@
34#include "gnunet_scheduler_lib.h" 34#include "gnunet_scheduler_lib.h"
35#include "gnunet_transport_service.h" 35#include "gnunet_transport_service.h"
36 36
37#define VERBOSE GNUNET_NO 37#define VERBOSE GNUNET_YES
38 38
39#define START_ARM GNUNET_YES 39#define START_ARM GNUNET_YES
40 40