return t;
}
+static int xprt_handshake_start(struct connection *conn, void *xprt_ctx)
+{
+ struct xprt_handshake_ctx *ctx = xprt_ctx;
+
+ if (ctx->xprt->start) {
+ int ret;
+
+ ret = ctx->xprt->start(conn, ctx->xprt_ctx);
+ if (ret < 0)
+ return ret;
+ }
+ tasklet_wakeup(ctx->wait_event.tasklet);
+
+ return 0;
+}
+
static int xprt_handshake_init(struct connection *conn, void **xprt_ctx)
{
struct xprt_handshake_ctx *ctx;
ctx->wait_event.tasklet->process = xprt_handshake_io_cb;
ctx->wait_event.tasklet->context = ctx;
ctx->wait_event.events = 0;
- /* This XPRT expects the underlying XPRT to be provided later,
- * with an add_xprt() call, so we start trying to do the handshake
- * there, when we'll be provided an XPRT.
- */
+
ctx->xprt = NULL;
ctx->xprt_ctx = NULL;
ctx->subs = NULL;
*oldxprt_ctx = ctx->xprt_ctx;
ctx->xprt = toadd_ops;
ctx->xprt_ctx = toadd_ctx;
- /* Ok we know have an xprt, so let's try to do the handshake */
- tasklet_wakeup(ctx->wait_event.tasklet);
+
return 0;
}
.remove_xprt = xprt_handshake_remove_xprt,
.add_xprt = xprt_handshake_add_xprt,
.init = xprt_handshake_init,
+ .start = xprt_handshake_start,
.close= xprt_handshake_close,
.rcv_pipe = NULL,
.snd_pipe = NULL,