mirror of
https://github.com/libssh2/libssh2.git
synced 2025-07-29 13:01:14 +03:00
@ -192,7 +192,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
fprintf(stderr, "Asking server to listen on remote %s:%d\n",
|
||||
remote_listenhost, remote_wantport);
|
||||
remote_listenhost, remote_wantport);
|
||||
|
||||
listener = libssh2_channel_forward_listen_ex(session, remote_listenhost,
|
||||
remote_wantport, &remote_listenport, 1);
|
||||
@ -204,7 +204,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
fprintf(stderr, "Server is listening on %s:%d\n", remote_listenhost,
|
||||
remote_listenport);
|
||||
remote_listenport);
|
||||
|
||||
fprintf(stderr, "Waiting for remote connection\n");
|
||||
channel = libssh2_channel_forward_accept(listener);
|
||||
@ -216,8 +216,8 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
fprintf(stderr,
|
||||
"Accepted remote connection. Connecting to local server %s:%d\n",
|
||||
local_destip, local_destport);
|
||||
"Accepted remote connection. Connecting to local server %s:%d\n",
|
||||
local_destip, local_destport);
|
||||
forwardsock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
if(forwardsock == LIBSSH2_INVALID_SOCKET) {
|
||||
fprintf(stderr, "failed to open forward socket.\n");
|
||||
@ -237,7 +237,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
fprintf(stderr, "Forwarding connection from remote %s:%d to local %s:%d\n",
|
||||
remote_listenhost, remote_listenport, local_destip, local_destport);
|
||||
remote_listenhost, remote_listenport, local_destip, local_destport);
|
||||
|
||||
/* Must use non-blocking IO hereafter due to the current libssh2 API */
|
||||
libssh2_session_set_blocking(session, 0);
|
||||
@ -261,7 +261,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else if(len == 0) {
|
||||
fprintf(stderr, "The local server at %s:%d disconnected.\n",
|
||||
local_destip, local_destport);
|
||||
local_destip, local_destport);
|
||||
goto shutdown;
|
||||
}
|
||||
wr = 0;
|
||||
@ -296,7 +296,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
if(libssh2_channel_eof(channel)) {
|
||||
fprintf(stderr, "The remote client at %s:%d disconnected.\n",
|
||||
remote_listenhost, remote_listenport);
|
||||
remote_listenhost, remote_listenport);
|
||||
goto shutdown;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user