2006-09-26 Complication
* Take back another inadverent logging change in NTCPConnection
This commit is contained in:
@ -1,4 +1,7 @@
|
|||||||
$Id: history.txt,v 1.526 2006-09-26 23:02:13 complication Exp $
|
$Id: history.txt,v 1.527 2006-09-26 23:31:34 complication Exp $
|
||||||
|
|
||||||
|
2006-09-26 Complication
|
||||||
|
* Take back another inadverent logging change in NTCPConnection
|
||||||
|
|
||||||
2006-09-26 Complication
|
2006-09-26 Complication
|
||||||
* Take back an accidental log level change
|
* Take back an accidental log level change
|
||||||
|
@ -1011,11 +1011,10 @@ public class NTCPConnection implements FIFOBandwidthLimiter.CompleteListener {
|
|||||||
|
|
||||||
private void sendMeta() {
|
private void sendMeta() {
|
||||||
byte encrypted[] = new byte[_meta.length];
|
byte encrypted[] = new byte[_meta.length];
|
||||||
long ts = _context.clock().now()/1000;
|
|
||||||
synchronized (_meta) {
|
synchronized (_meta) {
|
||||||
_context.random().nextBytes(_meta); // randomize the uninterpreted, then overwrite w/ data
|
_context.random().nextBytes(_meta); // randomize the uninterpreted, then overwrite w/ data
|
||||||
DataHelper.toLong(_meta, 0, 2, 0);
|
DataHelper.toLong(_meta, 0, 2, 0);
|
||||||
DataHelper.toLong(_meta, 2, 4, ts);
|
DataHelper.toLong(_meta, 2, 4, _context.clock().now()/1000);
|
||||||
Adler32 crc = new Adler32();
|
Adler32 crc = new Adler32();
|
||||||
crc.update(_meta, 0, _meta.length-4);
|
crc.update(_meta, 0, _meta.length-4);
|
||||||
DataHelper.toLong(_meta, _meta.length-4, 4, crc.getValue());
|
DataHelper.toLong(_meta, _meta.length-4, 4, crc.getValue());
|
||||||
@ -1024,7 +1023,7 @@ public class NTCPConnection implements FIFOBandwidthLimiter.CompleteListener {
|
|||||||
System.arraycopy(encrypted, encrypted.length-16, _prevWriteEnd, 0, _prevWriteEnd.length);
|
System.arraycopy(encrypted, encrypted.length-16, _prevWriteEnd, 0, _prevWriteEnd.length);
|
||||||
// perhaps this should skip the bw limiter to reduce clock skew issues?
|
// perhaps this should skip the bw limiter to reduce clock skew issues?
|
||||||
if (_log.shouldLog(Log.DEBUG))
|
if (_log.shouldLog(Log.DEBUG))
|
||||||
_log.debug("Sending NTCP metadata with timestamp " + ts);
|
_log.debug("Sending NTCP metadata");
|
||||||
_sendingMeta = true;
|
_sendingMeta = true;
|
||||||
_transport.getPumper().wantsWrite(this, encrypted);
|
_transport.getPumper().wantsWrite(this, encrypted);
|
||||||
// enqueueInfoMessage(); // this often?
|
// enqueueInfoMessage(); // this often?
|
||||||
|
Reference in New Issue
Block a user