Skip to content

Commit

Permalink
cfilters: kill connection filter events attach+detach
Browse files Browse the repository at this point in the history
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 curl#16067
  • Loading branch information
icing authored and bagder committed Jan 22, 2025
1 parent f5f8f2c commit cd9107e
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 46 deletions.
12 changes: 0 additions & 12 deletions lib/cfilters.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
20 changes: 0 additions & 20 deletions lib/cfilters.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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.
Expand Down
3 changes: 0 additions & 3 deletions lib/http2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions lib/multi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand Down
3 changes: 0 additions & 3 deletions lib/vquic/curl_ngtcp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 0 additions & 3 deletions lib/vquic/curl_osslq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 0 additions & 3 deletions lib/vquic/curl_quiche.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit cd9107e

Please sign in to comment.