Index: tools/skiaserve/urlhandlers/QuitHandler.cpp |
diff --git a/tools/skiaserve/urlhandlers/RootHandler.cpp b/tools/skiaserve/urlhandlers/QuitHandler.cpp |
similarity index 66% |
copy from tools/skiaserve/urlhandlers/RootHandler.cpp |
copy to tools/skiaserve/urlhandlers/QuitHandler.cpp |
index 647c198cbcdacfdad3c84e51600ee4fa3aa319ca..a9196a0c697c864ba2d4f5e6db79db4dfb6fb38b 100644 |
--- a/tools/skiaserve/urlhandlers/RootHandler.cpp |
+++ b/tools/skiaserve/urlhandlers/QuitHandler.cpp |
@@ -13,13 +13,14 @@ |
using namespace Response; |
-bool RootHandler::canHandle(const char* method, const char* url) { |
+bool QuitHandler::canHandle(const char* method, const char* url) { |
+ const char* kBaseName = "/quitquitquit"; |
return 0 == strcmp(method, MHD_HTTP_METHOD_GET) && |
- 0 == strcmp(url, "/"); |
+ 0 == strncmp(url, kBaseName, strlen(kBaseName)); |
} |
-int RootHandler::handle(Request* request, MHD_Connection* connection, |
+int QuitHandler::handle(Request* request, MHD_Connection* connection, |
const char* url, const char* method, |
const char* upload_data, size_t* upload_data_size) { |
- return SendTemplate(connection); |
+ exit(0); |
} |