Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Leen-Meyer:test
tomcat6
apache-tomcat-CVE-2012-4543.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File apache-tomcat-CVE-2012-4543.patch of Package tomcat6
Index: apache-tomcat-6.0.33-src/java/org/apache/tomcat/util/net/NioEndpoint.java =================================================================== --- apache-tomcat-6.0.33-src.orig/java/org/apache/tomcat/util/net/NioEndpoint.java 2011-08-16 14:26:14.000000000 +0200 +++ apache-tomcat-6.0.33-src/java/org/apache/tomcat/util/net/NioEndpoint.java 2013-01-02 14:06:17.640150153 +0100 @@ -1710,8 +1710,14 @@ public boolean processSendfile(SelectionKey sk, KeyAttachment attachment, boolean reg, boolean event) { NioChannel sc = null; try { - //unreg(sk,attachment);//only do this if we do process send file on a separate thread + unreg(sk, attachment, sk.readyOps()); SendfileData sd = attachment.getSendfileData(); + + if (log.isTraceEnabled()) { + log.trace("Processing send file for: " + sd.fileName); + } + + //setup the file channel if ( sd.fchannel == null ) { File f = new File(sd.fileName); if ( !f.exists() ) { @@ -1720,10 +1726,14 @@ } sd.fchannel = new FileInputStream(f).getChannel(); } + + //configure output channel sc = attachment.getChannel(); sc.setSendFile(true); + //ssl channel is slightly different WritableByteChannel wc =(WritableByteChannel) ((sc instanceof SecureNioChannel)?sc:sc.getIOChannel()); - + + //we still have data in the buffer if (sc.getOutboundRemaining()>0) { if (sc.flushOutbound()) { attachment.access(); @@ -1750,15 +1760,13 @@ attachment.setSendfileData(null); try {sd.fchannel.close();}catch(Exception ignore){} if ( sd.keepAlive ) { - if (reg) { - if (log.isDebugEnabled()) { - log.debug("Connection is keep alive, registering back for OP_READ"); - } - if (event) { - this.add(attachment.getChannel(),SelectionKey.OP_READ); - } else { - reg(sk,attachment,SelectionKey.OP_READ); - } + if (log.isDebugEnabled()) { + log.debug("Connection is keep alive, registering back for OP_READ"); + } + if (event) { + this.add(attachment.getChannel(),SelectionKey.OP_READ); + } else { + reg(sk,attachment,SelectionKey.OP_READ); } } else { if (log.isDebugEnabled()) { @@ -1767,9 +1775,9 @@ cancelledKey(sk,SocketStatus.STOP,false); return false; } - } else if ( attachment.interestOps() == 0 && reg ) { + } else { if (log.isDebugEnabled()) { - log.debug("OP_WRITE for sendilfe:"+sd.fileName); + log.debug("OP_WRITE for sendfile:" + sd.fileName); } if (event) { add(attachment.getChannel(),SelectionKey.OP_WRITE);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor