[MAJOR] frontend: split accept() into frontend_accept() and session_accept()
A new function session_accept() is now called from the lower layer to
instanciate a new session. Once the session is instanciated, the upper
layer's frontent_accept() is called. This one can be service-dependant.
That way, we have a 3-phase accept() sequence :
1) protocol-specific, session-less accept(), which is pointed to by
the listener. It defaults to the generic stream_sock_accept().
2) session_accept() which relies on a frontend but not necessarily
for use in a proxy (eg: stats or any future service).
3) frontend_accept() which performs the accept for the service
offerred by the frontend. It defaults to frontend_accept() which
is really what is used by a proxy.
The TCP/HTTP proxies have been moved to this mode so that we can now rely on
frontend_accept() for any type of session initialization relying on a frontend.
The next step will be to convert the stats to use the same system for the stats.
diff --git a/include/proto/frontend.h b/include/proto/frontend.h
index 61e0460..796ebbb 100644
--- a/include/proto/frontend.h
+++ b/include/proto/frontend.h
@@ -26,7 +26,7 @@
#include <types/session.h>
void get_frt_addr(struct session *s);
-int frontend_accept(struct listener *l, int cfd, struct sockaddr_storage *addr);
+int frontend_accept(struct session *s);
#endif /* _PROTO_FRONTEND_H */
diff --git a/include/proto/session.h b/include/proto/session.h
index 737e065..c7a693e 100644
--- a/include/proto/session.h
+++ b/include/proto/session.h
@@ -1,23 +1,23 @@
/*
- include/proto/session.h
- This file defines everything related to sessions.
-
- Copyright (C) 2000-2008 Willy Tarreau - w@1wt.eu
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation, version 2.1
- exclusively.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/
+ * include/proto/session.h
+ * This file defines everything related to sessions.
+ *
+ * Copyright (C) 2000-2010 Willy Tarreau - w@1wt.eu
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation, version 2.1
+ * exclusively.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
#ifndef _PROTO_SESSION_H
#define _PROTO_SESSION_H
@@ -29,6 +29,7 @@
extern struct pool_head *pool2_session;
extern struct list sessions;
+int session_accept(struct listener *l, int cfd, struct sockaddr_storage *addr);
void session_free(struct session *s);
/* perform minimal intializations, report 0 in case of error, 1 if OK. */