diff options
author | Bart Polot <bart@net.in.tum.de> | 2013-05-10 08:04:29 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2013-05-10 08:04:29 +0000 |
commit | e9c1e7db7bc40fd0e78a46154f3069c2961761cd (patch) | |
tree | cd049d77ad9a242d2b9d65042503bbd9d38fe01a /src | |
parent | 100331ae270f47a538cf243b93a95908d04ebdd2 (diff) | |
download | gnunet-e9c1e7db7bc40fd0e78a46154f3069c2961761cd.tar.gz gnunet-e9c1e7db7bc40fd0e78a46154f3069c2961761cd.zip |
- proper memory usage
Diffstat (limited to 'src')
-rw-r--r-- | src/mesh/mesh2_api.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesh/mesh2_api.c b/src/mesh/mesh2_api.c index b0d5f6909..90a216774 100644 --- a/src/mesh/mesh2_api.c +++ b/src/mesh/mesh2_api.c | |||
@@ -869,8 +869,8 @@ process_incoming_data (struct GNUNET_MESH_Handle *h, | |||
869 | const struct GNUNET_MessageHeader *payload; | 869 | const struct GNUNET_MessageHeader *payload; |
870 | const struct GNUNET_MESH_MessageHandler *handler; | 870 | const struct GNUNET_MESH_MessageHandler *handler; |
871 | const struct GNUNET_PeerIdentity *peer; | 871 | const struct GNUNET_PeerIdentity *peer; |
872 | struct GNUNET_PeerIdentity id; | ||
872 | struct GNUNET_MESH_Unicast *ucast; | 873 | struct GNUNET_MESH_Unicast *ucast; |
873 | struct GNUNET_MESH_Multicast *mcast; | ||
874 | struct GNUNET_MESH_ToOrigin *to_orig; | 874 | struct GNUNET_MESH_ToOrigin *to_orig; |
875 | struct GNUNET_MESH_Tunnel *t; | 875 | struct GNUNET_MESH_Tunnel *t; |
876 | unsigned int i; | 876 | unsigned int i; |
@@ -895,7 +895,8 @@ process_incoming_data (struct GNUNET_MESH_Handle *h, | |||
895 | to_orig = (struct GNUNET_MESH_ToOrigin *) message; | 895 | to_orig = (struct GNUNET_MESH_ToOrigin *) message; |
896 | t = retrieve_tunnel (h, ntohl (to_orig->tid)); | 896 | t = retrieve_tunnel (h, ntohl (to_orig->tid)); |
897 | payload = (struct GNUNET_MessageHeader *) &to_orig[1]; | 897 | payload = (struct GNUNET_MessageHeader *) &to_orig[1]; |
898 | GNUNET_PEER_resolve (t->peer, &peer); | 898 | GNUNET_PEER_resolve (t->peer, &id); |
899 | peer = &id; | ||
899 | pid = ntohl (to_orig->pid); | 900 | pid = ntohl (to_orig->pid); |
900 | LOG (GNUNET_ERROR_TYPE_DEBUG, " torig on tunnel %s [%X]\n", | 901 | LOG (GNUNET_ERROR_TYPE_DEBUG, " torig on tunnel %s [%X]\n", |
901 | GNUNET_i2s (peer), ntohl (to_orig->tid)); | 902 | GNUNET_i2s (peer), ntohl (to_orig->tid)); |
@@ -1467,6 +1468,7 @@ GNUNET_MESH_tunnel_create (struct GNUNET_MESH_Handle *h, | |||
1467 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_CREATE); | 1468 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_CREATE); |
1468 | msg.header.size = htons (sizeof (struct GNUNET_MESH_TunnelMessage)); | 1469 | msg.header.size = htons (sizeof (struct GNUNET_MESH_TunnelMessage)); |
1469 | msg.tunnel_id = htonl (t->tid); | 1470 | msg.tunnel_id = htonl (t->tid); |
1471 | msg.peer = *peer; | ||
1470 | send_packet (h, &msg.header, t); | 1472 | send_packet (h, &msg.header, t); |
1471 | return t; | 1473 | return t; |
1472 | } | 1474 | } |