aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing_group.c
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2011-02-15 17:51:30 +0000
committerNathan S. Evans <evans@in.tum.de>2011-02-15 17:51:30 +0000
commit82a599ed85f2298e276ea8dd60a5a7c37c1bbf88 (patch)
tree165e785b6255f52ef264313d9c4eba6a078a9b73 /src/testing/testing_group.c
parentbffca0da11f7b2b878998b4146adfa0a13c151ed (diff)
downloadgnunet-82a599ed85f2298e276ea8dd60a5a7c37c1bbf88.tar.gz
gnunet-82a599ed85f2298e276ea8dd60a5a7c37c1bbf88.zip
fix for friend file copying using ssh, should still be set up to throttle connections
Diffstat (limited to 'src/testing/testing_group.c')
-rw-r--r--src/testing/testing_group.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c
index 7b851f708..727076f4c 100644
--- a/src/testing/testing_group.c
+++ b/src/testing/testing_group.c
@@ -44,7 +44,7 @@
44 * enough to not conflict with client-ports (typically starting around 44 * enough to not conflict with client-ports (typically starting around
45 * 32k). 45 * 32k).
46 */ 46 */
47#define LOW_PORT 10000 47#define LOW_PORT 12000
48 48
49/** 49/**
50 * Highest port used for GNUnet testing. Should be low enough to not 50 * Highest port used for GNUnet testing. Should be low enough to not
@@ -2539,11 +2539,15 @@ create_and_copy_friend_files (struct GNUNET_TESTING_PeerGroup *pg)
2539 struct GNUNET_OS_Process **procarr; 2539 struct GNUNET_OS_Process **procarr;
2540 char *arg; 2540 char *arg;
2541 char *mytemp; 2541 char *mytemp;
2542#if NOT_STUPID
2542 enum GNUNET_OS_ProcessStatusType type; 2543 enum GNUNET_OS_ProcessStatusType type;
2543 unsigned long return_code; 2544 unsigned long return_code;
2544 int count; 2545 int count;
2545 int ret;
2546 int max_wait = 10; 2546 int max_wait = 10;
2547#endif
2548 int ret;
2549
2550 ret = GNUNET_OK;
2547#if OLD 2551#if OLD
2548 struct GNUNET_CRYPTO_HashAsciiEncoded peer_enc; 2552 struct GNUNET_CRYPTO_HashAsciiEncoded peer_enc;
2549 struct PeerConnection *conn_iter; 2553 struct PeerConnection *conn_iter;
@@ -2615,6 +2619,11 @@ create_and_copy_friend_files (struct GNUNET_TESTING_PeerGroup *pg)
2615 GNUNET_OS_start_process (NULL, NULL, "scp", "scp", mytemp, arg, 2619 GNUNET_OS_start_process (NULL, NULL, "scp", "scp", mytemp, arg,
2616 NULL); 2620 NULL);
2617 2621
2622 ret = GNUNET_OS_process_wait(procarr[pg_iter]); /* FIXME: schedule this, throttle! */
2623 GNUNET_OS_process_close (procarr[pg_iter]);
2624 if (ret != GNUNET_OK)
2625 return ret;
2626 procarr[pg_iter] = NULL;
2618#if VERBOSE_TESTING 2627#if VERBOSE_TESTING
2619 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2628 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2620 _("Copying file with command scp %s %s\n"), mytemp, 2629 _("Copying file with command scp %s %s\n"), mytemp,
@@ -2626,6 +2635,7 @@ create_and_copy_friend_files (struct GNUNET_TESTING_PeerGroup *pg)
2626 GNUNET_free (mytemp); 2635 GNUNET_free (mytemp);
2627 } 2636 }
2628 2637
2638#if NOT_STUPID
2629 count = 0; 2639 count = 0;
2630 ret = GNUNET_SYSERR; 2640 ret = GNUNET_SYSERR;
2631 while ((count < max_wait) && (ret != GNUNET_OK)) 2641 while ((count < max_wait) && (ret != GNUNET_OK))
@@ -2672,6 +2682,7 @@ create_and_copy_friend_files (struct GNUNET_TESTING_PeerGroup *pg)
2672 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2682 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2673 _("Finished copying all friend files!\n")); 2683 _("Finished copying all friend files!\n"));
2674#endif 2684#endif
2685#endif
2675 GNUNET_free (procarr); 2686 GNUNET_free (procarr);
2676 return ret; 2687 return ret;
2677} 2688}