Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D0579EC7D for ; Tue, 26 Feb 2013 10:06:15 +0000 (UTC) Received: (qmail 23633 invoked by uid 500); 26 Feb 2013 10:06:15 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 22860 invoked by uid 500); 26 Feb 2013 10:06:15 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 22667 invoked by uid 99); 26 Feb 2013 10:06:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Feb 2013 10:06:13 +0000 Date: Tue, 26 Feb 2013 10:06:13 +0000 (UTC) From: "Mattias Lundstrom (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CXF-4855) The server does not work with HTTP 1.0 clients (keep-alive not respected) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-4855?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mattias Lundstrom updated CXF-4855: ----------------------------------- Attachment: JettyHTTPDestination.patch Attaching the patch (in the Description) as a separate file, since the whitespace became messed up. > The server does not work with HTTP 1.0 clients (keep-alive not respected) > ------------------------------------------------------------------------- > > Key: CXF-4855 > URL: https://issues.apache.org/jira/browse/CXF-4855 > Project: CXF > Issue Type: Bug > Components: Transports > Affects Versions: 2.7.0 > Reporter: Mattias Lundstrom > Attachments: JettyHTTPDestination.patch > > > The "Connection: keep-alive" handling for HTTP 1.0 clients do not seem to work in 2.7.x (tested on 2.7.0 and 2.7.3) > After some debugging in our system, the problem seems to be in the transport class org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java > This is a FilterOutputStream which means that calling close on this stream causes flush() + close() on the underlying stream. The problem is that the flush() call seem to cause response content length calculations to fail. This then causes the "Connection" response header to be filtered out (among other things). > We are currently running with our own local patch > ===== > --- apache-cxf-2.7.0-src/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java.orig 2012-10-06 04:19:50.000000000 +0200 > +++ apache-cxf-2.7.0-src/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java 2013-02-11 14:59:21.411916187 +0100 > @@ -405,6 +405,13 @@ > out.sendContent(c); > return c.getCount(); > } > + > + @Override > + public void close() throws IOException { > + // Avoid calling flush() here. It interferes with > + // content length calculation in the generator. > + out.close(); > + } > } > static class CountingInputStream extends FilterInputStream { > int count; > ===== > This seems to work in our system at least. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira