gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r30698 - gnunet/src/fs


From: gnunet
Subject: [GNUnet-SVN] r30698 - gnunet/src/fs
Date: Thu, 14 Nov 2013 14:57:53 +0100

Author: bartpolot
Date: 2013-11-14 14:57:53 +0100 (Thu, 14 Nov 2013)
New Revision: 30698

Modified:
   gnunet/src/fs/gnunet-service-fs_mesh_client.c
   gnunet/src/fs/gnunet-service-fs_mesh_server.c
Log:
- rename tunnel->channel


Modified: gnunet/src/fs/gnunet-service-fs_mesh_client.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_mesh_client.c       2013-11-14 13:55:12 UTC 
(rev 30697)
+++ gnunet/src/fs/gnunet-service-fs_mesh_client.c       2013-11-14 13:57:53 UTC 
(rev 30698)
@@ -121,9 +121,9 @@
   struct GNUNET_CONTAINER_MultiHashMap *waiting_map;
 
   /**
-   * Tunnel to the other peer.
+   * Channel to the other peer.
    */
-  struct GNUNET_MESH_Tunnel *tunnel;
+  struct GNUNET_MESH_Channel *channel;
 
   /**
    * Handle for active write operation, or NULL.
@@ -153,13 +153,13 @@
 
 
 /**
- * Mesh tunnel for creating outbound tunnels.
+ * Mesh channel for creating outbound channels.
  */
 static struct GNUNET_MESH_Handle *mesh_handle;
 
 /**
  * Map from peer identities to 'struct MeshHandles' with mesh
- * tunnels to those peers.
+ * channels to those peers.
  */
 static struct GNUNET_CONTAINER_MultiPeerMap *mesh_map;
 
@@ -214,13 +214,13 @@
 reset_mesh (struct MeshHandle *mh)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-             "Resetting mesh tunnel to %s\n",
+             "Resetting mesh channel to %s\n",
              GNUNET_i2s (&mh->target));
-  GNUNET_MESH_tunnel_destroy (mh->tunnel);
+  GNUNET_MESH_channel_destroy (mh->channel);
   GNUNET_CONTAINER_multihashmap_iterate (mh->waiting_map,
                                         &move_to_pending,
                                         mh);
-  mh->tunnel = GNUNET_MESH_tunnel_create (mesh_handle,
+  mh->channel = GNUNET_MESH_channel_create (mesh_handle,
                                          mh,
                                          &mh->target,
                                          
GNUNET_APPLICATION_TYPE_FS_BLOCK_TRANSFER,
@@ -231,7 +231,7 @@
 
 
 /**
- * Task called when it is time to destroy an inactive mesh tunnel.
+ * Task called when it is time to destroy an inactive mesh channel.
  *
  * @param cls the 'struct MeshHandle' to tear down
  * @param tc scheduler context, unused
@@ -241,15 +241,15 @@
              const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   struct MeshHandle *mh = cls;
-  struct GNUNET_MESH_Tunnel *tun;
+  struct GNUNET_MESH_Channel *tun;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-             "Timeout on mesh tunnel to %s\n",
+             "Timeout on mesh channel to %s\n",
              GNUNET_i2s (&mh->target));
   mh->timeout_task = GNUNET_SCHEDULER_NO_TASK;
-  tun = mh->tunnel;
-  mh->tunnel = NULL;
-  GNUNET_MESH_tunnel_destroy (tun);
+  tun = mh->channel;
+  mh->channel = NULL;
+  GNUNET_MESH_channel_destroy (tun);
 }
 
 
@@ -308,7 +308,7 @@
   if (NULL == buf)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-               "Mesh tunnel to %s failed during transmission attempt, 
rebuilding\n",
+               "Mesh channel to %s failed during transmission attempt, 
rebuilding\n",
                GNUNET_i2s (&mh->target));
     reset_mesh_async (mh);
     return 0;
@@ -352,11 +352,11 @@
 static void
 transmit_pending (struct MeshHandle *mh)
 {
-  if (NULL == mh->tunnel)
+  if (NULL == mh->channel)
     return;
   if (NULL != mh->wh)
     return;
-  mh->wh = GNUNET_MESH_notify_transmit_ready (mh->tunnel, GNUNET_YES /* allow 
cork */,
+  mh->wh = GNUNET_MESH_notify_transmit_ready (mh->channel, GNUNET_YES /* allow 
cork */,
                                              GNUNET_TIME_UNIT_FOREVER_REL,
                                              sizeof (struct MeshQueryMessage),
                                              &transmit_sqm, mh);
@@ -429,18 +429,18 @@
  * is received.
  *
  * @param cls closure with the 'struct MeshHandle'
- * @param tunnel tunnel handle
- * @param tunnel_ctx tunnel context
+ * @param channel channel handle
+ * @param channel_ctx channel context
  * @param message the actual message
  * @return GNUNET_OK on success, GNUNET_SYSERR to stop further processing
  */
 static int
 reply_cb (void *cls,
-         struct GNUNET_MESH_Tunnel *tunnel,
-         void **tunnel_ctx,
+         struct GNUNET_MESH_Channel *channel,
+         void **channel_ctx,
           const struct GNUNET_MessageHeader *message)
 {
-  struct MeshHandle *mh = *tunnel_ctx;
+  struct MeshHandle *mh = *channel_ctx;
   const struct MeshReplyMessage *srm;
   struct HandleReplyClosure hrc;
   uint16_t msize;
@@ -470,7 +470,7 @@
              "Received reply `%s' via mesh from peer %s\n",
              GNUNET_h2s (&query),
              GNUNET_i2s (&mh->target));
-  GNUNET_MESH_receive_done (tunnel);
+  GNUNET_MESH_receive_done (channel);
   GNUNET_STATISTICS_update (GSF_stats,
                            gettext_noop ("# replies received via mesh"), 1,
                            GNUNET_NO);
@@ -516,7 +516,7 @@
     return mh;
   }
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-             "Creating mesh tunnel to %s\n",
+             "Creating mesh channel to %s\n",
              GNUNET_i2s (target));
   mh = GNUNET_new (struct MeshHandle);
   mh->reset_task = GNUNET_SCHEDULER_add_delayed (CLIENT_RETRY_TIMEOUT,
@@ -524,7 +524,7 @@
                                                 mh);
   mh->waiting_map = GNUNET_CONTAINER_multihashmap_create (16, GNUNET_YES);
   mh->target = *target;
-  mh->tunnel = GNUNET_MESH_tunnel_create (mesh_handle,
+  mh->channel = GNUNET_MESH_channel_create (mesh_handle,
                                          mh,
                                          &mh->target,
                                          
GNUNET_APPLICATION_TYPE_FS_BLOCK_TRANSFER,
@@ -637,21 +637,21 @@
 
 /**
  * Function called by mesh when a client disconnects.
- * Cleans up our 'struct MeshClient' of that tunnel.
+ * Cleans up our 'struct MeshClient' of that channel.
  *
  * @param cls NULL
- * @param tunnel tunnel of the disconnecting client
- * @param tunnel_ctx our 'struct MeshClient'
+ * @param channel channel of the disconnecting client
+ * @param channel_ctx our 'struct MeshClient'
  */
 static void
 cleaner_cb (void *cls,
-           const struct GNUNET_MESH_Tunnel *tunnel,
-           void *tunnel_ctx)
+           const struct GNUNET_MESH_Channel *channel,
+           void *channel_ctx)
 {
-  struct MeshHandle *mh = tunnel_ctx;
+  struct MeshHandle *mh = channel_ctx;
   struct GSF_MeshRequest *sr;
 
-  mh->tunnel = NULL;
+  mh->channel = NULL;
   while (NULL != (sr = mh->pending_head))
   {
     sr->proc (sr->proc_cls, GNUNET_BLOCK_TYPE_ANY,
@@ -712,15 +712,15 @@
               void *value)
 {
   struct MeshHandle *mh = value;
-  struct GNUNET_MESH_Tunnel *tun;
+  struct GNUNET_MESH_Channel *tun;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-             "Timeout on mesh tunnel to %s\n",
+             "Timeout on mesh channel to %s\n",
              GNUNET_i2s (&mh->target));
-  tun = mh->tunnel;
-  mh->tunnel = NULL;
+  tun = mh->channel;
+  mh->channel = NULL;
   if (NULL != tun)
-    GNUNET_MESH_tunnel_destroy (tun);
+    GNUNET_MESH_channel_destroy (tun);
   return GNUNET_YES;
 }
 

Modified: gnunet/src/fs/gnunet-service-fs_mesh_server.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_mesh_server.c       2013-11-14 13:55:12 UTC 
(rev 30697)
+++ gnunet/src/fs/gnunet-service-fs_mesh_server.c       2013-11-14 13:57:53 UTC 
(rev 30698)
@@ -81,9 +81,9 @@
   struct MeshClient *prev;
 
   /**
-   * Tunnel for communication.
+   * Channel for communication.
    */
-  struct GNUNET_MESH_Tunnel *tunnel;
+  struct GNUNET_MESH_Channel *channel;
 
   /**
    * Handle for active write operation, or NULL.
@@ -124,9 +124,9 @@
 
 
 /**
- * Listen tunnel for incoming requests.
+ * Listen channel for incoming requests.
  */
-static struct GNUNET_MESH_Handle *listen_tunnel;
+static struct GNUNET_MESH_Handle *listen_channel;
 
 /**
  * Head of DLL of mesh clients.
@@ -161,15 +161,15 @@
                     const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   struct MeshClient *sc = cls;
-  struct GNUNET_MESH_Tunnel *tun;
+  struct GNUNET_MESH_Channel *tun;
 
   sc->timeout_task = GNUNET_SCHEDULER_NO_TASK;
-  tun = sc->tunnel;
-  sc->tunnel = NULL;
+  tun = sc->channel;
+  sc->channel = NULL;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Timeout for inactive mesh client %p\n",
              sc);
-  GNUNET_MESH_tunnel_destroy (tun);
+  GNUNET_MESH_channel_destroy (tun);
 }
 
 
@@ -201,7 +201,7 @@
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Finished processing mesh request from client %p, ready to 
receive the next one\n",
              sc);
-  GNUNET_MESH_receive_done (sc->tunnel);
+  GNUNET_MESH_receive_done (sc->channel);
 }
 
 
@@ -228,7 +228,7 @@
                    void *buf)
 {
   struct MeshClient *sc = cls;
-  struct GNUNET_MESH_Tunnel *tun;
+  struct GNUNET_MESH_Channel *tun;
   struct WriteQueueItem *wqi;
   size_t ret;
 
@@ -243,9 +243,9 @@
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                "Transmission of reply failed, terminating mesh\n");
-    tun = sc->tunnel;
-    sc->tunnel = NULL;
-    GNUNET_MESH_tunnel_destroy (tun);
+    tun = sc->channel;
+    sc->channel = NULL;
+    GNUNET_MESH_channel_destroy (tun);
     return 0;
   }
   GNUNET_CONTAINER_DLL_remove (sc->wqi_head,
@@ -274,7 +274,7 @@
 continue_writing (struct MeshClient *sc)
 {
   struct WriteQueueItem *wqi;
-  struct GNUNET_MESH_Tunnel *tun;
+  struct GNUNET_MESH_Channel *tun;
 
   if (NULL != sc->wh)
   {
@@ -289,7 +289,7 @@
     continue_reading (sc);
     return;
   }
-  sc->wh = GNUNET_MESH_notify_transmit_ready (sc->tunnel, GNUNET_NO,
+  sc->wh = GNUNET_MESH_notify_transmit_ready (sc->channel, GNUNET_NO,
                                              GNUNET_TIME_UNIT_FOREVER_REL,
                                              wqi->msize,                       
        
                                              &write_continuation,
@@ -298,9 +298,9 @@
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                "Write failed; terminating mesh\n");
-    tun = sc->tunnel;
-    sc->tunnel = NULL;
-    GNUNET_MESH_tunnel_destroy (tun);
+    tun = sc->channel;
+    sc->channel = NULL;
+    GNUNET_MESH_channel_destroy (tun);
     return;
   }
 }
@@ -389,18 +389,18 @@
  * Do not call GNUNET_SERVER_mst_destroy in callback
  *
  * @param cls closure with the 'struct MeshClient'
- * @param tunnel tunnel handle
- * @param tunnel_ctx tunnel context
+ * @param channel channel handle
+ * @param channel_ctx channel context
  * @param message the actual message
  * @return GNUNET_OK on success, GNUNET_SYSERR to stop further processing
  */
 static int
 request_cb (void *cls,
-           struct GNUNET_MESH_Tunnel *tunnel,
-           void **tunnel_ctx,
+           struct GNUNET_MESH_Channel *channel,
+           void **channel_ctx,
            const struct GNUNET_MessageHeader *message)
 {
-  struct MeshClient *sc = *tunnel_ctx;
+  struct MeshClient *sc = *channel_ctx;
   const struct MeshQueryMessage *sqm;
 
   sqm = (const struct MeshQueryMessage *) message;
@@ -434,34 +434,34 @@
  * Functions of this type are called upon new mesh connection from other peers.
  *
  * @param cls the closure from GNUNET_MESH_connect
- * @param tunnel the tunnel representing the mesh
+ * @param channel the channel representing the mesh
  * @param initiator the identity of the peer who wants to establish a mesh
  *            with us; NULL on binding error
  * @param port mesh port used for the incoming connection
- * @return initial tunnel context (our 'struct MeshClient')
+ * @return initial channel context (our 'struct MeshClient')
  */
 static void *
 accept_cb (void *cls,
-          struct GNUNET_MESH_Tunnel *tunnel,
+          struct GNUNET_MESH_Channel *channel,
           const struct GNUNET_PeerIdentity *initiator,
           uint32_t port)
 {
   struct MeshClient *sc;
 
-  GNUNET_assert (NULL != tunnel);
+  GNUNET_assert (NULL != channel);
   if (sc_count >= sc_count_max)
   {
     GNUNET_STATISTICS_update (GSF_stats,
                              gettext_noop ("# mesh client connections 
rejected"), 1,
                              GNUNET_NO);
-    GNUNET_MESH_tunnel_destroy (tunnel);
+    GNUNET_MESH_channel_destroy (channel);
     return NULL;
   }
   GNUNET_STATISTICS_update (GSF_stats,
                            gettext_noop ("# mesh connections active"), 1,
                            GNUNET_NO);
   sc = GNUNET_new (struct MeshClient);
-  sc->tunnel = tunnel;
+  sc->channel = channel;
   GNUNET_CONTAINER_DLL_insert (sc_head,
                               sc_tail,
                               sc);
@@ -477,23 +477,23 @@
 
 /**
  * Function called by mesh when a client disconnects.
- * Cleans up our 'struct MeshClient' of that tunnel.
+ * Cleans up our 'struct MeshClient' of that channel.
  *
  * @param cls NULL
- * @param tunnel tunnel of the disconnecting client
- * @param tunnel_ctx our 'struct MeshClient'
+ * @param channel channel of the disconnecting client
+ * @param channel_ctx our 'struct MeshClient'
  */
 static void
 cleaner_cb (void *cls,
-           const struct GNUNET_MESH_Tunnel *tunnel,
-           void *tunnel_ctx)
+           const struct GNUNET_MESH_Channel *channel,
+           void *channel_ctx)
 {
-  struct MeshClient *sc = tunnel_ctx;
+  struct MeshClient *sc = channel_ctx;
   struct WriteQueueItem *wqi;
 
   if (NULL == sc)
     return;
-  sc->tunnel = NULL;
+  sc->channel = NULL;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Terminating mesh connection with client %p\n",
              sc);
@@ -547,7 +547,7 @@
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Initializing mesh FS server with a limit of %llu connections\n",
              sc_count_max);
-  listen_tunnel = GNUNET_MESH_connect (GSF_cfg,
+  listen_channel = GNUNET_MESH_connect (GSF_cfg,
                                       NULL,
                                       &accept_cb,
                                       &cleaner_cb,
@@ -562,10 +562,10 @@
 void
 GSF_mesh_stop_server ()
 {
-  if (NULL != listen_tunnel)
+  if (NULL != listen_channel)
   {
-    GNUNET_MESH_disconnect (listen_tunnel);
-    listen_tunnel = NULL;
+    GNUNET_MESH_disconnect (listen_channel);
+    listen_channel = NULL;
   }
   GNUNET_assert (NULL == sc_head);
   GNUNET_assert (0 == sc_count);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]