[Ttssh2-commit] [6814] ポート転送設定関連のデバッグ用ログ出力を追加。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2017年 6月 21日 (水) 19:09:12 JST


Revision: 6814
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6814
Author:   doda
Date:     2017-06-21 19:09:12 +0900 (Wed, 21 Jun 2017)
Log Message:
-----------
ポート転送設定関連のデバッグ用ログ出力を追加。

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

-------------- next part --------------
Modified: trunk/ttssh2/ttxssh/fwd.c
===================================================================
--- trunk/ttssh2/ttxssh/fwd.c	2017-06-21 10:08:55 UTC (rev 6813)
+++ trunk/ttssh2/ttxssh/fwd.c	2017-06-21 10:09:12 UTC (rev 6814)
@@ -1137,6 +1137,45 @@
 		ptr_to_saved_sockets[i].num_listening_sockets = 0;
 	}
 
+	//
+	// \x91\xBC\x82\xCC LOG_LEVEL_VERBOSE \x82ŏo\x97͂\xB5\x82Ă\xA2\x82郍\x83O\x82ɔ\xE4\x82ׂāA
+	// \x82\xB3\x82\xE7\x82ɍ\x82\x82\xA2\x83\x8D\x83O\x83\x8C\x83x\x83\x8B\x82ŏo\x97͂\xB5\x82\xBD\x82\xA2\x82̂Ŏb\x92\xE8\x82\xC5 150 \x82ɂ\xB7\x82\xE9\x81B
+	// \x91\xBC\x82̂\xE0\x8A܂߂\xC4 LOG_LEVEL \x82𐮗\x9D\x82\xB5\x82\xBD\x82\xA2\x81c\x81c
+	//
+	if (LogLevel(pvar, 150)) {
+		logprintf(150, __FUNCTION__ ": old specs: %d", pvar->fwd_state.num_requests);
+		for (i=0; i < pvar->fwd_state.num_requests; i++) {
+			FWDRequestSpec *spec = &pvar->fwd_state.requests[i].spec;
+			char *ftype, *bind_addr = spec->bind_address;
+			switch (spec->type) {
+			  case FWD_LOCAL_TO_REMOTE: ftype = "LtoR"; break;
+			  case FWD_REMOTE_TO_LOCAL: ftype = "RtoL"; break;
+			  case FWD_REMOTE_X11_TO_LOCAL: ftype = "X11"; bind_addr = ftype; break;
+			  default: ftype = "Unknown"; break;
+			}
+			logprintf(150, "  request %d: type=%s, bind_address=%s, "
+				"from_port=%d, to_host=%s, to_port=%d, %s",
+				i, ftype, bind_addr, spec->from_port,
+				spec->to_host, spec->to_port,
+				(pvar->fwd_state.requests[i].status&FWD_DELETED)?"deleted, ":"");
+		}
+		logprintf(150, __FUNCTION__ ": listening specs: %d", pvar->fwd_state.num_server_listening_specs);
+		for (i=0; i < pvar->fwd_state.num_server_listening_specs; i++) {
+			FWDRequestSpec *listener = &pvar->fwd_state.server_listening_specs[i];
+			char *ftype, *bind_addr = listener->bind_address;
+			switch (listener->type) {
+			  case FWD_LOCAL_TO_REMOTE: ftype = "LtoR"; break;
+			  case FWD_REMOTE_TO_LOCAL: ftype = "RtoL"; break;
+			  case FWD_REMOTE_X11_TO_LOCAL: ftype = "X11";  bind_addr = ftype; break;
+			  default: ftype = "Unknown"; break;
+			}
+			logprintf(150, "  listen %d: type=%s, bind_address=%s, "
+				"from_port=%d, to_host=%s, to_port=%d, %s",
+				i, ftype, bind_addr, listener->from_port,
+				listener->to_host, listener->to_port, "");
+		}
+	}
+
 	for (i = pvar->fwd_state.num_requests - 1; i >= 0; i--) {
 		if ((pvar->fwd_state.requests[i].status & FWD_DELETED) == 0) {
 			FWDRequestSpec *cur_spec =



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