Fix incorrect port range check

Motivation:

In the Internet Protocol, the valid port number range is from 1 to 65535
(inclusive on the both side.)  However, SocksCmdRequest refuses to
construct itself when the port number 65535 is specified.

Modification:

Do not raise an exception when the specified port number is 65535.

Result:

Fixes #2428
This commit is contained in:
Trustin Lee 2014-04-29 17:55:13 +09:00
parent e8b5f19b82
commit 01ef614e77

View File

@ -63,7 +63,7 @@ public final class SocksCmdRequest extends SocksRequest {
case UNKNOWN:
break;
}
if (port < 0 && port >= 65535) {
if (port < 0 && port >= 65536) {
throw new IllegalArgumentException(port + " is not in bounds 0 < x < 65536");
}
this.cmdType = cmdType;