diff options
author | Carlo von lynX <lynX@time.to.get.psyced.org> | 2016-08-09 10:00:31 +0000 |
---|---|---|
committer | Carlo von lynX <lynX@time.to.get.psyced.org> | 2016-08-09 10:00:31 +0000 |
commit | 2c915e1775603c6bad5b78fe5c5e01984054958b (patch) | |
tree | e61e259bc7005c1f0187a0413d18e6c9e7b8d761 /src/cadet/gnunet-cadet.c | |
parent | d9fa2fd38959b65f50baa3000ccfdcc0312f0ff7 (diff) | |
download | gnunet-2c915e1775603c6bad5b78fe5c5e01984054958b.tar.gz gnunet-2c915e1775603c6bad5b78fe5c5e01984054958b.zip |
GNUNET_CADET_close_port doesnt work as expected. Bailing out instead.
Diffstat (limited to 'src/cadet/gnunet-cadet.c')
-rw-r--r-- | src/cadet/gnunet-cadet.c | 20 |
1 files changed, 16 insertions, 4 deletions
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, | |||
401 | enum GNUNET_CADET_ChannelOption options) | 401 | enum GNUNET_CADET_ChannelOption options) |
402 | { | 402 | { |
403 | GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, | 403 | GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, |
404 | "Incoming channel %p from %s on port %s\n", | 404 | "Connected from %s\n", |
405 | channel, GNUNET_i2s_full (initiator), GNUNET_h2s (port)); | 405 | GNUNET_i2s_full (initiator)); |
406 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | ||
407 | "Incoming channel %p on port %s\n", | ||
408 | channel, GNUNET_h2s (port)); | ||
406 | if (NULL != ch) | 409 | if (NULL != ch) |
407 | { | 410 | { |
408 | GNUNET_break (0); | 411 | GNUNET_break (0); |
409 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 412 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
410 | "A channel already exists (%p)\n", ch); | 413 | "A channel already exists (%p)\n", ch); |
411 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 414 | /* |
412 | "Incoming channel %p on port %s\n", channel, GNUNET_h2s (port)); | 415 | * From now on multiple channels will be sending data to us |
416 | * making the service of this command unpredictable in its | ||
417 | * current implementation. So for now let's just bail out. | ||
418 | */ | ||
419 | GNUNET_SCHEDULER_shutdown(); | ||
413 | return NULL; | 420 | return NULL; |
414 | } | 421 | } |
415 | if (0 == listen_port) | 422 | if (0 == listen_port) |
@@ -417,6 +424,10 @@ channel_incoming (void *cls, | |||
417 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Not listening to channels\n"); | 424 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Not listening to channels\n"); |
418 | return NULL; | 425 | return NULL; |
419 | } | 426 | } |
427 | #if 0 | ||
428 | // Closing the listen port currently breaks open connections. | ||
429 | // Is this an intentional departure from POSIX socket behavior? | ||
430 | // | ||
420 | if (NULL != lp) { | 431 | if (NULL != lp) { |
421 | /* Now that we have our circuit up and running, let's not | 432 | /* Now that we have our circuit up and running, let's not |
422 | * get confused by further incoming connect requests. | 433 | * get confused by further incoming connect requests. |
@@ -424,6 +435,7 @@ channel_incoming (void *cls, | |||
424 | GNUNET_CADET_close_port (lp); | 435 | GNUNET_CADET_close_port (lp); |
425 | lp = NULL; | 436 | lp = NULL; |
426 | } | 437 | } |
438 | #endif | ||
427 | ch = channel; | 439 | ch = channel; |
428 | if (GNUNET_NO == echo) | 440 | if (GNUNET_NO == echo) |
429 | { | 441 | { |