Commit d08a676
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` and `errno` each `addr_info`
loop iteration.
Closes #151connect error handling1 parent 0465dee commit d08a676
1 file changed
+7
-6
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 | | |
175 | 176 | | |
176 | 177 | | |
| |||
192 | 193 | | |
193 | 194 | | |
194 | 195 | | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
| 196 | + | |
199 | 197 | | |
200 | 198 | | |
201 | 199 | | |
| |||
209 | 207 | | |
210 | 208 | | |
211 | 209 | | |
212 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
213 | 214 | | |
214 | 215 | | |
215 | 216 | | |
| |||
0 commit comments