tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 50224] New: Http11NioProtocol closes connection if headers are sent in different TCP segments
Date Fri, 05 Nov 2010 17:54:25 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=50224

           Summary: Http11NioProtocol closes connection if headers are
                    sent in different TCP segments
           Product: Tomcat 6
           Version: 6.0.29
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Connectors
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: NOS@Utel.no


Ive tested an installation that was configured with Http11NioProtocol. When
sent a HEAD request, the connection just gets closed. With the default HTTP/1.1
connector the HEAD requests gets a proper response. (I'm doing a HEAD / on a
default installation, so it's the default tomcat / page that gets served, not a
custom servlet). I have not checked how this behaves with ordinary GET/POST
requests.

The part of the default server.xml that I altered:

      <Connector port="8080"
protocol="org.apache.coyote.http11.Http11NioProtocol"
               connectionTimeout="20000"
               compression="on"
               compressionMinSize="8912"
               noCompressionUserAgents="gozilla, traviata"
               compressableMimeType="text/html,text/xml,text/plain"
               redirectPort="8443" />


This seems to happen when the request headers get sent in several IP packets.
e.g. the HTTP request was:

HEAD / HTTP/1.0\r\n
Host: web01.example.com\r\n
User-Agent: go http package\r\n
\r\n

This request got sent in 4 different packets(tcp segments) - discovered with
Wireshark

1. packet: HEAD / HTTP/1.0\r\n
2. packet: Host: web01.myserver.internal\r\n
3. packet: User-Agent: go http package\r\n
4. packet: \r\n

The HTTP/1.1 connector seems to handle the above case fine, responds with 200
OK and a proper response. When the Http11NioProtocol is used, there's no
response, the TCP connection just gets closed from the Tomcat side.

This happens specifically when using the go http library(http://golang.org/)
run on Fedora 14, below is the simple test case written in go - but I'd guess
there's no guarantee the packets always gets sent in different segments (then
again maybe the go http library disables the Nagle algorithm)

If anyone want to try to reproduce this using go(http://golang.org/) the simple
test was this program:

package main
import (
    "http"
)
func main() {
    resp, err := http.Head("http://web01.myserver.internal/")
    println("after")
    if err != nil {
        print("Error::")
        println(err.String())
    } else {
        println(resp.Status)
    }
}

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message