better handling of failures in transport to catch assertions

move wrapping the stream into the try block, even though its unlikely they will throw a failure, better be safe...
This commit is contained in:
Shay Banon 2013-07-26 12:27:46 +02:00
parent 5022c4659c
commit 3d0382b562
1 changed files with 4 additions and 4 deletions

View File

@ -186,11 +186,11 @@ public class LocalTransport extends AbstractLifecycleComponent<Transport> implem
} }
void messageReceived(byte[] data, String action, LocalTransport sourceTransport, @Nullable final Long sendRequestId) { void messageReceived(byte[] data, String action, LocalTransport sourceTransport, @Nullable final Long sendRequestId) {
transportServiceAdapter.received(data.length);
StreamInput stream = new BytesStreamInput(data, false);
stream = CachedStreamInput.cachedHandles(stream);
try { try {
transportServiceAdapter.received(data.length);
StreamInput stream = new BytesStreamInput(data, false);
stream = CachedStreamInput.cachedHandles(stream);
long requestId = stream.readLong(); long requestId = stream.readLong();
byte status = stream.readByte(); byte status = stream.readByte();
boolean isRequest = TransportStatus.isRequest(status); boolean isRequest = TransportStatus.isRequest(status);