mirror of
https://github.com/curl/curl.git
synced 2026-08-25 21:03:34 +03:00
conncontrol: reuse handling
Add protocol handler flag `PROTOPT_CONN_REUSE` to indicate that the protocol allows reusing connections for other tranfers. Add that to all handlers that support it. Create connections with `conn->bits.close = FALSE` and remove all the `connkeep()` calls in protocol handlers setup/connect implementations. `PROTOPT_CONN_REUSE` assures that the default behaviour applies at the end of a transfer without need to juggle the close bit. `conn->bits.close` now serves as an additional indication that a connection cannot be reused. Only protocol handles that allow reuse need to set it to override the default behaviour. Remove all `connclose()` and `connkeep()` calls from connection filters. Filters should not modify connection flags. They are supposed to run in eyeballing situations where a filter is just one of many determining the outcome. Fix http response header handling to only honour `Connection: close` for HTTP/1.x versions. Closes #19333
This commit is contained in:
parent
a9e7a027ed
commit
feea968512
21 changed files with 93 additions and 114 deletions
|
|
@ -329,7 +329,7 @@ const struct Curl_handler Curl_handler_smb = {
|
|||
PORT_SMB, /* defport */
|
||||
CURLPROTO_SMB, /* protocol */
|
||||
CURLPROTO_SMB, /* family */
|
||||
PROTOPT_NONE /* flags */
|
||||
PROTOPT_CONN_REUSE /* flags */
|
||||
};
|
||||
|
||||
#ifdef USE_SSL
|
||||
|
|
@ -358,7 +358,7 @@ const struct Curl_handler Curl_handler_smbs = {
|
|||
PORT_SMBS, /* defport */
|
||||
CURLPROTO_SMBS, /* protocol */
|
||||
CURLPROTO_SMB, /* family */
|
||||
PROTOPT_SSL /* flags */
|
||||
PROTOPT_SSL | PROTOPT_CONN_REUSE /* flags */
|
||||
};
|
||||
#endif
|
||||
|
||||
|
|
@ -513,9 +513,6 @@ static CURLcode smb_connect(struct Curl_easy *data, bool *done)
|
|||
if(!smbc->send_buf)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
/* Multiple requests are allowed with this connection */
|
||||
connkeep(conn, "SMB default");
|
||||
|
||||
/* Parse the username, domain, and password */
|
||||
slash = strchr(conn->user, '/');
|
||||
if(!slash)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue