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

@ -280,8 +280,11 @@ public class SAMBridge implements Runnable {
if (_log.shouldLog(Log.ERROR))
_log.error("SAM Error sending error reply", ioe);
}
s.close();
}
try { s.close(); } catch (IOException ioe) {}
} catch (Exception ee) {
try { s.close(); } catch (IOException ioe) {}
_log.log(Log.CRIT, "Unexpected error handling SAM connection", ee);
}
}
} catch (Exception e) {
if (_log.shouldLog(Log.ERROR))

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);

View File

@ -1,4 +1,7 @@
$Id: history.txt,v 1.65 2004/11/06 21:25:13 jrandom Exp $
$Id: history.txt,v 1.66 2004/11/06 22:00:56 jrandom Exp $
2004-11-08 jrandom
* Make the SAM bridge more resiliant to bad handshakes (thanks duck!)
* 2004-11-06 0.4.1.4 released