10#include "microhttpd.h"
19 static const char* kBasePath =
"/overdraw/";
20 return 0 == strcmp(method, MHD_HTTP_METHOD_POST) &&
21 0 == strncmp(url, kBasePath, strlen(kBasePath));
25 const char* url,
const char* method,
26 const char* upload_data,
size_t* upload_data_size) {
35 sscanf(
commands[1].c_str(),
"%d", &enable);
37 bool success = request->setOverdraw(
SkToBool(enable));
39 return SendError(connection,
"Unable to set overdraw");
void SkStrSplit(const char *str, const char *delimiters, SkStrSplitMode splitMode, TArray< SkString > *out)
static constexpr bool SkToBool(const T &x)
bool canHandle(const char *method, const char *url) override
int handle(Request *request, MHD_Connection *connection, const char *url, const char *method, const char *upload_data, size_t *upload_data_size) override
int SendOK(MHD_Connection *connection)
int SendError(MHD_Connection *connection, const char *msg)