diff options
author | Bart Polot <bart@net.in.tum.de> | 2011-09-16 18:10:24 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2011-09-16 18:10:24 +0000 |
commit | 5db7465af6145d62b50ee0dd235198c75726deb6 (patch) | |
tree | b93c242213f24aa7992d319e99867d35f3519191 /src | |
parent | 3c098b0d6d3b4ea6417075ccbf3ff84da8d6b2e2 (diff) | |
download | gnunet-5db7465af6145d62b50ee0dd235198c75726deb6.tar.gz gnunet-5db7465af6145d62b50ee0dd235198c75726deb6.zip |
Fixed send data to origin to work with the new data structures
Diffstat (limited to 'src')
-rw-r--r-- | src/mesh/gnunet-service-mesh.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index 5002571ed..51f002a78 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c | |||
@@ -2099,8 +2099,6 @@ handle_mesh_data_multicast (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
2099 | * @param atsi performance data | 2099 | * @param atsi performance data |
2100 | * @return GNUNET_OK to keep the connection open, | 2100 | * @return GNUNET_OK to keep the connection open, |
2101 | * GNUNET_SYSERR to close it (signal serious error) | 2101 | * GNUNET_SYSERR to close it (signal serious error) |
2102 | * | ||
2103 | * FIXME path | ||
2104 | */ | 2102 | */ |
2105 | static int | 2103 | static int |
2106 | handle_mesh_data_to_orig (void *cls, const struct GNUNET_PeerIdentity *peer, | 2104 | handle_mesh_data_to_orig (void *cls, const struct GNUNET_PeerIdentity *peer, |
@@ -2109,14 +2107,14 @@ handle_mesh_data_to_orig (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
2109 | { | 2107 | { |
2110 | struct GNUNET_MESH_ToOrigin *msg; | 2108 | struct GNUNET_MESH_ToOrigin *msg; |
2111 | struct GNUNET_PeerIdentity id; | 2109 | struct GNUNET_PeerIdentity id; |
2112 | struct MeshTunnel *t; | ||
2113 | struct MeshPeerInfo *peer_info; | 2110 | struct MeshPeerInfo *peer_info; |
2111 | struct MeshTunnel *t; | ||
2114 | size_t size; | 2112 | size_t size; |
2115 | 2113 | ||
2116 | size = ntohs (message->size); | 2114 | size = ntohs (message->size); |
2117 | if (size < | 2115 | if (size < |
2118 | sizeof (struct GNUNET_MESH_ToOrigin) + | 2116 | sizeof (struct GNUNET_MESH_ToOrigin) + |
2119 | sizeof (struct GNUNET_MessageHeader)) | 2117 | sizeof (struct GNUNET_MessageHeader)) /* Payload >= header */ |
2120 | { | 2118 | { |
2121 | GNUNET_break_op (0); | 2119 | GNUNET_break_op (0); |
2122 | return GNUNET_OK; | 2120 | return GNUNET_OK; |
@@ -2138,6 +2136,7 @@ handle_mesh_data_to_orig (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
2138 | GNUNET_break_op (0); | 2136 | GNUNET_break_op (0); |
2139 | return GNUNET_OK; | 2137 | return GNUNET_OK; |
2140 | } | 2138 | } |
2139 | /* TODO signature verification */ | ||
2141 | GNUNET_SERVER_notification_context_unicast (nc, t->client->handle, message, | 2140 | GNUNET_SERVER_notification_context_unicast (nc, t->client->handle, message, |
2142 | GNUNET_YES); | 2141 | GNUNET_YES); |
2143 | return GNUNET_OK; | 2142 | return GNUNET_OK; |
@@ -2149,7 +2148,7 @@ handle_mesh_data_to_orig (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
2149 | GNUNET_break (0); | 2148 | GNUNET_break (0); |
2150 | return GNUNET_OK; | 2149 | return GNUNET_OK; |
2151 | } | 2150 | } |
2152 | GNUNET_PEER_resolve (path_get_first_hop (t, peer_info)->id, &id); | 2151 | GNUNET_PEER_resolve (t->paths->me->parent->peer->id, &id); |
2153 | msg = GNUNET_malloc (size); | 2152 | msg = GNUNET_malloc (size); |
2154 | memcpy (msg, message, size); | 2153 | memcpy (msg, message, size); |
2155 | GNUNET_CORE_notify_transmit_ready (core_handle, 0, 0, | 2154 | GNUNET_CORE_notify_transmit_ready (core_handle, 0, 0, |