]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] stream_interface: add iohandler callback
authorWilly Tarreau <w@1wt.eu>
Sat, 5 Sep 2009 18:57:35 +0000 (20:57 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 23 Sep 2009 21:52:15 +0000 (23:52 +0200)
When stream interfaces will embedded applets running as part as their
holding task, we'll need a new callback to process them from the
session processor.

include/types/stream_interface.h
src/client.c
src/proto_uxst.c

index 7e997224225bf0d8fa153b7284e7cb03aeb98b61..70b8cd596828000bf27e5be4c51fae46313eee4d 100644 (file)
@@ -83,13 +83,14 @@ struct stream_interface {
        int fd;                 /* file descriptor for a stream driver when known */
        unsigned int flags;
        unsigned int exp;       /* wake up time for connect, queue, turn-around, ... */
-       void (*update)(struct stream_interface *); /* update function */
+       void (*update)(struct stream_interface *); /* I/O update function */
        void (*shutr)(struct stream_interface *);  /* shutr function */
        void (*shutw)(struct stream_interface *);  /* shutw function */
        void (*chk_rcv)(struct stream_interface *);/* chk_rcv function */
        void (*chk_snd)(struct stream_interface *);/* chk_snd function */
        int (*connect)(struct stream_interface *, struct proxy *, struct server *,
                       struct sockaddr *, struct sockaddr *); /* connect function if any */
+       void (*iohandler)(struct stream_interface *);  /* internal I/O handler when embedded */
        struct buffer *ib, *ob; /* input and output buffers */
        unsigned int err_type;  /* first error detected, one of SI_ET_* */
        void *err_loc;          /* commonly the server, NULL when SI_ET_NONE */
index 76c91c919299cd8ce3ebbd89dd766bfd244db7f3..88c11312f95efd916c3f4d945b750ef394ec45b6 100644 (file)
@@ -197,6 +197,7 @@ int event_accept(int fd) {
                s->si[0].chk_rcv = stream_sock_chk_rcv;
                s->si[0].chk_snd = stream_sock_chk_snd;
                s->si[0].connect = NULL;
+               s->si[0].iohandler = NULL;
                s->si[0].fd = cfd;
                s->si[0].flags = SI_FL_NONE | SI_FL_CAP_SPLTCP; /* TCP splicing capable */
                s->si[0].exp = TICK_ETERNITY;
@@ -211,6 +212,7 @@ int event_accept(int fd) {
                s->si[1].chk_rcv = stream_sock_chk_rcv;
                s->si[1].chk_snd = stream_sock_chk_snd;
                s->si[1].connect = tcpv4_connect_server;
+               s->si[1].iohandler = NULL;
                s->si[1].exp = TICK_ETERNITY;
                s->si[1].fd = -1; /* just to help with debugging */
                s->si[1].flags = SI_FL_NONE;
index 60efb6dd7114642468b8353930bac36ab981526c..686d85429fca7c8f8d4aa6c5fe47891f5204a5f1 100644 (file)
@@ -451,6 +451,7 @@ int uxst_event_accept(int fd) {
                s->si[0].chk_rcv = stream_sock_chk_rcv;
                s->si[0].chk_snd = stream_sock_chk_snd;
                s->si[0].connect = NULL;
+               s->si[0].iohandler = NULL;
                s->si[0].fd = cfd;
                s->si[0].flags = SI_FL_NONE;
                s->si[0].exp = TICK_ETERNITY;
@@ -465,6 +466,7 @@ int uxst_event_accept(int fd) {
                s->si[1].chk_rcv = stream_sock_chk_rcv;
                s->si[1].chk_snd = stream_sock_chk_snd;
                s->si[1].connect = NULL;
+               s->si[1].iohandler = NULL;
                s->si[1].exp = TICK_ETERNITY;
                s->si[1].fd = -1; /* just to help with debugging */
                s->si[1].flags = SI_FL_NONE;