1
0
Fork 0
forked from blue/pica

Initial setup

This commit is contained in:
Blue 2023-11-21 19:19:08 -03:00
parent 3a0fa57a06
commit 68e795f0e6
Signed by untrusted user: blue
GPG key ID: 9B203B252A63EE38
17 changed files with 466 additions and 8 deletions

40
request/request.h Normal file
View 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;
};