comparison OrthancFramework/Sources/HttpClient.h @ 4650:9804d6490872

Reduced memory consumption of HTTP/REST plugins calls on POST/PUT if chunked transfer is disabled
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 04 May 2021 10:57:42 +0200
parents d9473bd5ed43
children e8967149d87a
comparison
equal deleted inserted replaced
4649:e915102093de 4650:9804d6490872
104 std::string clientCertificateKeyPassword_; 104 std::string clientCertificateKeyPassword_;
105 bool pkcs11Enabled_; 105 bool pkcs11Enabled_;
106 bool headersToLowerCase_; 106 bool headersToLowerCase_;
107 bool redirectionFollowed_; 107 bool redirectionFollowed_;
108 108
109 // New in Orthanc 1.9.3 to avoid memcpy()
110 bool hasExternalBody_;
111 const void* externalBodyData_;
112 size_t externalBodySize_;
113
109 void Setup(); 114 void Setup();
110 115
111 void operator= (const HttpClient&); // Assignment forbidden 116 void operator= (const HttpClient&); // Assignment forbidden
112 HttpClient(const HttpClient& base); // Copy forbidden 117 HttpClient(const HttpClient& base); // Copy forbidden
113 118
139 144
140 void SetTimeout(long seconds); 145 void SetTimeout(long seconds);
141 146
142 long GetTimeout() const; 147 long GetTimeout() const;
143 148
144 void SetBody(const std::string& data); 149 void AssignBody(const std::string& data);
145 150
146 std::string& GetBody(); 151 void AssignBody(const void* data,
147 152 size_t size);
148 const std::string& GetBody() const;
149 153
150 void SetBody(IRequestBody& body); 154 void SetBody(IRequestBody& body);
155
156 // New in Orthanc 1.9.3: The "data" buffer must have a lifetime
157 // that is longer than the HttpClient object
158 void SetExternalBody(const void* data,
159 size_t size);
160
161 void SetExternalBody(const std::string& data)
162 {
163 SetExternalBody(data.empty() ? NULL : data.c_str(), data.size());
164 }
151 165
152 void ClearBody(); 166 void ClearBody();
153 167
154 void SetVerbose(bool isVerbose); 168 void SetVerbose(bool isVerbose);
155 169