MCPcopy Create free account
hub / github.com/BlueMatthew/WechatExporter / writeHttpDataToBuffer

Function writeHttpDataToBuffer

WechatExporter/core/AsyncTask.cpp:23–36  ·  view source on GitHub ↗

#define FAKE_DOWNLOAD

Source from the content-addressed store, hash-verified

21
22// #define FAKE_DOWNLOAD
23size_t writeHttpDataToBuffer(void *buffer, size_t size, size_t nmemb, void *user_p)
24{
25 std::vector<unsigned char>* body = reinterpret_cast<std::vector<unsigned char> *>(user_p);
26 if (NULL != body)
27 {
28 size_t bytes = size * nmemb;
29
30 unsigned char *ptr = reinterpret_cast<unsigned char *>(buffer);
31 std::copy(ptr, ptr + bytes, back_inserter(*body));
32 return bytes;
33 }
34
35 return 0;
36}
37
38void DownloadTask::initialize()
39{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected