mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
More logging to debug the reliability layer.
This commit is contained in:
@@ -167,6 +167,11 @@ class ModemImpl implements Modem, WriteHandler, SerialPortEventListener {
|
||||
} else if(ev.isDSR() && ev.getEventValue() == 0) {
|
||||
if(LOG.isLoggable(INFO)) LOG.info("Remote end hung up");
|
||||
hangUp();
|
||||
} else {
|
||||
if(LOG.isLoggable(INFO)) {
|
||||
LOG.info("Serial event " + ev.getEventType() + " " +
|
||||
ev.getEventValue());
|
||||
}
|
||||
}
|
||||
} catch(IOException e) {
|
||||
if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
||||
|
||||
@@ -43,6 +43,8 @@ class ReliabilityLayer implements ReadHandler, WriteHandler {
|
||||
while(valid) {
|
||||
byte[] b = writes.take();
|
||||
if(b.length == 0) return; // Poison pill
|
||||
if(LOG.isLoggable(INFO))
|
||||
LOG.info("Writing " + b.length + " bytes");
|
||||
writeHandler.handleWrite(b);
|
||||
}
|
||||
} catch(InterruptedException e) {
|
||||
@@ -83,7 +85,7 @@ class ReliabilityLayer implements ReadHandler, WriteHandler {
|
||||
// The SLIP encoder calls this method to pass data down to the modem
|
||||
public void handleWrite(byte[] b) throws IOException {
|
||||
if(!valid) throw new IOException("Connection closed");
|
||||
if(LOG.isLoggable(INFO)) LOG.info("Writing " + b.length + " bytes");
|
||||
if(LOG.isLoggable(INFO)) LOG.info("Queueing " + b.length + " bytes");
|
||||
if(b.length > 0) writes.add(b);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user