@@ -113,7 +113,7 @@ string HTTPDownloadClient::createHTTPRequestHeaders(const string& hostName, cons
113
113
return request;
114
114
}
115
115
116
- uint64_t HTTPDownloadClient::parseHTTPResponseHeaders (ifstream& rawResponse, int16_t & statusCode, unordered_map<string, string>& responseHeaders ) {
116
+ uint64_t HTTPDownloadClient::parseHTTPResponseHeaders (ifstream& rawResponse) {
117
117
responseHeaders.clear ();
118
118
auto headerSize = 0ll ;
119
119
auto returnHeaderSize = 0ll ;
@@ -194,17 +194,12 @@ void HTTPDownloadClient::start() {
194
194
auto hostname = relativeUrl;
195
195
if (slashIdx != -1 ) hostname = StringTools::substring (relativeUrl, 0 , slashIdx);
196
196
relativeUrl = StringTools::substring (relativeUrl, hostname.size ());
197
-
198
- Console::println (" HTTPDownloadClient::execute(): hostname: " + hostname);
199
- Console::println (" HTTPDownloadClient::execute(): relative url: " + relativeUrl);
200
- Console::print (" HTTPDownloadClient::execute(): resolving hostname to IP: " + hostname + " : " );
197
+ //
201
198
auto ip = Network::getIpByHostname (hostname);
202
199
if (ip.empty () == true ) {
203
200
Console::println (" HTTPDownloadClient::execute(): failed" );
204
201
throw HTTPClientException (" Could not resolve host IP by hostname" );
205
202
}
206
- Console::println (ip);
207
-
208
203
// socket
209
204
TCPSocket::create (socket, TCPSocket::determineIpVersion (ip));
210
205
socket.connect (ip, 80 );
@@ -236,7 +231,7 @@ void HTTPDownloadClient::start() {
236
231
}
237
232
// try to read headers
238
233
downloadClient->responseHeaders .clear ();
239
- if ((downloadClient->headerSize = downloadClient->parseHTTPResponseHeaders (ifs, downloadClient-> statusCode , downloadClient-> responseHeaders )) > 0 ) {
234
+ if ((downloadClient->headerSize = downloadClient->parseHTTPResponseHeaders (ifs)) > 0 ) {
240
235
downloadClient->haveHeaders = true ;
241
236
auto contentLengthHeaderIt = downloadClient->responseHeaders .find (" Content-Length" );
242
237
if (contentLengthHeaderIt != downloadClient->responseHeaders .end ()) {
0 commit comments