aboutsummaryrefslogtreecommitdiff
path: root/src/integration-tests/connection_watchdog.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/integration-tests/connection_watchdog.c')
-rw-r--r--src/integration-tests/connection_watchdog.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/integration-tests/connection_watchdog.c b/src/integration-tests/connection_watchdog.c
index a012c0f22..888f38ef5 100644
--- a/src/integration-tests/connection_watchdog.c
+++ b/src/integration-tests/connection_watchdog.c
@@ -117,7 +117,7 @@ static struct TransportPlugin *phead;
117static struct TransportPlugin *ptail; 117static struct TransportPlugin *ptail;
118 118
119 119
120static int 120static int
121map_check_it (void *cls, 121map_check_it (void *cls,
122 const struct GNUNET_PeerIdentity * key, 122 const struct GNUNET_PeerIdentity * key,
123 void *value) 123 void *value)
@@ -138,7 +138,7 @@ map_check_it (void *cls,
138} 138}
139 139
140 140
141static int 141static int
142map_cleanup_it (void *cls, 142map_cleanup_it (void *cls,
143 const struct GNUNET_PeerIdentity * key, 143 const struct GNUNET_PeerIdentity * key,
144 void *value) 144 void *value)
@@ -216,7 +216,7 @@ check_lowlevel_connections (int port, int protocol)
216 char line[1024]; 216 char line[1024];
217 int count = -1; 217 int count = -1;
218 218
219 switch (protocol) 219 switch (protocol)
220 { 220 {
221 case tcp: 221 case tcp:
222#ifdef MINGW 222#ifdef MINGW
@@ -292,7 +292,7 @@ find_plugin (char * name)
292 return cur; 292 return cur;
293} 293}
294 294
295static int 295static int
296stats_check_cb (void *cls, const char *subsystem, 296stats_check_cb (void *cls, const char *subsystem,
297 const char *name, uint64_t value, 297 const char *name, uint64_t value,
298 int is_persistent) 298 int is_persistent)
@@ -412,33 +412,33 @@ struct PONG
412GNUNET_NETWORK_STRUCT_END 412GNUNET_NETWORK_STRUCT_END
413 413
414 414
415static size_t 415static size_t
416send_transport_ping_cb (void *cls, size_t size, void *buf) 416send_transport_ping_cb (void *cls, size_t size, void *buf)
417{ 417{
418 struct PeerContainer * pc = cls; 418 struct PeerContainer * pc = cls;
419 struct PING ping; 419 struct PING ping;
420 size_t mlen = sizeof (struct PING); 420 size_t mlen = sizeof (struct PING);
421 421
422 if (size < mlen) 422 if (size < mlen)
423 { 423 {
424 GNUNET_break (0); 424 GNUNET_break (0);
425 return 0; 425 return 0;
426 } 426 }
427 427
428 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 428 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
429 "Sending transport ping to `%s'\n", GNUNET_i2s (&pc->id)); 429 "Sending transport ping to `%s'\n", GNUNET_i2s (&pc->id));
430 ping.header.size = htons (mlen); 430 ping.header.size = htons (mlen);
431 ping.header.type = htons (1234); 431 ping.header.type = htons (1234);
432 ping.src = htons (0); 432 ping.src = htons (0);
433 433
434 pc->th_ping = NULL; 434 pc->th_ping = NULL;
435 435
436 memcpy (buf, &ping, mlen); 436 memcpy (buf, &ping, mlen);
437 return mlen; 437 return mlen;
438} 438}
439 439
440 440
441static size_t 441static size_t
442send_core_ping_cb (void *cls, size_t size, void *buf) 442send_core_ping_cb (void *cls, size_t size, void *buf)
443{ 443{
444 struct PeerContainer * pc = cls; 444 struct PeerContainer * pc = cls;
@@ -450,21 +450,21 @@ send_core_ping_cb (void *cls, size_t size, void *buf)
450 GNUNET_break (0); 450 GNUNET_break (0);
451 return 0; 451 return 0;
452 } 452 }
453 453
454 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 454 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
455 "Sending core ping to `%s'\n", GNUNET_i2s (&pc->id)); 455 "Sending core ping to `%s'\n", GNUNET_i2s (&pc->id));
456 ping.header.size = htons (mlen); 456 ping.header.size = htons (mlen);
457 ping.header.type = htons (1234); 457 ping.header.type = htons (1234);
458 ping.src = htons (1); 458 ping.src = htons (1);
459 459
460 pc->ch_ping = NULL; 460 pc->ch_ping = NULL;
461 461
462 memcpy (buf, &ping, mlen); 462 memcpy (buf, &ping, mlen);
463 return mlen; 463 return mlen;
464} 464}
465 465
466 466
467static int 467static int
468map_ping_it (void *cls, 468map_ping_it (void *cls,
469 const struct GNUNET_PeerIdentity * key, 469 const struct GNUNET_PeerIdentity * key,
470 void *value) 470 void *value)
@@ -522,7 +522,7 @@ stats_check (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
522} 522}
523 523
524 524
525static size_t 525static size_t
526send_transport_pong_cb (void *cls, size_t size, void *buf) 526send_transport_pong_cb (void *cls, size_t size, void *buf)
527{ 527{
528 struct PeerContainer * pc = cls; 528 struct PeerContainer * pc = cls;
@@ -548,27 +548,27 @@ send_transport_pong_cb (void *cls, size_t size, void *buf)
548} 548}
549 549
550 550
551static size_t 551static size_t
552send_core_pong_cb (void *cls, size_t size, void *buf) 552send_core_pong_cb (void *cls, size_t size, void *buf)
553{ 553{
554 struct PeerContainer * pc = cls; 554 struct PeerContainer * pc = cls;
555 struct PING ping; 555 struct PING ping;
556 size_t mlen = sizeof (struct PING); 556 size_t mlen = sizeof (struct PING);
557 557
558 if (size < mlen) 558 if (size < mlen)
559 { 559 {
560 GNUNET_break (0); 560 GNUNET_break (0);
561 return 0; 561 return 0;
562 } 562 }
563 563
564 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 564 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
565 "Sending core pong to `%s'\n", GNUNET_i2s (&pc->id)); 565 "Sending core pong to `%s'\n", GNUNET_i2s (&pc->id));
566 ping.header.size = htons (mlen); 566 ping.header.size = htons (mlen);
567 ping.header.type = htons (4321); 567 ping.header.type = htons (4321);
568 ping.src = htons (1); 568 ping.src = htons (1);
569 569
570 pc->ch_pong = NULL; 570 pc->ch_pong = NULL;
571 571
572 memcpy (buf, &ping, mlen); 572 memcpy (buf, &ping, mlen);
573 return mlen; 573 return mlen;
574} 574}
@@ -768,7 +768,7 @@ cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
768 768
769 if (NULL != ch) 769 if (NULL != ch)
770 { 770 {
771 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 771 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
772 "Disconnecting from core service\n"); 772 "Disconnecting from core service\n");
773 GNUNET_CORE_disconnect (ch); 773 GNUNET_CORE_disconnect (ch);
774 ch = NULL; 774 ch = NULL;
@@ -822,9 +822,9 @@ transport_notify_disconnect_cb (void *cls,
822 const struct GNUNET_PeerIdentity *peer) 822 const struct GNUNET_PeerIdentity *peer)
823{ 823{
824 GNUNET_assert (transport_connections > 0); 824 GNUNET_assert (transport_connections > 0);
825 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 825 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
826 "TRANSPORT disconnect for peer `%s' (%u total)\n", 826 "TRANSPORT disconnect for peer `%s' (%u total)\n",
827 GNUNET_i2s (peer), 827 GNUNET_i2s (peer),
828 transport_connections); 828 transport_connections);
829 map_disconnect (peer, th); 829 map_disconnect (peer, th);
830 transport_connections --; 830 transport_connections --;
@@ -851,7 +851,7 @@ transport_notify_receive_cb (void *cls,
851 if ((message->size == ntohs (sizeof (struct PING))) && 851 if ((message->size == ntohs (sizeof (struct PING))) &&
852 (message->type == ntohs (1234))) 852 (message->type == ntohs (1234)))
853 { 853 {
854 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 854 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
855 "Received %s %s from peer `%s'\n", 855 "Received %s %s from peer `%s'\n",
856 "TRANSPORT", 856 "TRANSPORT",
857 "PING", 857 "PING",
@@ -877,7 +877,7 @@ transport_notify_receive_cb (void *cls,
877 } 877 }
878} 878}
879 879
880static int 880static int
881core_notify_receive_cb (void *cls, 881core_notify_receive_cb (void *cls,
882 const struct GNUNET_PeerIdentity * peer, 882 const struct GNUNET_PeerIdentity * peer,
883 const struct GNUNET_MessageHeader * message) 883 const struct GNUNET_MessageHeader * message)
@@ -970,7 +970,7 @@ core_disconnect_cb (void *cls,
970 970
971 971
972static void 972static void
973core_init_cb (void *cls, 973core_init_cb (void *cls,
974 const struct GNUNET_PeerIdentity *my_identity) 974 const struct GNUNET_PeerIdentity *my_identity)
975{ 975{
976 my_peer_id = *my_identity; 976 my_peer_id = *my_identity;