diff options
author | Bart Polot <bart.polot+voyager@gmail.com> | 2017-02-08 19:41:41 +0100 |
---|---|---|
committer | Bart Polot <bart.polot+voyager@gmail.com> | 2017-02-08 19:41:41 +0100 |
commit | ec05b7e9cef7322f3291c96c278056f387ba574b (patch) | |
tree | 88f5ea07dba42950bddd174e0b73d6556f6527d5 /src/cadet/cadet_api.c | |
parent | 3cfcfa48b5682d4e55e168ffb9c78db9b2d9c351 (diff) | |
download | gnunet-ec05b7e9cef7322f3291c96c278056f387ba574b.tar.gz gnunet-ec05b7e9cef7322f3291c96c278056f387ba574b.zip |
Fix open port, copy handlers for use on incoming channels
Diffstat (limited to 'src/cadet/cadet_api.c')
-rw-r--r-- | src/cadet/cadet_api.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c index e20796d17..7b9ac62b3 100644 --- a/src/cadet/cadet_api.c +++ b/src/cadet/cadet_api.c | |||
@@ -2538,7 +2538,16 @@ GNUNET_CADET_open_porT (struct GNUNET_CADET_Handle *h, | |||
2538 | p->cls = connects_cls; | 2538 | p->cls = connects_cls; |
2539 | p->window_changes = window_changes; | 2539 | p->window_changes = window_changes; |
2540 | p->disconnects = disconnects; | 2540 | p->disconnects = disconnects; |
2541 | p->handlers = handlers; | 2541 | if (NULL != handlers) |
2542 | { | ||
2543 | unsigned int i; | ||
2544 | for (i=0;NULL != handlers[i].cb; i++) ; | ||
2545 | p->handlers = GNUNET_new_array (i + 1, | ||
2546 | struct GNUNET_MQ_MessageHandler); | ||
2547 | GNUNET_memcpy ((struct GNUNET_MQ_MessageHandler *) p->handlers, | ||
2548 | handlers, | ||
2549 | i * sizeof (struct GNUNET_MQ_MessageHandler)); | ||
2550 | } | ||
2542 | 2551 | ||
2543 | GNUNET_assert (GNUNET_OK == | 2552 | GNUNET_assert (GNUNET_OK == |
2544 | GNUNET_CONTAINER_multihashmap_put (h->ports, | 2553 | GNUNET_CONTAINER_multihashmap_put (h->ports, |