Added ipv6 patch.

This commit is contained in:
rakshasa
2014-08-14 20:56:20 +09:00
parent 7537a3c2a9
commit 7007973c76
11 changed files with 339 additions and 14 deletions
+17 -1
View File
@@ -91,8 +91,13 @@ CurlGet::start() {
curl_easy_setopt(m_handle, CURLOPT_NOSIGNAL, (long)1);
curl_easy_setopt(m_handle, CURLOPT_FOLLOWLOCATION, (long)1);
curl_easy_setopt(m_handle, CURLOPT_MAXREDIRS, (long)5);
curl_easy_setopt(m_handle, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
curl_easy_setopt(m_handle, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_WHATEVER);
curl_easy_setopt(m_handle, CURLOPT_ENCODING, "");
#ifdef RAK_USE_INET6
m_ipv6 = false;
#endif
m_stack->add_get(this);
}
@@ -110,6 +115,17 @@ CurlGet::close() {
m_handle = NULL;
}
#ifdef RAK_USE_INET6
void
CurlGet::retry_ipv6() {
CURL* nhandle = curl_easy_duphandle(m_handle);
curl_easy_setopt(nhandle, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V6);
curl_easy_cleanup(m_handle);
m_handle = nhandle;
m_ipv6 = true;
}
#endif
void
CurlGet::receive_timeout() {
return m_stack->transfer_done(m_handle, "Timed out");