Allow sending content even when the connection is in done state. When we
run into an error we will be in CLIENT_STATE_DONE state and have to
write some content to the client. Allow writing in normal DATA and in
DONE state.
This fixes http error 403 in LuCI.
Fixes: b3e3c05d6781 ("client: don't send stray EOF chunk on connection timeout")
Signed-off-by: Hauke Mehrtens <[email protected]>
va_list arg2;
int len;
- if (cl->state != CLIENT_STATE_DATA)
+ if (cl->state != CLIENT_STATE_DATA &&
+ cl->state != CLIENT_STATE_DONE)
return;
uloop_timeout_set(&cl->timeout, conf.network_timeout * 1000);
if (!uh_use_chunked(cl))
return;
- if (cl->state != CLIENT_STATE_DATA)
+ if (cl->state != CLIENT_STATE_DATA &&
+ cl->state != CLIENT_STATE_DONE)
return;
ustream_printf(cl->us, "0\r\n\r\n");