diff options
author | Bart Polot <bart@net.in.tum.de> | 2014-04-09 17:18:48 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2014-04-09 17:18:48 +0000 |
commit | 0cf253483433ce66627915bb72bc643d2f7c8a5c (patch) | |
tree | ab5d29c9d2ebad995a893dcef450bfe418e52e74 /src/mesh | |
parent | 2dae6d8d5b7eff1ee73f47ee6b3b57d40ae4f602 (diff) | |
download | gnunet-0cf253483433ce66627915bb72bc643d2f7c8a5c.tar.gz gnunet-0cf253483433ce66627915bb72bc643d2f7c8a5c.zip |
- add context in path to link connection
Diffstat (limited to 'src/mesh')
-rw-r--r-- | src/mesh/gnunet-service-mesh_connection.c | 1 | ||||
-rw-r--r-- | src/mesh/gnunet-service-mesh_peer.c | 15 | ||||
-rw-r--r-- | src/mesh/mesh_path.h | 7 |
3 files changed, 20 insertions, 3 deletions
diff --git a/src/mesh/gnunet-service-mesh_connection.c b/src/mesh/gnunet-service-mesh_connection.c index 8b5bf8dbf..e355b9e2b 100644 --- a/src/mesh/gnunet-service-mesh_connection.c +++ b/src/mesh/gnunet-service-mesh_connection.c | |||
@@ -2439,6 +2439,7 @@ GMC_new (const struct GNUNET_MESH_Hash *cid, | |||
2439 | GNUNET_assert (own_pos <= p->length - 1); | 2439 | GNUNET_assert (own_pos <= p->length - 1); |
2440 | c->own_pos = own_pos; | 2440 | c->own_pos = own_pos; |
2441 | c->path = p; | 2441 | c->path = p; |
2442 | p->c = c; | ||
2442 | 2443 | ||
2443 | if (GNUNET_OK != register_neighbors (c)) | 2444 | if (GNUNET_OK != register_neighbors (c)) |
2444 | { | 2445 | { |
diff --git a/src/mesh/gnunet-service-mesh_peer.c b/src/mesh/gnunet-service-mesh_peer.c index 7d537e875..50e37fee2 100644 --- a/src/mesh/gnunet-service-mesh_peer.c +++ b/src/mesh/gnunet-service-mesh_peer.c | |||
@@ -744,11 +744,10 @@ peer_get_best_path (const struct MeshPeer *peer) | |||
744 | best_p = NULL; | 744 | best_p = NULL; |
745 | for (p = peer->path_head; NULL != p; p = p->next) | 745 | for (p = peer->path_head; NULL != p; p = p->next) |
746 | { | 746 | { |
747 | if (GNUNET_YES == GMT_is_path_used (peer->tunnel, p)) | ||
748 | continue; /* If path is already in use, skip it. */ | ||
749 | |||
750 | if (GNUNET_NO == path_is_valid (p)) | 747 | if (GNUNET_NO == path_is_valid (p)) |
751 | continue; /* Don't use invalid paths. */ | 748 | continue; /* Don't use invalid paths. */ |
749 | if (GNUNET_YES == GMT_is_path_used (peer->tunnel, p)) | ||
750 | continue; /* If path is already in use, skip it. */ | ||
752 | 751 | ||
753 | if ((cost = GMT_get_path_cost (peer->tunnel, p)) < best_cost) | 752 | if ((cost = GMT_get_path_cost (peer->tunnel, p)) < best_cost) |
754 | { | 753 | { |
@@ -760,6 +759,16 @@ peer_get_best_path (const struct MeshPeer *peer) | |||
760 | } | 759 | } |
761 | 760 | ||
762 | 761 | ||
762 | /** | ||
763 | * Is this queue element sendable? | ||
764 | * | ||
765 | * - All management traffic is always sendable. | ||
766 | * - For payload traffic, check the connection flow control. | ||
767 | * | ||
768 | * @param q Queue element to inspect. | ||
769 | * | ||
770 | * @return #GNUNET_YES if it is sendable, #GNUNET_NO otherwise. | ||
771 | */ | ||
763 | static int | 772 | static int |
764 | queue_is_sendable (struct MeshPeerQueue *q) | 773 | queue_is_sendable (struct MeshPeerQueue *q) |
765 | { | 774 | { |
diff --git a/src/mesh/mesh_path.h b/src/mesh/mesh_path.h index 8b8e20a1e..bba11e9d4 100644 --- a/src/mesh/mesh_path.h +++ b/src/mesh/mesh_path.h | |||
@@ -24,6 +24,8 @@ | |||
24 | * @author Bartlomiej Polot | 24 | * @author Bartlomiej Polot |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "gnunet-service-mesh_connection.h" | ||
28 | |||
27 | #ifndef MESH_PATH_H_ | 29 | #ifndef MESH_PATH_H_ |
28 | #define MESH_PATH_H_ | 30 | #define MESH_PATH_H_ |
29 | 31 | ||
@@ -62,6 +64,11 @@ struct MeshPeerPath | |||
62 | unsigned int length; | 64 | unsigned int length; |
63 | 65 | ||
64 | /** | 66 | /** |
67 | * User defined data store. | ||
68 | */ | ||
69 | struct MeshConnection *c; | ||
70 | |||
71 | /** | ||
65 | * Path's score, how reliable is the path. | 72 | * Path's score, how reliable is the path. |
66 | */ | 73 | */ |
67 | // int score; | 74 | // int score; |