mirror of
https://github.com/curl/curl.git
synced 2026-08-24 14:03:35 +03:00
lib: send eos flag
Adds a `bool eos` flag to send methods to indicate that the data is the last chunk the invovled transfer wants to send to the server. This will help protocol filters like HTTP/2 and 3 to forward the stream's EOF flag and also allow to EAGAIN such calls when buffers are not yet fully flushed. Closes #14220
This commit is contained in:
parent
c98f6fcde7
commit
be93299f10
41 changed files with 200 additions and 166 deletions
|
|
@ -382,8 +382,8 @@ static ssize_t nw_out_writer(void *writer_ctx,
|
|||
struct Curl_easy *data = CF_DATA_CURRENT(cf);
|
||||
|
||||
if(data) {
|
||||
ssize_t nwritten = Curl_conn_cf_send(cf->next, data,
|
||||
(const char *)buf, buflen, err);
|
||||
ssize_t nwritten = Curl_conn_cf_send(cf->next, data, (const char *)buf,
|
||||
buflen, FALSE, err);
|
||||
if(nwritten > 0)
|
||||
CURL_TRC_CF(data, cf, "[0] egress: wrote %zd bytes", nwritten);
|
||||
return nwritten;
|
||||
|
|
@ -2173,7 +2173,8 @@ out:
|
|||
}
|
||||
|
||||
static ssize_t cf_h2_send(struct Curl_cfilter *cf, struct Curl_easy *data,
|
||||
const void *buf, size_t len, CURLcode *err)
|
||||
const void *buf, size_t len, bool eos,
|
||||
CURLcode *err)
|
||||
{
|
||||
struct cf_h2_ctx *ctx = cf->ctx;
|
||||
struct h2_stream_ctx *stream = H2_STREAM_CTX(ctx, data);
|
||||
|
|
@ -2186,6 +2187,7 @@ static ssize_t cf_h2_send(struct Curl_cfilter *cf, struct Curl_easy *data,
|
|||
|
||||
CF_DATA_SAVE(save, cf, data);
|
||||
|
||||
(void)eos; /* TODO: use for stream EOF */
|
||||
if(stream && stream->id != -1) {
|
||||
if(stream->upload_blocked_len) {
|
||||
/* the data in `buf` has already been submitted or added to the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue