diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2012-10-08 13:28:11 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2012-10-08 13:28:11 +0000 |
commit | 4fc3b5b308c49be68aff6cf99b4f6033ee680137 (patch) | |
tree | 8769318a85c810b82b78cae5ab1d894fc72c1854 /src/testbed/gnunet-service-testbed.c | |
parent | 21e8bc75bd7964e55f7d9eb5982b08d331034a5a (diff) | |
download | gnunet-4fc3b5b308c49be68aff6cf99b4f6033ee680137.tar.gz gnunet-4fc3b5b308c49be68aff6cf99b4f6033ee680137.zip |
forwarding overlay request connect
Diffstat (limited to 'src/testbed/gnunet-service-testbed.c')
-rw-r--r-- | src/testbed/gnunet-service-testbed.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/testbed/gnunet-service-testbed.c b/src/testbed/gnunet-service-testbed.c index b5282cffc..d254b2b28 100644 --- a/src/testbed/gnunet-service-testbed.c +++ b/src/testbed/gnunet-service-testbed.c | |||
@@ -79,7 +79,7 @@ struct Context | |||
79 | * The TESTING system handle for starting peers locally | 79 | * The TESTING system handle for starting peers locally |
80 | */ | 80 | */ |
81 | struct GNUNET_TESTING_System *system; | 81 | struct GNUNET_TESTING_System *system; |
82 | 82 | ||
83 | /** | 83 | /** |
84 | * Event mask of event to be responded in this context | 84 | * Event mask of event to be responded in this context |
85 | */ | 85 | */ |
@@ -296,7 +296,7 @@ struct LCFContextQueue | |||
296 | 296 | ||
297 | 297 | ||
298 | /** | 298 | /** |
299 | * A locally started peer | 299 | * A peer |
300 | */ | 300 | */ |
301 | struct Peer | 301 | struct Peer |
302 | { | 302 | { |
@@ -598,7 +598,7 @@ static struct Route **route_list; | |||
598 | static struct Slave **slave_list; | 598 | static struct Slave **slave_list; |
599 | 599 | ||
600 | /** | 600 | /** |
601 | * A list of peers we own locally | 601 | * A list of peers we know about |
602 | */ | 602 | */ |
603 | static struct Peer **peer_list; | 603 | static struct Peer **peer_list; |
604 | 604 | ||
@@ -2453,7 +2453,7 @@ handle_overlay_connect (void *cls, struct GNUNET_SERVER_Client *client, | |||
2453 | occ->peer_id = p1; | 2453 | occ->peer_id = p1; |
2454 | occ->other_peer_id = p2; | 2454 | occ->other_peer_id = p2; |
2455 | occ->peer = peer_list[p1]; | 2455 | occ->peer = peer_list[p1]; |
2456 | occ->op_id = GNUNET_ntohll (msg->operation_id); | 2456 | occ->op_id = GNUNET_ntohll (msg->operation_id); |
2457 | if ((p2 >= peer_list_size) || (NULL == peer_list[p2])) | 2457 | if ((p2 >= peer_list_size) || (NULL == peer_list[p2])) |
2458 | { | 2458 | { |
2459 | uint32_t peer2_host_id; | 2459 | uint32_t peer2_host_id; |
@@ -2462,6 +2462,9 @@ handle_overlay_connect (void *cls, struct GNUNET_SERVER_Client *client, | |||
2462 | if ((peer2_host_id >= slave_list_size) | 2462 | if ((peer2_host_id >= slave_list_size) |
2463 | || (NULL ==slave_list[peer2_host_id])) | 2463 | || (NULL ==slave_list[peer2_host_id])) |
2464 | { | 2464 | { |
2465 | /* Peer2's host is located above us or lateral to us.. | ||
2466 | FIXME: should try to ask for the configuration of peer2's host by | ||
2467 | sending a reply asking for its configuration */ | ||
2465 | GNUNET_break (0); | 2468 | GNUNET_break (0); |
2466 | GNUNET_SERVER_client_drop (client); | 2469 | GNUNET_SERVER_client_drop (client); |
2467 | GNUNET_free (occ); | 2470 | GNUNET_free (occ); |
@@ -2476,7 +2479,7 @@ handle_overlay_connect (void *cls, struct GNUNET_SERVER_Client *client, | |||
2476 | GNUNET_free (occ); | 2479 | GNUNET_free (occ); |
2477 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 2480 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); |
2478 | return; | 2481 | return; |
2479 | } | 2482 | } |
2480 | } | 2483 | } |
2481 | else | 2484 | else |
2482 | { | 2485 | { |
@@ -2656,10 +2659,14 @@ handle_overlay_request_connect (void *cls, struct GNUNET_SERVER_Client *client, | |||
2656 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 2659 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); |
2657 | return; | 2660 | return; |
2658 | } | 2661 | } |
2659 | if (GNUNET_NO != peer->is_remote) | 2662 | if (GNUNET_YES == peer->is_remote) |
2660 | { | 2663 | { |
2661 | GNUNET_break (0); | 2664 | struct GNUNET_MessageHeader *msg2; |
2662 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 2665 | |
2666 | msg2 = GNUNET_malloc (msize); | ||
2667 | (void) memcpy (msg2, message, msize); | ||
2668 | GNUNET_TESTBED_queue_message_ (peer->details.remote.controller, msg2); | ||
2669 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | ||
2663 | return; | 2670 | return; |
2664 | } | 2671 | } |
2665 | rocc = GNUNET_malloc (sizeof (struct RequestOverlayConnectContext)); | 2672 | rocc = GNUNET_malloc (sizeof (struct RequestOverlayConnectContext)); |