Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix telnet trace times is always 1 #3038

Merged
merged 6 commits into from
Jan 9, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,18 @@ public String telnet(Channel channel, String message) {
String[] parts = message.split("\\s+");
String method;
String times;
// message like : XxxService , XxxService 10 , XxxService xxxMethod , XxxService xxxMethod 10
if (service == null || service.length() == 0) {
LiZhenNet marked this conversation as resolved.
Show resolved Hide resolved
service = parts.length > 0 ? parts[0] : null;
method = parts.length > 1 ? parts[1] : null;
} else {
times = parts.length > 2 ? parts[2] : "1";
LiZhenNet marked this conversation as resolved.
Show resolved Hide resolved
} else { //message like : xxxMethod, xxxMethod 10
method = parts.length > 0 ? parts[0] : null;
times = parts.length > 1 ? parts[1] : "1";
}
if (StringUtils.isInteger(method)) {
times = method;
method = null;
} else {
times = parts.length > 2 ? parts[2] : "1";
}
if (!StringUtils.isInteger(times)) {
return "Illegal times " + times + ", must be integer.";
Expand Down