QuitHandler.cpp 779 B

1234567891011121314151617181920212223242526
  1. /*
  2. * Copyright 2016 Google Inc.
  3. *
  4. * Use of this source code is governed by a BSD-style license that can be
  5. * found in the LICENSE file.
  6. */
  7. #include "tools/skiaserve/urlhandlers/UrlHandler.h"
  8. #include "microhttpd.h"
  9. #include "tools/skiaserve/Request.h"
  10. #include "tools/skiaserve/Response.h"
  11. using namespace Response;
  12. bool QuitHandler::canHandle(const char* method, const char* url) {
  13. const char* kBaseName = "/quitquitquit";
  14. return 0 == strcmp(method, MHD_HTTP_METHOD_GET) &&
  15. 0 == strncmp(url, kBaseName, strlen(kBaseName));
  16. }
  17. int QuitHandler::handle(Request* request, MHD_Connection* connection,
  18. const char* url, const char* method,
  19. const char* upload_data, size_t* upload_data_size) {
  20. _exit(0);
  21. }