diff options
author | Adam Ierymenko <adam.ierymenko@zerotier.com> | 2014-01-18 14:53:59 -0800 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@zerotier.com> | 2014-01-18 14:53:59 -0800 |
commit | 45c5b66e9ef4d8a2afafe4250e40557290f07997 (patch) | |
tree | d005eb794fe011173fba4af20683ef2e170bd60d /node/HttpClient.cpp | |
parent | f303c24d3c19d6006e1c9ad0a0b4bfe688cddb4f (diff) | |
download | infinitytier-45c5b66e9ef4d8a2afafe4250e40557290f07997.tar.gz infinitytier-45c5b66e9ef4d8a2afafe4250e40557290f07997.zip |
Self test now passes on Windows.
Diffstat (limited to 'node/HttpClient.cpp')
-rw-r--r-- | node/HttpClient.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/node/HttpClient.cpp b/node/HttpClient.cpp index 0e0c8ccf..ca232437 100644 --- a/node/HttpClient.cpp +++ b/node/HttpClient.cpp @@ -386,9 +386,13 @@ public: goto closeAndReturnFromHttp; } - hRequest = WinHttpOpenRequest(hConnect,L"GET",NULL,NULL,WINHTTP_NO_REFERER,WINHTTP_DEFAULT_ACCEPT_TYPES,0); + hRequest = WinHttpOpenRequest(hConnect,L"GET",urlPath.c_str(),NULL,WINHTTP_NO_REFERER,WINHTTP_DEFAULT_ACCEPT_TYPES,0); if (!hRequest) { - _handler(_arg,-1,_url,false,"error sending request"); + _handler(_arg,-1,_url,false,"error sending request (1)"); + goto closeAndReturnFromHttp; + } + if (!WinHttpSendRequest(hRequest,WINHTTP_NO_ADDITIONAL_HEADERS,0,WINHTTP_NO_REQUEST_DATA,0,0,0)) { + _handler(_arg,-1,_url,false,"error sending request (2)"); goto closeAndReturnFromHttp; } @@ -421,6 +425,8 @@ public: } while (dwSize > 0); _handler(_arg,dwStatusCode,_url,false,_body); + } else { + _handler(_arg,-1,_url,false,"receive response failed"); } } catch (std::bad_alloc &exc) { _handler(_arg,-1,_url,false,"insufficient memory"); |