ObjectDownloadListener#onWritePossible: Add comment on return statement

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>
This commit is contained in:
David Ostrovsky 2018-09-25 08:20:57 +02:00 committed by David Ostrovsky
parent 0de8e1e65c
commit e5a4c0d17e
1 changed files with 4 additions and 0 deletions

View File

@ -134,6 +134,10 @@ public void onWritePossible() throws IOException {
} 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;
}
}