aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-05-06 01:12:57 +0000
committerChristian Grothoff <christian@grothoff.org>2012-05-06 01:12:57 +0000
commit9fac6b6eefdc9144053f736fd388cb2199a97046 (patch)
tree82740a981b7f6ae973d915aa77797acd9db668b2 /src/core
parent23d8d343d5c70481ecf78ec4fafc698907f3e8a9 (diff)
downloadgnunet-9fac6b6eefdc9144053f736fd388cb2199a97046.tar.gz
gnunet-9fac6b6eefdc9144053f736fd388cb2199a97046.zip
-removing legacy ifdefs, fixing log statements
Diffstat (limited to 'src/core')
-rw-r--r--src/core/gnunet-service-core_clients.c6
-rw-r--r--src/core/gnunet-service-core_neighbours.c14
-rw-r--r--src/core/gnunet-service-core_sessions.c8
3 files changed, 0 insertions, 28 deletions
diff --git a/src/core/gnunet-service-core_clients.c b/src/core/gnunet-service-core_clients.c
index c8e1199b7..2c603d217 100644
--- a/src/core/gnunet-service-core_clients.c
+++ b/src/core/gnunet-service-core_clients.c
@@ -535,11 +535,9 @@ client_tokenizer_callback (void *cls, void *client,
535 } 535 }
536 else 536 else
537 { 537 {
538#if DEBUG_CORE
539 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 538 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
540 "Delivering message of type %u to %s\n", ntohs (message->type), 539 "Delivering message of type %u to %s\n", ntohs (message->type),
541 GNUNET_i2s (&car->target)); 540 GNUNET_i2s (&car->target));
542#endif
543 GSC_CLIENTS_deliver_message (&car->target, NULL, 0, message, 541 GSC_CLIENTS_deliver_message (&car->target, NULL, 0, message,
544 ntohs (message->size), 542 ntohs (message->size),
545 GNUNET_CORE_OPTION_SEND_FULL_OUTBOUND); 543 GNUNET_CORE_OPTION_SEND_FULL_OUTBOUND);
@@ -589,10 +587,8 @@ handle_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client)
589 587
590 if (client == NULL) 588 if (client == NULL)
591 return; 589 return;
592#if DEBUG_CORE
593 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 590 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
594 "Client %p has disconnected from core service.\n", client); 591 "Client %p has disconnected from core service.\n", client);
595#endif
596 c = find_client (client); 592 c = find_client (client);
597 if (c == NULL) 593 if (c == NULL)
598 return; /* client never sent INIT */ 594 return; /* client never sent INIT */
@@ -736,10 +732,8 @@ GSC_CLIENTS_notify_client_about_neighbour (struct GSC_Client *client,
736 cnm->ats_count = htonl (atsi_count); 732 cnm->ats_count = htonl (atsi_count);
737 a = (struct GNUNET_ATS_Information *) &cnm[1]; 733 a = (struct GNUNET_ATS_Information *) &cnm[1];
738 memcpy (a, atsi, sizeof (struct GNUNET_ATS_Information) * atsi_count); 734 memcpy (a, atsi, sizeof (struct GNUNET_ATS_Information) * atsi_count);
739#if DEBUG_CORE
740 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending `%s' message to client.\n", 735 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending `%s' message to client.\n",
741 "NOTIFY_CONNECT"); 736 "NOTIFY_CONNECT");
742#endif
743 cnm->peer = *neighbour; 737 cnm->peer = *neighbour;
744 send_to_client (client, &cnm->header, GNUNET_NO); 738 send_to_client (client, &cnm->header, GNUNET_NO);
745 } 739 }
diff --git a/src/core/gnunet-service-core_neighbours.c b/src/core/gnunet-service-core_neighbours.c
index 538f38283..97737a63a 100644
--- a/src/core/gnunet-service-core_neighbours.c
+++ b/src/core/gnunet-service-core_neighbours.c
@@ -145,11 +145,9 @@ free_neighbour (struct Neighbour *n)
145{ 145{
146 struct NeighbourMessageEntry *m; 146 struct NeighbourMessageEntry *m;
147 147
148#if DEBUG_CORE
149 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 148 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
150 "Destroying neighbour entry for peer `%4s'\n", 149 "Destroying neighbour entry for peer `%4s'\n",
151 GNUNET_i2s (&n->peer)); 150 GNUNET_i2s (&n->peer));
152#endif
153 while (NULL != (m = n->message_head)) 151 while (NULL != (m = n->message_head))
154 { 152 {
155 GNUNET_CONTAINER_DLL_remove (n->message_head, n->message_tail, m); 153 GNUNET_CONTAINER_DLL_remove (n->message_head, n->message_tail, m);
@@ -224,13 +222,11 @@ transmit_ready (void *cls, size_t size, void *buf)
224 GNUNET_CONTAINER_DLL_remove (n->message_head, n->message_tail, m); 222 GNUNET_CONTAINER_DLL_remove (n->message_head, n->message_tail, m);
225 if (buf == NULL) 223 if (buf == NULL)
226 { 224 {
227#if DEBUG_CORE
228 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 225 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
229 "Transmission of message of type %u and size %u failed\n", 226 "Transmission of message of type %u and size %u failed\n",
230 (unsigned int) 227 (unsigned int)
231 ntohs (((struct GNUNET_MessageHeader *) &m[1])->type), 228 ntohs (((struct GNUNET_MessageHeader *) &m[1])->type),
232 (unsigned int) m->size); 229 (unsigned int) m->size);
233#endif
234 GNUNET_free (m); 230 GNUNET_free (m);
235 process_queue (n); 231 process_queue (n);
236 return 0; 232 return 0;
@@ -239,13 +235,11 @@ transmit_ready (void *cls, size_t size, void *buf)
239 GNUNET_assert (size >= m->size); 235 GNUNET_assert (size >= m->size);
240 memcpy (cbuf, &m[1], m->size); 236 memcpy (cbuf, &m[1], m->size);
241 ret = m->size; 237 ret = m->size;
242#if DEBUG_CORE
243 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 238 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
244 "Copied message of type %u and size %u into transport buffer for `%4s'\n", 239 "Copied message of type %u and size %u into transport buffer for `%4s'\n",
245 (unsigned int) 240 (unsigned int)
246 ntohs (((struct GNUNET_MessageHeader *) &m[1])->type), 241 ntohs (((struct GNUNET_MessageHeader *) &m[1])->type),
247 (unsigned int) ret, GNUNET_i2s (&n->peer)); 242 (unsigned int) ret, GNUNET_i2s (&n->peer));
248#endif
249 GNUNET_free (m); 243 GNUNET_free (m);
250 process_queue (n); 244 process_queue (n);
251 GNUNET_STATISTICS_update (GSC_stats, 245 GNUNET_STATISTICS_update (GSC_stats,
@@ -277,13 +271,11 @@ process_queue (struct Neighbour *n)
277 GSC_SESSIONS_solicit (&n->peer); 271 GSC_SESSIONS_solicit (&n->peer);
278 return; 272 return;
279 } 273 }
280#if DEBUG_CORE > 1
281 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 274 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
282 "Asking transport for transmission of %u bytes to `%4s' in next %llu ms\n", 275 "Asking transport for transmission of %u bytes to `%4s' in next %llu ms\n",
283 (unsigned int) m->size, GNUNET_i2s (&n->peer), 276 (unsigned int) m->size, GNUNET_i2s (&n->peer),
284 (unsigned long long) 277 (unsigned long long)
285 GNUNET_TIME_absolute_get_remaining (m->deadline).rel_value); 278 GNUNET_TIME_absolute_get_remaining (m->deadline).rel_value);
286#endif
287 n->th = 279 n->th =
288 GNUNET_TRANSPORT_notify_transmit_ready (transport, &n->peer, m->size, 0, 280 GNUNET_TRANSPORT_notify_transmit_ready (transport, &n->peer, m->size, 0,
289 GNUNET_TIME_absolute_get_remaining 281 GNUNET_TIME_absolute_get_remaining
@@ -330,10 +322,8 @@ handle_transport_notify_connect (void *cls,
330 GNUNET_break (0); 322 GNUNET_break (0);
331 return; 323 return;
332 } 324 }
333#if DEBUG_CORE
334 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received connection from `%4s'.\n", 325 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received connection from `%4s'.\n",
335 GNUNET_i2s (peer)); 326 GNUNET_i2s (peer));
336#endif
337 n = GNUNET_malloc (sizeof (struct Neighbour)); 327 n = GNUNET_malloc (sizeof (struct Neighbour));
338 n->peer = *peer; 328 n->peer = *peer;
339 GNUNET_assert (GNUNET_OK == 329 GNUNET_assert (GNUNET_OK ==
@@ -361,11 +351,9 @@ handle_transport_notify_disconnect (void *cls,
361{ 351{
362 struct Neighbour *n; 352 struct Neighbour *n;
363 353
364#if DEBUG_CORE
365 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 354 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
366 "Peer `%4s' disconnected from us; received notification from transport.\n", 355 "Peer `%4s' disconnected from us; received notification from transport.\n",
367 GNUNET_i2s (peer)); 356 GNUNET_i2s (peer));
368#endif
369 n = find_neighbour (peer); 357 n = find_neighbour (peer);
370 if (n == NULL) 358 if (n == NULL)
371 { 359 {
@@ -394,11 +382,9 @@ handle_transport_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
394 struct Neighbour *n; 382 struct Neighbour *n;
395 uint16_t type; 383 uint16_t type;
396 384
397#if DEBUG_CORE > 1
398 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 385 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
399 "Received message of type %u from `%4s', demultiplexing.\n", 386 "Received message of type %u from `%4s', demultiplexing.\n",
400 (unsigned int) ntohs (message->type), GNUNET_i2s (peer)); 387 (unsigned int) ntohs (message->type), GNUNET_i2s (peer));
401#endif
402 if (0 == memcmp (peer, &GSC_my_identity, sizeof (struct GNUNET_PeerIdentity))) 388 if (0 == memcmp (peer, &GSC_my_identity, sizeof (struct GNUNET_PeerIdentity)))
403 { 389 {
404 GNUNET_break (0); 390 GNUNET_break (0);
diff --git a/src/core/gnunet-service-core_sessions.c b/src/core/gnunet-service-core_sessions.c
index 1f697cf16..7cb880053 100644
--- a/src/core/gnunet-service-core_sessions.c
+++ b/src/core/gnunet-service-core_sessions.c
@@ -176,10 +176,8 @@ GSC_SESSIONS_end (const struct GNUNET_PeerIdentity *pid)
176 session = find_session (pid); 176 session = find_session (pid);
177 if (NULL == session) 177 if (NULL == session)
178 return; 178 return;
179#if DEBUG_CORE
180 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Destroying session for peer `%4s'\n", 179 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Destroying session for peer `%4s'\n",
181 GNUNET_i2s (&session->peer)); 180 GNUNET_i2s (&session->peer));
182#endif
183 if (GNUNET_SCHEDULER_NO_TASK != session->cork_task) 181 if (GNUNET_SCHEDULER_NO_TASK != session->cork_task)
184 { 182 {
185 GNUNET_SCHEDULER_cancel (session->cork_task); 183 GNUNET_SCHEDULER_cancel (session->cork_task);
@@ -255,10 +253,8 @@ GSC_SESSIONS_create (const struct GNUNET_PeerIdentity *peer,
255{ 253{
256 struct Session *session; 254 struct Session *session;
257 255
258#if DEBUG_CORE
259 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Creating session for peer `%4s'\n", 256 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Creating session for peer `%4s'\n",
260 GNUNET_i2s (peer)); 257 GNUNET_i2s (peer));
261#endif
262 session = GNUNET_malloc (sizeof (struct Session)); 258 session = GNUNET_malloc (sizeof (struct Session));
263 session->tmap = GSC_TYPEMAP_create (); 259 session->tmap = GSC_TYPEMAP_create ();
264 session->peer = *peer; 260 session->peer = *peer;
@@ -341,10 +337,8 @@ GSC_SESSIONS_queue_request (struct GSC_ClientActiveRequest *car)
341 session = find_session (&car->target); 337 session = find_session (&car->target);
342 if (session == NULL) 338 if (session == NULL)
343 { 339 {
344#if DEBUG_CORE
345 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 340 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
346 "Dropped client request for transmission (am disconnected)\n"); 341 "Dropped client request for transmission (am disconnected)\n");
347#endif
348 GNUNET_break (0); /* should have been rejected earlier */ 342 GNUNET_break (0); /* should have been rejected earlier */
349 GSC_CLIENTS_reject_request (car); 343 GSC_CLIENTS_reject_request (car);
350 return; 344 return;
@@ -355,10 +349,8 @@ GSC_SESSIONS_queue_request (struct GSC_ClientActiveRequest *car)
355 GSC_CLIENTS_reject_request (car); 349 GSC_CLIENTS_reject_request (car);
356 return; 350 return;
357 } 351 }
358#if DEBUG_CORE
359 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 352 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
360 "Received client transmission request. queueing\n"); 353 "Received client transmission request. queueing\n");
361#endif
362 GNUNET_CONTAINER_DLL_insert (session->active_client_request_head, 354 GNUNET_CONTAINER_DLL_insert (session->active_client_request_head,
363 session->active_client_request_tail, car); 355 session->active_client_request_tail, car);
364 try_transmission (session); 356 try_transmission (session);