incoming_http_msg_limits.hpp
Go to the documentation of this file.
/*
* RESTinio
*/
#pragma once
#include <restinio/compiler_features.hpp>
#include <cstdint>
#include <limits>
namespace restinio
{
//
// incoming_http_msg_limits_t
//
class incoming_http_msg_limits_t
{
std::size_t m_max_url_size{ std::numeric_limits<std::size_t>::max() };
std::size_t m_max_field_name_size{ std::numeric_limits<std::size_t>::max() };
std::size_t m_max_field_value_size{ std::numeric_limits<std::size_t>::max() };
std::size_t m_max_field_count{ std::numeric_limits<std::size_t>::max() };
std::uint64_t m_max_body_size{ std::numeric_limits<std::uint64_t>::max() };
public:
incoming_http_msg_limits_t() noexcept = default;
RESTINIO_NODISCARD
std::size_t
max_url_size() const noexcept { return m_max_url_size; }
incoming_http_msg_limits_t &
max_url_size( std::size_t value ) & noexcept
{
m_max_url_size = value;
return *this;
}
incoming_http_msg_limits_t &&
max_url_size( std::size_t value ) && noexcept
{
return std::move(max_url_size(value));
}
RESTINIO_NODISCARD
std::size_t
max_field_name_size() const noexcept { return m_max_field_name_size; }
incoming_http_msg_limits_t &
max_field_name_size( std::size_t value ) & noexcept
{
m_max_field_name_size = value;
return *this;
}
incoming_http_msg_limits_t &&
max_field_name_size( std::size_t value ) && noexcept
{
return std::move(max_field_name_size(value));
}
RESTINIO_NODISCARD
std::size_t
max_field_value_size() const noexcept { return m_max_field_value_size; }
incoming_http_msg_limits_t &
max_field_value_size( std::size_t value ) & noexcept
{
m_max_field_value_size = value;
return *this;
}
incoming_http_msg_limits_t &&
max_field_value_size( std::size_t value ) && noexcept
{
return std::move(max_field_value_size(value));
}
RESTINIO_NODISCARD
std::size_t
max_field_count() const noexcept { return m_max_field_count; }
incoming_http_msg_limits_t &
max_field_count( std::size_t value ) & noexcept
{
m_max_field_count = value;
return *this;
}
incoming_http_msg_limits_t &&
max_field_count( std::size_t value ) && noexcept
{
return std::move(max_field_count(value));
}
RESTINIO_NODISCARD
std::uint64_t
max_body_size() const noexcept { return m_max_body_size; }
incoming_http_msg_limits_t &
max_body_size( std::uint64_t value ) & noexcept
{
m_max_body_size = value;
return *this;
}
incoming_http_msg_limits_t &&
max_body_size( std::uint64_t value ) && noexcept
{
return std::move(max_body_size(value));
}
};
} /* namespace restinio */
restinio::incoming_http_msg_limits_t
A type of holder of limits related to an incoming HTTP message.
Definition: incoming_http_msg_limits.hpp:69
restinio::incoming_http_msg_limits_t::m_max_field_value_size
std::size_t m_max_field_value_size
Definition: incoming_http_msg_limits.hpp:72
restinio::incoming_http_msg_limits_t::max_field_value_size
incoming_http_msg_limits_t & max_field_value_size(std::size_t value) &noexcept
Definition: incoming_http_msg_limits.hpp:118
restinio::incoming_http_msg_limits_t::max_body_size
incoming_http_msg_limits_t & max_body_size(std::uint64_t value) &noexcept
Definition: incoming_http_msg_limits.hpp:152
restinio::incoming_http_msg_limits_t::max_field_name_size
RESTINIO_NODISCARD std::size_t max_field_name_size() const noexcept
Definition: incoming_http_msg_limits.hpp:98
restinio::incoming_http_msg_limits_t::max_url_size
incoming_http_msg_limits_t & max_url_size(std::size_t value) &noexcept
Definition: incoming_http_msg_limits.hpp:84
restinio::incoming_http_msg_limits_t::max_field_count
incoming_http_msg_limits_t && max_field_count(std::size_t value) &&noexcept
Definition: incoming_http_msg_limits.hpp:142
restinio::incoming_http_msg_limits_t::max_url_size
incoming_http_msg_limits_t && max_url_size(std::size_t value) &&noexcept
Definition: incoming_http_msg_limits.hpp:91
restinio::incoming_http_msg_limits_t::max_field_name_size
incoming_http_msg_limits_t & max_field_name_size(std::size_t value) &noexcept
Definition: incoming_http_msg_limits.hpp:101
restinio::incoming_http_msg_limits_t::max_url_size
RESTINIO_NODISCARD std::size_t max_url_size() const noexcept
Definition: incoming_http_msg_limits.hpp:81
restinio::incoming_http_msg_limits_t::incoming_http_msg_limits_t
incoming_http_msg_limits_t() noexcept=default
restinio::incoming_http_msg_limits_t::m_max_body_size
std::uint64_t m_max_body_size
Definition: incoming_http_msg_limits.hpp:74
restinio::incoming_http_msg_limits_t::max_body_size
incoming_http_msg_limits_t && max_body_size(std::uint64_t value) &&noexcept
Definition: incoming_http_msg_limits.hpp:159
restinio::incoming_http_msg_limits_t::max_field_name_size
incoming_http_msg_limits_t && max_field_name_size(std::size_t value) &&noexcept
Definition: incoming_http_msg_limits.hpp:108
restinio::incoming_http_msg_limits_t::m_max_url_size
std::size_t m_max_url_size
Definition: incoming_http_msg_limits.hpp:70
restinio::incoming_http_msg_limits_t::max_field_count
RESTINIO_NODISCARD std::size_t max_field_count() const noexcept
Definition: incoming_http_msg_limits.hpp:132
restinio::incoming_http_msg_limits_t::max_field_count
incoming_http_msg_limits_t & max_field_count(std::size_t value) &noexcept
Definition: incoming_http_msg_limits.hpp:135
restinio::incoming_http_msg_limits_t::m_max_field_name_size
std::size_t m_max_field_name_size
Definition: incoming_http_msg_limits.hpp:71
restinio::incoming_http_msg_limits_t::max_field_value_size
incoming_http_msg_limits_t && max_field_value_size(std::size_t value) &&noexcept
Definition: incoming_http_msg_limits.hpp:125
restinio::incoming_http_msg_limits_t::m_max_field_count
std::size_t m_max_field_count
Definition: incoming_http_msg_limits.hpp:73
restinio::incoming_http_msg_limits_t::max_body_size
RESTINIO_NODISCARD std::uint64_t max_body_size() const noexcept
Definition: incoming_http_msg_limits.hpp:149
restinio::incoming_http_msg_limits_t::max_field_value_size
RESTINIO_NODISCARD std::size_t max_field_value_size() const noexcept
Definition: incoming_http_msg_limits.hpp:115
compiler_features.hpp
Detection of compiler version and absence of various features.
RESTINIO_NODISCARD
#define RESTINIO_NODISCARD
Definition: compiler_features.hpp:33
nonstd::optional_lite::std11::move
T & move(T &t)
Definition: optional.hpp:465
restinio
Definition: asio_include.hpp:21
std
STL namespace.
const
#define const
Definition: zconf.h:230