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

Method createClient

Sming/Components/ssl/Axtls/AxContext.cpp:81–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81Connection* AxContext::createClient(tcp_pcb* tcp)
82{
83 assert(context != nullptr);
84
85 auto ssl_ext = ssl_ext_new();
86 ssl_ext_set_host_name(ssl_ext, session.hostName.c_str());
87 ssl_ext_set_max_fragment_size(ssl_ext, unsigned(session.maxBufferSize));
88
89 auto id = session.getSessionId();
90 auto connection = new AxConnection(*this, tcp);
91 auto client =
92 ssl_client_new(context, intptr_t(connection), id ? id->getValue() : nullptr, id ? id->getLength() : 0, ssl_ext);
93 if(client == nullptr) {
94 ssl_ext_free(ssl_ext);
95 delete connection;
96 return nullptr;
97 }
98
99 connection->init(client);
100 return connection;
101}
102
103Connection* AxContext::createServer(tcp_pcb* tcp)
104{

Callers 1

onConnectMethod · 0.45

Calls 5

c_strMethod · 0.45
getSessionIdMethod · 0.45
getValueMethod · 0.45
getLengthMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected