2018-08-19 17:09:54 +00:00
|
|
|
#include "PingHandler.h"
|
|
|
|
#include <Poco/Net/HTTPServerRequest.h>
|
|
|
|
#include <Poco/Net/HTTPServerResponse.h>
|
|
|
|
#include <Common/Exception.h>
|
|
|
|
#include <IO/HTTPCommon.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2024-01-03 16:47:15 +00:00
|
|
|
void PingHandler::handleRequest(HTTPServerRequest & /* request */, HTTPServerResponse & response, const ProfileEvents::Event & /*write_event*/)
|
2018-08-19 17:09:54 +00:00
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2024-03-22 16:09:14 +00:00
|
|
|
setResponseDefaultHeaders(response);
|
2018-08-19 17:09:54 +00:00
|
|
|
const char * data = "Ok.\n";
|
|
|
|
response.sendBuffer(data, strlen(data));
|
|
|
|
}
|
|
|
|
catch (...)
|
|
|
|
{
|
|
|
|
tryLogCurrentException("PingHandler");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|