diff options
Diffstat (limited to 'src/gns/gnunet-gns-proxy.c')
-rw-r--r-- | src/gns/gnunet-gns-proxy.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c index 833a8da01..d02f0f576 100644 --- a/src/gns/gnunet-gns-proxy.c +++ b/src/gns/gnunet-gns-proxy.c | |||
@@ -1841,6 +1841,7 @@ create_response (void *cls, | |||
1841 | char *curlurl; | 1841 | char *curlurl; |
1842 | char ipstring[INET6_ADDRSTRLEN]; | 1842 | char ipstring[INET6_ADDRSTRLEN]; |
1843 | char ipaddr[INET6_ADDRSTRLEN + 2]; | 1843 | char ipaddr[INET6_ADDRSTRLEN + 2]; |
1844 | char *curl_hosts; | ||
1844 | const struct sockaddr *sa; | 1845 | const struct sockaddr *sa; |
1845 | const struct sockaddr_in *s4; | 1846 | const struct sockaddr_in *s4; |
1846 | const struct sockaddr_in6 *s6; | 1847 | const struct sockaddr_in6 *s6; |
@@ -1900,6 +1901,14 @@ create_response (void *cls, | |||
1900 | GNUNET_break (0); | 1901 | GNUNET_break (0); |
1901 | return MHD_NO; | 1902 | return MHD_NO; |
1902 | } | 1903 | } |
1904 | GNUNET_asprintf (&curl_hosts, | ||
1905 | "%s:%d:%s", | ||
1906 | s5r->leho, | ||
1907 | port, | ||
1908 | ipaddr); | ||
1909 | s5r->hosts = curl_slist_append (NULL, | ||
1910 | curl_hosts); | ||
1911 | GNUNET_free (curl_hosts); | ||
1903 | } | 1912 | } |
1904 | else | 1913 | else |
1905 | { | 1914 | { |
@@ -1949,21 +1958,13 @@ create_response (void *cls, | |||
1949 | * Pre-populate cache to resolve Hostname. | 1958 | * Pre-populate cache to resolve Hostname. |
1950 | * This is necessary as the DNS name in the CURLOPT_URL is used | 1959 | * This is necessary as the DNS name in the CURLOPT_URL is used |
1951 | * for SNI http://de.wikipedia.org/wiki/Server_Name_Indication | 1960 | * for SNI http://de.wikipedia.org/wiki/Server_Name_Indication |
1952 | */if (NULL != s5r->leho) | 1961 | */ |
1962 | if ((NULL != s5r->leho) && | ||
1963 | (NULL != s5r->hosts)) | ||
1953 | { | 1964 | { |
1954 | char *curl_hosts; | ||
1955 | |||
1956 | GNUNET_asprintf (&curl_hosts, | ||
1957 | "%s:%d:%s", | ||
1958 | s5r->leho, | ||
1959 | port, | ||
1960 | ipaddr); | ||
1961 | s5r->hosts = curl_slist_append (NULL, | ||
1962 | curl_hosts); | ||
1963 | curl_easy_setopt (s5r->curl, | 1965 | curl_easy_setopt (s5r->curl, |
1964 | CURLOPT_RESOLVE, | 1966 | CURLOPT_RESOLVE, |
1965 | s5r->hosts); | 1967 | s5r->hosts); |
1966 | GNUNET_free (curl_hosts); | ||
1967 | } | 1968 | } |
1968 | if (s5r->is_gns) | 1969 | if (s5r->is_gns) |
1969 | { | 1970 | { |