[Ttssh2-commit] [6903] RtoL の forwarding 追加時にサーバ側へ転送要求を出すようにした。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2017年 8月 25日 (金) 23:48:00 JST


Revision: 6903
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6903
Author:   doda
Date:     2017-08-25 23:48:00 +0900 (Fri, 25 Aug 2017)
Log Message:
-----------
RtoL の forwarding 追加時にサーバ側へ転送要求を出すようにした。

取りあえず追加した転送が使えるようになったが、内部での管理状態をちゃんと更新していないので細かい不具合が出るかも。

Modified Paths:
--------------
    trunk/ttssh2/ttxssh/fwd.c

-------------- next part --------------
Modified: trunk/ttssh2/ttxssh/fwd.c
===================================================================
--- trunk/ttssh2/ttxssh/fwd.c	2017-08-25 14:47:57 UTC (rev 6902)
+++ trunk/ttssh2/ttxssh/fwd.c	2017-08-25 14:48:00 UTC (rev 6903)
@@ -1093,6 +1093,21 @@
 		}
 		freeaddrinfo(res0);
 	}
+	else if (request->spec.type == FWD_REMOTE_TO_LOCAL) {
+		if (SSHv2(pvar)) {
+			FWDRequestSpec *listener =
+				bsearch(&request->spec, pvar->fwd_state.server_listening_specs,
+					pvar->fwd_state.num_server_listening_specs,
+				        sizeof(FWDRequestSpec), FWD_compare_specs);
+			if (listener == NULL) {
+				SSH_request_forwarding(pvar,
+				                       request->spec.bind_address,
+				                       request->spec.from_port,
+				                       request->spec.to_host,
+				                       request->spec.to_port);
+			}
+		}
+	}
 
 	return TRUE;
 }



Ttssh2-commit メーリングリストの案内
Back to archive index