41 lines
810 B
C
41 lines
810 B
C
|
#pragma once
|
||
|
|
||
|
#include <memory>
|
||
|
#include <stdexcept>
|
||
|
#include <string_view>
|
||
|
|
||
|
#include <fcgiapp.h>
|
||
|
|
||
|
#include "stream/ostream.h"
|
||
|
|
||
|
class Request {
|
||
|
public:
|
||
|
enum class State {
|
||
|
initial,
|
||
|
accepted,
|
||
|
responded
|
||
|
};
|
||
|
|
||
|
Request();
|
||
|
~Request();
|
||
|
Request(const Request& other) = delete;
|
||
|
Request(Request&& other) = delete;
|
||
|
Request& operator = (const Request& other) = delete;
|
||
|
Request& operator = (Request&& other) = delete;
|
||
|
|
||
|
bool wait(int socketDescriptor);
|
||
|
void terminate();
|
||
|
bool isGet() const;
|
||
|
|
||
|
OStream getOutputStream();
|
||
|
OStream getErrorStream();
|
||
|
|
||
|
std::string_view getPath(const std::string& serverName) const;
|
||
|
std::string getServerName() const;
|
||
|
void printEnvironment(std::ostream& out);
|
||
|
|
||
|
private:
|
||
|
State state;
|
||
|
FCGX_Request raw;
|
||
|
};
|