diff options
Diffstat (limited to 'fbench/src/httpclient/httpclient.h')
-rw-r--r-- | fbench/src/httpclient/httpclient.h | 77 |
1 files changed, 37 insertions, 40 deletions
diff --git a/fbench/src/httpclient/httpclient.h b/fbench/src/httpclient/httpclient.h index 31a3881ec27..5b96daa2441 100644 --- a/fbench/src/httpclient/httpclient.h +++ b/fbench/src/httpclient/httpclient.h @@ -109,8 +109,6 @@ protected: ssize_t _bufused; ssize_t _bufpos; - unsigned int _headerinfoPos; - bool _isOpen; unsigned int _httpVersion; unsigned int _requestStatus; @@ -221,37 +219,6 @@ protected: **/ bool ReadChunkHeader(); -public: - - /** - * Create a HTTP client that may be used to fetch documents from the - * given host. - * - * @param hostname the host you want to fetch documents from. - * @param port the TCP port to use when contacting the host. - * @param keepAlive flag indicating if keep-alive should be enabled. - **/ - HTTPClient(vespalib::CryptoEngine::SP engine, const char *hostname, int port, bool keepAlive, - bool headerBenchmarkdataCoverage, const std::string & extraHeaders="", const std::string &authority = ""); - - /** - * Disconnect from server and free memory. - **/ - ~HTTPClient(); - - /** - * This method may be used to obtain information about how many - * times a physical connection has been reused to send an additional - * HTTP request. Note that connections may only be reused if - * keep-alive is enabled. - * - * @return connection reuse count - **/ - uint64_t GetReuseCount() const - { - return _reuseCount; - } - /** * Connect to the given url and read the response HTTP header. Note * that this method will fail if the host returns a status code @@ -265,6 +232,17 @@ public: * @param cLen length of content in bytes **/ bool Open(std::string & headerinfo, const char *url, bool usePost = false, const char *content = 0, int cLen = 0); + + /** + * Close the connection to the url we are currently reading + * from. Will also close the physical connection if keepAlive is not + * enabled or if all the url content was not read. This is done + * because skipping will probably be more expencive than creating a + * new connection. + * + * @return success(true)/failure(false) + **/ + bool Close(); /** * Read data from the url we are currently connected to. This method @@ -278,17 +256,36 @@ public: * @param len length of buf. **/ ssize_t Read(void *buf, size_t len); +public: /** - * Close the connection to the url we are currently reading - * from. Will also close the physical connection if keepAlive is not - * enabled or if all the url content was not read. This is done - * because skipping will probably be more expencive than creating a - * new connection. + * Create a HTTP client that may be used to fetch documents from the + * given host. * - * @return success(true)/failure(false) + * @param hostname the host you want to fetch documents from. + * @param port the TCP port to use when contacting the host. + * @param keepAlive flag indicating if keep-alive should be enabled. **/ - bool Close(); + HTTPClient(vespalib::CryptoEngine::SP engine, const char *hostname, int port, bool keepAlive, + bool headerBenchmarkdataCoverage, const std::string & extraHeaders="", const std::string &authority = ""); + + /** + * Disconnect from server and free memory. + **/ + ~HTTPClient(); + + /** + * This method may be used to obtain information about how many + * times a physical connection has been reused to send an additional + * HTTP request. Note that connections may only be reused if + * keep-alive is enabled. + * + * @return connection reuse count + **/ + uint64_t GetReuseCount() const + { + return _reuseCount; + } /** * Class that provides status about the executed fetch method. |