diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-08-14 09:49:29 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-08-14 09:49:29 +0000 |
commit | ae0700a8b5d905db4403a52dbf4a5eda5315e3ec (patch) | |
tree | 2838c1339d91c8427e3b6a4d6abbef69a51777b9 /src/fs | |
parent | 097fb7799b72de5015c582af3df0bf626ded2969 (diff) | |
download | gnunet-ae0700a8b5d905db4403a52dbf4a5eda5315e3ec.tar.gz gnunet-ae0700a8b5d905db4403a52dbf4a5eda5315e3ec.zip |
-slightly better FS port conversion, more to be done _much_ later
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/gnunet-service-fs_cadet_client.c | 24 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_cadet_server.c | 10 |
2 files changed, 24 insertions, 10 deletions
diff --git a/src/fs/gnunet-service-fs_cadet_client.c b/src/fs/gnunet-service-fs_cadet_client.c index 5b24b3116..4e268b93c 100644 --- a/src/fs/gnunet-service-fs_cadet_client.c +++ b/src/fs/gnunet-service-fs_cadet_client.c | |||
@@ -214,6 +214,7 @@ static void | |||
214 | reset_cadet (struct CadetHandle *mh) | 214 | reset_cadet (struct CadetHandle *mh) |
215 | { | 215 | { |
216 | struct GNUNET_CADET_Channel *channel = mh->channel; | 216 | struct GNUNET_CADET_Channel *channel = mh->channel; |
217 | struct GNUNET_HashCode port; | ||
217 | 218 | ||
218 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 219 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
219 | "Resetting cadet channel to %s\n", | 220 | "Resetting cadet channel to %s\n", |
@@ -233,11 +234,14 @@ reset_cadet (struct CadetHandle *mh) | |||
233 | GNUNET_CONTAINER_multihashmap_iterate (mh->waiting_map, | 234 | GNUNET_CONTAINER_multihashmap_iterate (mh->waiting_map, |
234 | &move_to_pending, | 235 | &move_to_pending, |
235 | mh); | 236 | mh); |
237 | GNUNET_CRYPTO_hash (GNUNET_APPLICATION_PORT_FS_BLOCK_TRANSFER, | ||
238 | strlen (GNUNET_APPLICATION_PORT_FS_BLOCK_TRANSFER), | ||
239 | &port); | ||
236 | mh->channel = GNUNET_CADET_channel_create (cadet_handle, | 240 | mh->channel = GNUNET_CADET_channel_create (cadet_handle, |
237 | mh, | 241 | mh, |
238 | &mh->target, | 242 | &mh->target, |
239 | GC_u2h (GNUNET_APPLICATION_TYPE_FS_BLOCK_TRANSFER), | 243 | &port, |
240 | GNUNET_CADET_OPTION_RELIABLE); | 244 | GNUNET_CADET_OPTION_RELIABLE); |
241 | transmit_pending (mh); | 245 | transmit_pending (mh); |
242 | } | 246 | } |
243 | 247 | ||
@@ -518,6 +522,7 @@ static struct CadetHandle * | |||
518 | get_cadet (const struct GNUNET_PeerIdentity *target) | 522 | get_cadet (const struct GNUNET_PeerIdentity *target) |
519 | { | 523 | { |
520 | struct CadetHandle *mh; | 524 | struct CadetHandle *mh; |
525 | struct GNUNET_HashCode port; | ||
521 | 526 | ||
522 | mh = GNUNET_CONTAINER_multipeermap_get (cadet_map, | 527 | mh = GNUNET_CONTAINER_multipeermap_get (cadet_map, |
523 | target); | 528 | target); |
@@ -544,11 +549,14 @@ get_cadet (const struct GNUNET_PeerIdentity *target) | |||
544 | &mh->target, | 549 | &mh->target, |
545 | mh, | 550 | mh, |
546 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); | 551 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); |
552 | GNUNET_CRYPTO_hash (GNUNET_APPLICATION_PORT_FS_BLOCK_TRANSFER, | ||
553 | strlen (GNUNET_APPLICATION_PORT_FS_BLOCK_TRANSFER), | ||
554 | &port); | ||
547 | mh->channel = GNUNET_CADET_channel_create (cadet_handle, | 555 | mh->channel = GNUNET_CADET_channel_create (cadet_handle, |
548 | mh, | 556 | mh, |
549 | &mh->target, | 557 | &mh->target, |
550 | GC_u2h (GNUNET_APPLICATION_TYPE_FS_BLOCK_TRANSFER), | 558 | &port, |
551 | GNUNET_CADET_OPTION_RELIABLE); | 559 | GNUNET_CADET_OPTION_RELIABLE); |
552 | GNUNET_assert (mh == | 560 | GNUNET_assert (mh == |
553 | GNUNET_CONTAINER_multipeermap_get (cadet_map, | 561 | GNUNET_CONTAINER_multipeermap_get (cadet_map, |
554 | target)); | 562 | target)); |
diff --git a/src/fs/gnunet-service-fs_cadet_server.c b/src/fs/gnunet-service-fs_cadet_server.c index 32fe4191a..ac86537c3 100644 --- a/src/fs/gnunet-service-fs_cadet_server.c +++ b/src/fs/gnunet-service-fs_cadet_server.c | |||
@@ -562,6 +562,8 @@ GSF_cadet_start_server () | |||
562 | { &request_cb, GNUNET_MESSAGE_TYPE_FS_CADET_QUERY, sizeof (struct CadetQueryMessage)}, | 562 | { &request_cb, GNUNET_MESSAGE_TYPE_FS_CADET_QUERY, sizeof (struct CadetQueryMessage)}, |
563 | { NULL, 0, 0 } | 563 | { NULL, 0, 0 } |
564 | }; | 564 | }; |
565 | struct GNUNET_HashCode port; | ||
566 | |||
565 | if (GNUNET_YES != | 567 | if (GNUNET_YES != |
566 | GNUNET_CONFIGURATION_get_value_number (GSF_cfg, | 568 | GNUNET_CONFIGURATION_get_value_number (GSF_cfg, |
567 | "fs", | 569 | "fs", |
@@ -576,9 +578,13 @@ GSF_cadet_start_server () | |||
576 | &cleaner_cb, | 578 | &cleaner_cb, |
577 | handlers); | 579 | handlers); |
578 | GNUNET_assert (NULL != listen_channel); | 580 | GNUNET_assert (NULL != listen_channel); |
581 | GNUNET_CRYPTO_hash (GNUNET_APPLICATION_PORT_FS_BLOCK_TRANSFER, | ||
582 | strlen (GNUNET_APPLICATION_PORT_FS_BLOCK_TRANSFER), | ||
583 | &port); | ||
579 | GNUNET_CADET_open_port (listen_channel, | 584 | GNUNET_CADET_open_port (listen_channel, |
580 | GC_u2h (GNUNET_APPLICATION_TYPE_FS_BLOCK_TRANSFER), | 585 | &port, |
581 | &accept_cb, NULL); | 586 | &accept_cb, |
587 | NULL); | ||
582 | } | 588 | } |
583 | 589 | ||
584 | 590 | ||