Skip to content

Close TCPConnection on failure#2342

Open
gedaiu wants to merge 1 commit intovibe-d:masterfrom
gedaiu:patch-4
Open

Close TCPConnection on failure#2342
gedaiu wants to merge 1 commit intovibe-d:masterfrom
gedaiu:patch-4

Conversation

@gedaiu
Copy link
Contributor

@gedaiu gedaiu commented Aug 5, 2019

I'm not sure if this is the best fix, but it looks like the TCPConnection state is connected after it fails to connect here: m_conn = connectTCP(proxyAddr, m_settings.networkInterface);

@s-ludwig
Copy link
Member

There is a try-catch around the TLS stream construction, which seems to be the only place in the upper part of the function that can throw. It should be sufficient to put the additions into the closure at the bottom. scope (failure) is a bit problematic, though, because unfortunately it catches any Throwable as opposed to just Exception, so using an eplicit try-catch would be better here.

@gedaiu
Copy link
Contributor Author

gedaiu commented Aug 26, 2019

I found this issue on http connections, where there was no tls context. As I remember, the exception that I got was from vibe-core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants