MCPcopy Create free account
hub / github.com/SmingHub/Sming / onConnect

Method onConnect

Sming/Components/ssl/src/Session.cpp:72–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72bool Session::onConnect(tcp_pcb* tcp)
73{
74 debug_d("SSL %p: Starting connection...", this);
75
76 assert(!connection);
77 assert(!context);
78
79 // Client Session
80 context.reset();
81 assert(factory != nullptr);
82 context.reset(factory->createContext(*this));
83 if(!context) {
84 return false;
85 }
86
87 cacheSize = 1;
88
89 if(!context->init()) {
90 return false;
91 }
92
93 if(sessionId && sessionId->isValid()) {
94 debug_d("-----BEGIN SSL SESSION PARAMETERS-----");
95 debug_d("SessionId: %s", toString(*sessionId).c_str());
96 debug_d("------END SSL SESSION PARAMETERS------");
97 }
98
99 beginHandshake();
100
101 connection.reset(context->createClient(tcp));
102 if(!connection) {
103 endHandshake();
104 return false;
105 }
106
107 return true;
108}
109
110void Session::beginHandshake()
111{

Callers 1

internalOnConnectedMethod · 0.45

Calls 7

toStringFunction · 0.70
resetMethod · 0.45
createContextMethod · 0.45
initMethod · 0.45
isValidMethod · 0.45
c_strMethod · 0.45
createClientMethod · 0.45

Tested by

no test coverage detected