aboutsummaryrefslogtreecommitdiff
path: root/src/consensus
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-03-30 16:28:07 +0000
committerChristian Grothoff <christian@grothoff.org>2013-03-30 16:28:07 +0000
commitb4c0264db5eb1bb842623deb36d4cd474a8f0ccf (patch)
tree2d46d931599a5dd4cefbf0d5017a49cf7e2ae23e /src/consensus
parentb3f4edfdee4d329661c74e5468aaea99f096fadb (diff)
downloadgnunet-b4c0264db5eb1bb842623deb36d4cd474a8f0ccf.tar.gz
gnunet-b4c0264db5eb1bb842623deb36d4cd474a8f0ccf.zip
-this CAN happen, do not crash then
Diffstat (limited to 'src/consensus')
-rw-r--r--src/consensus/gnunet-service-consensus.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/consensus/gnunet-service-consensus.c b/src/consensus/gnunet-service-consensus.c
index 7a9eba671..ebd2d238b 100644
--- a/src/consensus/gnunet-service-consensus.c
+++ b/src/consensus/gnunet-service-consensus.c
@@ -1535,7 +1535,12 @@ listen_cb (void *cls,
1535 const struct GNUNET_PeerIdentity *initiator) 1535 const struct GNUNET_PeerIdentity *initiator)
1536{ 1536{
1537 struct IncomingSocket *incoming; 1537 struct IncomingSocket *incoming;
1538 GNUNET_assert (NULL != socket); 1538
1539 if (NULL == socket)
1540 {
1541 GNUNET_break (0);
1542 return GNUNET_SYSERR;
1543 }
1539 incoming = GNUNET_malloc (sizeof *incoming); 1544 incoming = GNUNET_malloc (sizeof *incoming);
1540 incoming->socket = socket; 1545 incoming->socket = socket;
1541 incoming->peer_id = *initiator; 1546 incoming->peer_id = *initiator;
@@ -2746,14 +2751,16 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, const struct GNUNET_CONFIGU
2746 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task, NULL); 2751 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task, NULL);
2747 2752
2748 listener = GNUNET_STREAM_listen (cfg, GNUNET_APPLICATION_TYPE_CONSENSUS, 2753 listener = GNUNET_STREAM_listen (cfg, GNUNET_APPLICATION_TYPE_CONSENSUS,
2749 listen_cb, NULL, 2754 &listen_cb, NULL,
2750 GNUNET_STREAM_OPTION_END); 2755 GNUNET_STREAM_OPTION_END);
2751 2756
2752 /* we have to wait for the core_startup callback before proceeding with the consensus service startup */ 2757 /* we have to wait for the core_startup callback before proceeding with the consensus service startup */
2753 core = GNUNET_CORE_connect (c, NULL, &core_startup, NULL, NULL, NULL, GNUNET_NO, NULL, GNUNET_NO, core_handlers); 2758 core = GNUNET_CORE_connect (c, NULL,
2759 &core_startup, NULL,
2760 NULL, NULL, GNUNET_NO, NULL,
2761 GNUNET_NO, core_handlers);
2754 GNUNET_assert (NULL != core); 2762 GNUNET_assert (NULL != core);
2755 2763 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "consensus running\n");
2756 GNUNET_log(GNUNET_ERROR_TYPE_INFO, "consensus running\n");
2757} 2764}
2758 2765
2759 2766