-1
-5 merge of '8dc3dbded4d489ddca319052bf3cdb0c4d5a13cc' and 'afcd808741bf31d75eee2639e19d5e8946b62756'
This commit is contained in:
@ -107,11 +107,26 @@ public class SAMv1Handler extends SAMHandler implements SAMRawReceiver, SAMDatag
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
msg = DataHelper.readLine(getClientSocket().socket().getInputStream()).trim();
|
SocketChannel clientSocketChannel = getClientSocket() ;
|
||||||
if (msg == null) {
|
if (clientSocketChannel == null) {
|
||||||
_log.debug("Connection closed by client");
|
_log.info("Connection closed by client");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (clientSocketChannel.socket() == null) {
|
||||||
|
_log.info("Connection closed by client");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
java.io.InputStream is = clientSocketChannel.socket().getInputStream();
|
||||||
|
if (is == null) {
|
||||||
|
_log.info("Connection closed by client");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
msg = DataHelper.readLine(is);
|
||||||
|
if (msg == null) {
|
||||||
|
_log.info("Connection closed by client (line read : null)");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
msg = msg.trim();
|
||||||
|
|
||||||
if (_log.shouldLog(Log.DEBUG)) {
|
if (_log.shouldLog(Log.DEBUG)) {
|
||||||
_log.debug("New message received: [" + msg + "]");
|
_log.debug("New message received: [" + msg + "]");
|
||||||
|
@ -38,7 +38,7 @@ public class SAMv3DatagramSession extends SAMDatagramSession implements SAMv3Han
|
|||||||
* @throws I2PSessionException
|
* @throws I2PSessionException
|
||||||
*/
|
*/
|
||||||
public SAMv3DatagramSession(String nick)
|
public SAMv3DatagramSession(String nick)
|
||||||
throws IOException, DataFormatException, I2PSessionException {
|
throws IOException, DataFormatException, I2PSessionException, SAMException {
|
||||||
|
|
||||||
super(SAMv3Handler.sSessionsHash.get(nick).getDest(),
|
super(SAMv3Handler.sSessionsHash.get(nick).getDest(),
|
||||||
SAMv3Handler.sSessionsHash.get(nick).getProps(),
|
SAMv3Handler.sSessionsHash.get(nick).getProps(),
|
||||||
@ -49,7 +49,7 @@ public class SAMv3DatagramSession extends SAMDatagramSession implements SAMv3Han
|
|||||||
this.server = SAMv3Handler.DatagramServer.getInstance() ;
|
this.server = SAMv3Handler.DatagramServer.getInstance() ;
|
||||||
|
|
||||||
SAMv3Handler.SessionRecord rec = SAMv3Handler.sSessionsHash.get(nick);
|
SAMv3Handler.SessionRecord rec = SAMv3Handler.sSessionsHash.get(nick);
|
||||||
if ( rec==null ) throw new InterruptedIOException() ;
|
if ( rec==null ) throw new SAMException("Record disappeared for nickname : \""+nick+"\"") ;
|
||||||
|
|
||||||
this.handler = rec.getHandler();
|
this.handler = rec.getHandler();
|
||||||
|
|
||||||
|
@ -564,7 +564,7 @@ public class SAMv3Handler extends SAMv1Handler
|
|||||||
_log.debug("I2P error when instantiating session", e);
|
_log.debug("I2P error when instantiating session", e);
|
||||||
return writeString("SESSION STATUS RESULT=I2P_ERROR DESTINATION=" + dest + " MESSAGE=\"" + e.getMessage() + "\"\n");
|
return writeString("SESSION STATUS RESULT=I2P_ERROR DESTINATION=" + dest + " MESSAGE=\"" + e.getMessage() + "\"\n");
|
||||||
} catch (SAMException e) {
|
} catch (SAMException e) {
|
||||||
_log.error("Unexpected SAM error", e);
|
_log.info("Funny SAM error", e);
|
||||||
return writeString("SESSION STATUS RESULT=I2P_ERROR DESTINATION=" + dest + " MESSAGE=\"" + e.getMessage() + "\"\n");
|
return writeString("SESSION STATUS RESULT=I2P_ERROR DESTINATION=" + dest + " MESSAGE=\"" + e.getMessage() + "\"\n");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
_log.error("Unexpected IOException", e);
|
_log.error("Unexpected IOException", e);
|
||||||
|
@ -197,7 +197,7 @@ public class SAMv3StreamSession extends SAMStreamSession implements SAMv3Handle
|
|||||||
|
|
||||||
SAMv3Handler.SessionRecord rec = SAMv3Handler.sSessionsHash.get(nick);
|
SAMv3Handler.SessionRecord rec = SAMv3Handler.sSessionsHash.get(nick);
|
||||||
|
|
||||||
if ( rec==null ) throw new InterruptedIOException() ;
|
if ( rec==null || i2ps==null ) throw new InterruptedIOException() ;
|
||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
handler.notifyStreamIncomingConnection(i2ps.getPeerDestination()) ;
|
handler.notifyStreamIncomingConnection(i2ps.getPeerDestination()) ;
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
2009-05-24 mkvore
|
||||||
|
* SAM: logging some exceptions at INFO level instead of ERROR
|
||||||
|
|
||||||
2009-05-24 zzz
|
2009-05-24 zzz
|
||||||
* Connection limits / throttle:
|
* Connection limits / throttle:
|
||||||
- Better limits when no inbound TCP
|
- Better limits when no inbound TCP
|
||||||
|
@ -18,7 +18,7 @@ public class RouterVersion {
|
|||||||
/** deprecated */
|
/** deprecated */
|
||||||
public final static String ID = "Monotone";
|
public final static String ID = "Monotone";
|
||||||
public final static String VERSION = CoreVersion.VERSION;
|
public final static String VERSION = CoreVersion.VERSION;
|
||||||
public final static long BUILD = 4;
|
public final static long BUILD = 5;
|
||||||
/** for example "-test" */
|
/** for example "-test" */
|
||||||
public final static String EXTRA = "";
|
public final static String EXTRA = "";
|
||||||
public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA;
|
public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA;
|
||||||
|
Reference in New Issue
Block a user