aboutsummaryrefslogtreecommitdiff
path: root/src/setup
diff options
context:
space:
mode:
authorChristian Fuchs <christian.fuchs@cfuchs.net>2014-06-09 06:52:07 +0000
committerChristian Fuchs <christian.fuchs@cfuchs.net>2014-06-09 06:52:07 +0000
commit02bb15308e8c042b6258bc7ef805243e90a30551 (patch)
tree41d9dbaa77136b89c9bbb38d7486d94df7590e27 /src/setup
parentf35316cde2292cdfb84e1dc404800912e66c3503 (diff)
downloadgnunet-gtk-02bb15308e8c042b6258bc7ef805243e90a30551.tar.gz
gnunet-gtk-02bb15308e8c042b6258bc7ef805243e90a30551.zip
- fixbuild: modified gnunet-gtk to conform with new nat-test behavior (dedicated redundant timeout task removed)
Diffstat (limited to 'src/setup')
-rw-r--r--src/setup/gnunet-setup-transport-test.c31
-rw-r--r--src/setup/gnunet-setup-transport.c29
2 files changed, 2 insertions, 58 deletions
diff --git a/src/setup/gnunet-setup-transport-test.c b/src/setup/gnunet-setup-transport-test.c
index 83eca413..83ae10ef 100644
--- a/src/setup/gnunet-setup-transport-test.c
+++ b/src/setup/gnunet-setup-transport-test.c
@@ -42,11 +42,6 @@ struct TestContext
42 struct GNUNET_NAT_Test *tst; 42 struct GNUNET_NAT_Test *tst;
43 43
44 /** 44 /**
45 * Task identifier for the timeout.
46 */
47 GNUNET_SCHEDULER_TaskIdentifier tsk;
48
49 /**
50 * Name of widget to show on success. 45 * Name of widget to show on success.
51 */ 46 */
52 const char *success_image; 47 const char *success_image;
@@ -88,11 +83,6 @@ display_test_result (struct TestContext *tc, int result)
88 if (NULL != w) 83 if (NULL != w)
89 gtk_widget_show (GTK_WIDGET (w)); 84 gtk_widget_show (GTK_WIDGET (w));
90 } 85 }
91 if (GNUNET_SCHEDULER_NO_TASK != tc->tsk)
92 {
93 GNUNET_SCHEDULER_cancel (tc->tsk);
94 tc->tsk = GNUNET_SCHEDULER_NO_TASK;
95 }
96 if (NULL != tc->tst) 86 if (NULL != tc->tst)
97 { 87 {
98 GNUNET_NAT_test_stop (tc->tst); 88 GNUNET_NAT_test_stop (tc->tst);
@@ -123,24 +113,6 @@ result_callback (void *cls,
123 113
124 114
125/** 115/**
126 * Function called if NAT failed to confirm success.
127 * Clean up and update GUI (with failure).
128 *
129 * @param cls test context
130 * @param tc scheduler callback
131 */
132static void
133fail_timeout (void *cls,
134 const struct GNUNET_SCHEDULER_TaskContext *tc)
135{
136 struct TestContext *tstc = cls;
137
138 tstc->tsk = GNUNET_SCHEDULER_NO_TASK;
139 display_test_result (tstc, GNUNET_NO);
140}
141
142
143/**
144 * Function called whenever the user wants to test a 116 * Function called whenever the user wants to test a
145 * transport configuration. 117 * transport configuration.
146 * 118 *
@@ -179,14 +151,13 @@ GNUNET_setup_transport_test (const char *section_name, int is_tcp,
179 GNUNET_RESOLVER_connect (cfg); 151 GNUNET_RESOLVER_connect (cfg);
180 tc->tst = 152 tc->tst =
181 GNUNET_NAT_test_start (cfg, is_tcp, (uint16_t) bnd_port, 153 GNUNET_NAT_test_start (cfg, is_tcp, (uint16_t) bnd_port,
182 (uint16_t) adv_port, 154 (uint16_t) adv_port, TIMEOUT,
183 &result_callback, tc); 155 &result_callback, tc);
184 if (NULL == tc->tst) 156 if (NULL == tc->tst)
185 { 157 {
186 display_test_result (tc, GNUNET_SYSERR); 158 display_test_result (tc, GNUNET_SYSERR);
187 return; 159 return;
188 } 160 }
189 tc->tsk = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &fail_timeout, tc);
190} 161}
191 162
192/* end of gnunet-setup-transport-test.c */ 163/* end of gnunet-setup-transport-test.c */
diff --git a/src/setup/gnunet-setup-transport.c b/src/setup/gnunet-setup-transport.c
index ad588e12..9ec9cda0 100644
--- a/src/setup/gnunet-setup-transport.c
+++ b/src/setup/gnunet-setup-transport.c
@@ -194,32 +194,6 @@ result_callback (void *cls,
194 194
195 195
196/** 196/**
197 * Function called if NAT failed to confirm success.
198 * Clean up and update GUI (with failure).
199 *
200 * @param cls closure with setup context
201 * @param tc scheduler callback
202 */
203static void
204fail_timeout (void *cls,
205 const struct GNUNET_SCHEDULER_TaskContext *tc)
206{
207 struct GNUNET_SetupAutoContext *ac = cls;
208
209 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
210 _("NAT traversal with ICMP Server timed out.\n"));
211 GNUNET_assert (NULL != ac->tst);
212 ac->tsk = GNUNET_SCHEDULER_NO_TASK;
213 GNUNET_NAT_test_stop (ac->tst);
214 ac->tst = NULL;
215 update_icmp_server_enable_button (GNUNET_NO);
216 if (NULL != cfg)
217 GNUNET_CONFIGURATION_set_value_string (cfg, "nat", "ENABLE_ICMP_SERVER", "NO");
218 next_phase (ac);
219}
220
221
222/**
223 * Main function for the connection reversal test. 197 * Main function for the connection reversal test.
224 * 198 *
225 * @param cls the 'int*' for the result 199 * @param cls the 'int*' for the result
@@ -237,14 +211,13 @@ reversal_test (void *cls,
237 GNUNET_RESOLVER_connect (cfg); 211 GNUNET_RESOLVER_connect (cfg);
238 ac->tst = GNUNET_NAT_test_start (cfg, 212 ac->tst = GNUNET_NAT_test_start (cfg,
239 GNUNET_YES, 213 GNUNET_YES,
240 0, 0, 214 0, 0, TIMEOUT,
241 &result_callback, ac); 215 &result_callback, ac);
242 if (NULL == ac->tst) 216 if (NULL == ac->tst)
243 { 217 {
244 next_phase (ac); 218 next_phase (ac);
245 return; 219 return;
246 } 220 }
247 ac->tsk = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &fail_timeout, ac);
248} 221}
249 222
250 223