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
|
|
|
|
{
|
|
|
|
setResponseDefaultHeaders(response, keep_alive_timeout);
|
|
|
|
const char * data = "Ok.\n";
|
|
|
|
response.sendBuffer(data, strlen(data));
|
|
|
|
}
|
|
|
|
catch (...)
|
|
|
|
{
|
|
|
|
tryLogCurrentException("PingHandler");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|