Summary: | NIO Connector: IllegalArgumentException: You can only write using the application write buffer provided by the handler | ||
---|---|---|---|
Product: | Tomcat 6 | Reporter: | Christophe Pierret <cpierret> |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | major | ||
Priority: | P2 | ||
Version: | 6.0.7 | ||
Target Milestone: | default | ||
Hardware: | All | ||
OS: | Windows XP | ||
Attachments: | A patch fixing the issue, but not meant to be a definitive patch |
Description
Christophe Pierret
2007-01-25 09:12:11 UTC
Created attachment 19460 [details]
A patch fixing the issue, but not meant to be a definitive patch
Should fix this differently since it removes a useful check that is not valid
in only one special case (sendAck call)
Patch is invalid and would lead to invalid SSL data being sent, bug is acknowledged and will be fixed. The following fix has been applied Index: java/org/apache/tomcat/util/net/NioSelectorPool.java =================================================================== --- java/org/apache/tomcat/util/net/NioSelectorPool.java (revision 500888) +++ java/org/apache/tomcat/util/net/NioSelectorPool.java (working copy) @@ -103,6 +103,10 @@ boolean timedout = false; int keycount = 1; //assume we can write long time = System.currentTimeMillis(); //start the timeout timer + if ( socket.getBufHandler().getWriteBuffer()!= buf ) { + socket.getBufHandler().getWriteBuffer().put(buf); + buf = socket.getBufHandler().getWriteBuffer(); + } try { while ( (!timedout) && buf.hasRemaining() ) { if ( keycount > 0 ) { //only write if we were registered for a write |