From 2c915e1775603c6bad5b78fe5c5e01984054958b Mon Sep 17 00:00:00 2001 From: Carlo von lynX Date: Tue, 9 Aug 2016 10:00:31 +0000 Subject: GNUNET_CADET_close_port doesnt work as expected. Bailing out instead. --- src/cadet/gnunet-cadet.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src/cadet/gnunet-cadet.c') diff --git a/src/cadet/gnunet-cadet.c b/src/cadet/gnunet-cadet.c index 53c0f2e47..ae8829cd9 100644 --- a/src/cadet/gnunet-cadet.c +++ b/src/cadet/gnunet-cadet.c @@ -401,15 +401,22 @@ channel_incoming (void *cls, enum GNUNET_CADET_ChannelOption options) { GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, - "Incoming channel %p from %s on port %s\n", - channel, GNUNET_i2s_full (initiator), GNUNET_h2s (port)); + "Connected from %s\n", + GNUNET_i2s_full (initiator)); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Incoming channel %p on port %s\n", + channel, GNUNET_h2s (port)); if (NULL != ch) { GNUNET_break (0); GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "A channel already exists (%p)\n", ch); - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Incoming channel %p on port %s\n", channel, GNUNET_h2s (port)); + /* + * From now on multiple channels will be sending data to us + * making the service of this command unpredictable in its + * current implementation. So for now let's just bail out. + */ + GNUNET_SCHEDULER_shutdown(); return NULL; } if (0 == listen_port) @@ -417,6 +424,10 @@ channel_incoming (void *cls, GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Not listening to channels\n"); return NULL; } +#if 0 + // Closing the listen port currently breaks open connections. + // Is this an intentional departure from POSIX socket behavior? + // if (NULL != lp) { /* Now that we have our circuit up and running, let's not * get confused by further incoming connect requests. @@ -424,6 +435,7 @@ channel_incoming (void *cls, GNUNET_CADET_close_port (lp); lp = NULL; } +#endif ch = channel; if (GNUNET_NO == echo) { -- cgit v1.2.3