Skip to content

SocketByteHandler is leaked when upgrading to SSL #1247

@bgrainger

Description

@bgrainger

When ServerSession connects to a server via TCP, a SocketByteHandler is created:

var byteHandler = m_socket is null ? new StreamByteHandler(m_stream!) : (IByteHandler) new SocketByteHandler(m_socket);

If the connection is upgraded to SSL, InitSslAsync replaces the ByteHandler with a StreamByteHandler:

var sslByteHandler = new StreamByteHandler(sslStream);
m_payloadHandler!.ByteHandler = sslByteHandler;

At this point, the original SocketByteHandler is leaked, along with the TCP socket, the SocketAwaitable, an OverlappedData, etc.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions