diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2020-10-15 13:25:25 +0200 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2020-10-15 13:25:25 +0200 |
commit | f0f17fa797862f5cf90be73864c46abf82ec2952 (patch) | |
tree | 8db914267fbcf2f7cf0479b3c579c56f9549a017 /vespaclient-container-plugin/src/main/java/com | |
parent | 1a3f3ebaecd62fa59442d6659bc4ed7565441de5 (diff) |
Be less stupid and do not consume all content yourself
Diffstat (limited to 'vespaclient-container-plugin/src/main/java/com')
-rw-r--r-- | vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java b/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java index 3192c09184c..68e47bf81ad 100644 --- a/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java +++ b/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java @@ -614,9 +614,9 @@ public class DocumentV1ApiHandler extends AbstractRequestHandler { boolean dispatch() { if (request.isCancelled()) return true; - + if ( ! lock.tryLock()) - throw new IllegalStateException("Comcurrent attempts at dispatch — this is a bug"); + throw new IllegalStateException("Concurrent attempts at dispatch — this is a bug"); try { if (operation == null) @@ -679,9 +679,7 @@ public class DocumentV1ApiHandler extends AbstractRequestHandler { public void close(CompletionHandler handler) { try { delegate.close(logException); - try (UnsafeContentInputStream in = new UnsafeContentInputStream(delegate)) { - reader.accept(in); - } + reader.accept(new UnsafeContentInputStream(delegate)); handler.completed(); } catch (Exception e) { |