diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2012-10-19 12:15:45 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2012-10-19 12:15:45 +0000 |
commit | 33b1edb5e9ee559da27d6491cddbfdbe30e6d3f4 (patch) | |
tree | 24b92067b11df583678133f9d67b239dfbc47017 /src | |
parent | 4394539dca8d91edb2be740bd139e2e267899a30 (diff) | |
download | gnunet-33b1edb5e9ee559da27d6491cddbfdbe30e6d3f4.tar.gz gnunet-33b1edb5e9ee559da27d6491cddbfdbe30e6d3f4.zip |
removed redundancy
Diffstat (limited to 'src')
-rw-r--r-- | src/testbed/gnunet-service-testbed.c | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/src/testbed/gnunet-service-testbed.c b/src/testbed/gnunet-service-testbed.c index 90ff87235..4d66df04b 100644 --- a/src/testbed/gnunet-service-testbed.c +++ b/src/testbed/gnunet-service-testbed.c | |||
@@ -2094,14 +2094,10 @@ static void | |||
2094 | peer_create_forward_timeout (void *cls, | 2094 | peer_create_forward_timeout (void *cls, |
2095 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 2095 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
2096 | { | 2096 | { |
2097 | struct ForwardedOperationContext *fo_ctxt = cls; | 2097 | struct ForwardedOperationContext *fopc = cls; |
2098 | 2098 | ||
2099 | /* send error msg to client */ | 2099 | GNUNET_free (fopc->cls); |
2100 | GNUNET_free (fo_ctxt->cls); | 2100 | forwarded_operation_timeout (fopc, tc); |
2101 | send_operation_fail_msg (fo_ctxt->client, fo_ctxt->operation_id, "Timedout"); | ||
2102 | GNUNET_SERVER_client_drop (fo_ctxt->client); | ||
2103 | GNUNET_TESTBED_forward_operation_msg_cancel_ (fo_ctxt->opc); | ||
2104 | GNUNET_free (fo_ctxt); | ||
2105 | } | 2101 | } |
2106 | 2102 | ||
2107 | 2103 | ||
@@ -2115,21 +2111,21 @@ peer_create_forward_timeout (void *cls, | |||
2115 | static void | 2111 | static void |
2116 | peer_create_success_cb (void *cls, const struct GNUNET_MessageHeader *msg) | 2112 | peer_create_success_cb (void *cls, const struct GNUNET_MessageHeader *msg) |
2117 | { | 2113 | { |
2118 | struct ForwardedOperationContext *fo_ctxt = cls; | 2114 | struct ForwardedOperationContext *fopc = cls; |
2119 | struct GNUNET_MessageHeader *dup_msg; | 2115 | struct GNUNET_MessageHeader *dup_msg; |
2120 | struct Peer *remote_peer; | 2116 | struct Peer *remote_peer; |
2121 | 2117 | ||
2122 | GNUNET_SCHEDULER_cancel (fo_ctxt->timeout_task); | 2118 | GNUNET_SCHEDULER_cancel (fopc->timeout_task); |
2123 | if (ntohs (msg->type) == GNUNET_MESSAGE_TYPE_TESTBED_PEERCREATESUCCESS) | 2119 | if (ntohs (msg->type) == GNUNET_MESSAGE_TYPE_TESTBED_PEERCREATESUCCESS) |
2124 | { | 2120 | { |
2125 | GNUNET_assert (NULL != fo_ctxt->cls); | 2121 | GNUNET_assert (NULL != fopc->cls); |
2126 | remote_peer = fo_ctxt->cls; | 2122 | remote_peer = fopc->cls; |
2127 | peer_list_add (remote_peer); | 2123 | peer_list_add (remote_peer); |
2128 | } | 2124 | } |
2129 | dup_msg = GNUNET_copy_message (msg); | 2125 | dup_msg = GNUNET_copy_message (msg); |
2130 | queue_message (fo_ctxt->client, dup_msg); | 2126 | queue_message (fopc->client, dup_msg); |
2131 | GNUNET_SERVER_client_drop (fo_ctxt->client); | 2127 | GNUNET_SERVER_client_drop (fopc->client); |
2132 | GNUNET_free (fo_ctxt); | 2128 | GNUNET_free (fopc); |
2133 | } | 2129 | } |
2134 | 2130 | ||
2135 | 2131 | ||
@@ -2143,21 +2139,21 @@ peer_create_success_cb (void *cls, const struct GNUNET_MessageHeader *msg) | |||
2143 | static void | 2139 | static void |
2144 | peer_destroy_success_cb (void *cls, const struct GNUNET_MessageHeader *msg) | 2140 | peer_destroy_success_cb (void *cls, const struct GNUNET_MessageHeader *msg) |
2145 | { | 2141 | { |
2146 | struct ForwardedOperationContext *fo_ctxt = cls; | 2142 | struct ForwardedOperationContext *fopc = cls; |
2147 | struct GNUNET_MessageHeader *dup_msg; | 2143 | struct GNUNET_MessageHeader *dup_msg; |
2148 | struct Peer *remote_peer; | 2144 | struct Peer *remote_peer; |
2149 | 2145 | ||
2150 | GNUNET_SCHEDULER_cancel (fo_ctxt->timeout_task); | 2146 | GNUNET_SCHEDULER_cancel (fopc->timeout_task); |
2151 | if (GNUNET_MESSAGE_TYPE_TESTBED_GENERICOPSUCCESS == ntohs (msg->type)) | 2147 | if (GNUNET_MESSAGE_TYPE_TESTBED_GENERICOPSUCCESS == ntohs (msg->type)) |
2152 | { | 2148 | { |
2153 | remote_peer = fo_ctxt->cls; | 2149 | remote_peer = fopc->cls; |
2154 | GNUNET_assert (NULL != remote_peer); | 2150 | GNUNET_assert (NULL != remote_peer); |
2155 | peer_list_remove (remote_peer); | 2151 | peer_list_remove (remote_peer); |
2156 | } | 2152 | } |
2157 | dup_msg = GNUNET_copy_message (msg); | 2153 | dup_msg = GNUNET_copy_message (msg); |
2158 | queue_message (fo_ctxt->client, dup_msg); | 2154 | queue_message (fopc->client, dup_msg); |
2159 | GNUNET_SERVER_client_drop (fo_ctxt->client); | 2155 | GNUNET_SERVER_client_drop (fopc->client); |
2160 | GNUNET_free (fo_ctxt); | 2156 | GNUNET_free (fopc); |
2161 | } | 2157 | } |
2162 | 2158 | ||
2163 | 2159 | ||