mirror of
https://github.com/curl/curl.git
synced 2025-02-05 14:30:10 +08:00
cfilters: kill connection filter events attach+detach
Make transfer attach/detach to/from connections chepaer. - the "attach" event was no longer implemented by any filter - the "detach" did the same as the "done" event for the filters who still implemented it. It should be superfluous as the "done" must always happen. Closes #16067
This commit is contained in:
parent
f5f8f2c892
commit
cd9107e012
@ -711,18 +711,6 @@ static CURLcode cf_cntrl_all(struct connectdata *conn,
|
||||
return result;
|
||||
}
|
||||
|
||||
void Curl_conn_ev_data_attach(struct connectdata *conn,
|
||||
struct Curl_easy *data)
|
||||
{
|
||||
cf_cntrl_all(conn, data, TRUE, CF_CTRL_DATA_ATTACH, 0, NULL);
|
||||
}
|
||||
|
||||
void Curl_conn_ev_data_detach(struct connectdata *conn,
|
||||
struct Curl_easy *data)
|
||||
{
|
||||
cf_cntrl_all(conn, data, TRUE, CF_CTRL_DATA_DETACH, 0, NULL);
|
||||
}
|
||||
|
||||
CURLcode Curl_conn_ev_data_setup(struct Curl_easy *data)
|
||||
{
|
||||
return cf_cntrl_all(data->conn, data, FALSE,
|
||||
|
@ -132,8 +132,6 @@ typedef CURLcode Curl_cft_conn_keep_alive(struct Curl_cfilter *cf,
|
||||
* to all filters in the chain. Overall result is always CURLE_OK.
|
||||
*/
|
||||
/* data event arg1 arg2 return */
|
||||
#define CF_CTRL_DATA_ATTACH 1 /* 0 NULL ignored */
|
||||
#define CF_CTRL_DATA_DETACH 2 /* 0 NULL ignored */
|
||||
#define CF_CTRL_DATA_SETUP 4 /* 0 NULL first fail */
|
||||
#define CF_CTRL_DATA_IDLE 5 /* 0 NULL first fail */
|
||||
#define CF_CTRL_DATA_PAUSE 6 /* on/off NULL first fail */
|
||||
@ -476,24 +474,6 @@ ssize_t Curl_cf_recv(struct Curl_easy *data, int sockindex, char *buf,
|
||||
ssize_t Curl_cf_send(struct Curl_easy *data, int sockindex,
|
||||
const void *buf, size_t len, bool eos, CURLcode *code);
|
||||
|
||||
/**
|
||||
* The easy handle `data` is being attached to `conn`. This does
|
||||
* not mean that data will actually do a transfer. Attachment is
|
||||
* also used for temporary actions on the connection.
|
||||
*/
|
||||
void Curl_conn_ev_data_attach(struct connectdata *conn,
|
||||
struct Curl_easy *data);
|
||||
|
||||
/**
|
||||
* The easy handle `data` is being detached (no longer served)
|
||||
* by connection `conn`. All filters are informed to release any resources
|
||||
* related to `data`.
|
||||
* Note: there may be several `data` attached to a connection at the same
|
||||
* time.
|
||||
*/
|
||||
void Curl_conn_ev_data_detach(struct connectdata *conn,
|
||||
struct Curl_easy *data);
|
||||
|
||||
/**
|
||||
* Notify connection filters that they need to setup data for
|
||||
* a transfer.
|
||||
|
@ -2636,9 +2636,6 @@ static CURLcode cf_h2_cntrl(struct Curl_cfilter *cf,
|
||||
case CF_CTRL_FLUSH:
|
||||
result = cf_h2_flush(cf, data);
|
||||
break;
|
||||
case CF_CTRL_DATA_DETACH:
|
||||
http2_data_done(cf, data);
|
||||
break;
|
||||
case CF_CTRL_DATA_DONE:
|
||||
http2_data_done(cf, data);
|
||||
break;
|
||||
|
@ -946,7 +946,6 @@ void Curl_detach_connection(struct Curl_easy *data)
|
||||
{
|
||||
struct connectdata *conn = data->conn;
|
||||
if(conn) {
|
||||
Curl_conn_ev_data_detach(conn, data);
|
||||
Curl_node_remove(&data->conn_queue);
|
||||
}
|
||||
data->conn = NULL;
|
||||
@ -967,7 +966,6 @@ void Curl_attach_connection(struct Curl_easy *data,
|
||||
Curl_llist_append(&conn->easyq, data, &data->conn_queue);
|
||||
if(conn->handler && conn->handler->attach)
|
||||
conn->handler->attach(data, conn);
|
||||
Curl_conn_ev_data_attach(conn, data);
|
||||
}
|
||||
|
||||
static int connecting_getsock(struct Curl_easy *data, curl_socket_t *socks)
|
||||
|
@ -1990,9 +1990,6 @@ static CURLcode cf_ngtcp2_data_event(struct Curl_cfilter *cf,
|
||||
case CF_CTRL_DATA_PAUSE:
|
||||
result = h3_data_pause(cf, data, (arg1 != 0));
|
||||
break;
|
||||
case CF_CTRL_DATA_DETACH:
|
||||
h3_data_done(cf, data);
|
||||
break;
|
||||
case CF_CTRL_DATA_DONE:
|
||||
h3_data_done(cf, data);
|
||||
break;
|
||||
|
@ -2200,9 +2200,6 @@ static CURLcode cf_osslq_data_event(struct Curl_cfilter *cf,
|
||||
case CF_CTRL_DATA_PAUSE:
|
||||
result = h3_data_pause(cf, data, (arg1 != 0));
|
||||
break;
|
||||
case CF_CTRL_DATA_DETACH:
|
||||
h3_data_done(cf, data);
|
||||
break;
|
||||
case CF_CTRL_DATA_DONE:
|
||||
h3_data_done(cf, data);
|
||||
break;
|
||||
|
@ -1228,9 +1228,6 @@ static CURLcode cf_quiche_data_event(struct Curl_cfilter *cf,
|
||||
case CF_CTRL_DATA_PAUSE:
|
||||
result = h3_data_pause(cf, data, (arg1 != 0));
|
||||
break;
|
||||
case CF_CTRL_DATA_DETACH:
|
||||
h3_data_done(cf, data);
|
||||
break;
|
||||
case CF_CTRL_DATA_DONE:
|
||||
h3_data_done(cf, data);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user