aboutsummaryrefslogtreecommitdiff
path: root/src/core/test_core_api_send_to_self.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-08-15 21:54:06 +0000
committerChristian Grothoff <christian@grothoff.org>2011-08-15 21:54:06 +0000
commit5746309cb4be2073d550ad7a6885e918631dbc38 (patch)
tree89455bc4aadf977816b38df13f990372cd81d71a /src/core/test_core_api_send_to_self.c
parent6fd3e715cae09fa6e657c96f1c6f9711ee51f42f (diff)
downloadgnunet-5746309cb4be2073d550ad7a6885e918631dbc38.tar.gz
gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.zip
indentation
Diffstat (limited to 'src/core/test_core_api_send_to_self.c')
-rw-r--r--src/core/test_core_api_send_to_self.c40
1 files changed, 17 insertions, 23 deletions
diff --git a/src/core/test_core_api_send_to_self.c b/src/core/test_core_api_send_to_self.c
index 09d6edacc..808447fa1 100644
--- a/src/core/test_core_api_send_to_self.c
+++ b/src/core/test_core_api_send_to_self.c
@@ -79,8 +79,8 @@ cleanup (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tskctx)
79 if (GNUNET_OS_process_wait (arm_proc) != GNUNET_OK) 79 if (GNUNET_OS_process_wait (arm_proc) != GNUNET_OK)
80 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); 80 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid");
81 81
82 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 82 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ARM process %u stopped\n",
83 "ARM process %u stopped\n", GNUNET_OS_process_get_pid (arm_proc)); 83 GNUNET_OS_process_get_pid (arm_proc));
84 GNUNET_OS_process_close (arm_proc); 84 GNUNET_OS_process_close (arm_proc);
85 arm_proc = NULL; 85 arm_proc = NULL;
86 86
@@ -143,10 +143,8 @@ connect_cb (void *cls, const struct GNUNET_PeerIdentity *peer,
143 { 143 {
144 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 144 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
145 "Connected to myself; sending message!\n"); 145 "Connected to myself; sending message!\n");
146 GNUNET_CORE_notify_transmit_ready (core, 146 GNUNET_CORE_notify_transmit_ready (core, GNUNET_YES, 0,
147 GNUNET_YES, 147 GNUNET_TIME_UNIT_FOREVER_REL, peer,
148 0, GNUNET_TIME_UNIT_FOREVER_REL,
149 peer,
150 sizeof (struct GNUNET_MessageHeader), 148 sizeof (struct GNUNET_MessageHeader),
151 send_message, NULL); 149 send_message, NULL);
152 } 150 }
@@ -162,9 +160,8 @@ connect_cb (void *cls, const struct GNUNET_PeerIdentity *peer,
162 * @param cfg configuration 160 * @param cfg configuration
163 */ 161 */
164static void 162static void
165run (void *cls, 163run (void *cls, char *const *args, const char *cfgfile,
166 char *const *args, 164 const struct GNUNET_CONFIGURATION_Handle *cfg)
167 const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
168{ 165{
169 const static struct GNUNET_CORE_MessageHandler handlers[] = { 166 const static struct GNUNET_CORE_MessageHandler handlers[] = {
170 {&receive, GNUNET_MESSAGE_TYPE_VPN_SERVICE_UDP, 0}, 167 {&receive, GNUNET_MESSAGE_TYPE_VPN_SERVICE_UDP, 0},
@@ -173,23 +170,21 @@ run (void *cls,
173 170
174 core_cfg = GNUNET_CONFIGURATION_create (); 171 core_cfg = GNUNET_CONFIGURATION_create ();
175 172
176 arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", 173 arm_proc =
177 "gnunet-service-arm", 174 GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm",
175 "gnunet-service-arm",
178#if VERBOSE 176#if VERBOSE
179 "-L", "DEBUG", 177 "-L", "DEBUG",
180#endif 178#endif
181 "-c", "test_core_api_peer1.conf", NULL); 179 "-c", "test_core_api_peer1.conf", NULL);
182 180
183 GNUNET_assert (GNUNET_OK == 181 GNUNET_assert (GNUNET_OK ==
184 GNUNET_CONFIGURATION_load (core_cfg, 182 GNUNET_CONFIGURATION_load (core_cfg,
185 "test_core_api_peer1.conf")); 183 "test_core_api_peer1.conf"));
186 184
187 core = GNUNET_CORE_connect (core_cfg, 185 core =
188 42, 186 GNUNET_CORE_connect (core_cfg, 42, NULL, &init, &connect_cb, NULL, NULL,
189 NULL, 187 NULL, 0, NULL, 0, handlers);
190 &init,
191 &connect_cb,
192 NULL, NULL, NULL, 0, NULL, 0, handlers);
193 188
194 die_task = 189 die_task =
195 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply 190 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
@@ -217,11 +212,10 @@ check ()
217 ret = 1; 212 ret = 1;
218 213
219 return (GNUNET_OK == 214 return (GNUNET_OK ==
220 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, 215 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv,
221 argv,
222 "test_core_api_send_to_self", 216 "test_core_api_send_to_self",
223 gettext_noop ("help text"), 217 gettext_noop ("help text"), options, &run,
224 options, &run, NULL)) ? ret : 1; 218 NULL)) ? ret : 1;
225} 219}
226 220
227/** 221/**