]> source.dussan.org Git - jgit.git/commitdiff
ObjectDownloadListener#onWritePossible: Add comment on return statement 98/129898/2
authorDavid Ostrovsky <david@ostrovsky.org>
Tue, 25 Sep 2018 06:20:57 +0000 (08:20 +0200)
committerDavid Ostrovsky <d.ostrovsky@gmx.de>
Tue, 25 Sep 2018 08:31:41 +0000 (03:31 -0500)
It is not obvious why this return statement is needed. Clarify with a
comment that otherwise endless loop may show up when recent versions
of Jetty are used.

Change-Id: I8e5d4de51869fb1179bf599bfb81bcd7d745874b
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectDownloadListener.java

index 60258602f1335d4a18ac3569a58f4810c668fdb8..2dc9493f3f5c233208ec844d5cec733afbbfe872 100644 (file)
@@ -134,6 +134,10 @@ public class ObjectDownloadListener implements WriteListener {
                                        } finally {
                                                context.complete();
                                        }
+                                       // This is need to avoid endless loop in recent Jetty versions.
+                                       // That's because out.isReady() is returning true for already
+                                       // closed streams and because out.close() doesn't throw any
+                                       // exception any more when trying to close already closed stream.
                                        return;
                                }
                        }