]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: connection: add an init callback to the data_cb struct
authorWilly Tarreau <w@1wt.eu>
Tue, 2 Oct 2012 23:12:30 +0000 (01:12 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 4 Oct 2012 20:26:10 +0000 (22:26 +0200)
This callback is used to initialize the data layer.

include/types/connection.h

index c8858c36f9a1109dfe119ae43621a9342e8edfde..ddc610e2b2be781ddeeaa6e17d7c875e6b6f9f10 100644 (file)
@@ -174,12 +174,15 @@ struct xprt_ops {
  * callbacks are supposed to make use of the xprt_ops above to exchange data
  * from/to buffers and pipes. The <wake> callback is used to report activity
  * at the transport layer, which can be a connection opening/close, or any
- * data movement.
+ * data movement. The <init> callback may be called by the connection handler
+ * at the end of a transport handshake, when it is about to transfer data and
+ * the data layer is not ready yet.
  */
 struct data_cb {
        void (*recv)(struct connection *conn);  /* data-layer recv callback */
        void (*send)(struct connection *conn);  /* data-layer send callback */
        void (*wake)(struct connection *conn);  /* data-layer callback to report activity */
+       int  (*init)(struct connection *conn);  /* data-layer initialization */
 };
 
 /* a target describes what is on the remote side of the connection. */