[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r16819 - in gnunet: . src/vpn
From: |
gnunet |
Subject: |
[GNUnet-SVN] r16819 - in gnunet: . src/vpn |
Date: |
Wed, 14 Sep 2011 09:15:08 +0200 |
Author: grothoff
Date: 2011-09-14 09:15:07 +0200 (Wed, 14 Sep 2011)
New Revision: 16819
Modified:
gnunet/TODO
gnunet/src/vpn/gnunet-service-dns.c
Log:
fixing 1752
Modified: gnunet/TODO
===================================================================
--- gnunet/TODO 2011-09-13 17:43:33 UTC (rev 16818)
+++ gnunet/TODO 2011-09-14 07:15:07 UTC (rev 16819)
@@ -1,4 +1,6 @@
0.9.0pre3:
+* make sure transport provides latency in ATS (fs tests are complaining
bitterly,
+ on line gnunet-service-fs_cp.c:338).
* clean buildbots (with new transport)
0.9.0pre4:
Modified: gnunet/src/vpn/gnunet-service-dns.c
===================================================================
--- gnunet/src/vpn/gnunet-service-dns.c 2011-09-13 17:43:33 UTC (rev 16818)
+++ gnunet/src/vpn/gnunet-service-dns.c 2011-09-14 07:15:07 UTC (rev 16819)
@@ -1123,12 +1123,13 @@
*
* @return
*/
-uint64_t
+static uint64_t
get_port_from_redirects (const char *udp_redirects, const char *tcp_redirects)
{
uint64_t ret = 0;
char *cpy, *hostname, *redirect;
- int local_port, count = 0;
+ int local_port;
+ unsigned int count = 0;
if (NULL != udp_redirects)
{
@@ -1197,12 +1198,11 @@
}
out:
- if (NULL != cpy)
- GNUNET_free (cpy);
+ GNUNET_free_non_null (cpy);
return ret;
}
-void
+static void
publish_name (const char *name, uint64_t ports, uint32_t service_type,
struct GNUNET_CRYPTO_RsaPrivateKey *my_private_key)
{
@@ -1245,29 +1245,37 @@
GNUNET_TIME_UNIT_MINUTES, NULL, NULL);
}
+
/**
* @brief Publishes the record defined by the section section
*
* @param cls closure
* @param section the current section
*/
-void
+static void
publish_iterate (void *cls __attribute__ ((unused)), const char *section)
{
+ char *udp_redirects;
+ char *tcp_redirects;
+ char *alternative_names;
+ char *alternative_name;
+ char *keyfile;
+
if ((strlen (section) < 8) ||
(0 != strcmp (".gnunet.", section + (strlen (section) - 8))))
return;
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Parsing dns-name %s\n",
+ section);
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_string (cfg, section, "UDP_REDIRECTS",
+ &udp_redirects))
+ udp_redirects = NULL;
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_string (cfg, section, "TCP_REDIRECTS",
+ &tcp_redirects))
+ tcp_redirects = NULL;
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Parsing dns-name %s\n", section);
-
- char *udp_redirects, *tcp_redirects, *alternative_names, *alternative_name,
- *keyfile;
-
- GNUNET_CONFIGURATION_get_value_string (cfg, section, "UDP_REDIRECTS",
- &udp_redirects);
- GNUNET_CONFIGURATION_get_value_string (cfg, section, "TCP_REDIRECTS",
- &tcp_redirects);
-
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_filename (cfg, "GNUNETD", "HOSTKEY",
&keyfile))
@@ -1296,22 +1304,23 @@
publish_name (section, ports, service_type, my_private_key);
-
- GNUNET_CONFIGURATION_get_value_string (cfg, section, "ALTERNATIVE_NAMES",
- &alternative_names);
- for (alternative_name = strtok (alternative_names, " ");
- alternative_name != NULL; alternative_name = strtok (NULL, " "))
- {
- char *altname =
- alloca (strlen (alternative_name) + strlen (section) + 1 + 1);
- strcpy (altname, alternative_name);
- strcpy (altname + strlen (alternative_name) + 1, section);
- altname[strlen (alternative_name)] = '.';
-
- publish_name (altname, ports, service_type, my_private_key);
- }
-
- GNUNET_free_non_null (alternative_names);
+ if (GNUNET_OK ==
+ GNUNET_CONFIGURATION_get_value_string (cfg, section, "ALTERNATIVE_NAMES",
+ &alternative_names))
+ {
+ for (alternative_name = strtok (alternative_names, " ");
+ alternative_name != NULL; alternative_name = strtok (NULL, " "))
+ {
+ char *altname =
+ alloca (strlen (alternative_name) + strlen (section) + 1 + 1);
+ strcpy (altname, alternative_name);
+ strcpy (altname + strlen (alternative_name) + 1, section);
+ altname[strlen (alternative_name)] = '.';
+
+ publish_name (altname, ports, service_type, my_private_key);
+ }
+ GNUNET_free (alternative_names);
+ }
GNUNET_CRYPTO_rsa_key_free (my_private_key);
GNUNET_free_non_null (udp_redirects);
GNUNET_free_non_null (tcp_redirects);
@@ -1328,9 +1337,9 @@
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
- GNUNET_CONFIGURATION_iterate_sections (cfg, publish_iterate, NULL);
+ GNUNET_CONFIGURATION_iterate_sections (cfg, &publish_iterate, NULL);
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_HOURS, publish_names, NULL);
+ GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_HOURS, &publish_names, NULL);
}
/**
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r16819 - in gnunet: . src/vpn,
gnunet <=