diff options
Diffstat (limited to 'src/forward.c')
-rw-r--r-- | src/forward.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/forward.c b/src/forward.c index 54b64fe..f12a6f8 100644 --- a/src/forward.c +++ b/src/forward.c @@ -36,7 +36,7 @@ int fwd_setup(forward_ctx *ctx, const char *host, const char *port) return 1; if (ctx->fwd_cbs.on_listen(ctx, host, port)) return 1; - if (socket_connect_in(&ctx->sock, fwd_addr)) { + if (socket_connect_in(&ctx->sock, &fwd_addr)) { E_STRERR("Connection to forward socket"); return 1; } @@ -63,3 +63,11 @@ int fwd_validate_ctx(const forward_ctx *ctx) return 0; } + +int fwd_connect(forward_ctx *ctx, psocket *fwd_client) +{ + assert(ctx); + socket_clone(&ctx->sock, fwd_client); + + return socket_reconnect_in(fwd_client); +} |