Initial setup
This commit is contained in:
parent
3a0fa57a06
commit
68e795f0e6
17 changed files with 466 additions and 8 deletions
40
request/request.h
Normal file
40
request/request.h
Normal file
|
@ -0,0 +1,40 @@
|
|||
#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;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue