summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-04-25 11:18:51 +0200
committerKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-04-25 11:18:51 +0200
commitc665fed11821f24dc99f71f77f297d404316cb24 (patch)
tree1b2d489cceae107756a4a502a27cbdc2d740fc9f
parentbeca45333ed2139b82f45fbe0d408f36c5f5f984 (diff)
Fix timeout bug.
-rw-r--r--src/main/java/com/orbekk/protobuf/RpcChannel.java4
-rw-r--r--src/test/java/com/orbekk/protobuf/ProtobufFunctionalTest.java2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/com/orbekk/protobuf/RpcChannel.java b/src/main/java/com/orbekk/protobuf/RpcChannel.java
index 9c52651..594cff8 100644
--- a/src/main/java/com/orbekk/protobuf/RpcChannel.java
+++ b/src/main/java/com/orbekk/protobuf/RpcChannel.java
@@ -80,7 +80,9 @@ public class RpcChannel implements com.google.protobuf.RpcChannel {
@Override
public void run() {
RequestMetadata request = ongoingRequests.remove(id);
- cancelRequest(request, "timeout");
+ if (request != null) {
+ cancelRequest(request, "timeout");
+ }
}
}
diff --git a/src/test/java/com/orbekk/protobuf/ProtobufFunctionalTest.java b/src/test/java/com/orbekk/protobuf/ProtobufFunctionalTest.java
index a1661d2..55cb2cf 100644
--- a/src/test/java/com/orbekk/protobuf/ProtobufFunctionalTest.java
+++ b/src/test/java/com/orbekk/protobuf/ProtobufFunctionalTest.java
@@ -167,7 +167,7 @@ public class ProtobufFunctionalTest {
final CountDownLatch stop = new CountDownLatch(1);
final Rpc rpc = new Rpc();
- rpc.setTimout(1);
+ rpc.setTimeout(1);
service.testC(rpc, request, new RpcCallback<Type2>() {
@Override public void run(Type2 result) {
stop.countDown();