Commit 08ccdd9
authored
Add timeout to remaining HTTP requests (#316)
Prevent get_headers() and file_get_contents() from hanging indefinitely.
Changes:
- Utility::urlExists() fallback: Add stream context with 5s timeout
- Utility::getHeaderFromUrl(): Add 5s timeout to stream context defaults
- Mime::getMimeTypeByUrl(): Add stream context with 5s timeout
- Message::_readFile(): Add 10s timeout (files may be larger)1 parent c297d8e commit 08ccdd9
3 files changed
Lines changed: 19 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
401 | | - | |
402 | | - | |
403 | | - | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
404 | 407 | | |
405 | 408 | | |
406 | 409 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
794 | 794 | | |
795 | 795 | | |
796 | 796 | | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
797 | 802 | | |
798 | | - | |
| 803 | + | |
799 | 804 | | |
800 | 805 | | |
801 | 806 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
310 | 315 | | |
311 | | - | |
| 316 | + | |
312 | 317 | | |
313 | 318 | | |
314 | 319 | | |
| |||
346 | 351 | | |
347 | 352 | | |
348 | 353 | | |
| 354 | + | |
349 | 355 | | |
350 | 356 | | |
351 | 357 | | |
| |||
0 commit comments