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 43653] New: - NIO connector may corrupt first line of HTTP response
Date Thu, 18 Oct 2007 17:43:39 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43653>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43653

           Summary: NIO connector may corrupt first line of HTTP response
           Product: Tomcat 6
           Version: 6.0.14
          Platform: PC
        OS/Version: Windows 2000
            Status: NEW
          Severity: major
          Priority: P2
         Component: Connectors
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: cpierret@sparus-software.com


Sometimes, the HTTP response sent when NIO connector is used is corrupted.
The first line of header contains 16Ko of garbage (0x00) and the next ones are OK.
HTTPS was used during the testing.

Debugging showed that in a call to NioBlockingSelector.write(,,), the variable
buf was correct until it went through this code:
if (socket.getBufHandler().getWriteBuffer() != buf) {
            socket.getBufHandler().getWriteBuffer().put(buf);
            buf = socket.getBufHandler().getWriteBuffer();
        }
After appending a ByteBuffer to another ByteBuffer, one shoud take some extra
step to flip the buffer (prepare for read after write)

See enclosed patch for a fix validated to correct the issue.

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

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


Mime
View raw message