diff --git a/src/protopassthrough.c b/src/protopassthrough.c index 61985d0..03e1af2 100644 --- a/src/protopassthrough.c +++ b/src/protopassthrough.c @@ -254,6 +254,13 @@ protopassthrough_bev_eventcb_connected_srvdst(struct bufferevent *bev, pxy_conn_ { log_finest("ENTER"); +#ifndef WITHOUT_USERAUTH + pxy_userauth(ctx); + if (ctx->term || ctx->enomem) { + return; + } +#endif /* !WITHOUT_USERAUTH */ + ctx->connected = 1; bufferevent_enable(bev, EV_READ|EV_WRITE); @@ -261,12 +268,6 @@ protopassthrough_bev_eventcb_connected_srvdst(struct bufferevent *bev, pxy_conn_ if (!ctx->src.bev && protopassthrough_enable_src(ctx) == -1) { return; } - -#ifndef WITHOUT_USERAUTH - if (!ctx->term && !ctx->enomem) { - pxy_userauth(ctx); - } -#endif /* !WITHOUT_USERAUTH */ } static void NONNULL(1,2) diff --git a/src/prototcp.c b/src/prototcp.c index 240ca7d..7af8590 100644 --- a/src/prototcp.c +++ b/src/prototcp.c @@ -509,6 +509,13 @@ prototcp_bev_eventcb_connected_srvdst(UNUSED struct bufferevent *bev, pxy_conn_c { log_finest("ENTER"); +#ifndef WITHOUT_USERAUTH + pxy_userauth(ctx); + if (ctx->term || ctx->enomem) { + return; + } +#endif /* !WITHOUT_USERAUTH */ + if (prototcp_setup_dst(ctx) == -1) { return; } @@ -521,12 +528,6 @@ prototcp_bev_eventcb_connected_srvdst(UNUSED struct bufferevent *bev, pxy_conn_c return; } } - -#ifndef WITHOUT_USERAUTH - if (!ctx->term && !ctx->enomem) { - pxy_userauth(ctx); - } -#endif /* !WITHOUT_USERAUTH */ } void