# HttpProcessor.hpp

This File On Github
Ask A Question

API: latest
module: oatpp
#include "oatpp/web/server/HttpProcessor.hpp"

# HttpProcessor

HttpProcessor. Helper class to handle HTTP processing.

namespace oatpp { namespace web { namespace server { 
  class HttpProcessor {}
}}}

# HttpProcessor::Config

Resource config per connection.

namespace oatpp { namespace web { namespace server { 
  class HttpProcessor {
    struct Config {}
  };
}}}

# Fields

Type Name Summary
v_buff_size headersInBufferInitial Buffer used to read headers in request. Initial size of the buffer.
v_buff_size headersOutBufferInitial Buffer used to write headers in response. Initial size of the buffer.
v_buff_size headersReaderChunkSize Size of the chunk used for iterative-read of headers.
v_buff_size headersReaderMaxSize Maximum allowed size of requests headers. The overall size of all headers in the request.

# HttpProcessor::Config::headersInBufferInitial

Buffer used to read headers in request. Initial size of the buffer.

v_buff_size headersInBufferInitial = 2048

# HttpProcessor::Config::headersOutBufferInitial

Buffer used to write headers in response. Initial size of the buffer.

v_buff_size headersOutBufferInitial = 2048

# HttpProcessor::Config::headersReaderChunkSize

Size of the chunk used for iterative-read of headers.

v_buff_size headersReaderChunkSize = 2048

# HttpProcessor::Config::headersReaderMaxSize

Maximum allowed size of requests headers. The overall size of all headers in the request.

v_buff_size headersReaderMaxSize = 4096

# HttpProcessor::Components

Collection of components needed to serve http-connection.

namespace oatpp { namespace web { namespace server { 
  class HttpProcessor {
    struct Components {}
  };
}}}

# Fields

Type Name Summary
std::shared_ptr<HttpRouter> router Router to route incoming requests. oatpp::web::server::HttpRouter.
std::shared_ptr<protocol::http::encoding::ProviderCollection> contentEncodingProviders Content-encoding providers. oatpp::web::protocol::encoding::ProviderCollection.
std::shared_ptr<const oatpp::web::protocol::http::incoming::BodyDecoder> bodyDecoder Body decoder. oatpp::web::protocol::http::incoming::BodyDecoder.
std::shared_ptr<handler::ErrorHandler> errorHandler Error handler. oatpp::web::server::handler::ErrorHandler.
std::shared_ptr<RequestInterceptors> requestInterceptors Collection of request interceptors. oatpp::web::server::handler::RequestInterceptor.
std::shared_ptr<Config> config Resource allocation config. HttpProcessor::Config.

# Methods

Return Type Name Summary
[none] Components Multiple implementations:
  1. Construcotor.
  2. Constructor.
  3. Constructor.

# HttpProcessor::Components::router

Router to route incoming requests. oatpp::web::server::HttpRouter.

std::shared_ptr<HttpRouter> router

# HttpProcessor::Components::contentEncodingProviders

Content-encoding providers. oatpp::web::protocol::encoding::ProviderCollection.

std::shared_ptr<protocol::http::encoding::ProviderCollection> contentEncodingProviders

# HttpProcessor::Components::bodyDecoder

Body decoder. oatpp::web::protocol::http::incoming::BodyDecoder.

std::shared_ptr<const oatpp::web::protocol::http::incoming::BodyDecoder> bodyDecoder

# HttpProcessor::Components::errorHandler

Error handler. oatpp::web::server::handler::ErrorHandler.

std::shared_ptr<handler::ErrorHandler> errorHandler

# HttpProcessor::Components::requestInterceptors

Collection of request interceptors. oatpp::web::server::handler::RequestInterceptor.

std::shared_ptr<RequestInterceptors> requestInterceptors

# HttpProcessor::Components::config

Resource allocation config. HttpProcessor::Config.

std::shared_ptr<Config> config

# HttpProcessor::Components::Components

  1. Construcotor.
    • @param pRouter
    • @param pContentEncodingProviders
    • @param pBodyDecoder
    • @param pErrorHandler
    • @param pRequestInterceptors
    • @param pConfig
    Components(const std::shared_ptr<HttpRouter>& pRouter,
               const std::shared_ptr<protocol::http::encoding::ProviderCollection>& pContentEncodingProviders,
               const std::shared_ptr<const oatpp::web::protocol::http::incoming::BodyDecoder>& pBodyDecoder,
               const std::shared_ptr<handler::ErrorHandler>& pErrorHandler,
               const std::shared_ptr<RequestInterceptors>& pRequestInterceptors,
               const std::shared_ptr<Config>& pConfig)
    
  2. Constructor.
    • @param pRouter
    Components(const std::shared_ptr<HttpRouter>& pRouter)
    
  3. Constructor.
    • @param pRouter
    • @param pConfig
    Components(const std::shared_ptr<HttpRouter>& pRouter, const std::shared_ptr<Config>& pConfig)
    

# HttpProcessor::Task

Connection serving task.
Usege example:
std::thread thread(HttpProcessor::Task::run, HttpProcessor::Task(components, connection));

namespace oatpp { namespace web { namespace server { 
  class HttpProcessor {
    class Task : public base::Countable {}
  };
}}}

# Methods

Return Type Name Summary
[none] Task Constructor.
void run Run loop.

# HttpProcessor::Task::Task

Constructor.

Task(const std::shared_ptr<Components>& components,
     const std::shared_ptr<oatpp::data::stream::IOStream>& connection)

# HttpProcessor::Task::run

Run loop.

void run()

# HttpProcessor::Coroutine

Connection serving coroutiner - oatpp::async::Coroutine.

namespace oatpp { namespace web { namespace server { 
  class HttpProcessor {
    class Coroutine : public oatpp::async::Coroutine<HttpProcessor::Coroutine> {}
  };
}}}

# Methods

Return Type Name Summary
[none] Coroutine Constructor.

# HttpProcessor::Coroutine::Coroutine

Constructor.

Coroutine(const std::shared_ptr<Components>& components,
          const std::shared_ptr<oatpp::data::stream::IOStream>& connection)