MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / setHttpHeader

Method setHttpHeader

src/common/cURLManager.cpp:214–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212
213
214void cURLManager::setHttpHeader(const std::vector<std::string>& lines) {
215 if (httpHeader) {
216 curl_slist_free_all(httpHeader);
217 httpHeader = NULL;
218 }
219
220 for (size_t i = 0; i < lines.size(); ++i) {
221 debugf(3, "adding header line: '%s'\n", lines[i].c_str());
222 httpHeader = curl_slist_append(httpHeader, lines[i].c_str());
223 }
224
225 CURLcode result;
226 result = curl_easy_setopt(easyHandle, CURLOPT_HTTPHEADER, httpHeader);
227 if (result != CURLE_OK) {
228 debugf(1, "CURLOPT_HTTPHEADER error %d : %s\n", result, errorBuffer);
229 }
230
231}
232
233
234void cURLManager::setPostMode(const std::string& _postData) {

Callers

nothing calls this directly

Calls 6

curl_slist_free_allFunction · 0.85
debugfFunction · 0.85
curl_slist_appendFunction · 0.85
curl_easy_setoptFunction · 0.85
c_strMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected