* I2PTunnelRunner: Remove unnecessary lock (ticket #690)

This commit is contained in:
zzz
2012-08-20 12:10:10 +00:00
parent 05516f3260
commit 6c2eb317fe

View File

@@ -145,7 +145,7 @@ public class I2PTunnelRunner extends I2PAppThread implements I2PSocket.SocketErr
OutputStream i2pout = i2ps.getOutputStream(); //new BufferedOutputStream(i2ps.getOutputStream(), MAX_PACKET_SIZE); OutputStream i2pout = i2ps.getOutputStream(); //new BufferedOutputStream(i2ps.getOutputStream(), MAX_PACKET_SIZE);
if (initialI2PData != null) { if (initialI2PData != null) {
// why synchronize this? we could be in here a LONG time for large initial data // why synchronize this? we could be in here a LONG time for large initial data
synchronized (slock) { //synchronized (slock) {
// this does not increment totalSent // this does not increment totalSent
i2pout.write(initialI2PData); i2pout.write(initialI2PData);
// do NOT flush here, it will block and then onTimeout.run() won't happen on fail. // do NOT flush here, it will block and then onTimeout.run() won't happen on fail.
@@ -159,7 +159,7 @@ public class I2PTunnelRunner extends I2PAppThread implements I2PSocket.SocketErr
// only flush if it fits in one message. // only flush if it fits in one message.
if (initialI2PData.length <= 1730) // ConnectionOptions.DEFAULT_MAX_MESSAGE_SIZE if (initialI2PData.length <= 1730) // ConnectionOptions.DEFAULT_MAX_MESSAGE_SIZE
i2pout.flush(); i2pout.flush();
} //}
} }
if (initialSocketData != null) { if (initialSocketData != null) {
// this does not increment totalReceived // this does not increment totalReceived