This repository was archived by the owner on Jan 13, 2021. It is now read-only.
Commit 1d1d981
Tim Emiola
Improve handling of socket errors
- Use the default connection timeout set by socket.setdefaulttimeout().
* I.e, don't specify one, until there is [an API][1] for timeouts, it's
probably better for libraries to be able to set the socket timeout
outside of hyper via [setdefaulttimeout][2]
- Updates error handling to simulate blocking behaviour when the socket
is in timeout mode (which is internally a kind of non-blocking
mode). Specifically, during reads, add
* handling of specific ssl.SSLErrors WANT_READ and WANT_WRITE
* handling of errno.EAGAIN and errno.EINTR
[1]: #187
[2]: https://docs.python.org/2/library/socket.html#socket.setdefaulttimeout1 parent 40a7569 commit 1d1d981
2 files changed
+22
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
237 | 238 | | |
238 | 239 | | |
239 | 240 | | |
240 | | - | |
| 241 | + | |
241 | 242 | | |
242 | 243 | | |
243 | 244 | | |
| |||
522 | 523 | | |
523 | 524 | | |
524 | 525 | | |
| 526 | + | |
525 | 527 | | |
526 | 528 | | |
527 | | - | |
| 529 | + | |
| 530 | + | |
528 | 531 | | |
529 | 532 | | |
530 | 533 | | |
531 | 534 | | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
532 | 551 | | |
533 | 552 | | |
534 | 553 | | |
| |||
0 commit comments