mirror of
https://github.com/curl/curl.git
synced 2026-08-04 18:26:13 +03:00
cfilters: remove close method
closing a filter chain and reconnecting it again is a complication that only the HTTP/1.x proxy filter used. Remove it from all filters. Instead, a filter can return CURLE_AGAIN during the connect phase and the cf-setup filter will tear down all "sub filters" and restart over. With this, a filter never resets to the initial phase but progresses through connect -> connected -> shutdown -> destroy once. Closes #21831
This commit is contained in:
parent
ba600296d2
commit
31cb54e1fa
21 changed files with 50 additions and 296 deletions
|
|
@ -45,13 +45,6 @@ struct cf_haproxy_ctx {
|
|||
struct dynbuf data_out;
|
||||
};
|
||||
|
||||
static void cf_haproxy_ctx_reset(struct cf_haproxy_ctx *ctx)
|
||||
{
|
||||
DEBUGASSERT(ctx);
|
||||
ctx->state = HAPROXY_INIT;
|
||||
curlx_dyn_reset(&ctx->data_out);
|
||||
}
|
||||
|
||||
static void cf_haproxy_ctx_free(struct cf_haproxy_ctx *ctx)
|
||||
{
|
||||
if(ctx) {
|
||||
|
|
@ -173,16 +166,6 @@ static void cf_haproxy_destroy(struct Curl_cfilter *cf,
|
|||
cf_haproxy_ctx_free(cf->ctx);
|
||||
}
|
||||
|
||||
static void cf_haproxy_close(struct Curl_cfilter *cf,
|
||||
struct Curl_easy *data)
|
||||
{
|
||||
CURL_TRC_CF(data, cf, "close");
|
||||
cf->connected = FALSE;
|
||||
cf_haproxy_ctx_reset(cf->ctx);
|
||||
if(cf->next)
|
||||
cf->next->cft->do_close(cf->next, data);
|
||||
}
|
||||
|
||||
static CURLcode cf_haproxy_adjust_pollset(struct Curl_cfilter *cf,
|
||||
struct Curl_easy *data,
|
||||
struct easy_pollset *ps)
|
||||
|
|
@ -202,7 +185,6 @@ struct Curl_cftype Curl_cft_haproxy = {
|
|||
0,
|
||||
cf_haproxy_destroy,
|
||||
cf_haproxy_connect,
|
||||
cf_haproxy_close,
|
||||
Curl_cf_def_shutdown,
|
||||
cf_haproxy_adjust_pollset,
|
||||
Curl_cf_def_data_pending,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue