1 /* 2 * Copyright 2009-2017 Alibaba Cloud All rights reserved. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #pragma once 18 19 #include <alibabacloud/oss/client/ClientConfiguration.h> 20 #include <alibabacloud/oss/http/HttpClient.h> 21 22 namespace AlibabaCloud 23 { 24 namespace OSS 25 { 26 27 class CurlContainer; 28 class RateLimiter; 29 30 class CurlHttpClient : public HttpClient 31 { 32 public: 33 CurlHttpClient(const ClientConfiguration &configuration); 34 ~CurlHttpClient(); 35 36 static void initGlobalState(); 37 static void cleanupGlobalState(); 38 39 virtual std::shared_ptr<HttpResponse> makeRequest(const std::shared_ptr<HttpRequest> &request) override; 40 private: 41 CurlContainer *curlContainer_; 42 std::string userAgent_; 43 Http::Scheme proxyScheme_; 44 std::string proxyHost_; 45 unsigned int proxyPort_; 46 std::string proxyUserName_; 47 std::string proxyPassword_; 48 bool verifySSL_; 49 std::string caPath_; 50 std::string caFile_; 51 std::string networkInterface_; 52 public: 53 std::shared_ptr<RateLimiter> sendRateLimiter_; 54 std::shared_ptr<RateLimiter> recvRateLimiter_; 55 }; 56 } 57 } 58