From f53a55e58dd7733f1176a0ac268b2df576778970 Mon Sep 17 00:00:00 2001 From: dartraiden Date: Wed, 26 Jul 2023 15:20:15 +0300 Subject: libcurl: update to 8.2.1 --- libs/libcurl/src/CMakeLists.txt | 9 +++++++++ libs/libcurl/src/amigaos.c | 1 + libs/libcurl/src/cf-h1-proxy.c | 4 ++-- libs/libcurl/src/cf-haproxy.c | 4 ++-- libs/libcurl/src/cf-https-connect.c | 2 +- libs/libcurl/src/cfilters.c | 10 +++++----- libs/libcurl/src/cfilters.h | 4 ++-- libs/libcurl/src/config-win32.h | 7 ------- libs/libcurl/src/connect.c | 4 ++-- libs/libcurl/src/curl_setup.h | 11 +++++++++++ libs/libcurl/src/dynbuf.h | 2 -- libs/libcurl/src/hostip.c | 9 +++++++-- libs/libcurl/src/http.c | 17 ++++++++++------- libs/libcurl/src/http2.c | 14 ++++++++++---- libs/libcurl/src/http_proxy.c | 4 ++-- libs/libcurl/src/libcurl.plist | 6 +++--- libs/libcurl/src/socks.c | 15 +++++++-------- libs/libcurl/src/transfer.c | 4 ---- libs/libcurl/src/vquic/curl_ngtcp2.c | 2 ++ libs/libcurl/src/vquic/curl_quiche.c | 26 ++++++++++++-------------- libs/libcurl/src/vtls/vtls.c | 4 ++-- libs/libcurl/src/ws.c | 26 +++++++++++++------------- 22 files changed, 103 insertions(+), 82 deletions(-) (limited to 'libs/libcurl/src') diff --git a/libs/libcurl/src/CMakeLists.txt b/libs/libcurl/src/CMakeLists.txt index 6d404d588b..f55c3449a2 100644 --- a/libs/libcurl/src/CMakeLists.txt +++ b/libs/libcurl/src/CMakeLists.txt @@ -64,6 +64,14 @@ add_library( ${HHEADERS} ${CSOURCES} ) +add_library( + curlu # special libcurlu library just for unittests + STATIC + EXCLUDE_FROM_ALL + ${HHEADERS} ${CSOURCES} +) +target_compile_definitions(curlu PUBLIC UNITTESTS CURL_STATICLIB) + add_library( ${PROJECT_NAME}::${LIB_NAME} ALIAS ${LIB_NAME} @@ -80,6 +88,7 @@ if(NOT BUILD_SHARED_LIBS) endif() target_link_libraries(${LIB_NAME} PRIVATE ${CURL_LIBS}) +target_link_libraries(curlu PRIVATE ${CURL_LIBS}) transform_makefile_inc("Makefile.soname" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.soname.cmake") include(${CMAKE_CURRENT_BINARY_DIR}/Makefile.soname.cmake) diff --git a/libs/libcurl/src/amigaos.c b/libs/libcurl/src/amigaos.c index 26c3535b6f..1448def49a 100644 --- a/libs/libcurl/src/amigaos.c +++ b/libs/libcurl/src/amigaos.c @@ -178,6 +178,7 @@ struct Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname, #endif /* CURLRES_AMIGA */ #ifdef USE_AMISSL +#include int Curl_amiga_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *timeout) { diff --git a/libs/libcurl/src/cf-h1-proxy.c b/libs/libcurl/src/cf-h1-proxy.c index 57277598b0..0c3aa3c020 100644 --- a/libs/libcurl/src/cf-h1-proxy.c +++ b/libs/libcurl/src/cf-h1-proxy.c @@ -1074,7 +1074,7 @@ static CURLcode cf_h1_proxy_connect(struct Curl_cfilter *cf, } DEBUGF(LOG_CF(data, cf, "connect")); - result = cf->next->cft->connect(cf->next, data, blocking, done); + result = cf->next->cft->do_connect(cf->next, data, blocking, done); if(result || !*done) return result; @@ -1146,7 +1146,7 @@ static void cf_h1_proxy_close(struct Curl_cfilter *cf, h1_tunnel_go_state(cf, cf->ctx, H1_TUNNEL_INIT, data); } if(cf->next) - cf->next->cft->close(cf->next, data); + cf->next->cft->do_close(cf->next, data); } diff --git a/libs/libcurl/src/cf-haproxy.c b/libs/libcurl/src/cf-haproxy.c index 0848943135..c970552a15 100644 --- a/libs/libcurl/src/cf-haproxy.c +++ b/libs/libcurl/src/cf-haproxy.c @@ -115,7 +115,7 @@ static CURLcode cf_haproxy_connect(struct Curl_cfilter *cf, return CURLE_OK; } - result = cf->next->cft->connect(cf->next, data, blocking, done); + result = cf->next->cft->do_connect(cf->next, data, blocking, done); if(result || !*done) return result; @@ -168,7 +168,7 @@ static void cf_haproxy_close(struct Curl_cfilter *cf, cf->connected = FALSE; cf_haproxy_ctx_reset(cf->ctx); if(cf->next) - cf->next->cft->close(cf->next, data); + cf->next->cft->do_close(cf->next, data); } static int cf_haproxy_get_select_socks(struct Curl_cfilter *cf, diff --git a/libs/libcurl/src/cf-https-connect.c b/libs/libcurl/src/cf-https-connect.c index 387da5ab5c..76251d94c8 100644 --- a/libs/libcurl/src/cf-https-connect.c +++ b/libs/libcurl/src/cf-https-connect.c @@ -432,7 +432,7 @@ static void cf_hc_close(struct Curl_cfilter *cf, struct Curl_easy *data) cf->connected = FALSE; if(cf->next) { - cf->next->cft->close(cf->next, data); + cf->next->cft->do_close(cf->next, data); Curl_conn_cf_discard_chain(&cf->next, data); } } diff --git a/libs/libcurl/src/cfilters.c b/libs/libcurl/src/cfilters.c index a83a5cc590..e12aa2019a 100644 --- a/libs/libcurl/src/cfilters.c +++ b/libs/libcurl/src/cfilters.c @@ -50,7 +50,7 @@ void Curl_cf_def_close(struct Curl_cfilter *cf, struct Curl_easy *data) { cf->connected = FALSE; if(cf->next) - cf->next->cft->close(cf->next, data); + cf->next->cft->do_close(cf->next, data); } #endif @@ -161,7 +161,7 @@ void Curl_conn_close(struct Curl_easy *data, int index) /* it is valid to call that without filters being present */ cf = data->conn->cfilter[index]; if(cf) { - cf->cft->close(cf, data); + cf->cft->do_close(cf, data); } } @@ -293,14 +293,14 @@ CURLcode Curl_conn_cf_connect(struct Curl_cfilter *cf, bool blocking, bool *done) { if(cf) - return cf->cft->connect(cf, data, blocking, done); + return cf->cft->do_connect(cf, data, blocking, done); return CURLE_FAILED_INIT; } void Curl_conn_cf_close(struct Curl_cfilter *cf, struct Curl_easy *data) { if(cf) - cf->cft->close(cf, data); + cf->cft->do_close(cf, data); } int Curl_conn_cf_get_select_socks(struct Curl_cfilter *cf, @@ -348,7 +348,7 @@ CURLcode Curl_conn_connect(struct Curl_easy *data, *done = cf->connected; if(!*done) { - result = cf->cft->connect(cf, data, blocking, done); + result = cf->cft->do_connect(cf, data, blocking, done); if(!result && *done) { Curl_conn_ev_update_info(data, data->conn); conn_report_connect_stats(data, data->conn); diff --git a/libs/libcurl/src/cfilters.h b/libs/libcurl/src/cfilters.h index 384cdd3c9b..829340a2af 100644 --- a/libs/libcurl/src/cfilters.h +++ b/libs/libcurl/src/cfilters.h @@ -168,8 +168,8 @@ struct Curl_cftype { int flags; /* flags of filter type */ int log_level; /* log level for such filters */ Curl_cft_destroy_this *destroy; /* destroy resources of this cf */ - Curl_cft_connect *connect; /* establish connection */ - Curl_cft_close *close; /* close conn */ + Curl_cft_connect *do_connect; /* establish connection */ + Curl_cft_close *do_close; /* close conn */ Curl_cft_get_host *get_host; /* host filter talks to */ Curl_cft_get_select_socks *get_select_socks;/* sockets to select on */ Curl_cft_data_pending *has_data_pending;/* conn has data pending */ diff --git a/libs/libcurl/src/config-win32.h b/libs/libcurl/src/config-win32.h index 5536ebfa7a..e12ab552fd 100644 --- a/libs/libcurl/src/config-win32.h +++ b/libs/libcurl/src/config-win32.h @@ -205,10 +205,6 @@ /* Define if you have the socket function. */ #define HAVE_SOCKET 1 -/* Define if libSSH2 is in use */ -#define USE_LIBSSH2 1 -#define HAVE_LIBSSH2_H 1 - /* Define if you have the strcasecmp function. */ #ifdef __MINGW32__ #define HAVE_STRCASECMP 1 @@ -627,9 +623,6 @@ Vista # define CURL_DISABLE_LDAP 1 #endif -/* if SSL is enabled */ -#define USE_OPENSSL 1 - /* Define to use the Windows crypto library. */ #if !defined(CURL_WINDOWS_APP) #define USE_WIN32_CRYPTO diff --git a/libs/libcurl/src/connect.c b/libs/libcurl/src/connect.c index 9a8e1e3bbb..52739b9783 100644 --- a/libs/libcurl/src/connect.c +++ b/libs/libcurl/src/connect.c @@ -937,7 +937,7 @@ static void cf_he_close(struct Curl_cfilter *cf, ctx->state = SCFST_INIT; if(cf->next) { - cf->next->cft->close(cf->next, data); + cf->next->cft->do_close(cf->next, data); Curl_conn_cf_discard_chain(&cf->next, data); } } @@ -1291,7 +1291,7 @@ static void cf_setup_close(struct Curl_cfilter *cf, ctx->state = CF_SETUP_INIT; if(cf->next) { - cf->next->cft->close(cf->next, data); + cf->next->cft->do_close(cf->next, data); Curl_conn_cf_discard_chain(&cf->next, data); } } diff --git a/libs/libcurl/src/curl_setup.h b/libs/libcurl/src/curl_setup.h index a5df371c4c..de5d6a6182 100644 --- a/libs/libcurl/src/curl_setup.h +++ b/libs/libcurl/src/curl_setup.h @@ -61,6 +61,16 @@ # ifndef NOGDI # define NOGDI # endif +/* Detect Windows App environment which has a restricted access + * to the Win32 APIs. */ +# if (defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0602)) || \ + defined(WINAPI_FAMILY) +# include +# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && \ + !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +# define CURL_WINDOWS_APP +# endif +# endif #endif /* @@ -288,6 +298,7 @@ # if defined(HAVE_PROTO_BSDSOCKET_H) && \ (!defined(__amigaos4__) || defined(USE_AMISSL)) /* use bsdsocket.library directly, instead of libc networking functions */ +# define _SYS_MBUF_H /* m_len define clashes with curl */ # include # ifdef __amigaos4__ int Curl_amiga_select(int nfds, fd_set *readfds, fd_set *writefds, diff --git a/libs/libcurl/src/dynbuf.h b/libs/libcurl/src/dynbuf.h index b95412567f..8f85254cc0 100644 --- a/libs/libcurl/src/dynbuf.h +++ b/libs/libcurl/src/dynbuf.h @@ -81,8 +81,6 @@ int Curl_dyn_vprintf(struct dynbuf *dyn, const char *format, va_list ap_save); #define DYN_PAUSE_BUFFER (64 * 1024 * 1024) #define DYN_HAXPROXY 2048 #define DYN_HTTP_REQUEST (1024*1024) -#define DYN_H2_HEADERS (128*1024) -#define DYN_H2_TRAILERS (128*1024) #define DYN_APRINTF 8000000 #define DYN_RTSP_REQ_HEADER (64*1024) #define DYN_TRAILERS (64*1024) diff --git a/libs/libcurl/src/hostip.c b/libs/libcurl/src/hostip.c index 04ac91437c..3b1b3f8877 100644 --- a/libs/libcurl/src/hostip.c +++ b/libs/libcurl/src/hostip.c @@ -557,6 +557,7 @@ static struct Curl_addrinfo *get_localhost6(int port, const char *name) static struct Curl_addrinfo *get_localhost(int port, const char *name) { struct Curl_addrinfo *ca; + struct Curl_addrinfo *ca6; const size_t ss_size = sizeof(struct sockaddr_in); const size_t hostlen = strlen(name); struct sockaddr_in sa; @@ -583,8 +584,12 @@ static struct Curl_addrinfo *get_localhost(int port, const char *name) memcpy(ca->ai_addr, &sa, ss_size); ca->ai_canonname = (char *)ca->ai_addr + ss_size; strcpy(ca->ai_canonname, name); - ca->ai_next = get_localhost6(port, name); - return ca; + + ca6 = get_localhost6(port, name); + if(!ca6) + return ca; + ca6->ai_next = ca; + return ca6; } #ifdef ENABLE_IPV6 diff --git a/libs/libcurl/src/http.c b/libs/libcurl/src/http.c index fcbbeddaaa..c0261b7cc5 100644 --- a/libs/libcurl/src/http.c +++ b/libs/libcurl/src/http.c @@ -1308,7 +1308,7 @@ CURLcode Curl_buffer_send(struct dynbuf *in, || IS_HTTPS_PROXY(conn->http_proxy.proxytype) #endif ) - && conn->httpversion != 20) { + && conn->httpversion < 20) { /* Make sure this doesn't send more body bytes than what the max send speed says. The request bytes do not count to the max speed. */ @@ -3380,6 +3380,9 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) } } + if(data->req.upload_done) + Curl_conn_ev_data_done_send(data); + if((conn->httpversion >= 20) && data->req.upload_chunky) /* upload_chunky was set above to set up the request in a chunky fashion, but is disabled here again to avoid that the chunked encoded version is @@ -4568,8 +4571,8 @@ CURLcode Curl_http_req_make(struct httpreq **preq, if(!req->path) goto out; } - Curl_dynhds_init(&req->headers, 0, DYN_H2_HEADERS); - Curl_dynhds_init(&req->trailers, 0, DYN_H2_TRAILERS); + Curl_dynhds_init(&req->headers, 0, DYN_HTTP_REQUEST); + Curl_dynhds_init(&req->trailers, 0, DYN_HTTP_REQUEST); result = CURLE_OK; out: @@ -4726,8 +4729,8 @@ CURLcode Curl_http_req_make2(struct httpreq **preq, if(result) goto out; - Curl_dynhds_init(&req->headers, 0, DYN_H2_HEADERS); - Curl_dynhds_init(&req->trailers, 0, DYN_H2_TRAILERS); + Curl_dynhds_init(&req->headers, 0, DYN_HTTP_REQUEST); + Curl_dynhds_init(&req->trailers, 0, DYN_HTTP_REQUEST); result = CURLE_OK; out: @@ -4857,8 +4860,8 @@ CURLcode Curl_http_resp_make(struct http_resp **presp, if(!resp->description) goto out; } - Curl_dynhds_init(&resp->headers, 0, DYN_H2_HEADERS); - Curl_dynhds_init(&resp->trailers, 0, DYN_H2_TRAILERS); + Curl_dynhds_init(&resp->headers, 0, DYN_HTTP_REQUEST); + Curl_dynhds_init(&resp->trailers, 0, DYN_HTTP_REQUEST); result = CURLE_OK; out: diff --git a/libs/libcurl/src/http2.c b/libs/libcurl/src/http2.c index 00a5b107c0..c5528019b8 100644 --- a/libs/libcurl/src/http2.c +++ b/libs/libcurl/src/http2.c @@ -252,7 +252,7 @@ static CURLcode http2_data_setup(struct Curl_cfilter *cf, H2_STREAM_SEND_CHUNKS, BUFQ_OPT_NONE); Curl_bufq_initp(&stream->recvbuf, &ctx->stream_bufcp, H2_STREAM_RECV_CHUNKS, BUFQ_OPT_SOFT_LIMIT); - Curl_dynhds_init(&stream->resp_trailers, 0, DYN_H2_TRAILERS); + Curl_dynhds_init(&stream->resp_trailers, 0, DYN_HTTP_REQUEST); stream->resp_hds_len = 0; stream->bodystarted = FALSE; stream->status_code = -1; @@ -2122,7 +2122,13 @@ static ssize_t cf_h2_send(struct Curl_cfilter *cf, struct Curl_easy *data, /* Call the nghttp2 send loop and flush to write ALL buffered data, * headers and/or request body completely out to the network */ result = h2_progress_egress(cf, data); - if(result == CURLE_AGAIN) { + /* if the stream has been closed in egress handling (nghttp2 does that + * when it does not like the headers, for example */ + if(stream && stream->closed) { + nwritten = http2_handle_stream_close(cf, data, stream, err); + goto out; + } + else if(result == CURLE_AGAIN) { blocked = 1; } else if(result) { @@ -2130,14 +2136,14 @@ static ssize_t cf_h2_send(struct Curl_cfilter *cf, struct Curl_easy *data, nwritten = -1; goto out; } - else if(!Curl_bufq_is_empty(&stream->sendbuf)) { + else if(stream && !Curl_bufq_is_empty(&stream->sendbuf)) { /* although we wrote everything that nghttp2 wants to send now, * there is data left in our stream send buffer unwritten. This may * be due to the stream's HTTP/2 flow window being exhausted. */ blocked = 1; } - if(blocked) { + if(stream && blocked) { /* Unable to send all data, due to connection blocked or H2 window * exhaustion. Data is left in our stream buffer, or nghttp2's internal * frame buffer or our network out buffer. */ diff --git a/libs/libcurl/src/http_proxy.c b/libs/libcurl/src/http_proxy.c index 0d680832ab..c741b01261 100644 --- a/libs/libcurl/src/http_proxy.c +++ b/libs/libcurl/src/http_proxy.c @@ -71,7 +71,7 @@ static CURLcode http_proxy_cf_connect(struct Curl_cfilter *cf, DEBUGF(LOG_CF(data, cf, "connect")); connect_sub: - result = cf->next->cft->connect(cf->next, data, blocking, done); + result = cf->next->cft->do_connect(cf->next, data, blocking, done); if(result || !*done) return result; @@ -181,7 +181,7 @@ static void http_proxy_cf_close(struct Curl_cfilter *cf, ctx->cf_protocol = NULL; } if(cf->next) - cf->next->cft->close(cf->next, data); + cf->next->cft->do_close(cf->next, data); } diff --git a/libs/libcurl/src/libcurl.plist b/libs/libcurl/src/libcurl.plist index 20247bd436..f1e86cc3a8 100644 --- a/libs/libcurl/src/libcurl.plist +++ b/libs/libcurl/src/libcurl.plist @@ -15,7 +15,7 @@ se.curl.libcurl CFBundleVersion - 8.2.0 + 8.2.1 CFBundleName libcurl @@ -27,9 +27,9 @@ ???? CFBundleShortVersionString - libcurl 8.2.0 + libcurl 8.2.1 CFBundleGetInfoString - libcurl.plist 8.2.0 + libcurl.plist 8.2.1 diff --git a/libs/libcurl/src/socks.c b/libs/libcurl/src/socks.c index a390d10f17..c214a1746d 100644 --- a/libs/libcurl/src/socks.c +++ b/libs/libcurl/src/socks.c @@ -567,7 +567,6 @@ static CURLproxycode do_SOCKS5(struct Curl_cfilter *cf, */ struct connectdata *conn = cf->conn; unsigned char *socksreq = (unsigned char *)data->state.buffer; - char dest[256] = "unknown"; /* printable hostname:port */ int idx; CURLcode result; CURLproxycode presult; @@ -820,8 +819,8 @@ CONNECT_REQ_INIT: /* FALLTHROUGH */ CONNECT_RESOLVED: case CONNECT_RESOLVED: { + char dest[MAX_IPADR_LEN] = "unknown"; /* printable address */ struct Curl_addrinfo *hp = NULL; - size_t destlen; if(dns) hp = dns->addr; if(!hp) { @@ -831,8 +830,6 @@ CONNECT_RESOLVED: } Curl_printable_address(hp, dest, sizeof(dest)); - destlen = strlen(dest); - msnprintf(dest + destlen, sizeof(dest) - destlen, ":%d", sx->remote_port); len = 0; socksreq[len++] = 5; /* version (SOCKS5) */ @@ -848,7 +845,8 @@ CONNECT_RESOLVED: socksreq[len++] = ((unsigned char *)&saddr_in->sin_addr.s_addr)[i]; } - infof(data, "SOCKS5 connect to IPv4 %s (locally resolved)", dest); + infof(data, "SOCKS5 connect to %s:%d (locally resolved)", dest, + sx->remote_port); } #ifdef ENABLE_IPV6 else if(hp->ai_family == AF_INET6) { @@ -862,7 +860,8 @@ CONNECT_RESOLVED: ((unsigned char *)&saddr_in6->sin6_addr.s6_addr)[i]; } - infof(data, "SOCKS5 connect to IPv6 %s (locally resolved)", dest); + infof(data, "SOCKS5 connect to [%s]:%d (locally resolved)", dest, + sx->remote_port); } #endif else { @@ -1115,7 +1114,7 @@ static CURLcode socks_proxy_cf_connect(struct Curl_cfilter *cf, return CURLE_OK; } - result = cf->next->cft->connect(cf->next, data, blocking, done); + result = cf->next->cft->do_connect(cf->next, data, blocking, done); if(result || !*done) return result; @@ -1193,7 +1192,7 @@ static void socks_proxy_cf_close(struct Curl_cfilter *cf, DEBUGASSERT(cf->next); cf->connected = FALSE; socks_proxy_cf_free(cf); - cf->next->cft->close(cf->next, data); + cf->next->cft->do_close(cf->next, data); } static void socks_proxy_cf_destroy(struct Curl_cfilter *cf, diff --git a/libs/libcurl/src/transfer.c b/libs/libcurl/src/transfer.c index 45c47e373c..4d466c145e 100644 --- a/libs/libcurl/src/transfer.c +++ b/libs/libcurl/src/transfer.c @@ -1558,10 +1558,6 @@ CURLcode Curl_follow(struct Curl_easy *data, /* If this is not redirect due to a 401 or 407 response and an absolute URL: don't allow a custom port number */ disallowport = TRUE; - if(!data->set.allow_auth_to_other_hosts) { - Curl_safefree(data->state.aptr.user); - Curl_safefree(data->state.aptr.passwd); - } } DEBUGASSERT(data->state.uh); diff --git a/libs/libcurl/src/vquic/curl_ngtcp2.c b/libs/libcurl/src/vquic/curl_ngtcp2.c index 41ed55a64a..50ca212a96 100644 --- a/libs/libcurl/src/vquic/curl_ngtcp2.c +++ b/libs/libcurl/src/vquic/curl_ngtcp2.c @@ -1835,6 +1835,8 @@ out: *err = result; sent = -1; } + DEBUGF(LOG_CF(data, cf, "[h3sid=%" PRId64 "] cf_send(len=%zu) -> %zd, %d", + stream? stream->id : -1, len, sent, *err)); CF_DATA_RESTORE(cf, save); return sent; } diff --git a/libs/libcurl/src/vquic/curl_quiche.c b/libs/libcurl/src/vquic/curl_quiche.c index c587b13571..f6e995c6c5 100644 --- a/libs/libcurl/src/vquic/curl_quiche.c +++ b/libs/libcurl/src/vquic/curl_quiche.c @@ -329,7 +329,7 @@ static struct Curl_easy *get_stream_easy(struct Curl_cfilter *cf, else { DEBUGASSERT(data->multi); for(sdata = data->multi->easyp; sdata; sdata = sdata->next) { - if(H3_STREAM_ID(sdata) == stream3_id) { + if((sdata->conn == data->conn) && H3_STREAM_ID(sdata) == stream3_id) { return sdata; } } @@ -426,7 +426,7 @@ static ssize_t stream_resp_read(void *reader_ctx, return nread; } else { - *err = stream->resp_got_header? CURLE_PARTIAL_FILE : CURLE_RECV_ERROR; + *err = CURLE_AGAIN; return -1; } } @@ -457,8 +457,8 @@ static CURLcode cf_recv_body(struct Curl_cfilter *cf, if(nwritten < 0 && result != CURLE_AGAIN) { DEBUGF(LOG_CF(data, cf, "[h3sid=%"PRId64"] recv_body error %zd", stream->id, nwritten)); - failf(data, "Error %zd in HTTP/3 response body for stream[%"PRId64"]", - nwritten, stream->id); + failf(data, "Error %d in HTTP/3 response body for stream[%"PRId64"]", + result, stream->id); stream->closed = TRUE; stream->reset = TRUE; stream->send_closed = TRUE; @@ -591,8 +591,13 @@ static CURLcode cf_poll_events(struct Curl_cfilter *cf, "for [h3sid=%"PRId64"] -> %d", stream? stream->id : -1, cf_ev_name(ev), stream3_id, result)); - quiche_h3_event_free(ev); - return result; + if(data == sdata) { + /* Only report this error to the caller if it is about the + * transfer we were called with. Otherwise we fail a transfer + * due to a problem in another one. */ + quiche_h3_event_free(ev); + return result; + } } quiche_h3_event_free(ev); } @@ -1147,10 +1152,8 @@ static CURLcode cf_quiche_data_event(struct Curl_cfilter *cf, (void)arg1; (void)arg2; switch(event) { - case CF_CTRL_DATA_SETUP: { - result = h3_data_setup(cf, data); + case CF_CTRL_DATA_SETUP: break; - } case CF_CTRL_DATA_PAUSE: result = h3_data_pause(cf, data, (arg1 != 0)); break; @@ -1339,11 +1342,6 @@ static CURLcode cf_connect_start(struct Curl_cfilter *cf, } #endif - /* we do not get a setup event for the initial transfer */ - result = h3_data_setup(cf, data); - if(result) - return result; - result = cf_flush_egress(cf, data); if(result) return result; diff --git a/libs/libcurl/src/vtls/vtls.c b/libs/libcurl/src/vtls/vtls.c index 20beeacb02..353775d46e 100644 --- a/libs/libcurl/src/vtls/vtls.c +++ b/libs/libcurl/src/vtls/vtls.c @@ -1504,7 +1504,7 @@ static void ssl_cf_close(struct Curl_cfilter *cf, CF_DATA_SAVE(save, cf, data); cf_close(cf, data); - cf->next->cft->close(cf->next, data); + cf->next->cft->do_close(cf->next, data); CF_DATA_RESTORE(cf, save); } @@ -1528,7 +1528,7 @@ static CURLcode ssl_cf_connect(struct Curl_cfilter *cf, DEBUGASSERT(connssl); DEBUGASSERT(cf->conn->host.name); - result = cf->next->cft->connect(cf->next, data, blocking, done); + result = cf->next->cft->do_connect(cf->next, data, blocking, done); if(result || !*done) goto out; diff --git a/libs/libcurl/src/ws.c b/libs/libcurl/src/ws.c index 47f26be9e6..41eb5d526d 100644 --- a/libs/libcurl/src/ws.c +++ b/libs/libcurl/src/ws.c @@ -970,10 +970,10 @@ static CURLcode ws_flush(struct Curl_easy *data, struct websocket *ws, return CURLE_OK; } -CURL_EXTERN CURLcode curl_ws_send(struct Curl_easy *data, const void *buffer, +CURL_EXTERN CURLcode curl_ws_send(CURL *data, const void *buffer, size_t buflen, size_t *sent, - curl_off_t totalsize, - unsigned int sendflags) + curl_off_t fragsize, + unsigned int flags) { struct websocket *ws; ssize_t nwritten, n; @@ -997,7 +997,7 @@ CURL_EXTERN CURLcode curl_ws_send(struct Curl_easy *data, const void *buffer, ws = data->conn->proto.ws; if(data->set.ws_raw_mode) { - if(totalsize || sendflags) + if(fragsize || flags) return CURLE_BAD_FUNCTION_ARGUMENT; if(!buflen) /* nothing to do */ @@ -1030,10 +1030,10 @@ CURL_EXTERN CURLcode curl_ws_send(struct Curl_easy *data, const void *buffer, if(space < 14) return CURLE_AGAIN; - if(sendflags & CURLWS_OFFSET) { - if(totalsize) { - /* a frame series 'totalsize' bytes big, this is the first */ - n = ws_enc_write_head(data, &ws->enc, sendflags, totalsize, + if(flags & CURLWS_OFFSET) { + if(fragsize) { + /* a frame series 'fragsize' bytes big, this is the first */ + n = ws_enc_write_head(data, &ws->enc, flags, fragsize, &ws->sendbuf, &result); if(n < 0) return result; @@ -1047,7 +1047,7 @@ CURL_EXTERN CURLcode curl_ws_send(struct Curl_easy *data, const void *buffer, } } else if(!ws->enc.payload_remain) { - n = ws_enc_write_head(data, &ws->enc, sendflags, (curl_off_t)buflen, + n = ws_enc_write_head(data, &ws->enc, flags, (curl_off_t)buflen, &ws->sendbuf, &result); if(n < 0) return result; @@ -1112,15 +1112,15 @@ CURL_EXTERN CURLcode curl_ws_recv(CURL *curl, void *buffer, size_t buflen, CURL_EXTERN CURLcode curl_ws_send(CURL *curl, const void *buffer, size_t buflen, size_t *sent, - curl_off_t framesize, - unsigned int sendflags) + curl_off_t fragsize, + unsigned int flags) { (void)curl; (void)buffer; (void)buflen; (void)sent; - (void)framesize; - (void)sendflags; + (void)fragsize; + (void)flags; return CURLE_NOT_BUILT_IN; } -- cgit v1.2.3