Commit feb589e4 authored by Ciarán Ó Rourke's avatar Ciarán Ó Rourke
Browse files

Renamed StaticHandler class to GetRequestHandler

parent f459c890
......@@ -22,7 +22,7 @@
namespace fiphoboserver {
void StaticHandler::onRequest(
void GetRequestHandler::onRequest(
std::unique_ptr<proxygen::HTTPMessage> headers) noexcept
{
if (headers->getMethod() != proxygen::HTTPMethod::GET) {
......@@ -82,11 +82,11 @@ void StaticHandler::onRequest(
readFileScheduled_ = true;
folly::getCPUExecutor()->add(
std::bind(&StaticHandler::readFile, this,
std::bind(&GetRequestHandler::readFile, this,
folly::EventBaseManager::get()->getEventBase()));
}
void StaticHandler::readFile(folly::EventBase* evb)
void GetRequestHandler::readFile(folly::EventBase* evb)
{
#ifdef DEBUG
std::cout << "Getting data from FIFO... " << std::endl;
......@@ -114,24 +114,24 @@ void StaticHandler::readFile(folly::EventBase* evb)
}
}
void StaticHandler::onBody(std::unique_ptr<folly::IOBuf> /*body*/) noexcept
void GetRequestHandler::onBody(std::unique_ptr<folly::IOBuf> /*body*/) noexcept
{
// ignore, only support GET
}
void StaticHandler::onEOM() noexcept {}
void GetRequestHandler::onEOM() noexcept {}
void StaticHandler::onUpgrade(proxygen::UpgradeProtocol /*protocol*/) noexcept
void GetRequestHandler::onUpgrade(proxygen::UpgradeProtocol /*protocol*/) noexcept
{
// handler doesn't support upgrades
}
void StaticHandler::requestComplete() noexcept
void GetRequestHandler::requestComplete() noexcept
{
delete this;
}
void StaticHandler::onError(proxygen::ProxygenError /*err*/) noexcept
void GetRequestHandler::onError(proxygen::ProxygenError /*err*/) noexcept
{
delete this;
}
......
......@@ -21,12 +21,12 @@ class ResponseHandler;
namespace fiphoboserver {
class StaticHandler : public proxygen::RequestHandler {
class GetRequestHandler : public proxygen::RequestHandler {
public:
void onRequest(
std::unique_ptr<proxygen::HTTPMessage> headers) noexcept override;
void StaticHandler::readFile(folly::EventBase* evb)
void readFile(folly::EventBase* evb)
void onBody(std::unique_ptr<folly::IOBuf> body) noexcept override;
......
......@@ -46,7 +46,7 @@ class HandlerFactory : public proxygen::RequestHandlerFactory {
proxygen::HTTPMessage* headers) noexcept override
{
if (headers->getMethod() == proxygen::HTTPMethod::GET) {
return new fiphoboserver::StaticHandler;
return new fiphoboserver::getRequestHandler;
}
else if (headers->getMethod() == proxygen::HTTPMethod::PUT) {
return new fiphoboserver::PushRequestHandler;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment