diff options
author | Bart Polot <bart.polot+gnunet@gmail.com> | 2017-02-20 19:13:59 +0100 |
---|---|---|
committer | Bart Polot <bart.polot+gnunet@gmail.com> | 2017-02-20 19:17:40 +0100 |
commit | ba5817a7dbaef67b871606431d9a9a7f82d5bdf8 (patch) | |
tree | 747bdbac51436264cbf64c59c594dbd356393f9e /src/cadet | |
parent | 6b6a966864221ffa0d52d311da3b68f6c42549be (diff) | |
download | gnunet-ba5817a7dbaef67b871606431d9a9a7f82d5bdf8.tar.gz gnunet-ba5817a7dbaef67b871606431d9a9a7f82d5bdf8.zip |
Refactor copying of handler arrays
Diffstat (limited to 'src/cadet')
-rw-r--r-- | src/cadet/cadet_api_new.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/cadet/cadet_api_new.c b/src/cadet/cadet_api_new.c index 673764813..7ed681a9d 100644 --- a/src/cadet/cadet_api_new.c +++ b/src/cadet/cadet_api_new.c | |||
@@ -1635,17 +1635,7 @@ GNUNET_CADET_open_porT (struct GNUNET_CADET_Handle *h, | |||
1635 | p->cls = connects_cls; | 1635 | p->cls = connects_cls; |
1636 | p->window_changes = window_changes; | 1636 | p->window_changes = window_changes; |
1637 | p->disconnects = disconnects; | 1637 | p->disconnects = disconnects; |
1638 | if (NULL != handlers) | 1638 | p->handlers = GNUNET_MQ_copy_handlers (handlers); |
1639 | { | ||
1640 | unsigned int i; | ||
1641 | |||
1642 | for (i=0;NULL != handlers[i].cb; i++) ; | ||
1643 | p->handlers = GNUNET_new_array (i + 1, | ||
1644 | struct GNUNET_MQ_MessageHandler); | ||
1645 | GNUNET_memcpy ((struct GNUNET_MQ_MessageHandler *) p->handlers, | ||
1646 | handlers, | ||
1647 | i * sizeof (struct GNUNET_MQ_MessageHandler)); | ||
1648 | } | ||
1649 | 1639 | ||
1650 | GNUNET_assert (GNUNET_OK == | 1640 | GNUNET_assert (GNUNET_OK == |
1651 | GNUNET_CONTAINER_multihashmap_put (h->ports, | 1641 | GNUNET_CONTAINER_multihashmap_put (h->ports, |