MCPcopy Create free account
hub / github.com/DistroAV/DistroAV / header_write

Function header_write

src/obs-support/remote-text.cpp:123–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121#ifdef USE_GET_REMOTE_FILE
122
123static size_t header_write(char *ptr, size_t size, size_t nmemb, vector<string> &list)
124{
125 string str;
126
127 size_t total = size * nmemb;
128 if (total)
129 str.append(ptr, total);
130
131 if (str.back() == '\n')
132 str.resize(str.size() - 1);
133 if (str.back() == '\r')
134 str.resize(str.size() - 1);
135
136 list.push_back(std::move(str));
137 return total;
138}
139
140bool GetRemoteFile(const char *url, std::string &str, std::string &error, long *responseCode, const char *contentType,
141 std::string request_type, const char *postData, std::vector<std::string> headers,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected