Commit f9ab934
[ruby/net-http] Use nonblocking IO to detect eof
The call to `@socket.eof?` can block when attempting to reuse a
persistent connection and there are SSL Handshake messages ready to be
read, but no Application Data, such as when the server sends an updated
NewSessionTicket in TLS 1.3.
Instead call `OpenSSL::SSL::SSLSocket#read_nonblocking`, which will read
and process the SSL Handshake message, but return `nil` on EOF or an empty
string if no data is available. It may also return `:wait_readable` or
`:wait_writable` which indicates the socket is reusable.1 parent cf29594 commit f9ab934
1 file changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2467 | 2467 | | |
2468 | 2468 | | |
2469 | 2469 | | |
2470 | | - | |
| 2470 | + | |
2471 | 2471 | | |
2472 | 2472 | | |
2473 | 2473 | | |
| |||
2482 | 2482 | | |
2483 | 2483 | | |
2484 | 2484 | | |
| 2485 | + | |
| 2486 | + | |
| 2487 | + | |
| 2488 | + | |
| 2489 | + | |
| 2490 | + | |
| 2491 | + | |
| 2492 | + | |
2485 | 2493 | | |
2486 | 2494 | | |
2487 | 2495 | | |
| |||
0 commit comments