aboutsummaryrefslogtreecommitdiff
path: root/src/cadet
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-01-27 01:07:58 +0100
committerChristian Grothoff <christian@grothoff.org>2019-01-27 01:07:58 +0100
commit3db0825fdc964032a7c6ee17ccb7dedbbcfb208b (patch)
tree0fe0221028f6f127a0135f15898c38efe6257b51 /src/cadet
parent65b339b7ce68fcbaec9df6f66e8ed45e60b39ce1 (diff)
downloadgnunet-3db0825fdc964032a7c6ee17ccb7dedbbcfb208b.tar.gz
gnunet-3db0825fdc964032a7c6ee17ccb7dedbbcfb208b.zip
more work on #5385
Diffstat (limited to 'src/cadet')
-rw-r--r--src/cadet/Makefile.am1
-rw-r--r--src/cadet/cadet_api_get_channel.c16
-rw-r--r--src/cadet/cadet_api_get_peer.c2
-rw-r--r--src/cadet/cadet_api_list_peers.c5
4 files changed, 15 insertions, 9 deletions
diff --git a/src/cadet/Makefile.am b/src/cadet/Makefile.am
index 62eaad38c..57a716f29 100644
--- a/src/cadet/Makefile.am
+++ b/src/cadet/Makefile.am
@@ -35,6 +35,7 @@ lib_LTLIBRARIES = \
35libgnunetcadet_la_SOURCES = \ 35libgnunetcadet_la_SOURCES = \
36 cadet_api.c \ 36 cadet_api.c \
37 cadet_api_get_peer.c \ 37 cadet_api_get_peer.c \
38 cadet_api_get_tunnel.c \
38 cadet_api_list_peers.c \ 39 cadet_api_list_peers.c \
39 cadet_api_helper.c 40 cadet_api_helper.c
40libgnunetcadet_la_LIBADD = \ 41libgnunetcadet_la_LIBADD = \
diff --git a/src/cadet/cadet_api_get_channel.c b/src/cadet/cadet_api_get_channel.c
index d41337522..1249777c2 100644
--- a/src/cadet/cadet_api_get_channel.c
+++ b/src/cadet/cadet_api_get_channel.c
@@ -121,17 +121,20 @@ reconnect (void *cls)
121{ 121{
122 struct GNUNET_CADET_ChannelMonitor *cm = cls; 122 struct GNUNET_CADET_ChannelMonitor *cm = cls;
123 struct GNUNET_MQ_MessageHandler *handlers[] = { 123 struct GNUNET_MQ_MessageHandler *handlers[] = {
124 FIXME 124 FIXME,
125 } 125 GNUNET_MQ_handler_end ()
126 };
126 struct GNUNET_MessageHeader *msg; 127 struct GNUNET_MessageHeader *msg;
127 struct GNUNET_MQ_Envelope *env; 128 struct GNUNET_MQ_Envelope *env;
128 129
130 cm->reconnect_task = NULL;
129 cm->mq = GNUNET_CLIENT_connect (cm->cfg, 131 cm->mq = GNUNET_CLIENT_connect (cm->cfg,
130 "cadet", 132 "cadet",
131 handlers, 133 handlers,
132 &error_handler, 134 &error_handler,
133 cm); 135 cm);
134 136 if (NULL == cm->mq)
137 return;
135 env = GNUNET_MQ_msg (msg, 138 env = GNUNET_MQ_msg (msg,
136 type); 139 type);
137 GNUNET_MQ_send (cm->mq, 140 GNUNET_MQ_send (cm->mq,
@@ -142,13 +145,12 @@ reconnect (void *cls)
142/** 145/**
143 * Request information about a specific channel of the running cadet peer. 146 * Request information about a specific channel of the running cadet peer.
144 * 147 *
145 * WARNING: unstable API, likely to change in the future! 148 * @param cfg configuration to use
146 *
147 * @param h Handle to the cadet peer.
148 * @param peer ID of the other end of the channel. 149 * @param peer ID of the other end of the channel.
149 * @param channel_number Channel number. 150 * @param channel_number Channel number.
150 * @param callback Function to call with the requested data. 151 * @param callback Function to call with the requested data.
151 * @param callback_cls Closure for @c callback. 152 * @param callback_cls Closure for @c callback.
153 * @return NULL on error
152 */ 154 */
153struct GNUNET_CADET_ChannelMonitor * 155struct GNUNET_CADET_ChannelMonitor *
154GNUNET_CADET_get_channel (const struct GNUNET_CONFIGURATION_Handle *cfg, 156GNUNET_CADET_get_channel (const struct GNUNET_CONFIGURATION_Handle *cfg,
diff --git a/src/cadet/cadet_api_get_peer.c b/src/cadet/cadet_api_get_peer.c
index e86c1567c..bfac8d583 100644
--- a/src/cadet/cadet_api_get_peer.c
+++ b/src/cadet/cadet_api_get_peer.c
@@ -227,7 +227,7 @@ reconnect (void *cls)
227 * Request information about a peer known to the running cadet peer. 227 * Request information about a peer known to the running cadet peer.
228 * The callback will be called for the tunnel once. 228 * The callback will be called for the tunnel once.
229 * 229 *
230 * @param h Handle to the cadet peer. 230 * @param cfg configuration to use
231 * @param id Peer whose tunnel to examine. 231 * @param id Peer whose tunnel to examine.
232 * @param callback Function to call with the requested data. 232 * @param callback Function to call with the requested data.
233 * @param callback_cls Closure for @c callback. 233 * @param callback_cls Closure for @c callback.
diff --git a/src/cadet/cadet_api_list_peers.c b/src/cadet/cadet_api_list_peers.c
index d53bcf65d..cc6948a36 100644
--- a/src/cadet/cadet_api_list_peers.c
+++ b/src/cadet/cadet_api_list_peers.c
@@ -177,11 +177,14 @@ reconnect (void *cls)
177 struct GNUNET_MessageHeader *msg; 177 struct GNUNET_MessageHeader *msg;
178 struct GNUNET_MQ_Envelope *env; 178 struct GNUNET_MQ_Envelope *env;
179 179
180 pl->reconnect_task = NULL;
180 pl->mq = GNUNET_CLIENT_connect (pl->cfg, 181 pl->mq = GNUNET_CLIENT_connect (pl->cfg,
181 "cadet", 182 "cadet",
182 handlers, 183 handlers,
183 &error_handler, 184 &error_handler,
184 pl); 185 pl);
186 if (NULL == pl->mq)
187 return;
185 env = GNUNET_MQ_msg (msg, 188 env = GNUNET_MQ_msg (msg,
186 GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PEERS); 189 GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_PEERS);
187 GNUNET_MQ_send (pl->mq, 190 GNUNET_MQ_send (pl->mq,
@@ -194,7 +197,7 @@ reconnect (void *cls)
194 * The callback will be called for every peer known to the service. 197 * The callback will be called for every peer known to the service.
195 * Only one info request (of any kind) can be active at once. 198 * Only one info request (of any kind) can be active at once.
196 * 199 *
197 * @param h Handle to the cadet peer. 200 * @param cfg configuration to use
198 * @param callback Function to call with the requested data. 201 * @param callback Function to call with the requested data.
199 * @param callback_cls Closure for @c callback. 202 * @param callback_cls Closure for @c callback.
200 * @return NULL on error 203 * @return NULL on error