32 lines
597 B
C
32 lines
597 B
C
|
// SPDX-FileCopyrightText: 2023 Yury Gubich <blue@macaw.me>
|
||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||
|
|
||
|
#pragma once
|
||
|
|
||
|
#include "handler.h"
|
||
|
#include "request/request.h"
|
||
|
#include "response/response.h"
|
||
|
|
||
|
class Server;
|
||
|
namespace Handler {
|
||
|
|
||
|
class Poll : public Handler {
|
||
|
public:
|
||
|
Poll(Server* server);
|
||
|
void handle(Request& request) override;
|
||
|
|
||
|
enum class Result {
|
||
|
success,
|
||
|
tokenProblem,
|
||
|
replace,
|
||
|
timeout,
|
||
|
unknownError
|
||
|
};
|
||
|
|
||
|
void error(Request& request, Result result, Response::Status status) const;
|
||
|
private:
|
||
|
Server* server;
|
||
|
|
||
|
};
|
||
|
|
||
|
}
|