mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-19 22:29:53 +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) {
|
} else if(ev.isDSR() && ev.getEventValue() == 0) {
|
||||||
if(LOG.isLoggable(INFO)) LOG.info("Remote end hung up");
|
if(LOG.isLoggable(INFO)) LOG.info("Remote end hung up");
|
||||||
hangUp();
|
hangUp();
|
||||||
|
} else {
|
||||||
|
if(LOG.isLoggable(INFO)) {
|
||||||
|
LOG.info("Serial event " + ev.getEventType() + " " +
|
||||||
|
ev.getEventValue());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch(IOException e) {
|
} catch(IOException e) {
|
||||||
if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ class ReliabilityLayer implements ReadHandler, WriteHandler {
|
|||||||
while(valid) {
|
while(valid) {
|
||||||
byte[] b = writes.take();
|
byte[] b = writes.take();
|
||||||
if(b.length == 0) return; // Poison pill
|
if(b.length == 0) return; // Poison pill
|
||||||
|
if(LOG.isLoggable(INFO))
|
||||||
|
LOG.info("Writing " + b.length + " bytes");
|
||||||
writeHandler.handleWrite(b);
|
writeHandler.handleWrite(b);
|
||||||
}
|
}
|
||||||
} catch(InterruptedException e) {
|
} 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
|
// The SLIP encoder calls this method to pass data down to the modem
|
||||||
public void handleWrite(byte[] b) throws IOException {
|
public void handleWrite(byte[] b) throws IOException {
|
||||||
if(!valid) throw new IOException("Connection closed");
|
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);
|
if(b.length > 0) writes.add(b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user