From 691b1f429eeefe8e87c2209c1c254d798a35ad68 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 30 Sep 2013 14:53:05 +0200 Subject: [PATCH] CLEANUP: stream-int: remove obsolete si_ctrl function This function makes no sense anymore and will cause trouble to convert the remains of connection/applet to end points. Let's replace it now with its contents. --- include/proto/stream_interface.h | 9 ++------- src/backend.c | 2 +- src/session.c | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/include/proto/stream_interface.h b/include/proto/stream_interface.h index 95b995db1..42b1ebb2d 100644 --- a/include/proto/stream_interface.h +++ b/include/proto/stream_interface.h @@ -46,11 +46,6 @@ struct task *stream_int_register_handler(struct stream_interface *si, struct si_applet *app); void stream_int_unregister_handler(struct stream_interface *si); -static inline const struct protocol *si_ctrl(struct stream_interface *si) -{ - return si->conn->ctrl; -} - static inline void si_prepare_none(struct stream_interface *si) { si->ops = &si_embedded_ops; @@ -148,10 +143,10 @@ static inline int si_connect(struct stream_interface *si) { int ret; - if (unlikely(!si_ctrl(si) || !si_ctrl(si)->connect)) + if (unlikely(!si->conn->ctrl || !si->conn->ctrl->connect)) return SN_ERR_INTERNAL; - ret = si_ctrl(si)->connect(si->conn, !channel_is_empty(si->ob), !!si->send_proxy_ofs); + ret = si->conn->ctrl->connect(si->conn, !channel_is_empty(si->ob), !!si->send_proxy_ofs); if (ret != SN_ERR_NONE) return ret; diff --git a/src/backend.c b/src/backend.c index b8349174a..63bd368c2 100644 --- a/src/backend.c +++ b/src/backend.c @@ -987,7 +987,7 @@ int connect_server(struct session *s) else if (obj_type(s->target) == OBJ_TYPE_PROXY) { /* proxies exclusively run on raw_sock right now */ si_prepare_conn(s->req->cons, protocol_by_family(s->req->cons->conn->addr.to.ss_family), &raw_sock); - if (!si_ctrl(s->req->cons)) + if (!s->req->cons->conn->ctrl) return SN_ERR_INTERNAL; } else diff --git a/src/session.c b/src/session.c index 472e5d238..218476650 100644 --- a/src/session.c +++ b/src/session.c @@ -954,7 +954,7 @@ static void sess_establish(struct session *s, struct stream_interface *si) rep->analysers |= s->fe->fe_rsp_ana | s->be->be_rsp_ana; rep->flags |= CF_READ_ATTACHED; /* producer is now attached */ - if (si_ctrl(si)) { + if (si->conn->ctrl) { /* real connections have timeouts */ req->wto = s->be->timeout.server; rep->rto = s->be->timeout.server;