diff --git a/lib/conncache.c b/lib/conncache.c index 48d9873ea5..39e4d71666 100644 --- a/lib/conncache.c +++ b/lib/conncache.c @@ -206,7 +206,7 @@ static void cpool_discard_conn(struct cpool *cpool, /* treat the connection as aborted in CONNECT_ONLY situations, we do * not know what the APP did with it. */ - if(conn->connect_only) + if(conn->bits.connect_only) aborted = TRUE; conn->bits.aborted = aborted; @@ -354,7 +354,7 @@ static struct connectdata *cpool_get_oldest_idle(struct cpool *cpool, for(curr = Curl_llist_head(&bundle->conns); curr; curr = Curl_node_next(curr)) { conn = Curl_node_elem(curr); - if(CONN_INUSE(conn) || conn->bits.close || conn->connect_only) + if(CONN_INUSE(conn) || conn->bits.close || conn->bits.connect_only) continue; /* Set higher score for the age passed since the connection was used */ score = curlx_ptimediff_ms(pnow, &conn->lastused); @@ -665,7 +665,7 @@ void Curl_conn_terminate(struct Curl_easy *data, /* treat the connection as aborted in CONNECT_ONLY situations, * so no graceful shutdown is attempted. */ - if(conn->connect_only) + if(conn->bits.connect_only) aborted = TRUE; if(data->multi) { diff --git a/lib/cshutdn.c b/lib/cshutdn.c index 308f2aaa82..27b4a9f0dd 100644 --- a/lib/cshutdn.c +++ b/lib/cshutdn.c @@ -87,14 +87,14 @@ static void cshutdn_run_once(struct Curl_easy *data, return; } - if(!conn->connect_only && Curl_conn_is_connected(conn, FIRSTSOCKET)) + if(!conn->bits.connect_only && Curl_conn_is_connected(conn, FIRSTSOCKET)) r1 = Curl_conn_shutdown(data, FIRSTSOCKET, &done1); else { r1 = CURLE_OK; done1 = TRUE; } - if(!conn->connect_only && Curl_conn_is_connected(conn, SECONDARYSOCKET)) + if(!conn->bits.connect_only && Curl_conn_is_connected(conn, SECONDARYSOCKET)) r2 = Curl_conn_shutdown(data, SECONDARYSOCKET, &done2); else { r2 = CURLE_OK; diff --git a/lib/http2.c b/lib/http2.c index 6869a0fe2f..68ee4805e8 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -1821,7 +1821,7 @@ out: /* Defer flushing during the connect phase so that the SETTINGS and * other initial frames are sent together with the first request. * Unless we are 'connect_only' where the request will never come. */ - if(!cf->connected && !cf->conn->connect_only) + if(!cf->connected && !cf->conn->bits.connect_only) return CURLE_OK; return nw_out_flush(cf, data); } diff --git a/lib/multi.c b/lib/multi.c index a0e2cede1d..482c160fde 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -729,7 +729,7 @@ static void close_connect_only(struct connectdata *conn, { (void)userdata; (void)data; - if(conn->connect_only) + if(conn->bits.connect_only) connclose(conn, "Removing connect-only easy handle"); } diff --git a/lib/url.c b/lib/url.c index e2f4a158ae..a9ef60709a 100644 --- a/lib/url.c +++ b/lib/url.c @@ -739,7 +739,7 @@ static bool url_match_connect_config(struct connectdata *conn, struct url_conn_match *m) { /* connect-only or to-be-closed connections will not be reused */ - if(conn->connect_only || conn->bits.close || conn->bits.no_reuse) + if(conn->bits.connect_only || conn->bits.close || conn->bits.no_reuse) return FALSE; /* ip_version must match */ @@ -1402,7 +1402,7 @@ static struct connectdata *allocate_conn(struct Curl_easy *data) conn->bits.ftp_use_eprt = data->set.ftp_use_eprt; #endif conn->ip_version = data->set.ipver; - conn->connect_only = (bool)data->set.connect_only; + conn->bits.connect_only = (bool)data->set.connect_only; conn->transport_wanted = TRNSPRT_TCP; /* most of them are TCP streams */ /* Store the local bind parameters that will be used for this connection */ diff --git a/lib/urldata.h b/lib/urldata.h index 2509e12e8a..e5264b5a3c 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -250,6 +250,7 @@ typedef enum { * Boolean values that concerns this connection. */ struct ConnectBits { + BIT(connect_only); #ifndef CURL_DISABLE_PROXY BIT(httpproxy); /* if set, this transfer is done through an HTTP proxy */ BIT(socksproxy); /* if set, this transfer is done through a socks proxy */ @@ -480,7 +481,6 @@ struct connectdata { * 0 at start, then one of 09, 10, 11, etc. */ uint8_t httpversion_seen; uint8_t gssapi_delegation; /* inherited from set.gssapi_delegation */ - BIT(connect_only); }; #ifndef CURL_DISABLE_PROXY diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index 46fd665834..4ac1913240 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -1138,7 +1138,8 @@ CURLcode Curl_gtls_ctx_init(struct gtls_ctx *gctx, else { infof(data, "SSL reusing session with ALPN '%s'", scs->alpn ? scs->alpn : "-"); - if(ssl_config->earlydata && scs->alpn && !cf->conn->connect_only) { + if(ssl_config->earlydata && scs->alpn && + !cf->conn->bits.connect_only) { bool do_early_data = FALSE; if(sess_reuse_cb) { result = sess_reuse_cb(cf, data, &alpns, scs, &do_early_data); diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 756fc427b3..cbe7898f10 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -3411,7 +3411,7 @@ ossl_init_session_and_alpns(struct ossl_ctx *octx, #ifdef HAVE_OPENSSL_EARLYDATA if(ssl_config->earlydata && scs->alpn && SSL_SESSION_get_max_early_data(ssl_session) && - !cf->conn->connect_only && + !cf->conn->bits.connect_only && (SSL_version(octx->ssl) == TLS1_3_VERSION)) { bool do_early_data = FALSE; if(sess_reuse_cb) { diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index 741b1a1c0a..b35645b458 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -549,7 +549,7 @@ wssl_setup_session(struct Curl_cfilter *cf, infof(data, "SSL reusing session with ALPN '%s'", scs->alpn ? scs->alpn : "-"); if(ssl_config->earlydata && - !cf->conn->connect_only && + !cf->conn->bits.connect_only && !strcmp("TLSv1.3", wolfSSL_get_version(wss->ssl))) { bool do_early_data = FALSE; if(sess_reuse_cb) {