diff --git a/jetty-fcgi/fcgi-server/src/main/java/org/eclipse/jetty/fcgi/server/HttpChannelOverFCGI.java b/jetty-fcgi/fcgi-server/src/main/java/org/eclipse/jetty/fcgi/server/HttpChannelOverFCGI.java index 5759121ca55..162023424bc 100644 --- a/jetty-fcgi/fcgi-server/src/main/java/org/eclipse/jetty/fcgi/server/HttpChannelOverFCGI.java +++ b/jetty-fcgi/fcgi-server/src/main/java/org/eclipse/jetty/fcgi/server/HttpChannelOverFCGI.java @@ -123,8 +123,11 @@ public class HttpChannelOverFCGI extends HttpChannel _contentQueue.clear(); } copy.forEach(c -> c.failed(failure)); - HttpInput.Content lastContent = copy.isEmpty() ? null : copy.get(copy.size() - 1); - boolean atEof = lastContent != null && lastContent.isEof(); + boolean atEof; + try (AutoLock l = _lock.lock()) + { + atEof = _specialContent != null && _specialContent.isEof(); + } if (LOG.isDebugEnabled()) LOG.debug("failed all content, EOF = {}", atEof); return atEof;