[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r6661 - GNUnet/src/applications/testing
From: |
gnunet |
Subject: |
[GNUnet-SVN] r6661 - GNUnet/src/applications/testing |
Date: |
Tue, 1 Apr 2008 16:39:15 -0600 (MDT) |
Author: nevans
Date: 2008-04-01 16:39:12 -0600 (Tue, 01 Apr 2008)
New Revision: 6661
Modified:
GNUnet/src/applications/testing/remote.c
GNUnet/src/applications/testing/remote.h
GNUnet/src/applications/testing/remotetopologies.c
Log:
Modified: GNUnet/src/applications/testing/remote.c
===================================================================
--- GNUnet/src/applications/testing/remote.c 2008-04-01 22:09:36 UTC (rev
6660)
+++ GNUnet/src/applications/testing/remote.c 2008-04-01 22:39:12 UTC (rev
6661)
@@ -29,6 +29,9 @@
#define VERBOSE GNUNET_NO
+/* Yes this is ugly, but for now it is nice to
+ * have a linked list and an array
+ */
static struct GNUNET_REMOTE_host_list *head;
static struct GNUNET_REMOTE_host_list **list_as_array;
@@ -58,7 +61,11 @@
snprintf (cmd, length + 1, "scp %s%s address@hidden:%s", localConfigPath,
configFileName, username, hostname, remote_config_path);
- fprintf (stderr, "scp command is : %s \n", cmd);
+ /* To me this seems like information that will always be appreciated by the
user
+ * if this is contested by anyone, please mark it here as well as how it
should be
+ * done, and I can change it everywhere else by example! NE
+ */
+ fprintf (stderr, _("scp command is : %s \n"), cmd);
system (cmd);
GNUNET_free (cmd);
@@ -268,9 +275,6 @@
CLOSE (ret);
if (0 != GNUNET_GC_write_configuration (basecfg, temp_path))
{
- fprintf (stderr,
- "Failed to write peer configuration file `%s'\n",
- temp_path);
GNUNET_free (temp_path);
break;
}
@@ -381,9 +385,7 @@
CLOSE (ret);
if (0 != GNUNET_GC_write_configuration (basecfg, temp_path))
{
- fprintf (stderr,
- "Failed to write peer configuration file `%s'\n",
- temp_path);
+ /* I guess an error would be logged by
GNUNET_GC_write_configuration */
GNUNET_GC_free (basecfg);
GNUNET_free (temp_path);
break;
@@ -487,7 +489,8 @@
pos = head;
while (pos != NULL)
{
- fprintf (stderr, "Friend list of %s:%d\n", pos->hostname,
+ /* Printing out the friends isn't necessary, but it's nice */
+ fprintf (stderr, _("Friend list of %s:%d\n"), pos->hostname,
pos->port);
temp_friend_handle = fopen ("friend.temp", "wt");
friend_pos = pos->friend_entries;
@@ -509,7 +512,7 @@
pos->username, pos->hostname,
pos->remote_friend_file_path);
- fprintf (stderr, "scp command for friend file copy is : %s \n",
+ fprintf (stderr, _("scp command for friend file copy is : %s \n"),
cmd);
system (cmd);
GNUNET_free (cmd);
@@ -519,17 +522,22 @@
system ("rm friend.temp");
pos = head;
+
+ /* This loop goes over the friend entries of each peer and connects that
+ * peer to each friend in the list. Note this is redundant, i.e. once
+ * the two are connected, the second doesn't really need to try to
connect
+ * to the first later, but this IS simple. If performance becomes a
problem
+ * with MANY conns, we'll see...
+ */
while (pos != NULL)
{
friend_pos = pos->friend_entries;
while (friend_pos != NULL)
{
- fprintf (stderr, "connecting %s:%d to %s:%d\n",
+ fprintf (stderr, _("connecting peer %s:%d to peer %s:%d\n"),
pos->hostname, pos->port,
friend_pos->hostentry->hostname,
friend_pos->hostentry->port);
- fprintf (stderr, "or %s:%d to %s\n", pos->hostname, pos->port,
- (const char *) friend_pos->nodeid);
GNUNET_REMOTE_connect_daemons (pos->hostname, pos->port,
friend_pos->hostentry->hostname,
friend_pos->hostentry->port);
Modified: GNUnet/src/applications/testing/remote.h
===================================================================
--- GNUnet/src/applications/testing/remote.h 2008-04-01 22:09:36 UTC (rev
6660)
+++ GNUnet/src/applications/testing/remote.h 2008-04-01 22:39:12 UTC (rev
6661)
@@ -67,9 +67,21 @@
* @return GNUNET_OK on success, GNUNET_SYSERR on failure
*/
int
-GNUNET_REMOTE_connect_daemons (char *ip1, unsigned short port1, char *ip2,
- unsigned short port2);
+GNUNET_REMOTE_connect_daemons (char *hostname1, unsigned short port1,
+ char *hostname2, unsigned short port2);
+/**
+ * Because we need to copy over the friends file before actually connecting,
+ * we call this function to get the information for the peers and store it
+ * in a linked list, which is iterated over later to actually connect.
+ *
+ * @param port1 client port of the first daemon
+ * @param port2 client port of the second daemon
+ * @param ip1 client ip or hostname for the first daemon
+ * @param ip2 client ip or hostname for the second daemon
+ * @param host1entry the entry of host1 for the friends file of host2
+ * @param host2entry the entry of host2 for the friends file of host1
+ */
int
GNUNET_REMOTE_get_daemons_information (char *hostname1, unsigned short port1,
char *hostname2, unsigned short port2,
Modified: GNUnet/src/applications/testing/remotetopologies.c
===================================================================
--- GNUnet/src/applications/testing/remotetopologies.c 2008-04-01 22:09:36 UTC
(rev 6660)
+++ GNUnet/src/applications/testing/remotetopologies.c 2008-04-01 22:39:12 UTC
(rev 6661)
@@ -361,7 +361,7 @@
}
else
{
- fprintf (stderr, "Failed to establish connection with peers.\n");
+ fprintf (stderr, _("Failed to establish connection with peers.\n"));
}
GNUNET_GC_free (cfg1);
GNUNET_GC_free (cfg2);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r6661 - GNUnet/src/applications/testing,
gnunet <=