21#ifndef G_SMTP_SERVER_BUFFER_IN_H
22#define G_SMTP_SERVER_BUFFER_IN_H
34 class ServerBufferIn ;
76 G_EXCEPTION( Overflow ,
tx(
"server protocol overflow") )
82 Config & set_input_buffer_soft_limit( std::size_t ) noexcept ;
83 Config & set_input_buffer_hard_limit( std::size_t ) noexcept ;
92 void apply(
const char * , std::size_t ) ;
101 void expect( std::size_t ) ;
104 std::string
head()
const ;
120 void applySome( const
char * ,
std::
size_t ) ;
122 void onProtocolChange() ;
123 bool overLimit() const ;
124 bool overHardLimit() const ;
131 GNet::LineBuffer m_line_buffer ;
133 G::Slot::Signal<
bool> m_flow_signal ;
134 bool m_flow_on {
true} ;
137inline GSmtp::ServerBufferIn::Config & GSmtp::ServerBufferIn::Config::set_input_buffer_soft_limit( std::size_t n )
noexcept { input_buffer_soft_limit = n ;
return *this ; }
138inline GSmtp::ServerBufferIn::Config & GSmtp::ServerBufferIn::Config::set_input_buffer_hard_limit( std::size_t n )
noexcept { input_buffer_hard_limit = n ;
return *this ; }
A lightweight object containing an ExceptionHandler pointer, optional ExceptionSource pointer and opt...
A helper class for GSmtp::ServerProtocol that does buffering of data received from the remote peer an...
G::Slot::Signal< bool > & flowSignal() noexcept
Returns a signal that should be connected to a function that controls network flow control,...
std::string head() const
Returns GNet::LineBufferState::head().
~ServerBufferIn()
Destructor.
void expect(std::size_t)
Forwards to GNet::LineBuffer::expect().
void apply(const char *, std::size_t)
Called when raw data is received from the peer.
ServerBufferIn(GNet::EventState, ServerProtocol &, const Config &)
Constructor.
Implements the SMTP server-side protocol.
constexpr const char * tx(const char *p) noexcept
A briefer alternative to G::gettext_noop().
A configuration structure for GSmtp::ServerBufferIn.
A set of compile-time buffer sizes.