Commit 1e30935
committed
client: don't advertise keep-alive when sending error replies
Commit 15346de ("client: Always close connection with request body in case
of error") added logic to close keep alive connections on HTTP errors due
to unconsumed request body data.
However, since the check happens after emitting the standard HTTP headers,
uhttpd might incorrectly reply with a `Connection: keep-alive` even if it
is going to close the connection.
Move the check before the emitting of the response headers in order to
ensure that we're sending the correct `Connection: close` line.
Fixes: 15346de ("client: Always close connection with request body in case of error")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>1 parent d83a891 commit 1e30935
1 file changed
+11
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | 144 | | |
156 | 145 | | |
157 | 146 | | |
| |||
163 | 152 | | |
164 | 153 | | |
165 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| |||
0 commit comments