aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2010-09-03 15:32:39 +0000
committerNathan S. Evans <evans@in.tum.de>2010-09-03 15:32:39 +0000
commit03b0d533b3394b41065c9b69764c665058657f56 (patch)
tree275c6c86fe8ea01d1d8e33a1698cbde9573cdb40 /src/core
parent734f4aaaeb4613414ddf00d0f86335d0a262c67a (diff)
downloadgnunet-03b0d533b3394b41065c9b69764c665058657f56.tar.gz
gnunet-03b0d533b3394b41065c9b69764c665058657f56.zip
niceties
Diffstat (limited to 'src/core')
-rw-r--r--src/core/gnunet-service-core.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/core/gnunet-service-core.c b/src/core/gnunet-service-core.c
index 2fc7a1350..e715e768a 100644
--- a/src/core/gnunet-service-core.c
+++ b/src/core/gnunet-service-core.c
@@ -2243,7 +2243,7 @@ handle_client_send (void *cls,
2243 if (msize < 2243 if (msize <
2244 sizeof (struct SendMessage) + sizeof (struct GNUNET_MessageHeader)) 2244 sizeof (struct SendMessage) + sizeof (struct GNUNET_MessageHeader))
2245 { 2245 {
2246 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "about to assert fail, msize is %d, should be less than %d\n", msize, sizeof (struct SendMessage) + sizeof (struct GNUNET_MessageHeader)); 2246 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "about to assert fail, msize is %d, should be at least %d\n", msize, sizeof (struct SendMessage) + sizeof (struct GNUNET_MessageHeader));
2247 GNUNET_break (0); 2247 GNUNET_break (0);
2248 if (client != NULL) 2248 if (client != NULL)
2249 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); 2249 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
@@ -2367,6 +2367,13 @@ notify_transport_connect_done (void *cls, size_t size, void *buf)
2367{ 2367{
2368 struct Neighbour *n = cls; 2368 struct Neighbour *n = cls;
2369 2369
2370 if (GNUNET_YES != n->is_connected)
2371 {
2372 /* transport should only call us to transmit a message after
2373 * telling us about a successful connection to the respective peer */
2374 GNUNET_break (0);
2375 return 0;
2376 }
2370 n->th = NULL; 2377 n->th = NULL;
2371 if (buf == NULL) 2378 if (buf == NULL)
2372 { 2379 {
@@ -2416,14 +2423,20 @@ handle_client_request_connect (void *cls,
2416 n = create_neighbour (&cm->peer); 2423 n = create_neighbour (&cm->peer);
2417 if ( (GNUNET_YES == n->is_connected) || 2424 if ( (GNUNET_YES == n->is_connected) ||
2418 (n->th != NULL) ) 2425 (n->th != NULL) )
2419 return; /* already connected, or at least trying */ 2426 {
2427 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2428 "Core received `%s' request for `%4s', already connected!\n",
2429 "REQUEST_CONNECT",
2430 GNUNET_i2s (&cm->peer));
2431 return; /* already connected, or at least trying */
2432 }
2420 GNUNET_STATISTICS_update (stats, gettext_noop ("# connection requests received"), 1, GNUNET_NO); 2433 GNUNET_STATISTICS_update (stats, gettext_noop ("# connection requests received"), 1, GNUNET_NO);
2421#if DEBUG_CORE 2434
2422 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2435 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2423 "Core received `%s' request for `%4s', will try to establish connection\n", 2436 "Core received `%s' request for `%4s', will try to establish connection\n",
2424 "REQUEST_CONNECT", 2437 "REQUEST_CONNECT",
2425 GNUNET_i2s (&cm->peer)); 2438 GNUNET_i2s (&cm->peer));
2426#endif 2439
2427 timeout = GNUNET_TIME_relative_ntoh (cm->timeout); 2440 timeout = GNUNET_TIME_relative_ntoh (cm->timeout);
2428 /* ask transport to connect to the peer */ 2441 /* ask transport to connect to the peer */
2429 n->th = GNUNET_TRANSPORT_notify_transmit_ready (transport, 2442 n->th = GNUNET_TRANSPORT_notify_transmit_ready (transport,
@@ -3067,7 +3080,7 @@ handle_set_key (struct Neighbour *n, const struct SetKeyMessage *m)
3067 &my_identity, 3080 &my_identity,
3068 sizeof (struct GNUNET_PeerIdentity))) 3081 sizeof (struct GNUNET_PeerIdentity)))
3069 { 3082 {
3070 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 3083 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3071 _("Received `%s' message that was for `%s', not for me. Ignoring.\n"), 3084 _("Received `%s' message that was for `%s', not for me. Ignoring.\n"),
3072 "SET_KEY", 3085 "SET_KEY",
3073 GNUNET_i2s (&m->target)); 3086 GNUNET_i2s (&m->target));
@@ -3764,8 +3777,9 @@ handle_transport_notify_disconnect (void *cls,
3764 3777
3765#if DEBUG_CORE 3778#if DEBUG_CORE
3766 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3779 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3767 "Peer `%4s' disconnected from us.\n", GNUNET_i2s (peer)); 3780 "Peer `%4s' disconnected from us; received notification from transport.\n", GNUNET_i2s (peer));
3768#endif 3781#endif
3782
3769 n = find_neighbour (peer); 3783 n = find_neighbour (peer);
3770 if (n == NULL) 3784 if (n == NULL)
3771 { 3785 {