diff options
author | jcgregorio <jcgregorio@google.com> | 2016-02-10 14:10:37 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-10 14:10:37 -0800 |
commit | 12d47ce49e65e27f39fa20b78445e637c95b19b8 (patch) | |
tree | 1697672ea6df162cb75ab0620e5c5dde88df958a | |
parent | 1446a9a67ab30cd93e3e9c6210daec86b062e234 (diff) |
skiaserve: Fix /cmd/N and /cmd/N[0|1], the response was never queued.
BUG=skia:
R=joshualitt@google.com, ethannicholas@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1686553006
Review URL: https://codereview.chromium.org/1686553006
-rw-r--r-- | tools/skiaserve/skiaserve.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tools/skiaserve/skiaserve.cpp b/tools/skiaserve/skiaserve.cpp index e2e5450fbd..6bc7cc7846 100644 --- a/tools/skiaserve/skiaserve.cpp +++ b/tools/skiaserve/skiaserve.cpp @@ -143,6 +143,18 @@ static int process_upload_data(void* cls, enum MHD_ValueKind kind, return MHD_YES; } +// SendOK just sends an empty response with a 200 OK status code. +static int SendOK(MHD_Connection* connection) { + const char* data = ""; + + MHD_Response* response = MHD_create_response_from_buffer(strlen(data), + (void*)data, + MHD_RESPMEM_PERSISTENT); + int ret = MHD_queue_response(connection, 200, response); + MHD_destroy_response(response); + return ret; +} + static int SendData(MHD_Connection* connection, const SkData* data, const char* type, bool setContentDisposition = false, const char* dispositionString = nullptr) { MHD_Response* response = MHD_create_response_from_buffer(data->size(), @@ -228,7 +240,7 @@ public: int n; sscanf(commands[1].c_str(), "%d", &n); request->fDebugCanvas->deleteDrawCommandAt(n); - return MHD_YES; + return SendOK(connection); } // /cmd/N/[0|1] @@ -237,7 +249,7 @@ public: sscanf(commands[1].c_str(), "%d", &n); sscanf(commands[2].c_str(), "%d", &toggle); request->fDebugCanvas->toggleCommand(n, toggle); - return MHD_YES; + return SendOK(connection); } return MHD_NO; |