]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] change type of fdtab[]->owner to void*
authorWilly Tarreau <w@1wt.eu>
Fri, 29 Aug 2008 21:36:51 +0000 (23:36 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 2 Nov 2008 09:19:08 +0000 (10:19 +0100)
The owner of an fd was initially a task but this was sometimes
casted to a (struct listener *). We'll soon need more types,
so void* is more appropriate.

include/types/fd.h
src/client.c
src/proto_tcp.c
src/proto_uxst.c

index 7d746f04791c9da29e97767cd00e236234d23f68..97e14b14d45746b3b302d63c823a4b2111881c77 100644 (file)
@@ -65,7 +65,7 @@ struct fdtab {
                int (*f)(int fd);            /* read/write function */
                struct buffer *b;            /* read/write buffer */
        } cb[DIR_SIZE];
-       struct task *owner;                  /* the session (or proxy) associated with this fd */
+       void *owner;                         /* the session (or proxy) associated with this fd */
        unsigned char state;                 /* the state of this fd */
        unsigned char ev;                    /* event seen in return of poll() : FD_POLL_* */
        struct sockaddr *peeraddr;           /* pointer to peer's network address, or NULL if unset */
index 5ff1abe796b78adf8a6ab054e750fe2b4f5352ca..1f577d1be8ca248dbf030efc112a5bd274f0ebcb 100644 (file)
@@ -60,7 +60,7 @@ void get_frt_addr(struct session *s)
  * It returns 0.
  */
 int event_accept(int fd) {
-       struct listener *l = (struct listener *)fdtab[fd].owner;
+       struct listener *l = fdtab[fd].owner;
        struct proxy *p = (struct proxy *)l->private; /* attached frontend */
        struct session *s;
        struct http_txn *txn;
index 0cf1e0e98086126f6f6833f12552d8d6f6ca498d..32c4994cef82a33e9fc8b54328e933fc4f60fca7 100644 (file)
@@ -263,7 +263,7 @@ int tcp_bind_listener(struct listener *listener, char *errmsg, int errlen)
        fdtab[fd].cb[DIR_RD].f = listener->accept;
        fdtab[fd].cb[DIR_WR].f = NULL; /* never called */
        fdtab[fd].cb[DIR_RD].b = fdtab[fd].cb[DIR_WR].b = NULL;
-       fdtab[fd].owner = (struct task *)listener; /* reference the listener instead of a task */
+       fdtab[fd].owner = listener; /* reference the listener instead of a task */
        fdtab[fd].state = FD_STLISTEN;
        fdtab[fd].peeraddr = NULL;
        fdtab[fd].peerlen = 0;
index 4eab55efbbf7fc2111cb84ee12baed88ca5b433c..dc2b93388bc58dbf89f7d86a755fe5e276ea44c3 100644 (file)
@@ -266,7 +266,7 @@ static int uxst_bind_listener(struct listener *listener)
        fdtab[fd].cb[DIR_RD].f = listener->accept;
        fdtab[fd].cb[DIR_WR].f = NULL; /* never called */
        fdtab[fd].cb[DIR_RD].b = fdtab[fd].cb[DIR_WR].b = NULL;
-       fdtab[fd].owner = (struct task *)listener; /* reference the listener instead of a task */
+       fdtab[fd].owner = listener; /* reference the listener instead of a task */
        fdtab[fd].state = FD_STLISTEN;
        fdtab[fd].peeraddr = NULL;
        fdtab[fd].peerlen = 0;
@@ -358,7 +358,7 @@ static int uxst_unbind_listeners(struct protocol *proto)
  * as with TCP which can fall under attack.
  */
 int uxst_event_accept(int fd) {
-       struct listener *l = (struct listener *)fdtab[fd].owner;
+       struct listener *l = fdtab[fd].owner;
        struct session *s;
        struct task *t;
        int cfd;