Commit d19257f
Add explicit closesocket(connfd) in ConnectTimeout before returning -ETIMEDOUT
When DNS resolution exhausts the timeout budget, explicitly close the
socket with closesocket() and return -ETIMEDOUT directly, instead of
relying on socket_errno_negative() which reads errno indirectly and
could return the wrong error code on Windows.
Co-authored-by: ithewei <26049660+ithewei@users.noreply.github.com>1 parent 899eb0d commit d19257f
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
349 | | - | |
350 | | - | |
| 349 | + | |
| 350 | + | |
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
| |||
0 commit comments