#include <TlsLegacySocketContext.h>
Public Types | |
| enum class | Role { SERVER , CLIENT } |
Public Member Functions | |
| TlsLegacySocketContext (core::socket::stream::SocketConnection *socketConnection, Role role) | |
| Public Member Functions inherited from core::socket::stream::SocketContext | |
| SocketContext (core::socket::stream::SocketConnection *socketConnection) | |
| void | sendToPeer (const char *chunk, std::size_t chunkLen) const final |
| bool | streamToPeer (core::pipe::Source *source) const |
| void | streamEof () |
| std::size_t | readFromPeer (char *chunk, std::size_t chunklen) const final |
| void | setTimeout (const utils::Timeval &timeout) final |
| void | shutdownRead () |
| void | shutdownWrite () |
| void | close () override |
| std::size_t | getTotalSent () const override |
| std::size_t | getTotalQueued () const override |
| std::size_t | getTotalRead () const override |
| std::size_t | getTotalProcessed () const override |
| std::string | getOnlineSince () const override |
| std::string | getOnlineDuration () const override |
| SocketConnection * | getSocketConnection () const |
| void | sendToPeer (const std::string &data) const |
| Public Member Functions inherited from core::socket::SocketContext | |
| SocketContext (const SocketContext &)=delete | |
| SocketContext (SocketContext &&)=delete | |
| SocketContext & | operator= (const SocketContext &)=delete |
| SocketContext & | operator= (SocketContext &&)=delete |
| void | sendToPeer (const std::string &data) const |
Private Member Functions | |
| void | onConnected () override |
| void | onDisconnected () override |
| bool | onSignal (int signum) override |
| std::size_t | onReceivedFromPeer () override |
| void | onClientLine (const std::string &line) |
| void | onServerLine (const std::string &line) |
| void | startLegacyRetryTimer (const std::string &payload) |
Private Attributes | |
| Role | role |
| std::string | inboundBuffer |
| bool | tlsReplySeen = false |
| bool | legacyReplySeen = false |
| bool | legacyPayloadSeen = false |
| core::timer::Timer | legacyRetryTimer |
Additional Inherited Members | |
| Protected Member Functions inherited from core::socket::stream::SocketContext | |
| void | onWriteError (int errnum) override |
| void | onReadError (int errnum) override |
| std::size_t | readFromPeer () |
| Protected Member Functions inherited from core::socket::SocketContext | |
| SocketContext ()=default | |
| virtual | ~SocketContext () |
Definition at line 23 of file TlsLegacySocketContext.h.
|
strong |
| Enumerator | |
|---|---|
| SERVER | |
| CLIENT | |
Definition at line 25 of file TlsLegacySocketContext.h.
|
explicit |
Definition at line 23 of file TlsLegacySocketContext.cpp.
References role, and core::socket::stream::SocketContext::SocketContext().
Referenced by apps::tlslegacy::TlsLegacyClientSocketContextFactory::create(), and apps::tlslegacy::TlsLegacyServerSocketContextFactory::create().
|
private |
Definition at line 62 of file TlsLegacySocketContext.cpp.
References core::Timer::cancel(), core::socket::stream::SocketConnection::getConnectionName(), core::socket::stream::SocketContext::getSocketConnection(), anonymous_namespace{TlsLegacySocketContext.cpp}::LEGACY_ACK, anonymous_namespace{TlsLegacySocketContext.cpp}::LEGACY_HELLO, legacyReplySeen, legacyRetryTimer, logger::LogMessage::LogMessage(), core::socket::stream::SocketContext::shutdownWrite(), startLegacyRetryTimer(), anonymous_namespace{TlsLegacySocketContext.cpp}::TLS_ACK, and tlsReplySeen.
Referenced by onReceivedFromPeer().
|
overrideprivatevirtual |
Implements core::socket::stream::SocketContext.
Definition at line 28 of file TlsLegacySocketContext.cpp.
References CLIENT, core::socket::stream::SocketConnection::getConnectionName(), core::socket::stream::SocketContext::getSocketConnection(), logger::LogMessage::LogMessage(), role, core::socket::SocketContext::sendToPeer(), and anonymous_namespace{TlsLegacySocketContext.cpp}::TLS_HELLO.
|
overrideprivatevirtual |
Implements core::socket::stream::SocketContext.
Definition at line 37 of file TlsLegacySocketContext.cpp.
References core::Timer::cancel(), core::socket::stream::SocketConnection::getConnectionName(), core::socket::stream::SocketContext::getSocketConnection(), legacyRetryTimer, and logger::LogMessage::LogMessage().
|
overrideprivatevirtual |
Implements core::socket::SocketContext.
Definition at line 91 of file TlsLegacySocketContext.cpp.
References CLIENT, inboundBuffer, onClientLine(), onServerLine(), core::socket::stream::SocketContext::readFromPeer(), and role.
|
private |
Definition at line 77 of file TlsLegacySocketContext.cpp.
References core::Timer::cancel(), core::socket::stream::SocketConnection::getConnectionName(), core::socket::stream::SocketContext::getSocketConnection(), anonymous_namespace{TlsLegacySocketContext.cpp}::LEGACY_ACK, anonymous_namespace{TlsLegacySocketContext.cpp}::LEGACY_HELLO, legacyPayloadSeen, legacyRetryTimer, logger::LogMessage::LogMessage(), core::socket::SocketContext::sendToPeer(), core::socket::stream::SocketContext::shutdownWrite(), anonymous_namespace{TlsLegacySocketContext.cpp}::TLS_ACK, anonymous_namespace{TlsLegacySocketContext.cpp}::TLS_HELLO, and tlsReplySeen.
Referenced by onReceivedFromPeer().
|
overrideprivatevirtual |
Implements core::socket::SocketContext.
Definition at line 42 of file TlsLegacySocketContext.cpp.
|
private |
Definition at line 46 of file TlsLegacySocketContext.cpp.
References core::Timer::cancel(), CLIENT, core::socket::stream::SocketConnection::getConnectionName(), core::socket::stream::SocketContext::getSocketConnection(), core::timer::Timer::intervalTimer(), legacyReplySeen, legacyRetryTimer, logger::LogMessage::LogMessage(), core::timer::Timer::operator=(), role, core::socket::SocketContext::sendToPeer(), and utils::Timeval::Timeval().
Referenced by onClientLine().
|
private |
Definition at line 40 of file TlsLegacySocketContext.h.
Referenced by onReceivedFromPeer().
|
private |
Definition at line 44 of file TlsLegacySocketContext.h.
Referenced by onServerLine().
|
private |
Definition at line 43 of file TlsLegacySocketContext.h.
Referenced by onClientLine(), and startLegacyRetryTimer().
|
private |
Definition at line 46 of file TlsLegacySocketContext.h.
Referenced by onClientLine(), onDisconnected(), onServerLine(), and startLegacyRetryTimer().
|
private |
Definition at line 39 of file TlsLegacySocketContext.h.
Referenced by onConnected(), onReceivedFromPeer(), startLegacyRetryTimer(), and TlsLegacySocketContext().
|
private |
Definition at line 42 of file TlsLegacySocketContext.h.
Referenced by onClientLine(), and onServerLine().