]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: stream-int: remove obsolete si_ctrl function
authorWilly Tarreau <w@1wt.eu>
Mon, 30 Sep 2013 12:53:05 +0000 (14:53 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 9 Dec 2013 14:40:22 +0000 (15:40 +0100)
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
src/backend.c
src/session.c

index 95b995db14d7b59aac9362050d83638066b2b2fb..42b1ebb2d7a51b3c4d6dbc283a19f4fd73cd1352 100644 (file)
@@ -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;
 
index b8349174ac5c53c44d07b15fcb519130be09bdbc..63bd368c2d7dbb0012dbc1cdd49d2973b0d6abb9 100644 (file)
@@ -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
index 472e5d23846abcc4899f4a0f98eef8632b635cdd..2184766507bca0e759da178baf6a553dbd4d6457 100644 (file)
@@ -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;