projects
/
project
/
uclient.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
http: allow the header_done callback to reset the client state
[project/uclient.git]
/
uclient-http.c
diff --git
a/uclient-http.c
b/uclient-http.c
index
676ce1b
..
e456564
100644
(file)
--- a/
uclient-http.c
+++ b/
uclient-http.c
@@
-211,6
+211,7
@@
static void uclient_http_reset_state(struct uclient_http *uh)
static void uclient_http_init_request(struct uclient_http *uh)
{
static void uclient_http_init_request(struct uclient_http *uh)
{
+ uh->seq++;
uclient_http_reset_state(uh);
blob_buf_init(&uh->meta, 0);
}
uclient_http_reset_state(uh);
blob_buf_init(&uh->meta, 0);
}
@@
-561,6
+562,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;
static void uclient_http_headers_complete(struct uclient_http *uh)
{
enum auth_type auth_type = uh->auth_type;
+ int seq = uh->uc.seq;
uh->state = HTTP_STATE_RECV_DATA;
uh->uc.meta = uh->meta.head;
uh->state = HTTP_STATE_RECV_DATA;
uh->uc.meta = uh->meta.head;
@@
-577,7
+579,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->uc.cb->header_done)
uh->uc.cb->header_done(&uh->uc);
- if (uh->eof)
+ if (uh->eof
|| seq != uh->uc.seq
)
return;
if (uh->req_type == REQ_HEAD || uh->uc.status_code == 204) {
return;
if (uh->req_type == REQ_HEAD || uh->uc.status_code == 204) {