SHOW_FLAG(f, CO_FL_SOCKS4_SEND);
SHOW_FLAG(f, CO_FL_EARLY_DATA);
SHOW_FLAG(f, CO_FL_EARLY_SSL_HS);
- SHOW_FLAG(f, CO_FL_ADDR_TO_SET);
- SHOW_FLAG(f, CO_FL_ADDR_FROM_SET);
SHOW_FLAG(f, CO_FL_WAIT_ROOM);
SHOW_FLAG(f, CO_FL_WANT_DRAIN);
SHOW_FLAG(f, CO_FL_XPRT_READY);
CO_FL_WAIT_ROOM = 0x00000800, /* data sink is full */
/* These flags are used to report whether the from/to addresses are set or not */
- CO_FL_ADDR_FROM_SET = 0x00001000, /* addr.from is set */
- CO_FL_ADDR_TO_SET = 0x00002000, /* addr.to is set */
+ /* unused: 0x00001000 */
+ /* unused: 0x00002000 */
CO_FL_EARLY_SSL_HS = 0x00004000, /* We have early data pending, don't start SSL handshake yet */
CO_FL_EARLY_DATA = 0x00008000, /* At least some of the data are early data */
/* Returns the source address of the connection or NULL if not set */
static inline const struct sockaddr_storage *conn_src(struct connection *conn)
{
- if (conn->flags & CO_FL_ADDR_FROM_SET)
- return conn->src;
- return NULL;
+ return conn->src;
}
/* Returns the destination address of the connection or NULL if not set */
static inline const struct sockaddr_storage *conn_dst(struct connection *conn)
{
- if (conn->flags & CO_FL_ADDR_TO_SET)
- return conn->dst;
- return NULL;
+ return conn->dst;
}
/* Retrieves the connection's original source address. Returns non-zero on
*/
static inline int conn_get_src(struct connection *conn)
{
- if (conn->flags & CO_FL_ADDR_FROM_SET)
+ if (conn->src)
return 1;
if (!conn_ctrl_ready(conn))
sockaddr_free(&conn->src);
return 0;
done:
- conn->flags |= CO_FL_ADDR_FROM_SET;
return 1;
}
*/
static inline int conn_get_dst(struct connection *conn)
{
- if (conn->flags & CO_FL_ADDR_TO_SET)
+ if (conn->dst)
return 1;
if (!conn_ctrl_ready(conn))
sockaddr_free(&conn->dst);
return 0;
done:
- conn->flags |= CO_FL_ADDR_TO_SET;
return 1;
}
chunk_appendf(buf, " %s/%s", conn_get_xprt_name(conn), conn_get_ctrl_name(conn));
- if (conn->flags & CO_FL_ADDR_FROM_SET && addr_to_str(conn->src, addr, sizeof(addr)))
+ if (conn->src && addr_to_str(conn->src, addr, sizeof(addr)))
chunk_appendf(buf, " src=%s:%d", addr, get_host_port(conn->src));
- if (conn->flags & CO_FL_ADDR_TO_SET && addr_to_str(conn->dst, addr, sizeof(addr)))
+ if (conn->dst && addr_to_str(conn->dst, addr, sizeof(addr)))
chunk_appendf(buf, " dst=%s:%d", addr, get_host_port(conn->dst));
return buf->data - old_len;
conn->flags &= ~CO_FL_WAIT_L4_CONN;
}
- conn->flags |= CO_FL_ADDR_TO_SET;
-
conn_ctrl_init(conn); /* registers the FD */
HA_ATOMIC_OR(&fdtab[fd].state, FD_LINGER_RISK); /* close hard if needed */
conn->flags &= ~CO_FL_WAIT_L4_CONN;
- conn->flags |= CO_FL_ADDR_TO_SET;
-
/* Prepare to send a few handshakes related to the on-wire protocol. */
if (conn->send_proxy_ofs)
conn->flags |= CO_FL_SEND_PROXY;
/* just like with UNIX sockets, only the family is filled */
conn->src->ss_family = AF_UNIX;
conn->handle.fd = cfd;
- conn->flags |= CO_FL_ADDR_FROM_SET;
ret = CO_AC_DONE;
goto done;
}
conn->flags &= ~CO_FL_WAIT_L4_CONN;
}
- conn->flags |= CO_FL_ADDR_TO_SET;
-
conn_ctrl_init(conn); /* registers the FD */
HA_ATOMIC_OR(&fdtab[fd].state, FD_LINGER_RISK); /* close hard if needed */
conn->flags &= ~CO_FL_WAIT_L4_CONN;
}
- conn->flags |= CO_FL_ADDR_TO_SET;
-
/* Prepare to send a few handshakes related to the on-wire protocol. */
if (conn->send_proxy_ofs)
conn->flags |= CO_FL_SEND_PROXY;
if (!sockaddr_alloc(&cli_conn->src, saddr, sizeof *saddr))
goto out_free_conn;
- cli_conn->flags |= CO_FL_ADDR_FROM_SET | CO_FL_FDLESS;
+ cli_conn->flags |= CO_FL_FDLESS;
qc->conn = cli_conn;
cli_conn->handle.qc = qc;
conn->src = addr;
conn->handle.fd = cfd;
- conn->flags |= CO_FL_ADDR_FROM_SET;
ret = CO_AC_DONE;
goto done;
}