summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau2026-01-31 13:45:03 +0000
committerFelix Fietkau2026-01-31 13:46:15 +0000
commit9c2ad269c42bca917fc563c97c732d8c47fd1bfc (patch)
treede27b540a5c50e61ae91b1d0a313207126720cea
parentb3ee1209a3d09ef56073bf5c1f999d7281fa27fb (diff)
downloaduclient-9c2ad269c42bca917fc563c97c732d8c47fd1bfc.tar.gz
uclient-http: fix seq field check to use correct field
The code was checking uh->uc.seq for changes to detect redirects, but only uh->seq is actually incremented (in uclient_http_init_request and uclient_http_reset_state). This meant the redirect detection check was always comparing against an unchanging value. Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--uclient-http.c4
-rw-r--r--uclient.h1
2 files changed, 2 insertions, 3 deletions
diff --git a/uclient-http.c b/uclient-http.c
index 5de7924..5327614 100644
--- a/uclient-http.c
+++ b/uclient-http.c
@@ -640,7 +640,7 @@ uclient_http_send_headers(struct uclient_http *uh)
static void uclient_http_headers_complete(struct uclient_http *uh)
{
enum auth_type auth_type = uh->auth_type;
- int seq = uh->uc.seq;
+ unsigned int seq = uh->seq;
uh->state = HTTP_STATE_RECV_DATA;
uh->uc.meta = uh->meta.head;
@@ -657,7 +657,7 @@ static void uclient_http_headers_complete(struct uclient_http *uh)
if (uh->uc.cb->header_done)
uh->uc.cb->header_done(&uh->uc);
- if (uh->eof || seq != uh->uc.seq)
+ if (uh->eof || seq != uh->seq)
return;
if (uh->req_type == REQ_HEAD || uh->uc.status_code == 204 ||
diff --git a/uclient.h b/uclient.h
index 772a5bd..51cda53 100644
--- a/uclient.h
+++ b/uclient.h
@@ -77,7 +77,6 @@ struct uclient {
bool data_eof;
int error_code;
int status_code;
- int seq;
struct blob_attr *meta;
struct uloop_timeout connection_timeout;