aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-05-26 15:23:33 +0000
committerChristian Grothoff <christian@grothoff.org>2015-05-26 15:23:33 +0000
commitdae4222c75b4879cf1524d4dc93bb6f023f468ca (patch)
tree73d9c5fb8009b8351d66e8b7f5a7093e7b202fd5 /src
parent98400554f939e0b318bdfd4c80fd13e7c89128d6 (diff)
downloadgnunet-dae4222c75b4879cf1524d4dc93bb6f023f468ca.tar.gz
gnunet-dae4222c75b4879cf1524d4dc93bb6f023f468ca.zip
-indentation
Diffstat (limited to 'src')
-rw-r--r--src/exit/gnunet-helper-exit.c8
-rw-r--r--src/pt/test_gnunet_vpn.c17
-rw-r--r--src/vpn/gnunet-helper-vpn.c14
3 files changed, 29 insertions, 10 deletions
diff --git a/src/exit/gnunet-helper-exit.c b/src/exit/gnunet-helper-exit.c
index e68c10c33..90a3fc0e5 100644
--- a/src/exit/gnunet-helper-exit.c
+++ b/src/exit/gnunet-helper-exit.c
@@ -503,7 +503,9 @@ run (int fd_tun)
503 MAX_SIZE - sizeof (struct GNUNET_MessageHeader)); 503 MAX_SIZE - sizeof (struct GNUNET_MessageHeader));
504 if (-1 == buftun_size) 504 if (-1 == buftun_size)
505 { 505 {
506 fprintf (stderr, "read-error: %s\n", strerror (errno)); 506 fprintf (stderr,
507 "read-error: %s\n",
508 strerror (errno));
507 shutdown (fd_tun, SHUT_RD); 509 shutdown (fd_tun, SHUT_RD);
508 shutdown (1, SHUT_WR); 510 shutdown (1, SHUT_WR);
509 read_open = 0; 511 read_open = 0;
@@ -538,7 +540,9 @@ run (int fd_tun)
538#if !DEBUG 540#if !DEBUG
539 if (errno != EPIPE) 541 if (errno != EPIPE)
540#endif 542#endif
541 fprintf (stderr, "write-error to stdout: %s\n", strerror (errno)); 543 fprintf (stderr,
544 "write-error to stdout: %s\n",
545 strerror (errno));
542 shutdown (fd_tun, SHUT_RD); 546 shutdown (fd_tun, SHUT_RD);
543 shutdown (1, SHUT_WR); 547 shutdown (1, SHUT_WR);
544 read_open = 0; 548 read_open = 0;
diff --git a/src/pt/test_gnunet_vpn.c b/src/pt/test_gnunet_vpn.c
index ef22fa404..3f252cb46 100644
--- a/src/pt/test_gnunet_vpn.c
+++ b/src/pt/test_gnunet_vpn.c
@@ -270,9 +270,16 @@ allocation_cb (void *cls, int af, const void *address)
270 GNUNET_SCHEDULER_shutdown (); 270 GNUNET_SCHEDULER_shutdown ();
271 return; 271 return;
272 } 272 }
273 GNUNET_asprintf (&url, "http://%s:%u/hello_world", 273 if (AF_INET6 == af)
274 inet_ntop (af, address, ips, sizeof (ips)), 274 GNUNET_asprintf (&url,
275 (unsigned int) PORT); 275 "http://[%s]:%u/hello_world",
276 inet_ntop (af, address, ips, sizeof (ips)),
277 (unsigned int) PORT);
278 else
279 GNUNET_asprintf (&url,
280 "http://%s:%u/hello_world",
281 inet_ntop (af, address, ips, sizeof (ips)),
282 (unsigned int) PORT);
276 curl = curl_easy_init (); 283 curl = curl_easy_init ();
277 curl_easy_setopt (curl, CURLOPT_URL, url); 284 curl_easy_setopt (curl, CURLOPT_URL, url);
278 curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, &copy_buffer); 285 curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, &copy_buffer);
@@ -281,11 +288,13 @@ allocation_cb (void *cls, int af, const void *address)
281 curl_easy_setopt (curl, CURLOPT_TIMEOUT, 150L); 288 curl_easy_setopt (curl, CURLOPT_TIMEOUT, 150L);
282 curl_easy_setopt (curl, CURLOPT_CONNECTTIMEOUT, 15L); 289 curl_easy_setopt (curl, CURLOPT_CONNECTTIMEOUT, 15L);
283 curl_easy_setopt (curl, CURLOPT_NOSIGNAL, 1); 290 curl_easy_setopt (curl, CURLOPT_NOSIGNAL, 1);
291 curl_easy_setopt (curl, CURLOPT_VERBOSE, 1);
284 292
285 multi = curl_multi_init (); 293 multi = curl_multi_init ();
286 GNUNET_assert (multi != NULL); 294 GNUNET_assert (multi != NULL);
287 GNUNET_assert (CURLM_OK == curl_multi_add_handle (multi, curl)); 295 GNUNET_assert (CURLM_OK == curl_multi_add_handle (multi, curl));
288 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Beginning HTTP download from `%s'\n", 296 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
297 "Beginning HTTP download from `%s'\n",
289 url); 298 url);
290 curl_main (); 299 curl_main ();
291} 300}
diff --git a/src/vpn/gnunet-helper-vpn.c b/src/vpn/gnunet-helper-vpn.c
index 5231c1657..3bf0704f9 100644
--- a/src/vpn/gnunet-helper-vpn.c
+++ b/src/vpn/gnunet-helper-vpn.c
@@ -360,7 +360,7 @@ run (int fd_tun)
360 /* write refers to reading from stdin, writing to fd_tun */ 360 /* write refers to reading from stdin, writing to fd_tun */
361 int write_open = 1; 361 int write_open = 1;
362 362
363 while ((1 == read_open) && (1 == write_open)) 363 while ((1 == read_open) || (1 == write_open))
364 { 364 {
365 FD_ZERO (&fds_w); 365 FD_ZERO (&fds_w);
366 FD_ZERO (&fds_r); 366 FD_ZERO (&fds_r);
@@ -412,7 +412,9 @@ run (int fd_tun)
412 MAX_SIZE - sizeof (struct GNUNET_MessageHeader)); 412 MAX_SIZE - sizeof (struct GNUNET_MessageHeader));
413 if (-1 == buftun_size) 413 if (-1 == buftun_size)
414 { 414 {
415 fprintf (stderr, "read-error: %s\n", strerror (errno)); 415 fprintf (stderr,
416 "read-error: %s\n",
417 strerror (errno));
416 shutdown (fd_tun, SHUT_RD); 418 shutdown (fd_tun, SHUT_RD);
417 shutdown (1, SHUT_WR); 419 shutdown (1, SHUT_WR);
418 read_open = 0; 420 read_open = 0;
@@ -445,7 +447,9 @@ run (int fd_tun)
445#if !DEBUG 447#if !DEBUG
446 if (errno != EPIPE) 448 if (errno != EPIPE)
447#endif 449#endif
448 fprintf (stderr, "write-error to stdout: %s\n", strerror (errno)); 450 fprintf (stderr,
451 "write-error to stdout: %s\n",
452 strerror (errno));
449 shutdown (fd_tun, SHUT_RD); 453 shutdown (fd_tun, SHUT_RD);
450 shutdown (1, SHUT_WR); 454 shutdown (1, SHUT_WR);
451 read_open = 0; 455 read_open = 0;
@@ -468,7 +472,9 @@ run (int fd_tun)
468 bufin_size = read (0, bufin + bufin_rpos, MAX_SIZE - bufin_rpos); 472 bufin_size = read (0, bufin + bufin_rpos, MAX_SIZE - bufin_rpos);
469 if (-1 == bufin_size) 473 if (-1 == bufin_size)
470 { 474 {
471 fprintf (stderr, "read-error: %s\n", strerror (errno)); 475 fprintf (stderr,
476 "read-error: %s\n",
477 strerror (errno));
472 shutdown (0, SHUT_RD); 478 shutdown (0, SHUT_RD);
473 shutdown (fd_tun, SHUT_WR); 479 shutdown (fd_tun, SHUT_WR);
474 write_open = 0; 480 write_open = 0;