diff options
author | Martin Schanzenbach <mschanzenbach@posteo.de> | 2012-06-11 15:50:40 +0000 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2012-06-11 15:50:40 +0000 |
commit | 366546f576315e0de97a700546d108a974161734 (patch) | |
tree | 87232a31739b479c7cde5b49b005923bc487fd42 /src/gns/gnunet-gns-proxy.c | |
parent | 16cf819a0feb38c36b046c59febae5bc511a3d1b (diff) | |
download | gnunet-366546f576315e0de97a700546d108a974161734.tar.gz gnunet-366546f576315e0de97a700546d108a974161734.zip |
-add cached flag for performance
Diffstat (limited to 'src/gns/gnunet-gns-proxy.c')
-rw-r--r-- | src/gns/gnunet-gns-proxy.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c index eff7fbfbd..ea1219b29 100644 --- a/src/gns/gnunet-gns-proxy.c +++ b/src/gns/gnunet-gns-proxy.c | |||
@@ -1010,14 +1010,26 @@ process_leho_lookup (void *cls, | |||
1010 | if (ctask->mhd->is_ssl) | 1010 | if (ctask->mhd->is_ssl) |
1011 | { | 1011 | { |
1012 | phost = (struct hostent*)gethostbyname (ctask->host); | 1012 | phost = (struct hostent*)gethostbyname (ctask->host); |
1013 | ssl_ip = inet_ntoa(*((struct in_addr*)(phost->h_addr))); | 1013 | |
1014 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1014 | if (phost!=NULL) |
1015 | "SSL target server: %s\n", ssl_ip); | 1015 | { |
1016 | sprintf (resolvename, "%s:%d:%s", ctask->leho, HTTPS_PORT, ssl_ip); | 1016 | ssl_ip = inet_ntoa(*((struct in_addr*)(phost->h_addr))); |
1017 | ctask->resolver = curl_slist_append ( ctask->resolver, resolvename); | 1017 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1018 | curl_easy_setopt (ctask->curl, CURLOPT_RESOLVE, ctask->resolver); | 1018 | "SSL target server: %s\n", ssl_ip); |
1019 | sprintf (curlurl, "https://%s%s", ctask->leho, ctask->url); | 1019 | sprintf (resolvename, "%s:%d:%s", ctask->leho, HTTPS_PORT, ssl_ip); |
1020 | curl_easy_setopt (ctask->curl, CURLOPT_URL, curlurl); | 1020 | ctask->resolver = curl_slist_append ( ctask->resolver, resolvename); |
1021 | curl_easy_setopt (ctask->curl, CURLOPT_RESOLVE, ctask->resolver); | ||
1022 | sprintf (curlurl, "https://%s%s", ctask->leho, ctask->url); | ||
1023 | curl_easy_setopt (ctask->curl, CURLOPT_URL, curlurl); | ||
1024 | } | ||
1025 | else | ||
1026 | { | ||
1027 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
1028 | "gethostbyname failed for %s!\n", ctask->host); | ||
1029 | ctask->download_successful = GNUNET_NO; | ||
1030 | ctask->download_error = GNUNET_YES; | ||
1031 | return; | ||
1032 | } | ||
1021 | } | 1033 | } |
1022 | 1034 | ||
1023 | if (CURLM_OK != (mret=curl_multi_add_handle (curl_multi, ctask->curl))) | 1035 | if (CURLM_OK != (mret=curl_multi_add_handle (curl_multi, ctask->curl))) |
@@ -1067,6 +1079,7 @@ process_get_authority (void *cls, | |||
1067 | &local_gns_zone, | 1079 | &local_gns_zone, |
1068 | &local_shorten_zone, | 1080 | &local_shorten_zone, |
1069 | GNUNET_GNS_RECORD_LEHO, | 1081 | GNUNET_GNS_RECORD_LEHO, |
1082 | GNUNET_YES, //Only cached for performance | ||
1070 | &process_leho_lookup, | 1083 | &process_leho_lookup, |
1071 | ctask); | 1084 | ctask); |
1072 | } | 1085 | } |