diff options
Diffstat (limited to 'lib/httpserver/S3Client.h')
-rw-r--r-- | lib/httpserver/S3Client.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/httpserver/S3Client.h b/lib/httpserver/S3Client.h index 3c4126ac..4cbb4b96 100644 --- a/lib/httpserver/S3Client.h +++ b/lib/httpserver/S3Client.h @@ -36,7 +36,8 @@ class S3Client : mpSimulator(pSimulator), mHostName(rHostName), mAccessKey(rAccessKey), - mSecretKey(rSecretKey) + mSecretKey(rSecretKey), + mNetworkTimeout(30000) { } S3Client(std::string HostName, int Port, const std::string& rAccessKey, @@ -45,12 +46,16 @@ class S3Client mHostName(HostName), mPort(Port), mAccessKey(rAccessKey), - mSecretKey(rSecretKey) + mSecretKey(rSecretKey), + mNetworkTimeout(30000) { } HTTPResponse GetObject(const std::string& rObjectURI); + HTTPResponse HeadObject(const std::string& rObjectURI); HTTPResponse PutObject(const std::string& rObjectURI, IOStream& rStreamToSend, const char* pContentType = NULL); + void CheckResponse(const HTTPResponse& response, const std::string& message) const; + int GetNetworkTimeout() const { return mNetworkTimeout; } private: HTTPServer* mpSimulator; @@ -58,6 +63,7 @@ class S3Client int mPort; std::auto_ptr<SocketStream> mapClientSocket; std::string mAccessKey, mSecretKey; + int mNetworkTimeout; // milliseconds HTTPResponse FinishAndSendRequest(HTTPRequest::Method Method, const std::string& rRequestURI, |