fastcgi++
A C++ FastCGI/Web API
Classes | Namespaces | Typedefs | Enumerations | Functions | Variables
protocol.hpp File Reference

Declares everything for relating to the FastCGI protocol itself. More...

#include <memory>
#include <cstdint>
#include <algorithm>
#include <map>
#include <vector>
#include "fastcgi++/message.hpp"
#include "fastcgi++/sockets.hpp"

Go to the source code of this file.

Classes

struct  Fastcgipp::Protocol::RequestId
 A unique identifier for each FastCGI request. More...
 
struct  Fastcgipp::Protocol::RequestId::Less
 We need this uglyness to find ranges based purely on the socket. More...
 
struct  Fastcgipp::Protocol::Unsigned< Size >
 Get unsigned integral type from size. More...
 
struct  Fastcgipp::Protocol::Unsigned< 2 >
 
struct  Fastcgipp::Protocol::Unsigned< 4 >
 
struct  Fastcgipp::Protocol::Unsigned< 8 >
 
class  Fastcgipp::Protocol::BigEndian< T >
 Allows raw storage of types in big endian format. More...
 
struct  Fastcgipp::Protocol::Header
 Data structure used as the header for FastCGI records. More...
 
struct  Fastcgipp::Protocol::BeginRequest
 The body for FastCGI records with a RecordType of BEGIN_REQUEST. More...
 
struct  Fastcgipp::Protocol::UnknownType
 The body for FastCGI records with a RecordType of UNKNOWN_TYPE. More...
 
struct  Fastcgipp::Protocol::EndRequest
 The body for FastCGI records of type RecordType::END_REQUEST. More...
 
struct  Fastcgipp::Protocol::ManagementReply< NAMELENGTH, VALUELENGTH >
 For the reply of FastCGI management records. More...
 

Namespaces

 Fastcgipp
 Topmost namespace for the fastcgi++ library.
 
 Fastcgipp::Protocol
 Defines aspects of the FastCGI Protocol.
 

Typedefs

typedef uint16_t Fastcgipp::Protocol::FcgiId
 The internal ID of a FastCGI request. More...
 
template<class T >
using Fastcgipp::Protocol::Requests = std::map< RequestId, T, RequestId::Less >
 A simple associative container that indexes with RequestId. More...
 

Enumerations

enum  Fastcgipp::Protocol::RecordType : uint8_t {
  Fastcgipp::Protocol::RecordType::BEGIN_REQUEST =1, Fastcgipp::Protocol::RecordType::ABORT_REQUEST =2, Fastcgipp::Protocol::RecordType::END_REQUEST =3, Fastcgipp::Protocol::RecordType::PARAMS =4,
  Fastcgipp::Protocol::RecordType::IN =5, Fastcgipp::Protocol::RecordType::OUT =6, Fastcgipp::Protocol::RecordType::ERR =7, Fastcgipp::Protocol::RecordType::DATA =8,
  Fastcgipp::Protocol::RecordType::GET_VALUES =9, Fastcgipp::Protocol::RecordType::GET_VALUES_RESULT =10, Fastcgipp::Protocol::RecordType::UNKNOWN_TYPE =11
}
 Defines the types of records within the FastCGI protocol. More...
 
enum  Fastcgipp::Protocol::Role : uint16_t { Fastcgipp::Protocol::Role::RESPONDER =1, Fastcgipp::Protocol::Role::AUTHORIZER =2, Fastcgipp::Protocol::Role::FILTER =3 }
 Defines the possible roles a FastCGI application may play. More...
 
enum  Fastcgipp::Protocol::ProtocolStatus : uint8_t { Fastcgipp::Protocol::ProtocolStatus::REQUEST_COMPLETE =0, Fastcgipp::Protocol::ProtocolStatus::CANT_MPX_CONN =1, Fastcgipp::Protocol::ProtocolStatus::OVERLOADED =2, Fastcgipp::Protocol::ProtocolStatus::UNKNOWN_ROLE =3 }
 Possible statuses a request may declare when complete. More...
 

Functions

bool Fastcgipp::Protocol::processParamHeader (const char *data, const char *const dataEnd, const char *&name, const char *&value, const char *&end)
 Process the body of a FastCGI record of type RecordType::PARAMS. More...
 

Variables

const char Fastcgipp::version [] =FASTCGIPP_VERSION
 Defines the fastcgi++ version. More...
 
const uint16_t Fastcgipp::Protocol::badFcgiId = 0xffffUL
 Constant that defines a bad/special FcgiId. More...
 
const int Fastcgipp::Protocol::version =1
 The version of the FastCGI protocol that this adheres to. More...
 
const int Fastcgipp::Protocol::chunkSize =8
 All FastCGI records will be a multiple of this many bytes. More...
 
const ManagementReply< 14, 2 > Fastcgipp::Protocol::maxConnsReply
 The maximum allowed file descriptors open at a time. More...
 
const ManagementReply< 13, 2 > Fastcgipp::Protocol::maxReqsReply
 The maximum allowed requests at a time. More...
 
const ManagementReply< 15, 1 > Fastcgipp::Protocol::mpxsConnsReply
 Where or not requests can be multiplexed over a single connections. More...
 

Detailed Description

Declares everything for relating to the FastCGI protocol itself.

Author
Eddie Carle <eddie.nosp@m.@isa.nosp@m.tec.c.nosp@m.a>
Date
May 10, 2017

Definition in file protocol.hpp.