MEDIUM: connections: Introduce a handshake pseudo-XPRT.
Add a new XPRT that is used when using non-SSL handshakes, such as proxy
protocol or Netscaler, instead of taking care of it in conn_fd_handler().
This XPRT is installed when any of those is used, and it removes itself once
the handshake is done.
This should allow us to remove the distinction between CO_FL_SOCK* and
CO_FL_XPRT*.
diff --git a/src/tcp_rules.c b/src/tcp_rules.c
index 13057ce..a70c4c0 100644
--- a/src/tcp_rules.c
+++ b/src/tcp_rules.c
@@ -455,12 +455,22 @@
stream_track_stkctr(&sess->stkctr[trk_idx(rule->action)], t, ts);
}
else if (rule->action == ACT_TCP_EXPECT_PX) {
+ if (!(conn->flags & (CO_FL_HANDSHAKE_NOSSL))) {
+ if (xprt_add_hs(conn) < 0) {
+ result = 0;
+ break;
+ }
+ }
conn->flags |= CO_FL_ACCEPT_PROXY;
- conn_sock_want_recv(conn);
}
else if (rule->action == ACT_TCP_EXPECT_CIP) {
+ if (!(conn->flags & (CO_FL_HANDSHAKE_NOSSL))) {
+ if (xprt_add_hs(conn) < 0) {
+ result = 0;
+ break;
+ }
+ }
conn->flags |= CO_FL_ACCEPT_CIP;
- conn_sock_want_recv(conn);
}
else {
/* Custom keywords. */