Commit 2e1dc2d
authored
net.websocket: close the socket when the TLS connect in dial_socket fails (#28263)
`Client.dial_socket` dials the TcpConn and then runs `ws.ssl_conn.connect(mut t, …)!`, so a
failed TLS handshake propagates with the socket never closed — and since `ws.conn` is only
assigned after dial_socket returns, nothing downstream can close it either. Against a small
embedded TLS server every failed connect kept a half-open session on the peer until its own
timeout, and a few in a row exhausted its pool. Close it there, and the peer's half with it.1 parent 6a0fbf3 commit 2e1dc2d
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
88 | 93 | | |
89 | 94 | | |
90 | 95 | | |
0 commit comments