haproxy/include/haproxy/proto_reverse_connect.h
Amaury Denoyelle 1f43fb71be MINOR: proto_reverse_connect: refactor preconnect failure
When a connection is freed during preconnect before reversal, the error
must be notified to the listener to remove any connection reference and
rearm a new preconnect attempt. Currently, this can occur through 2 code
paths :
* conn_free() called directly by H2 mux
* error during conn_create_mux(). For this case, connection is flagged
  with CO_FL_ERROR and reverse_connect task is woken up. The process
  task handler is then responsible to call conn_free() for such
  connection.

Duplicated steps where done both in conn_free() and process task
handler. These are now removed. To facilitate code maintenance,
dedicated operation have been centralized in a new function
rev_notify_preconn_err() which is called by conn_free().
2023-09-22 16:43:36 +02:00

22 lines
735 B
C

#ifndef _HAPROXY_PROTO_REVERSE_CONNECT_H
#define _HAPROXY_PROTO_REVERSE_CONNECT_H
#include <haproxy/connection-t.h>
#include <haproxy/listener-t.h>
#include <haproxy/receiver-t.h>
int rev_bind_receiver(struct receiver *rx, char **errmsg);
int rev_bind_listener(struct listener *listener, char *errmsg, int errlen);
void rev_enable_listener(struct listener *l);
void rev_disable_listener(struct listener *l);
struct connection *rev_accept_conn(struct listener *l, int *status);
void rev_unbind_receiver(struct listener *l);
int rev_set_affinity(struct connection *conn, int new_tid);
int rev_accepting_conn(const struct receiver *rx);
void rev_notify_preconn_err(struct listener *l);
#endif /* _HAPROXY_PROTO_REVERSE_CONNECT_H */