diff options
author | David Ostrovsky <david@ostrovsky.org> | 2018-09-15 21:09:51 +0200 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2018-09-15 19:20:55 -0500 |
commit | f8e514c74a039209488ef56948c784c00a1d87b3 (patch) | |
tree | f5ac5280752a8e6cd60ba0b95853318afe53fbb0 /org.eclipse.jgit.lfs.server/src | |
parent | e6e9073fc790009f4f7c1b31e5cfea1474972ecc (diff) | |
download | jgit-f8e514c74a039209488ef56948c784c00a1d87b3.tar.gz jgit-f8e514c74a039209488ef56948c784c00a1d87b3.zip |
ObjectDownloadListener: Return from onWritePossible when data is written
When buffer was written not only call AsyncContext#complete() but also
return from the ObjectDownloadListener#onWritePossible(). This avoids
endless loop after upgrading from Jetty 9.3.x to 9.4.x lines.
In Jetty example implementation:[1] the return statemnt is also used:
// If we are at EOF then complete
if (len < 0)
{
async.complete();
return;
}
See also this issue upstream: [2].
[1] https://webtide.com/servlet-3-1-async-io-and-jetty
[2] https://github.com/eclipse/jetty.project/issues/2911
Change-Id: Iac73fb25e67d40228a378a8e34103f1d28b72a76
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
Diffstat (limited to 'org.eclipse.jgit.lfs.server/src')
-rw-r--r-- | org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectDownloadListener.java | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectDownloadListener.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectDownloadListener.java index cc4350090f..0b96426420 100644 --- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectDownloadListener.java +++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectDownloadListener.java @@ -127,6 +127,7 @@ public class ObjectDownloadListener implements WriteListener { outChannel.write(buffer); } else { context.complete(); + return; } } } |