Affects Version/s: None
Fix Version/s: None
Number of attachments :
Greg asked me to open a ticket for this so here is a dump of the email conversation that we had on the support list.
I am using 5.1.11RC0. I can't quite duplicate the extact conversation using telnet. A couple of things would have to change: 1) in the request, do not send the Connection: close header, 2) if you do #1, Jetty no longer includes the Connection: close header in the response but the issue I am seeing happens when the Connection: close header is in the response. I can simulate the converstation with the following simple JSP:
<% response.setHeader( "Connection", "close" ); response.setStatus( 404 ); return; %>
So, if I request that JSP with telnet:
GET /t404.jsp HTTP/1.1
that simulates my issue. With Jetty 4, Jetty appears to recognize the fact that the Connection: close header was in the response and it closes the socket. In Jetty 5, it seems to ignore it and leaves the socket open until the idle timer kicks in and closes the socket.
From: Greg Wilkins firstname.lastname@example.org
Sent: Wednesday, September 13, 2006 11:47 AM
Subject: Re: Jetty 4 vs. Jetty 5
Can you tell me the exact version of Jetty 5 that you are using?
I need to do a Jetty 5 maint release soon and I will look at this issue if I can reproduce it.
If you look at the simple test I did below, you can see that Jetty 5.1.11RC0 is closing the connection. So can you test with a simple telnet and see if the connection is closed?
 telnet localhost 8080
Connected to localhost.
Escape character is '^]'.
GET /notexist.txt HTTP/1.1
HTTP/1.1 404 %2Fnotexist%2Etxt+Not+Found
Date: Wed, 13 Sep 2006 15:45:01 GMT
Server: Jetty/5.1.11RC0 (Linux/2.6.15-26-686 i386 java/1.5.0_06
<title>Error 404 /notexist.txt Not Found</title> </head> <body> <h2>HTTP ERROR: 404</h2><pre>/notexist.txt Not Found</pre> <p>RequestURI=/notexist.txt</p> <p><i><small><a href="http://jetty.mortbay.org">Powered by Jetty://</a></small></i></p>
Connection closed by foreign host.
Tony Thompson wrote:
> I have apparently run across what I feel is a crappy HTTP client but,
> crappy HTTP client works differently with Jetty 4 than it does with
> Jetty 5. Here is basically what is happening:
> Jetty responds to some request with an HTTP 404. The response
> contains a Connection: close header. With Jetty 4, the TCP FIN flag
> is set in the packet that includes the 404 response. With Jetty 5,
> the server sends the 404 WITHOUT the TCP FIN flag set in the packet.
> So, with Jetty 4, the socket close is dealt with and everyone goes
> away happy. With Jetty 5, since the server didn't close the socket,
> the client is apparently not closing the socket either even though
> Connection: close was sent. So, the client hangs out until the server
> detects the connection is idle and shuts down the socket. Once that
> happens, the client continues on its merry way.
> From what I can tell, I have the socket listener configured the same
> in Jetty 5 as I did in Jetty 4. Is there something in Jetty that
> changed or is there something I can configure differently in Jetty 5
> to make it work the way it did in Jetty 4?
> As an aside, am I even correct in assuming that Jetty 5 is allowed to
> behave this way?