mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 15:17:01 +02:00
CLEANUP: peers: remove unused "proto" and "xprt" struct members
peer->proto and peer->xprt struct members are now pure legacy: they are
only set during parsing but never used afterwards.
This is due to commit 02efedac
("MINOR: peers: now remove the remote
connection setup code") which made some cleanup in the past, but the
unused proto and xprt members were probably left unused by mistake.
Since we don't have valid uses for them, we remove them.
Also, peer_xprt() helper function was removed since it was related to
peer->xprt struct member.
This commit is contained in:
parent
334caefaaa
commit
372d3e2934
@ -60,8 +60,6 @@ struct peer {
|
||||
} conf; /* config information */
|
||||
time_t last_change;
|
||||
struct sockaddr_storage addr; /* peer address */
|
||||
struct protocol *proto; /* peer address protocol */
|
||||
struct xprt_ops *xprt; /* peer socket operations at transport layer */
|
||||
unsigned int flags; /* peer session flags */
|
||||
unsigned int statuscode; /* current/last session status code */
|
||||
unsigned int reconnect; /* next connect timer */
|
||||
|
@ -40,22 +40,10 @@ int peers_register_table(struct peers *, struct stktable *table);
|
||||
void peers_setup_frontend(struct proxy *fe);
|
||||
void peers_register_keywords(struct peers_kw_list *pkwl);
|
||||
|
||||
#if defined(USE_OPENSSL)
|
||||
static inline struct xprt_ops *peer_xprt(struct peer *p)
|
||||
{
|
||||
return p->srv->use_ssl ? xprt_get(XPRT_SSL) : xprt_get(XPRT_RAW);
|
||||
}
|
||||
#else
|
||||
static inline enum obj_type *peer_session_target(struct peer *p, struct stream *s)
|
||||
{
|
||||
return &p->srv->obj_type;
|
||||
}
|
||||
|
||||
static inline struct xprt_ops *peer_xprt(struct peer *p)
|
||||
{
|
||||
return xprt_get(XPRT_RAW);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _HAPROXY_PEERS_H */
|
||||
|
||||
|
@ -633,7 +633,6 @@ static struct peer *cfg_peers_add_peer(struct peers *peers,
|
||||
p->conf.file = strdup(file);
|
||||
p->conf.line = linenum;
|
||||
p->last_change = ns_to_sec(now_ns);
|
||||
p->xprt = xprt_get(XPRT_RAW);
|
||||
HA_SPIN_INIT(&p->lock);
|
||||
if (id)
|
||||
p->id = strdup(id);
|
||||
@ -747,7 +746,6 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm)
|
||||
}
|
||||
}
|
||||
newpeer->addr = l->rx.addr;
|
||||
newpeer->proto = l->rx.proto;
|
||||
cur_arg++;
|
||||
}
|
||||
|
||||
@ -902,14 +900,11 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm)
|
||||
}
|
||||
|
||||
/* If the peer address has just been parsed, let's copy it to <newpeer>
|
||||
* and initializes ->proto.
|
||||
*/
|
||||
if (peer || !local_peer) {
|
||||
newpeer->addr = curpeers->peers_fe->srv->addr;
|
||||
newpeer->proto = protocol_lookup(newpeer->addr.ss_family, PROTO_TYPE_STREAM, 0);
|
||||
}
|
||||
|
||||
newpeer->xprt = xprt_get(XPRT_RAW);
|
||||
HA_SPIN_INIT(&newpeer->lock);
|
||||
|
||||
newpeer->srv = curpeers->peers_fe->srv;
|
||||
|
Loading…
Reference in New Issue
Block a user