Open seawolf0820 opened 6 years ago
I think I found something about this issue: in http/src/server.cpp:122:
for (auto it = _connections.begin(); it != _connections.end(); ++it) {
if (it->get() == &conn) {
_connections.erase(it);
return;
}
after _connections.erase(it);
, SSLSocket::~SSLSocket
will be called. but we are still in a scy::net::SSLSocket::onRead
call. After adding deleteLater(*it) before this line, the segfault is gone. but I get this warning from curl:
curl: (56) GnuTLS recv error (-110): The TLS connection was non-properly terminated.
Hi! I'm trying to setup a https server with libsourcey, but I got a segfault with the sample code:
`net::SSLManager::initNoVerifyServer();
http::Server srv(address, std::make_shared(
net::SSLManager::instance().defaultServerContext()));
srv.start();
srv.Connection += [](http::ServerConnection::Ptr conn) { conn->send("hello universe", 14); conn->close(); };
std::cout << "HTTPS server listening on " << address << std::endl; waitForShutdown();(
net::SSLManager::instance().defaultServerContext()));
srv.start();
finnaly I found the problem seems to be caused by conn->close(); This code works well:
http::Server srv(address, std::make_shared