diff options
author | Bart Polot <bart@net.in.tum.de> | 2013-11-14 13:57:53 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2013-11-14 13:57:53 +0000 |
commit | e6ef137e2f3bcdbecfb0962e598182d7dc1fdc7f (patch) | |
tree | 8356366612e88dba7ae5a4ba66bea6af876928c2 /src/fs | |
parent | b7366f3d6a56d38d0269a33039f88de967e8c130 (diff) | |
download | gnunet-e6ef137e2f3bcdbecfb0962e598182d7dc1fdc7f.tar.gz gnunet-e6ef137e2f3bcdbecfb0962e598182d7dc1fdc7f.zip |
- rename tunnel->channel
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/gnunet-service-fs_mesh_client.c | 72 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_mesh_server.c | 80 |
2 files changed, 76 insertions, 76 deletions
diff --git a/src/fs/gnunet-service-fs_mesh_client.c b/src/fs/gnunet-service-fs_mesh_client.c index 73ab6bb5d..dadb86bbd 100644 --- a/src/fs/gnunet-service-fs_mesh_client.c +++ b/src/fs/gnunet-service-fs_mesh_client.c | |||
@@ -121,9 +121,9 @@ struct MeshHandle | |||
121 | struct GNUNET_CONTAINER_MultiHashMap *waiting_map; | 121 | struct GNUNET_CONTAINER_MultiHashMap *waiting_map; |
122 | 122 | ||
123 | /** | 123 | /** |
124 | * Tunnel to the other peer. | 124 | * Channel to the other peer. |
125 | */ | 125 | */ |
126 | struct GNUNET_MESH_Tunnel *tunnel; | 126 | struct GNUNET_MESH_Channel *channel; |
127 | 127 | ||
128 | /** | 128 | /** |
129 | * Handle for active write operation, or NULL. | 129 | * Handle for active write operation, or NULL. |
@@ -153,13 +153,13 @@ struct MeshHandle | |||
153 | 153 | ||
154 | 154 | ||
155 | /** | 155 | /** |
156 | * Mesh tunnel for creating outbound tunnels. | 156 | * Mesh channel for creating outbound channels. |
157 | */ | 157 | */ |
158 | static struct GNUNET_MESH_Handle *mesh_handle; | 158 | static struct GNUNET_MESH_Handle *mesh_handle; |
159 | 159 | ||
160 | /** | 160 | /** |
161 | * Map from peer identities to 'struct MeshHandles' with mesh | 161 | * Map from peer identities to 'struct MeshHandles' with mesh |
162 | * tunnels to those peers. | 162 | * channels to those peers. |
163 | */ | 163 | */ |
164 | static struct GNUNET_CONTAINER_MultiPeerMap *mesh_map; | 164 | static struct GNUNET_CONTAINER_MultiPeerMap *mesh_map; |
165 | 165 | ||
@@ -214,13 +214,13 @@ static void | |||
214 | reset_mesh (struct MeshHandle *mh) | 214 | reset_mesh (struct MeshHandle *mh) |
215 | { | 215 | { |
216 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 216 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
217 | "Resetting mesh tunnel to %s\n", | 217 | "Resetting mesh channel to %s\n", |
218 | GNUNET_i2s (&mh->target)); | 218 | GNUNET_i2s (&mh->target)); |
219 | GNUNET_MESH_tunnel_destroy (mh->tunnel); | 219 | GNUNET_MESH_channel_destroy (mh->channel); |
220 | GNUNET_CONTAINER_multihashmap_iterate (mh->waiting_map, | 220 | GNUNET_CONTAINER_multihashmap_iterate (mh->waiting_map, |
221 | &move_to_pending, | 221 | &move_to_pending, |
222 | mh); | 222 | mh); |
223 | mh->tunnel = GNUNET_MESH_tunnel_create (mesh_handle, | 223 | mh->channel = GNUNET_MESH_channel_create (mesh_handle, |
224 | mh, | 224 | mh, |
225 | &mh->target, | 225 | &mh->target, |
226 | GNUNET_APPLICATION_TYPE_FS_BLOCK_TRANSFER, | 226 | GNUNET_APPLICATION_TYPE_FS_BLOCK_TRANSFER, |
@@ -231,7 +231,7 @@ reset_mesh (struct MeshHandle *mh) | |||
231 | 231 | ||
232 | 232 | ||
233 | /** | 233 | /** |
234 | * Task called when it is time to destroy an inactive mesh tunnel. | 234 | * Task called when it is time to destroy an inactive mesh channel. |
235 | * | 235 | * |
236 | * @param cls the 'struct MeshHandle' to tear down | 236 | * @param cls the 'struct MeshHandle' to tear down |
237 | * @param tc scheduler context, unused | 237 | * @param tc scheduler context, unused |
@@ -241,15 +241,15 @@ mesh_timeout (void *cls, | |||
241 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 241 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
242 | { | 242 | { |
243 | struct MeshHandle *mh = cls; | 243 | struct MeshHandle *mh = cls; |
244 | struct GNUNET_MESH_Tunnel *tun; | 244 | struct GNUNET_MESH_Channel *tun; |
245 | 245 | ||
246 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 246 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
247 | "Timeout on mesh tunnel to %s\n", | 247 | "Timeout on mesh channel to %s\n", |
248 | GNUNET_i2s (&mh->target)); | 248 | GNUNET_i2s (&mh->target)); |
249 | mh->timeout_task = GNUNET_SCHEDULER_NO_TASK; | 249 | mh->timeout_task = GNUNET_SCHEDULER_NO_TASK; |
250 | tun = mh->tunnel; | 250 | tun = mh->channel; |
251 | mh->tunnel = NULL; | 251 | mh->channel = NULL; |
252 | GNUNET_MESH_tunnel_destroy (tun); | 252 | GNUNET_MESH_channel_destroy (tun); |
253 | } | 253 | } |
254 | 254 | ||
255 | 255 | ||
@@ -308,7 +308,7 @@ transmit_sqm (void *cls, | |||
308 | if (NULL == buf) | 308 | if (NULL == buf) |
309 | { | 309 | { |
310 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 310 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
311 | "Mesh tunnel to %s failed during transmission attempt, rebuilding\n", | 311 | "Mesh channel to %s failed during transmission attempt, rebuilding\n", |
312 | GNUNET_i2s (&mh->target)); | 312 | GNUNET_i2s (&mh->target)); |
313 | reset_mesh_async (mh); | 313 | reset_mesh_async (mh); |
314 | return 0; | 314 | return 0; |
@@ -352,11 +352,11 @@ transmit_sqm (void *cls, | |||
352 | static void | 352 | static void |
353 | transmit_pending (struct MeshHandle *mh) | 353 | transmit_pending (struct MeshHandle *mh) |
354 | { | 354 | { |
355 | if (NULL == mh->tunnel) | 355 | if (NULL == mh->channel) |
356 | return; | 356 | return; |
357 | if (NULL != mh->wh) | 357 | if (NULL != mh->wh) |
358 | return; | 358 | return; |
359 | mh->wh = GNUNET_MESH_notify_transmit_ready (mh->tunnel, GNUNET_YES /* allow cork */, | 359 | mh->wh = GNUNET_MESH_notify_transmit_ready (mh->channel, GNUNET_YES /* allow cork */, |
360 | GNUNET_TIME_UNIT_FOREVER_REL, | 360 | GNUNET_TIME_UNIT_FOREVER_REL, |
361 | sizeof (struct MeshQueryMessage), | 361 | sizeof (struct MeshQueryMessage), |
362 | &transmit_sqm, mh); | 362 | &transmit_sqm, mh); |
@@ -429,18 +429,18 @@ handle_reply (void *cls, | |||
429 | * is received. | 429 | * is received. |
430 | * | 430 | * |
431 | * @param cls closure with the 'struct MeshHandle' | 431 | * @param cls closure with the 'struct MeshHandle' |
432 | * @param tunnel tunnel handle | 432 | * @param channel channel handle |
433 | * @param tunnel_ctx tunnel context | 433 | * @param channel_ctx channel context |
434 | * @param message the actual message | 434 | * @param message the actual message |
435 | * @return GNUNET_OK on success, GNUNET_SYSERR to stop further processing | 435 | * @return GNUNET_OK on success, GNUNET_SYSERR to stop further processing |
436 | */ | 436 | */ |
437 | static int | 437 | static int |
438 | reply_cb (void *cls, | 438 | reply_cb (void *cls, |
439 | struct GNUNET_MESH_Tunnel *tunnel, | 439 | struct GNUNET_MESH_Channel *channel, |
440 | void **tunnel_ctx, | 440 | void **channel_ctx, |
441 | const struct GNUNET_MessageHeader *message) | 441 | const struct GNUNET_MessageHeader *message) |
442 | { | 442 | { |
443 | struct MeshHandle *mh = *tunnel_ctx; | 443 | struct MeshHandle *mh = *channel_ctx; |
444 | const struct MeshReplyMessage *srm; | 444 | const struct MeshReplyMessage *srm; |
445 | struct HandleReplyClosure hrc; | 445 | struct HandleReplyClosure hrc; |
446 | uint16_t msize; | 446 | uint16_t msize; |
@@ -470,7 +470,7 @@ reply_cb (void *cls, | |||
470 | "Received reply `%s' via mesh from peer %s\n", | 470 | "Received reply `%s' via mesh from peer %s\n", |
471 | GNUNET_h2s (&query), | 471 | GNUNET_h2s (&query), |
472 | GNUNET_i2s (&mh->target)); | 472 | GNUNET_i2s (&mh->target)); |
473 | GNUNET_MESH_receive_done (tunnel); | 473 | GNUNET_MESH_receive_done (channel); |
474 | GNUNET_STATISTICS_update (GSF_stats, | 474 | GNUNET_STATISTICS_update (GSF_stats, |
475 | gettext_noop ("# replies received via mesh"), 1, | 475 | gettext_noop ("# replies received via mesh"), 1, |
476 | GNUNET_NO); | 476 | GNUNET_NO); |
@@ -516,7 +516,7 @@ get_mesh (const struct GNUNET_PeerIdentity *target) | |||
516 | return mh; | 516 | return mh; |
517 | } | 517 | } |
518 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 518 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
519 | "Creating mesh tunnel to %s\n", | 519 | "Creating mesh channel to %s\n", |
520 | GNUNET_i2s (target)); | 520 | GNUNET_i2s (target)); |
521 | mh = GNUNET_new (struct MeshHandle); | 521 | mh = GNUNET_new (struct MeshHandle); |
522 | mh->reset_task = GNUNET_SCHEDULER_add_delayed (CLIENT_RETRY_TIMEOUT, | 522 | mh->reset_task = GNUNET_SCHEDULER_add_delayed (CLIENT_RETRY_TIMEOUT, |
@@ -524,7 +524,7 @@ get_mesh (const struct GNUNET_PeerIdentity *target) | |||
524 | mh); | 524 | mh); |
525 | mh->waiting_map = GNUNET_CONTAINER_multihashmap_create (16, GNUNET_YES); | 525 | mh->waiting_map = GNUNET_CONTAINER_multihashmap_create (16, GNUNET_YES); |
526 | mh->target = *target; | 526 | mh->target = *target; |
527 | mh->tunnel = GNUNET_MESH_tunnel_create (mesh_handle, | 527 | mh->channel = GNUNET_MESH_channel_create (mesh_handle, |
528 | mh, | 528 | mh, |
529 | &mh->target, | 529 | &mh->target, |
530 | GNUNET_APPLICATION_TYPE_FS_BLOCK_TRANSFER, | 530 | GNUNET_APPLICATION_TYPE_FS_BLOCK_TRANSFER, |
@@ -637,21 +637,21 @@ free_waiting_entry (void *cls, | |||
637 | 637 | ||
638 | /** | 638 | /** |
639 | * Function called by mesh when a client disconnects. | 639 | * Function called by mesh when a client disconnects. |
640 | * Cleans up our 'struct MeshClient' of that tunnel. | 640 | * Cleans up our 'struct MeshClient' of that channel. |
641 | * | 641 | * |
642 | * @param cls NULL | 642 | * @param cls NULL |
643 | * @param tunnel tunnel of the disconnecting client | 643 | * @param channel channel of the disconnecting client |
644 | * @param tunnel_ctx our 'struct MeshClient' | 644 | * @param channel_ctx our 'struct MeshClient' |
645 | */ | 645 | */ |
646 | static void | 646 | static void |
647 | cleaner_cb (void *cls, | 647 | cleaner_cb (void *cls, |
648 | const struct GNUNET_MESH_Tunnel *tunnel, | 648 | const struct GNUNET_MESH_Channel *channel, |
649 | void *tunnel_ctx) | 649 | void *channel_ctx) |
650 | { | 650 | { |
651 | struct MeshHandle *mh = tunnel_ctx; | 651 | struct MeshHandle *mh = channel_ctx; |
652 | struct GSF_MeshRequest *sr; | 652 | struct GSF_MeshRequest *sr; |
653 | 653 | ||
654 | mh->tunnel = NULL; | 654 | mh->channel = NULL; |
655 | while (NULL != (sr = mh->pending_head)) | 655 | while (NULL != (sr = mh->pending_head)) |
656 | { | 656 | { |
657 | sr->proc (sr->proc_cls, GNUNET_BLOCK_TYPE_ANY, | 657 | sr->proc (sr->proc_cls, GNUNET_BLOCK_TYPE_ANY, |
@@ -712,15 +712,15 @@ release_meshs (void *cls, | |||
712 | void *value) | 712 | void *value) |
713 | { | 713 | { |
714 | struct MeshHandle *mh = value; | 714 | struct MeshHandle *mh = value; |
715 | struct GNUNET_MESH_Tunnel *tun; | 715 | struct GNUNET_MESH_Channel *tun; |
716 | 716 | ||
717 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 717 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
718 | "Timeout on mesh tunnel to %s\n", | 718 | "Timeout on mesh channel to %s\n", |
719 | GNUNET_i2s (&mh->target)); | 719 | GNUNET_i2s (&mh->target)); |
720 | tun = mh->tunnel; | 720 | tun = mh->channel; |
721 | mh->tunnel = NULL; | 721 | mh->channel = NULL; |
722 | if (NULL != tun) | 722 | if (NULL != tun) |
723 | GNUNET_MESH_tunnel_destroy (tun); | 723 | GNUNET_MESH_channel_destroy (tun); |
724 | return GNUNET_YES; | 724 | return GNUNET_YES; |
725 | } | 725 | } |
726 | 726 | ||
diff --git a/src/fs/gnunet-service-fs_mesh_server.c b/src/fs/gnunet-service-fs_mesh_server.c index e732da990..aa7a62588 100644 --- a/src/fs/gnunet-service-fs_mesh_server.c +++ b/src/fs/gnunet-service-fs_mesh_server.c | |||
@@ -81,9 +81,9 @@ struct MeshClient | |||
81 | struct MeshClient *prev; | 81 | struct MeshClient *prev; |
82 | 82 | ||
83 | /** | 83 | /** |
84 | * Tunnel for communication. | 84 | * Channel for communication. |
85 | */ | 85 | */ |
86 | struct GNUNET_MESH_Tunnel *tunnel; | 86 | struct GNUNET_MESH_Channel *channel; |
87 | 87 | ||
88 | /** | 88 | /** |
89 | * Handle for active write operation, or NULL. | 89 | * Handle for active write operation, or NULL. |
@@ -124,9 +124,9 @@ struct MeshClient | |||
124 | 124 | ||
125 | 125 | ||
126 | /** | 126 | /** |
127 | * Listen tunnel for incoming requests. | 127 | * Listen channel for incoming requests. |
128 | */ | 128 | */ |
129 | static struct GNUNET_MESH_Handle *listen_tunnel; | 129 | static struct GNUNET_MESH_Handle *listen_channel; |
130 | 130 | ||
131 | /** | 131 | /** |
132 | * Head of DLL of mesh clients. | 132 | * Head of DLL of mesh clients. |
@@ -161,15 +161,15 @@ timeout_mesh_task (void *cls, | |||
161 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 161 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
162 | { | 162 | { |
163 | struct MeshClient *sc = cls; | 163 | struct MeshClient *sc = cls; |
164 | struct GNUNET_MESH_Tunnel *tun; | 164 | struct GNUNET_MESH_Channel *tun; |
165 | 165 | ||
166 | sc->timeout_task = GNUNET_SCHEDULER_NO_TASK; | 166 | sc->timeout_task = GNUNET_SCHEDULER_NO_TASK; |
167 | tun = sc->tunnel; | 167 | tun = sc->channel; |
168 | sc->tunnel = NULL; | 168 | sc->channel = NULL; |
169 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 169 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
170 | "Timeout for inactive mesh client %p\n", | 170 | "Timeout for inactive mesh client %p\n", |
171 | sc); | 171 | sc); |
172 | GNUNET_MESH_tunnel_destroy (tun); | 172 | GNUNET_MESH_channel_destroy (tun); |
173 | } | 173 | } |
174 | 174 | ||
175 | 175 | ||
@@ -201,7 +201,7 @@ continue_reading (struct MeshClient *sc) | |||
201 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 201 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
202 | "Finished processing mesh request from client %p, ready to receive the next one\n", | 202 | "Finished processing mesh request from client %p, ready to receive the next one\n", |
203 | sc); | 203 | sc); |
204 | GNUNET_MESH_receive_done (sc->tunnel); | 204 | GNUNET_MESH_receive_done (sc->channel); |
205 | } | 205 | } |
206 | 206 | ||
207 | 207 | ||
@@ -228,7 +228,7 @@ write_continuation (void *cls, | |||
228 | void *buf) | 228 | void *buf) |
229 | { | 229 | { |
230 | struct MeshClient *sc = cls; | 230 | struct MeshClient *sc = cls; |
231 | struct GNUNET_MESH_Tunnel *tun; | 231 | struct GNUNET_MESH_Channel *tun; |
232 | struct WriteQueueItem *wqi; | 232 | struct WriteQueueItem *wqi; |
233 | size_t ret; | 233 | size_t ret; |
234 | 234 | ||
@@ -243,9 +243,9 @@ write_continuation (void *cls, | |||
243 | { | 243 | { |
244 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 244 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
245 | "Transmission of reply failed, terminating mesh\n"); | 245 | "Transmission of reply failed, terminating mesh\n"); |
246 | tun = sc->tunnel; | 246 | tun = sc->channel; |
247 | sc->tunnel = NULL; | 247 | sc->channel = NULL; |
248 | GNUNET_MESH_tunnel_destroy (tun); | 248 | GNUNET_MESH_channel_destroy (tun); |
249 | return 0; | 249 | return 0; |
250 | } | 250 | } |
251 | GNUNET_CONTAINER_DLL_remove (sc->wqi_head, | 251 | GNUNET_CONTAINER_DLL_remove (sc->wqi_head, |
@@ -274,7 +274,7 @@ static void | |||
274 | continue_writing (struct MeshClient *sc) | 274 | continue_writing (struct MeshClient *sc) |
275 | { | 275 | { |
276 | struct WriteQueueItem *wqi; | 276 | struct WriteQueueItem *wqi; |
277 | struct GNUNET_MESH_Tunnel *tun; | 277 | struct GNUNET_MESH_Channel *tun; |
278 | 278 | ||
279 | if (NULL != sc->wh) | 279 | if (NULL != sc->wh) |
280 | { | 280 | { |
@@ -289,7 +289,7 @@ continue_writing (struct MeshClient *sc) | |||
289 | continue_reading (sc); | 289 | continue_reading (sc); |
290 | return; | 290 | return; |
291 | } | 291 | } |
292 | sc->wh = GNUNET_MESH_notify_transmit_ready (sc->tunnel, GNUNET_NO, | 292 | sc->wh = GNUNET_MESH_notify_transmit_ready (sc->channel, GNUNET_NO, |
293 | GNUNET_TIME_UNIT_FOREVER_REL, | 293 | GNUNET_TIME_UNIT_FOREVER_REL, |
294 | wqi->msize, | 294 | wqi->msize, |
295 | &write_continuation, | 295 | &write_continuation, |
@@ -298,9 +298,9 @@ continue_writing (struct MeshClient *sc) | |||
298 | { | 298 | { |
299 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 299 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
300 | "Write failed; terminating mesh\n"); | 300 | "Write failed; terminating mesh\n"); |
301 | tun = sc->tunnel; | 301 | tun = sc->channel; |
302 | sc->tunnel = NULL; | 302 | sc->channel = NULL; |
303 | GNUNET_MESH_tunnel_destroy (tun); | 303 | GNUNET_MESH_channel_destroy (tun); |
304 | return; | 304 | return; |
305 | } | 305 | } |
306 | } | 306 | } |
@@ -389,18 +389,18 @@ handle_datastore_reply (void *cls, | |||
389 | * Do not call GNUNET_SERVER_mst_destroy in callback | 389 | * Do not call GNUNET_SERVER_mst_destroy in callback |
390 | * | 390 | * |
391 | * @param cls closure with the 'struct MeshClient' | 391 | * @param cls closure with the 'struct MeshClient' |
392 | * @param tunnel tunnel handle | 392 | * @param channel channel handle |
393 | * @param tunnel_ctx tunnel context | 393 | * @param channel_ctx channel context |
394 | * @param message the actual message | 394 | * @param message the actual message |
395 | * @return GNUNET_OK on success, GNUNET_SYSERR to stop further processing | 395 | * @return GNUNET_OK on success, GNUNET_SYSERR to stop further processing |
396 | */ | 396 | */ |
397 | static int | 397 | static int |
398 | request_cb (void *cls, | 398 | request_cb (void *cls, |
399 | struct GNUNET_MESH_Tunnel *tunnel, | 399 | struct GNUNET_MESH_Channel *channel, |
400 | void **tunnel_ctx, | 400 | void **channel_ctx, |
401 | const struct GNUNET_MessageHeader *message) | 401 | const struct GNUNET_MessageHeader *message) |
402 | { | 402 | { |
403 | struct MeshClient *sc = *tunnel_ctx; | 403 | struct MeshClient *sc = *channel_ctx; |
404 | const struct MeshQueryMessage *sqm; | 404 | const struct MeshQueryMessage *sqm; |
405 | 405 | ||
406 | sqm = (const struct MeshQueryMessage *) message; | 406 | sqm = (const struct MeshQueryMessage *) message; |
@@ -434,34 +434,34 @@ request_cb (void *cls, | |||
434 | * Functions of this type are called upon new mesh connection from other peers. | 434 | * Functions of this type are called upon new mesh connection from other peers. |
435 | * | 435 | * |
436 | * @param cls the closure from GNUNET_MESH_connect | 436 | * @param cls the closure from GNUNET_MESH_connect |
437 | * @param tunnel the tunnel representing the mesh | 437 | * @param channel the channel representing the mesh |
438 | * @param initiator the identity of the peer who wants to establish a mesh | 438 | * @param initiator the identity of the peer who wants to establish a mesh |
439 | * with us; NULL on binding error | 439 | * with us; NULL on binding error |
440 | * @param port mesh port used for the incoming connection | 440 | * @param port mesh port used for the incoming connection |
441 | * @return initial tunnel context (our 'struct MeshClient') | 441 | * @return initial channel context (our 'struct MeshClient') |
442 | */ | 442 | */ |
443 | static void * | 443 | static void * |
444 | accept_cb (void *cls, | 444 | accept_cb (void *cls, |
445 | struct GNUNET_MESH_Tunnel *tunnel, | 445 | struct GNUNET_MESH_Channel *channel, |
446 | const struct GNUNET_PeerIdentity *initiator, | 446 | const struct GNUNET_PeerIdentity *initiator, |
447 | uint32_t port) | 447 | uint32_t port) |
448 | { | 448 | { |
449 | struct MeshClient *sc; | 449 | struct MeshClient *sc; |
450 | 450 | ||
451 | GNUNET_assert (NULL != tunnel); | 451 | GNUNET_assert (NULL != channel); |
452 | if (sc_count >= sc_count_max) | 452 | if (sc_count >= sc_count_max) |
453 | { | 453 | { |
454 | GNUNET_STATISTICS_update (GSF_stats, | 454 | GNUNET_STATISTICS_update (GSF_stats, |
455 | gettext_noop ("# mesh client connections rejected"), 1, | 455 | gettext_noop ("# mesh client connections rejected"), 1, |
456 | GNUNET_NO); | 456 | GNUNET_NO); |
457 | GNUNET_MESH_tunnel_destroy (tunnel); | 457 | GNUNET_MESH_channel_destroy (channel); |
458 | return NULL; | 458 | return NULL; |
459 | } | 459 | } |
460 | GNUNET_STATISTICS_update (GSF_stats, | 460 | GNUNET_STATISTICS_update (GSF_stats, |
461 | gettext_noop ("# mesh connections active"), 1, | 461 | gettext_noop ("# mesh connections active"), 1, |
462 | GNUNET_NO); | 462 | GNUNET_NO); |
463 | sc = GNUNET_new (struct MeshClient); | 463 | sc = GNUNET_new (struct MeshClient); |
464 | sc->tunnel = tunnel; | 464 | sc->channel = channel; |
465 | GNUNET_CONTAINER_DLL_insert (sc_head, | 465 | GNUNET_CONTAINER_DLL_insert (sc_head, |
466 | sc_tail, | 466 | sc_tail, |
467 | sc); | 467 | sc); |
@@ -477,23 +477,23 @@ accept_cb (void *cls, | |||
477 | 477 | ||
478 | /** | 478 | /** |
479 | * Function called by mesh when a client disconnects. | 479 | * Function called by mesh when a client disconnects. |
480 | * Cleans up our 'struct MeshClient' of that tunnel. | 480 | * Cleans up our 'struct MeshClient' of that channel. |
481 | * | 481 | * |
482 | * @param cls NULL | 482 | * @param cls NULL |
483 | * @param tunnel tunnel of the disconnecting client | 483 | * @param channel channel of the disconnecting client |
484 | * @param tunnel_ctx our 'struct MeshClient' | 484 | * @param channel_ctx our 'struct MeshClient' |
485 | */ | 485 | */ |
486 | static void | 486 | static void |
487 | cleaner_cb (void *cls, | 487 | cleaner_cb (void *cls, |
488 | const struct GNUNET_MESH_Tunnel *tunnel, | 488 | const struct GNUNET_MESH_Channel *channel, |
489 | void *tunnel_ctx) | 489 | void *channel_ctx) |
490 | { | 490 | { |
491 | struct MeshClient *sc = tunnel_ctx; | 491 | struct MeshClient *sc = channel_ctx; |
492 | struct WriteQueueItem *wqi; | 492 | struct WriteQueueItem *wqi; |
493 | 493 | ||
494 | if (NULL == sc) | 494 | if (NULL == sc) |
495 | return; | 495 | return; |
496 | sc->tunnel = NULL; | 496 | sc->channel = NULL; |
497 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 497 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
498 | "Terminating mesh connection with client %p\n", | 498 | "Terminating mesh connection with client %p\n", |
499 | sc); | 499 | sc); |
@@ -547,7 +547,7 @@ GSF_mesh_start_server () | |||
547 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 547 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
548 | "Initializing mesh FS server with a limit of %llu connections\n", | 548 | "Initializing mesh FS server with a limit of %llu connections\n", |
549 | sc_count_max); | 549 | sc_count_max); |
550 | listen_tunnel = GNUNET_MESH_connect (GSF_cfg, | 550 | listen_channel = GNUNET_MESH_connect (GSF_cfg, |
551 | NULL, | 551 | NULL, |
552 | &accept_cb, | 552 | &accept_cb, |
553 | &cleaner_cb, | 553 | &cleaner_cb, |
@@ -562,10 +562,10 @@ GSF_mesh_start_server () | |||
562 | void | 562 | void |
563 | GSF_mesh_stop_server () | 563 | GSF_mesh_stop_server () |
564 | { | 564 | { |
565 | if (NULL != listen_tunnel) | 565 | if (NULL != listen_channel) |
566 | { | 566 | { |
567 | GNUNET_MESH_disconnect (listen_tunnel); | 567 | GNUNET_MESH_disconnect (listen_channel); |
568 | listen_tunnel = NULL; | 568 | listen_channel = NULL; |
569 | } | 569 | } |
570 | GNUNET_assert (NULL == sc_head); | 570 | GNUNET_assert (NULL == sc_head); |
571 | GNUNET_assert (0 == sc_count); | 571 | GNUNET_assert (0 == sc_count); |