aboutsummaryrefslogtreecommitdiff
path: root/src/core/gnunet-service-core_clients.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-10-11 11:19:37 +0000
committerChristian Grothoff <christian@grothoff.org>2011-10-11 11:19:37 +0000
commit27dc0bfe8529724621ad29c07ca9f17e6be03918 (patch)
tree60104839a0c5fe141e0bf5dce04d16a09b5c9a6e /src/core/gnunet-service-core_clients.c
parent618488e70f1d726cd6fc40c86ca627a4d7610d3a (diff)
downloadgnunet-27dc0bfe8529724621ad29c07ca9f17e6be03918.tar.gz
gnunet-27dc0bfe8529724621ad29c07ca9f17e6be03918.zip
fix
Diffstat (limited to 'src/core/gnunet-service-core_clients.c')
-rw-r--r--src/core/gnunet-service-core_clients.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/src/core/gnunet-service-core_clients.c b/src/core/gnunet-service-core_clients.c
index 2b1c5fe59..838fa42db 100644
--- a/src/core/gnunet-service-core_clients.c
+++ b/src/core/gnunet-service-core_clients.c
@@ -220,10 +220,10 @@ send_to_all_clients (const struct GNUNET_MessageHeader *msg,
220 ( (0 != (options & GNUNET_CORE_OPTION_SEND_FULL_INBOUND)) && 220 ( (0 != (options & GNUNET_CORE_OPTION_SEND_FULL_INBOUND)) &&
221 (GNUNET_YES == type_match (type, c)) ) ) ) 221 (GNUNET_YES == type_match (type, c)) ) ) )
222 continue; /* skip */ 222 continue; /* skip */
223#if DEBUG_CORE > 1 223#if DEBUG_CORE
224 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 224 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
225 "Sending message of type %u to client.\n", 225 "Sending message to all clients interested in messages of type %u.\n",
226 (unsigned int) ntohs (msg->type)); 226 (unsigned int) type);
227#endif 227#endif
228 send_to_client (c, msg, can_drop); 228 send_to_client (c, msg, can_drop);
229 } 229 }
@@ -323,6 +323,11 @@ handle_client_send_request (void *cls, struct GNUNET_SERVER_Client *client,
323 } 323 }
324 if (c->requests == NULL) 324 if (c->requests == NULL)
325 c->requests = GNUNET_CONTAINER_multihashmap_create (16); 325 c->requests = GNUNET_CONTAINER_multihashmap_create (16);
326#if DEBUG_CORE
327 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
328 "Client asked for transmission to `%s'\n",
329 GNUNET_i2s (&req->peer));
330#endif
326 car = GNUNET_CONTAINER_multihashmap_get (c->requests, &req->peer.hashPubKey); 331 car = GNUNET_CONTAINER_multihashmap_get (c->requests, &req->peer.hashPubKey);
327 if (car == NULL) 332 if (car == NULL)
328 { 333 {
@@ -417,6 +422,13 @@ handle_client_send (void *cls, struct GNUNET_SERVER_Client *client,
417 &sm->peer.hashPubKey, 422 &sm->peer.hashPubKey,
418 tc.car)); 423 tc.car));
419 tc.cork = ntohl (sm->cork); 424 tc.cork = ntohl (sm->cork);
425#if DEBUG_CORE
426 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
427 "Client asked for transmission of %u bytes to `%s' %s\n",
428 msize,
429 GNUNET_i2s (&sm->peer),
430 tc.cork ? "now" : "");
431#endif
420 GNUNET_SERVER_mst_receive (client_mst, 432 GNUNET_SERVER_mst_receive (client_mst,
421 &tc, 433 &tc,
422 (const char*) &sm[1], msize, 434 (const char*) &sm[1], msize,
@@ -450,6 +462,11 @@ client_tokenizer_callback (void *cls, void *client,
450 if (0 == 462 if (0 ==
451 memcmp (&car->target, &GSC_my_identity, sizeof (struct GNUNET_PeerIdentity))) 463 memcmp (&car->target, &GSC_my_identity, sizeof (struct GNUNET_PeerIdentity)))
452 { 464 {
465#if DEBUG_CORE
466 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
467 "Delivering message of type %u to myself\n",
468 ntohs (message->type));
469#endif
453 GSC_CLIENTS_deliver_message (&GSC_my_identity, 470 GSC_CLIENTS_deliver_message (&GSC_my_identity,
454 NULL, 0, 471 NULL, 0,
455 message, 472 message,
@@ -462,7 +479,15 @@ client_tokenizer_callback (void *cls, void *client,
462 GNUNET_CORE_OPTION_SEND_HDR_INBOUND | GNUNET_CORE_OPTION_SEND_HDR_OUTBOUND); 479 GNUNET_CORE_OPTION_SEND_HDR_INBOUND | GNUNET_CORE_OPTION_SEND_HDR_OUTBOUND);
463 } 480 }
464 else 481 else
482 {
483#if DEBUG_CORE
484 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
485 "Delivering message of type %u to %s\n",
486 ntohs (message->type),
487 GNUNET_i2s (&car->target));
488#endif
465 GSC_SESSIONS_transmit (car, message, tc->cork); 489 GSC_SESSIONS_transmit (car, message, tc->cork);
490 }
466} 491}
467 492
468 493