Signed-off-by: Felix Fietkau <nbd@openwrt.org>
static void eof_cb(struct uclient *cl)
{
+ if (!cl->data_eof) {
+ if (!quiet)
+ fprintf(stderr, "Connection reset prematurely\n");
+ error_ret = 4;
+ }
request_done(cl);
}
read_len += sep + 2 - data;
data = sep + 2;
- if (!uh->read_chunked)
+ if (!uh->read_chunked) {
uh->eof = true;
+ uh->uc.data_eof = true;
+ }
}
if (len > data_end - data)
len = uh->content_length;
uh->content_length -= len;
- if (!uh->content_length)
+ if (!uh->content_length) {
uh->eof = true;
+ uh->uc.data_eof = true;
+ }
}
if (len > 0) {
void __hidden uclient_backend_reset_state(struct uclient *cl)
{
+ cl->data_eof = false;
cl->eof = false;
cl->error_code = 0;
uloop_timeout_cancel(&cl->timeout);
void *priv;
bool eof;
+ bool data_eof;
int error_code;
int status_code;
struct blob_attr *meta;