mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-28 11:40:11 +03:00
Some HTTP client fixes.
This commit is contained in:
parent
3400b6bacb
commit
dd4a42b345
@ -71,7 +71,8 @@
|
||||
u2_bean liv; // keepalive
|
||||
u2_bean end; // all responses added
|
||||
u2_hhed* hed_u; // headers
|
||||
u2_hbod* bod_u; // body parts
|
||||
u2_hbod* bod_u; // body parts (exit)
|
||||
u2_hbod* dob_u; // body parts (entry)
|
||||
struct _u2_hreq* nex_u; // next in request queue
|
||||
u2_hbod* rub_u; // exit of write queue
|
||||
u2_hbod* bur_u; // entry of write queue
|
||||
@ -118,7 +119,8 @@
|
||||
void* par_u; // struct http_parser *
|
||||
c3_w sas_w; // status code
|
||||
u2_hhed* hed_u; // headers
|
||||
u2_hbod* bod_u; // body parts
|
||||
u2_hbod* bod_u; // exit of body queue
|
||||
u2_hbod* dob_u; // entry of body queue
|
||||
} u2_cres;
|
||||
|
||||
/* u2_creq: outgoing http request.
|
||||
|
20
v/cttp.c
20
v/cttp.c
@ -585,18 +585,20 @@ _cttp_headers_complete(http_parser* par_u)
|
||||
static c3_i
|
||||
_cttp_body(http_parser* par_u, const c3_c* buf_c, size_t siz_i)
|
||||
{
|
||||
{
|
||||
u2_creq* ceq_u = par_u->data;
|
||||
u2_cres* res_u = ceq_u->res_u;
|
||||
u2_hbod* bod_u;
|
||||
u2_creq* ceq_u = par_u->data;
|
||||
u2_cres* res_u = ceq_u->res_u;
|
||||
u2_hbod* bod_u;
|
||||
|
||||
bod_u = _cttp_bod(siz_i, (const c3_y*)buf_c);
|
||||
bod_u = _cttp_bod(siz_i, (const c3_y*)buf_c);
|
||||
|
||||
bod_u->nex_u = res_u->bod_u;
|
||||
res_u->bod_u = bod_u;
|
||||
|
||||
return 0;
|
||||
if ( !(res_u->bod_u) ) {
|
||||
res_u->bod_u = res_u->dob_u = bod_u;
|
||||
}
|
||||
else {
|
||||
res_u->dob_u->nex_u = bod_u;
|
||||
res_u->dob_u = bod_u;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* _cttp_message_complete(): jhttp callback
|
||||
|
19
v/http.c
19
v/http.c
@ -434,17 +434,20 @@ _http_headers_complete(http_parser* par_u)
|
||||
static c3_i
|
||||
_http_body(http_parser* par_u, const c3_c* buf_c, size_t siz_i)
|
||||
{
|
||||
{
|
||||
u2_hreq *req_u = par_u->data;
|
||||
u2_hbod* bod_u;
|
||||
u2_hreq *req_u = par_u->data;
|
||||
u2_hbod* bod_u;
|
||||
|
||||
bod_u = _http_bod(siz_i, (const c3_y*)buf_c);
|
||||
bod_u = _http_bod(siz_i, (const c3_y*)buf_c);
|
||||
|
||||
bod_u->nex_u = req_u->bod_u;
|
||||
req_u->bod_u = bod_u;
|
||||
|
||||
return 0;
|
||||
if ( !(req_u->bod_u) ) {
|
||||
req_u->bod_u = req_u->dob_u = bod_u;
|
||||
}
|
||||
else {
|
||||
req_u->dob_u->nex_u = bod_u;
|
||||
req_u->dob_u = bod_u;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* _http_message_complete(): jhttp callback
|
||||
|
Loading…
Reference in New Issue
Block a user