mirror of
https://github.com/curl/curl.git
synced 2026-08-24 18:33:34 +03:00
mime: fix unpausing of readers
When unpausing a transfer, check if the reader pause state differs in addition to the "keepon" flags. Reported-by: 包布丁 Fixes #18848 Closes #19178
This commit is contained in:
parent
76d2852550
commit
40f7cd2bdd
6 changed files with 68 additions and 14 deletions
|
|
@ -188,6 +188,7 @@ static int curltest_echo_handler(request_rec *r)
|
|||
char buffer[8192];
|
||||
const char *ct;
|
||||
apr_off_t die_after_len = -1, total_read_len = 0;
|
||||
apr_time_t read_delay = 0;
|
||||
int just_die = 0, die_after_100 = 0;
|
||||
long l;
|
||||
|
||||
|
|
@ -221,6 +222,12 @@ static int curltest_echo_handler(request_rec *r)
|
|||
die_after_100 = 1;
|
||||
continue;
|
||||
}
|
||||
else if(!strcmp("read_delay", arg)) {
|
||||
rv = duration_parse(&read_delay, val, "s");
|
||||
if(APR_SUCCESS == rv) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -258,6 +265,12 @@ static int curltest_echo_handler(request_rec *r)
|
|||
apr_table_setn(r->headers_out, "Request-TE",
|
||||
apr_table_get(r->headers_in, "TE"));
|
||||
|
||||
if(read_delay) {
|
||||
ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r,
|
||||
"put_handler: read_delay");
|
||||
apr_sleep(read_delay);
|
||||
}
|
||||
|
||||
bb = apr_brigade_create(r->pool, c->bucket_alloc);
|
||||
/* copy any request body into the response */
|
||||
rv = ap_setup_client_block(r, REQUEST_CHUNKED_DECHUNK);
|
||||
|
|
@ -637,6 +650,8 @@ static int curltest_put_handler(request_rec *r)
|
|||
ap_set_content_type(r, ct ? ct : "text/plain");
|
||||
|
||||
if(read_delay) {
|
||||
ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r,
|
||||
"put_handler: read_delay");
|
||||
apr_sleep(read_delay);
|
||||
}
|
||||
bb = apr_brigade_create(r->pool, c->bucket_alloc);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue