Repository navigation
Commit 021acbe
committed
sapi/cli: Fix built-in server truncating responses after a partial write
php_cli_server_content_sender_send() moved on to the next queued chunk
after a short send() of the current one. When that send() succeeded, its
bytes went out ahead of the current chunk's remainder, and the full-send
branch pointed buffer.first past both, unlinking the partially sent chunk.
The client received later chunks spliced into the body, the connection was
closed short of Content-Length, and the unsent remainder leaked. Stop at
the first partial write and resume from that chunk on the next POLLOUT.
Closes GH-239691 parent 2116084 commit 021acbe
2 files changed
Lines changed: 10 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1067 | 1067 | | |
1068 | 1068 | | |
1069 | 1069 | | |
1070 | | - | |
| 1070 | + | |
| 1071 | + | |
1071 | 1072 | | |
1072 | 1073 | | |
1073 | 1074 | | |
| |||
1085 | 1086 | | |
1086 | 1087 | | |
1087 | 1088 | | |
1088 | | - | |
1089 | 1089 | | |
1090 | 1090 | | |
1091 | 1091 | | |
| |||
1101 | 1101 | | |
1102 | 1102 | | |
1103 | 1103 | | |
| 1104 | + | |
| 1105 | + | |
1104 | 1106 | | |
1105 | | - | |
| 1107 | + | |
1106 | 1108 | | |
1107 | 1109 | | |
1108 | 1110 | | |
| |||
1112 | 1114 | | |
1113 | 1115 | | |
1114 | 1116 | | |
1115 | | - | |
1116 | 1117 | | |
1117 | 1118 | | |
1118 | 1119 | | |
| |||
1128 | 1129 | | |
1129 | 1130 | | |
1130 | 1131 | | |
| 1132 | + | |
| 1133 | + | |
1131 | 1134 | | |
1132 | | - | |
| 1135 | + | |
1133 | 1136 | | |
1134 | 1137 | | |
1135 | 1138 | | |
1136 | | - | |
1137 | 1139 | | |
1138 | 1140 | | |
1139 | 1141 | | |
| |||
0 commit comments