uloop_timeout_set(&uh->disconnect_t, 1);
}
+static bool uclient_http_bodyless_response(struct uclient_http *uh)
+{
+ return uh->req_type == REQ_HEAD ||
+ uh->uc.status_code == 204 ||
+ uh->uc.status_code == 304;
+}
+
static void uclient_notify_eof(struct uclient_http *uh)
{
struct ustream *us = uh->us;
return;
}
- if ((uh->content_length < 0 && uh->read_chunked >= 0) ||
- uh->content_length == 0)
+ if (uclient_http_bodyless_response(uh) ||
+ (uh->content_length < 0 && uh->read_chunked >= 0) ||
+ uh->content_length == 0)
uh->uc.data_eof = true;
uclient_backend_set_eof(&uh->uc);
if (uh->eof || seq != uh->seq)
return;
- if (uh->req_type == REQ_HEAD || uh->uc.status_code == 204 ||
- uh->content_length == 0) {
+ if (uclient_http_bodyless_response(uh) || uh->content_length == 0) {
uh->eof = true;
uclient_notify_eof(uh);
return;