libjansson replaced to rapidjson.

Sync changes with proxy.
This commit is contained in:
XMRig 2017-10-04 23:33:30 +03:00
parent 4cf3bb9930
commit af51513614
78 changed files with 15550 additions and 6420 deletions

View file

@ -110,13 +110,11 @@ int Httpd::handler(void *cls, struct MHD_Connection *connection, const char *url
return done(connection, status, nullptr);
}
MHD_Response *rsp = nullptr;
size_t size = 0;
const char *buf = Api::get(url, &size, &status);
if (size) {
rsp = MHD_create_response_from_buffer(size, (void*) buf, MHD_RESPMEM_PERSISTENT);
char *buf = Api::get(url, &status);
if (buf == nullptr) {
return MHD_NO;
}
MHD_Response *rsp = MHD_create_response_from_buffer(strlen(buf), (void*) buf, MHD_RESPMEM_MUST_FREE);
return done(connection, status, rsp);
}