gnunet

Main GNUnet Logic
Log | Files | Refs | Submodules | README | LICENSE

commit 0e15cbeb7359ad8c4095bb371c6992f22d8fa3b8
parent a900b29ddaa9ea46c731b054b5e3ef3e725b95a8
Author: Bart Polot <bart@net.in.tum.de>
Date:   Wed, 19 Jun 2013 11:50:50 +0000

Change in mesh API: data callback no longer provides sender, user must remember tunnel<->sender if needed (fix bug #2894)



Diffstat:
Msrc/fs/gnunet-service-fs_mesh.c | 10+++++-----
Msrc/include/gnunet_mesh2_service.h | 2--
Msrc/mesh/mesh2_api.c | 2+-
3 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/fs/gnunet-service-fs_mesh.c b/src/fs/gnunet-service-fs_mesh.c @@ -647,7 +647,8 @@ handle_reply (void *cls, * complete reply is received. * * @param cls closure with the 'struct StreamHandle' - * @param client identification of the client, NULL + * @param tunnel tunnel handle + * @param tunnel_ctx tunnel context * @param message the actual message * @return GNUNET_OK on success, GNUNET_SYSERR to stop further processing */ @@ -655,8 +656,7 @@ static int reply_cb (void *cls, struct GNUNET_MESH_Tunnel *tunnel, void **tunnel_ctx, - const struct GNUNET_PeerIdentity *sender, - const struct GNUNET_MessageHeader *message) + const struct GNUNET_MessageHeader *message) { struct StreamHandle *sh = *tunnel_ctx; const struct StreamReplyMessage *srm; @@ -1080,7 +1080,8 @@ handle_datastore_reply (void *cls, * Do not call GNUNET_SERVER_mst_destroy in callback * * @param cls closure with the 'struct StreamClient' - * @param client identification of the client, NULL + * @param tunnel tunnel handle + * @param tunnel_ctx tunnel context * @param message the actual message * @return GNUNET_OK on success, GNUNET_SYSERR to stop further processing */ @@ -1088,7 +1089,6 @@ static int request_cb (void *cls, struct GNUNET_MESH_Tunnel *tunnel, void **tunnel_ctx, - const struct GNUNET_PeerIdentity *sender, const struct GNUNET_MessageHeader *message) { struct StreamClient *sc = *tunnel_ctx; diff --git a/src/include/gnunet_mesh2_service.h b/src/include/gnunet_mesh2_service.h @@ -70,7 +70,6 @@ struct GNUNET_MESH_Tunnel; * @param cls Closure (set from GNUNET_MESH_connect). * @param tunnel Connection to the other end. * @param tunnel_ctx Place to store local state associated with the tunnel. - * @param sender Peer who sent the message. * @param message The actual message. * * @return GNUNET_OK to keep the tunnel open, @@ -79,7 +78,6 @@ struct GNUNET_MESH_Tunnel; typedef int (*GNUNET_MESH_MessageCallback) (void *cls, struct GNUNET_MESH_Tunnel *tunnel, void **tunnel_ctx, - const struct GNUNET_PeerIdentity *sender, const struct GNUNET_MessageHeader *message); diff --git a/src/mesh/mesh2_api.c b/src/mesh/mesh2_api.c @@ -951,7 +951,7 @@ process_incoming_data (struct GNUNET_MESH_Handle *h, if (handler->type == type) { if (GNUNET_OK != - handler->callback (h->cls, t, &t->ctx, peer, payload)) + handler->callback (h->cls, t, &t->ctx, payload)) { LOG (GNUNET_ERROR_TYPE_DEBUG, "callback caused disconnection\n"); GNUNET_MESH_tunnel_destroy (t);