Commit 10815c4
http: provide keep-alive timeout response header
In http 1.1 persistent connection protocol there is a
timing race where the client sends the request and then
the server kills the connection (due to inactivity)
before receiving the client's request.
By providing a keep-alive header it is possible to provide
the client a hint of when idle timeout would occur and
avoid the race.
Fixes: #34560
PR-URL: #34561
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Pranshu Srivastava <rexagod@gmail.com>1 parent c0a961e commit 10815c4Copy full SHA for 10815c4
File tree
Expand file treeCollapse file tree
3 files changed
+36
-0
lines changedOpen diff view settings
Filter options
- lib
- test/parallel
Expand file treeCollapse file tree
3 files changed
+36
-0
lines changedOpen diff view settings
Collapse file
+7Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
28 | 28 | |
29 | 29 | |
30 | 30 | |
| 31 | + |
31 | 32 | |
32 | 33 | |
33 | 34 | |
| ||
117 | 118 | |
118 | 119 | |
119 | 120 | |
| 121 | + |
| 122 | + |
120 | 123 | |
121 | 124 | |
122 | 125 | |
| ||
402 | 405 | |
403 | 406 | |
404 | 407 | |
| 408 | + |
| 409 | + |
| 410 | + |
| 411 | + |
405 | 412 | |
406 | 413 | |
407 | 414 | |
|
Collapse file
+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
740 | 740 | |
741 | 741 | |
742 | 742 | |
| 743 | + |
743 | 744 | |
744 | 745 | |
745 | 746 | |
|
Collapse file
test/parallel/test-http-keep-alive-timeout.js
Copy file name to clipboard+28Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
0 commit comments