lib: add eos flag to send methods

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:
Stefan Eissing 2024-07-18 11:29:37 +02:00 committed by Daniel Stenberg
parent 0472afe5f9
commit 911c3166b6
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
42 changed files with 205 additions and 168 deletions

View file

@ -207,7 +207,8 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf,
us_length = htons((unsigned short)sspi_send_token.cbBuffer);
memcpy(socksreq + 2, &us_length, sizeof(short));
written = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 4, &code);
written = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 4, FALSE,
&code);
if(code || (4 != written)) {
failf(data, "Failed to send SSPI authentication request.");
free(service_name);
@ -222,7 +223,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf,
written = Curl_conn_cf_send(cf->next, data,
(char *)sspi_send_token.pvBuffer,
sspi_send_token.cbBuffer, &code);
sspi_send_token.cbBuffer, FALSE, &code);
if(code || (sspi_send_token.cbBuffer != (size_t)written)) {
failf(data, "Failed to send SSPI authentication token.");
free(service_name);
@ -476,7 +477,8 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf,
memcpy(socksreq + 2, &us_length, sizeof(short));
}
written = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 4, &code);
written = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 4, FALSE,
&code);
if(code || (4 != written)) {
failf(data, "Failed to send SSPI encryption request.");
if(sspi_send_token.pvBuffer)
@ -487,7 +489,8 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf,
if(data->set.socks5_gssapi_nec) {
memcpy(socksreq, &gss_enc, 1);
written = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 1, &code);
written = Curl_conn_cf_send(cf->next, data, (char *)socksreq, 1, FALSE,
&code);
if(code || (1 != written)) {
failf(data, "Failed to send SSPI encryption type.");
s_pSecFn->DeleteSecurityContext(&sspi_context);
@ -497,7 +500,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf,
else {
written = Curl_conn_cf_send(cf->next, data,
(char *)sspi_send_token.pvBuffer,
sspi_send_token.cbBuffer, &code);
sspi_send_token.cbBuffer, FALSE, &code);
if(code || (sspi_send_token.cbBuffer != (size_t)written)) {
failf(data, "Failed to send SSPI encryption type.");
if(sspi_send_token.pvBuffer)