diff options
author | Bart Polot <bart@net.in.tum.de> | 2016-07-20 17:13:26 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2016-07-20 17:13:26 +0000 |
commit | 90c70e8315c4a366996da379f839dc84d21d5f38 (patch) | |
tree | 0bfd73d2da8b8efb8de888c09ea4dd5bfc4cdb0f /src/scalarproduct | |
parent | 3aab63d5c50db0eb784d3b65b2bd989d3458c960 (diff) | |
download | gnunet-90c70e8315c4a366996da379f839dc84d21d5f38.tar.gz gnunet-90c70e8315c4a366996da379f839dc84d21d5f38.zip |
- fix CADET-using services
Diffstat (limited to 'src/scalarproduct')
4 files changed, 14 insertions, 24 deletions
diff --git a/src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c b/src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c index c9f4811e2..43a25a08d 100644 --- a/src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c +++ b/src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c | |||
@@ -858,7 +858,7 @@ client_request_complete_alice (struct AliceServiceSession *s) | |||
858 | = GNUNET_CADET_channel_create (my_cadet, | 858 | = GNUNET_CADET_channel_create (my_cadet, |
859 | s, | 859 | s, |
860 | &s->peer, | 860 | &s->peer, |
861 | GNUNET_APPLICATION_TYPE_SCALARPRODUCT_ECC, | 861 | GC_u2h (GNUNET_APPLICATION_TYPE_SCALARPRODUCT_ECC), |
862 | GNUNET_CADET_OPTION_RELIABLE); | 862 | GNUNET_CADET_OPTION_RELIABLE); |
863 | if (NULL == s->channel) | 863 | if (NULL == s->channel) |
864 | { | 864 | { |
@@ -1184,10 +1184,8 @@ run (void *cls, | |||
1184 | &handle_client_disconnect, | 1184 | &handle_client_disconnect, |
1185 | NULL); | 1185 | NULL); |
1186 | my_cadet = GNUNET_CADET_connect (cfg, NULL, | 1186 | my_cadet = GNUNET_CADET_connect (cfg, NULL, |
1187 | NULL /* no incoming supported */, | ||
1188 | &cb_channel_destruction, | 1187 | &cb_channel_destruction, |
1189 | cadet_handlers, | 1188 | cadet_handlers); |
1190 | NULL); | ||
1191 | if (NULL == my_cadet) | 1189 | if (NULL == my_cadet) |
1192 | { | 1190 | { |
1193 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1191 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
diff --git a/src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c b/src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c index fbdf62192..7246fa6a0 100644 --- a/src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c +++ b/src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c | |||
@@ -891,7 +891,7 @@ static void * | |||
891 | cb_channel_incoming (void *cls, | 891 | cb_channel_incoming (void *cls, |
892 | struct GNUNET_CADET_Channel *channel, | 892 | struct GNUNET_CADET_Channel *channel, |
893 | const struct GNUNET_PeerIdentity *initiator, | 893 | const struct GNUNET_PeerIdentity *initiator, |
894 | uint32_t port, | 894 | const struct GNUNET_HashCode *port, |
895 | enum GNUNET_CADET_ChannelOption options) | 895 | enum GNUNET_CADET_ChannelOption options) |
896 | { | 896 | { |
897 | struct CadetIncomingSession *in; | 897 | struct CadetIncomingSession *in; |
@@ -1221,10 +1221,6 @@ run (void *cls, | |||
1221 | 0}, | 1221 | 0}, |
1222 | { NULL, 0, 0} | 1222 | { NULL, 0, 0} |
1223 | }; | 1223 | }; |
1224 | static const uint32_t ports[] = { | ||
1225 | GNUNET_APPLICATION_TYPE_SCALARPRODUCT_ECC, | ||
1226 | 0 | ||
1227 | }; | ||
1228 | 1224 | ||
1229 | cfg = c; | 1225 | cfg = c; |
1230 | /* We don't really do DLOG, so we can setup with very minimal resources */ | 1226 | /* We don't really do DLOG, so we can setup with very minimal resources */ |
@@ -1241,10 +1237,8 @@ run (void *cls, | |||
1241 | cadet_sessions = GNUNET_CONTAINER_multihashmap_create (128, | 1237 | cadet_sessions = GNUNET_CONTAINER_multihashmap_create (128, |
1242 | GNUNET_YES); | 1238 | GNUNET_YES); |
1243 | my_cadet = GNUNET_CADET_connect (cfg, NULL, | 1239 | my_cadet = GNUNET_CADET_connect (cfg, NULL, |
1244 | &cb_channel_incoming, | ||
1245 | &cb_channel_destruction, | 1240 | &cb_channel_destruction, |
1246 | cadet_handlers, | 1241 | cadet_handlers); |
1247 | ports); | ||
1248 | if (NULL == my_cadet) | 1242 | if (NULL == my_cadet) |
1249 | { | 1243 | { |
1250 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1244 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
@@ -1252,6 +1246,9 @@ run (void *cls, | |||
1252 | GNUNET_SCHEDULER_shutdown (); | 1246 | GNUNET_SCHEDULER_shutdown (); |
1253 | return; | 1247 | return; |
1254 | } | 1248 | } |
1249 | GNUNET_CADET_open_port (my_cadet, | ||
1250 | GC_u2h (GNUNET_APPLICATION_TYPE_SCALARPRODUCT_ECC), | ||
1251 | &cb_channel_incoming, NULL); | ||
1255 | GNUNET_SCHEDULER_add_shutdown (&shutdown_task, | 1252 | GNUNET_SCHEDULER_add_shutdown (&shutdown_task, |
1256 | NULL); | 1253 | NULL); |
1257 | } | 1254 | } |
diff --git a/src/scalarproduct/gnunet-service-scalarproduct_alice.c b/src/scalarproduct/gnunet-service-scalarproduct_alice.c index 5478a85a7..8c3b1ed24 100644 --- a/src/scalarproduct/gnunet-service-scalarproduct_alice.c +++ b/src/scalarproduct/gnunet-service-scalarproduct_alice.c | |||
@@ -1081,7 +1081,7 @@ client_request_complete_alice (struct AliceServiceSession *s) | |||
1081 | = GNUNET_CADET_channel_create (my_cadet, | 1081 | = GNUNET_CADET_channel_create (my_cadet, |
1082 | s, | 1082 | s, |
1083 | &s->peer, | 1083 | &s->peer, |
1084 | GNUNET_APPLICATION_TYPE_SCALARPRODUCT, | 1084 | GC_u2h (GNUNET_APPLICATION_TYPE_SCALARPRODUCT), |
1085 | GNUNET_CADET_OPTION_RELIABLE); | 1085 | GNUNET_CADET_OPTION_RELIABLE); |
1086 | if (NULL == s->channel) | 1086 | if (NULL == s->channel) |
1087 | { | 1087 | { |
@@ -1409,10 +1409,8 @@ run (void *cls, | |||
1409 | &handle_client_disconnect, | 1409 | &handle_client_disconnect, |
1410 | NULL); | 1410 | NULL); |
1411 | my_cadet = GNUNET_CADET_connect (cfg, NULL, | 1411 | my_cadet = GNUNET_CADET_connect (cfg, NULL, |
1412 | NULL /* no incoming supported */, | ||
1413 | &cb_channel_destruction, | 1412 | &cb_channel_destruction, |
1414 | cadet_handlers, | 1413 | cadet_handlers); |
1415 | NULL); | ||
1416 | if (NULL == my_cadet) | 1414 | if (NULL == my_cadet) |
1417 | { | 1415 | { |
1418 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1416 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
diff --git a/src/scalarproduct/gnunet-service-scalarproduct_bob.c b/src/scalarproduct/gnunet-service-scalarproduct_bob.c index 5be0a85d1..84c831c82 100644 --- a/src/scalarproduct/gnunet-service-scalarproduct_bob.c +++ b/src/scalarproduct/gnunet-service-scalarproduct_bob.c | |||
@@ -1187,7 +1187,7 @@ static void * | |||
1187 | cb_channel_incoming (void *cls, | 1187 | cb_channel_incoming (void *cls, |
1188 | struct GNUNET_CADET_Channel *channel, | 1188 | struct GNUNET_CADET_Channel *channel, |
1189 | const struct GNUNET_PeerIdentity *initiator, | 1189 | const struct GNUNET_PeerIdentity *initiator, |
1190 | uint32_t port, | 1190 | const struct GNUNET_HashCode *port, |
1191 | enum GNUNET_CADET_ChannelOption options) | 1191 | enum GNUNET_CADET_ChannelOption options) |
1192 | { | 1192 | { |
1193 | struct CadetIncomingSession *in; | 1193 | struct CadetIncomingSession *in; |
@@ -1512,10 +1512,6 @@ run (void *cls, | |||
1512 | 0}, | 1512 | 0}, |
1513 | { NULL, 0, 0} | 1513 | { NULL, 0, 0} |
1514 | }; | 1514 | }; |
1515 | static const uint32_t ports[] = { | ||
1516 | GNUNET_APPLICATION_TYPE_SCALARPRODUCT, | ||
1517 | 0 | ||
1518 | }; | ||
1519 | 1515 | ||
1520 | cfg = c; | 1516 | cfg = c; |
1521 | /* | 1517 | /* |
@@ -1538,10 +1534,8 @@ run (void *cls, | |||
1538 | cadet_sessions = GNUNET_CONTAINER_multihashmap_create (128, | 1534 | cadet_sessions = GNUNET_CONTAINER_multihashmap_create (128, |
1539 | GNUNET_YES); | 1535 | GNUNET_YES); |
1540 | my_cadet = GNUNET_CADET_connect (cfg, NULL, | 1536 | my_cadet = GNUNET_CADET_connect (cfg, NULL, |
1541 | &cb_channel_incoming, | ||
1542 | &cb_channel_destruction, | 1537 | &cb_channel_destruction, |
1543 | cadet_handlers, | 1538 | cadet_handlers); |
1544 | ports); | ||
1545 | if (NULL == my_cadet) | 1539 | if (NULL == my_cadet) |
1546 | { | 1540 | { |
1547 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1541 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
@@ -1549,6 +1543,9 @@ run (void *cls, | |||
1549 | GNUNET_SCHEDULER_shutdown (); | 1543 | GNUNET_SCHEDULER_shutdown (); |
1550 | return; | 1544 | return; |
1551 | } | 1545 | } |
1546 | GNUNET_CADET_open_port (my_cadet, | ||
1547 | GC_u2h (GNUNET_APPLICATION_TYPE_SCALARPRODUCT), | ||
1548 | &cb_channel_incoming, NULL); | ||
1552 | GNUNET_SCHEDULER_add_shutdown (&shutdown_task, | 1549 | GNUNET_SCHEDULER_add_shutdown (&shutdown_task, |
1553 | NULL); | 1550 | NULL); |
1554 | } | 1551 | } |