Implements the POP server-side protocol. More...
#include <gpopserverprotocol.h>
Classes | |
struct | Config |
A structure containing configuration parameters for ServerProtocol. NOT USED. More... | |
class | Security |
An interface used by ServerProtocol to enable TLS. More... | |
class | Sender |
An interface used by ServerProtocol to send protocol replies. More... | |
class | Text |
An interface used by ServerProtocol to provide response text strings. More... | |
Public Member Functions | |
ServerProtocol (Sender &sender, Security &security, Store &store, const Secrets &secrets, const Text &text, GNet::Address peer_address, Config config) | |
Constructor. More... | |
virtual | ~ServerProtocol () |
Destructor. More... | |
void | init () |
Starts the protocol. More... | |
void | apply (const std::string &line) |
Called on receipt of a string from the client. More... | |
void | resume () |
Called when the Sender can send again. More... | |
void | secure () |
Called when the server connection becomes secure. More... | |
Implements the POP server-side protocol.
Uses the ServerProtocol::Sender as its "sideways" interface to talk back to the client.
Definition at line 50 of file gpopserverprotocol.h.
GPop::ServerProtocol::ServerProtocol | ( | Sender & | sender, |
Security & | security, | ||
Store & | store, | ||
const Secrets & | secrets, | ||
const Text & | text, | ||
GNet::Address | peer_address, | ||
Config | config | ||
) |
Constructor.
The Sender interface is used to send protocol replies back to the client.
The Text interface is used to get informational text for returning to the client.
All references are kept.
Definition at line 31 of file gpopserverprotocol.cpp.
References G::StateMachine< T, State, Event, Arg >::addTransition(), and GPop::ServerProtocol::Security::securityEnabled().
|
virtual |
Destructor.
Definition at line 76 of file gpopserverprotocol.cpp.
void GPop::ServerProtocol::apply | ( | const std::string & | line | ) |
Called on receipt of a string from the client.
The string is expected to be CR-LF terminated. Throws ProtocolDone if done.
Definition at line 110 of file gpopserverprotocol.cpp.
References G_LOG, and G::Str::printable().
void GPop::ServerProtocol::init | ( | ) |
Starts the protocol.
Definition at line 71 of file gpopserverprotocol.cpp.
Referenced by GPop::ServerPeer::ServerPeer().
void GPop::ServerProtocol::resume | ( | ) |
void GPop::ServerProtocol::secure | ( | ) |
Called when the server connection becomes secure.
Definition at line 475 of file gpopserverprotocol.cpp.