diff options
Diffstat (limited to 'src/network/core/tcp_http.h')
-rw-r--r-- | src/network/core/tcp_http.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/network/core/tcp_http.h b/src/network/core/tcp_http.h index cc9a3adac..d7be0c327 100644 --- a/src/network/core/tcp_http.h +++ b/src/network/core/tcp_http.h @@ -73,6 +73,7 @@ public: /** Connect with a HTTP server and do ONE query. */ class NetworkHTTPContentConnecter : TCPConnecter { + std::string hostname; ///< Hostname we are connecting to. HTTPCallback *callback; ///< Callback to tell that we received some data (or won't). const char *url; ///< The URL we want to get at the server. const char *data; ///< The data to send @@ -81,14 +82,15 @@ class NetworkHTTPContentConnecter : TCPConnecter { public: /** * Start the connecting. - * @param connection_string The address to connect to. + * @param hostname The hostname to connect to. * @param callback The callback for HTTP retrieval. * @param url The url at the server. * @param data The data to send. * @param depth The depth (redirect recursion) of the queries. */ - NetworkHTTPContentConnecter(const std::string &connection_string, HTTPCallback *callback, const char *url, const char *data = nullptr, int depth = 0) : - TCPConnecter(connection_string, 80), + NetworkHTTPContentConnecter(const std::string &hostname, HTTPCallback *callback, const char *url, const char *data = nullptr, int depth = 0) : + TCPConnecter(hostname, 80), + hostname(hostname), callback(callback), url(stredup(url)), data(data), @@ -110,7 +112,7 @@ public: void OnConnect(SOCKET s) override { - new NetworkHTTPSocketHandler(s, this->callback, this->address.GetHostname(), this->url, this->data, this->depth); + new NetworkHTTPSocketHandler(s, this->callback, this->hostname.c_str(), this->url, this->data, this->depth); /* We've relinquished control of data now. */ this->data = nullptr; } |