Commit efe4da2
committed
client: fix
Currently, if we timeout waiting for `connect` using `poll`, we set
`connect_errno` to `ETIMEOUT`. However, after we exit the `connect`
interruption loop, we unconditionally set to `errno`, which we do not even
clear after checking the `connect` result. As a result, the timeout error
gets masked by the in-progress connection error.
To fix this, let's:
1. Clear `errno` after checking the `connect` result;
2. Check the value of `connect_errno` after exiting the `connect` interrupt
loop before setting it to `errno`;
3. Zero out `socket_errno`, `connect_errno` each `addr_info` loop
iteration.
Closes #151connect error handling1 parent a0e6e03 commit efe4da2
1 file changed
+6
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| 172 | + | |
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
| |||
190 | 191 | | |
191 | 192 | | |
192 | 193 | | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
| 194 | + | |
197 | 195 | | |
198 | 196 | | |
199 | 197 | | |
| |||
207 | 205 | | |
208 | 206 | | |
209 | 207 | | |
210 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
211 | 212 | | |
212 | 213 | | |
213 | 214 | | |
| |||
0 commit comments