2004-11-08 jrandom

* Make the SAM bridge more resiliant to bad handshakes (thanks duck!)
This commit is contained in:
jrandom
2004-11-08 03:18:01 +00:00
committed by zzz
parent 9018af4765
commit 096b807c37
3 changed files with 13 additions and 3 deletions

View File

@@ -152,6 +152,8 @@ public class SAMHandlerFactory {
/* Get the major protocol version from a string */
private static int getMajor(String ver) {
if ( (ver == null) || (ver.indexOf('.') < 0) )
return -1;
try {
String major = ver.substring(0, ver.indexOf("."));
return Integer.parseInt(major);
@@ -164,6 +166,8 @@ public class SAMHandlerFactory {
/* Get the minor protocol version from a string */
private static int getMinor(String ver) {
if ( (ver == null) || (ver.indexOf('.') < 0) )
return -1;
try {
String major = ver.substring(ver.indexOf(".") + 1);
return Integer.parseInt(major);