Re: WebSocket progress report
On 23/02/2012 01:32, Petr Praus wrote: > On Mon, Feb 20, 2012 at 16:19, Mark Thomas wrote: >> Haven't looked too hard at those yet. Assuming Java can tell the UTF-8 >> is invalid then handling that should be easy. >> > Yes, except that the java CharsetDecoder didn't seem to think that UTF-8 > sent by Autobahn as invalid was indeed invalid. At least was my impression, > but I might very well be wrong. Java complains about most of them. I need to dig into the ones it doesn't. Something isn't quite right there yet. >> There are some of those trunk changes (I am thinking of >> AbstractProcessor) that you'll need to pull into your fork. >> > I'll try to pull these during the weekend, maybe it'll still be useful. I get the impression that trunk is heading towards your implementation. 'd be happy to look at suggested patches to improve trunk that moved it towards your implementation. As I said before, small incremental changes are easier to manage than one big patch. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1292706 - in /tomcat/native/branches/1.1.x: build.xml native/include/tcn_version.h native/os/win32/libtcnative.rc native/src/sslcontext.c
Author: mturk Date: Thu Feb 23 08:45:32 2012 New Revision: 1292706 URL: http://svn.apache.org/viewvc?rev=1292706&view=rev Log: Bump versions to current candidate Modified: tomcat/native/branches/1.1.x/build.xml tomcat/native/branches/1.1.x/native/include/tcn_version.h tomcat/native/branches/1.1.x/native/os/win32/libtcnative.rc tomcat/native/branches/1.1.x/native/src/sslcontext.c Modified: tomcat/native/branches/1.1.x/build.xml URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/build.xml?rev=1292706&r1=1292705&r2=1292706&view=diff == --- tomcat/native/branches/1.1.x/build.xml (original) +++ tomcat/native/branches/1.1.x/build.xml Thu Feb 23 08:45:32 2012 @@ -33,7 +33,7 @@ - + Modified: tomcat/native/branches/1.1.x/native/include/tcn_version.h URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/include/tcn_version.h?rev=1292706&r1=1292705&r2=1292706&view=diff == --- tomcat/native/branches/1.1.x/native/include/tcn_version.h (original) +++ tomcat/native/branches/1.1.x/native/include/tcn_version.h Thu Feb 23 08:45:32 2012 @@ -69,7 +69,7 @@ extern "C" { #define TCN_MINOR_VERSION 1 /** patch level */ -#define TCN_PATCH_VERSION 22 +#define TCN_PATCH_VERSION 23 /** * This symbol is defined for internal, "development" copies of TCN. This Modified: tomcat/native/branches/1.1.x/native/os/win32/libtcnative.rc URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/os/win32/libtcnative.rc?rev=1292706&r1=1292705&r2=1292706&view=diff == --- tomcat/native/branches/1.1.x/native/os/win32/libtcnative.rc (original) +++ tomcat/native/branches/1.1.x/native/os/win32/libtcnative.rc Thu Feb 23 08:45:32 2012 @@ -20,7 +20,7 @@ LANGUAGE 0x9,0x1 "See the License for the specific language governing " \ "permissions and limitations under the License." -#define TCN_VERSION "1.1.22" +#define TCN_VERSION "1.1.23" 1000 ICON "apache.ico" 1001 DIALOGEX 0, 0, 252, 51 @@ -36,8 +36,8 @@ BEGIN END 1 VERSIONINFO - FILEVERSION 1,1,22,0 - PRODUCTVERSION 1,1,22,0 + FILEVERSION 1,1,23,0 + PRODUCTVERSION 1,1,23,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L Modified: tomcat/native/branches/1.1.x/native/src/sslcontext.c URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/src/sslcontext.c?rev=1292706&r1=1292705&r2=1292706&view=diff == --- tomcat/native/branches/1.1.x/native/src/sslcontext.c (original) +++ tomcat/native/branches/1.1.x/native/src/sslcontext.c Thu Feb 23 08:45:32 2012 @@ -484,6 +484,8 @@ static X509 *load_pem_cert(tcn_ssl_ctxt_ BIO_free(bio); return NULL; } +if (!cb_data) +cb_data = &tcn_password_callback; cert = PEM_read_bio_X509_AUX(bio, NULL, (pem_password_cb *)SSL_password_callback, (void *)cb_data); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 52744] New: [Jasper] JSP files are always recompiled in development mode
https://issues.apache.org/bugzilla/show_bug.cgi?id=52744 Bug #: 52744 Summary: [Jasper] JSP files are always recompiled in development mode Product: Tomcat 7 Version: unspecified Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: Jasper AssignedTo: dev@tomcat.apache.org ReportedBy: forres...@gmail.com Classification: Unclassified Steps to reproduce: 1. Have a simple sample application which includes some jsp files 2. Deploy it into tomcat and make it running successfully 3. Stop the server and enable JspServlet development mode 4. In this mode, try to reload the jsp page from the browser 5. Have a debugger attached to the server jvm, set a breakpoint in the jasper Compiler isOutDated method 6. You will see the jsp file is always be recompiled even there is nothing changed on it. Reason analysis: The code logic below in the isOutDated(boolean checkClass) method: Long jspRealLastModified = ctxt.getLastModified(ctxt.getJspFile()); if (jspRealLastModified.longValue() < 0) { // Something went wrong - assume modification return true; } long targetLastModified = 0; File targetFile; if (checkClass) { targetFile = new File(ctxt.getClassFileName()); } else { targetFile = new File(ctxt.getServletJavaFileName()); } if (!targetFile.exists()) { return true; } targetLastModified = targetFile.lastModified(); if (checkClass && jsw != null) { jsw.setServletClassLastModifiedTime(targetLastModified); } if (targetLastModified != jspRealLastModified.longValue()) { if (log.isDebugEnabled()) { log.debug("Compiler: outdated: " + targetFile + " " + targetLastModified); } return true; } Which relies on File.lastModified() method to do comparation, while searched the web, and got this url[1] [1] http://www.coderanch.com/t/384700/java/java/File-lastModified-windows-vs-linux Which indicates that that method is rounding off the value on the Linux, for example if a file is modified at 1173423665215 msec, the above method is returning the value 1173423665000 on linux. -- 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 52744] [Jasper] JSP files are always recompiled in development mode
https://issues.apache.org/bugzilla/show_bug.cgi?id=52744 xiaming changed: What|Removed |Added Keywords||PatchAvailable -- 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 52744] [Jasper] JSP files are always recompiled in development mode
https://issues.apache.org/bugzilla/show_bug.cgi?id=52744 --- Comment #1 from xiaming 2012-02-23 09:29:31 UTC --- Created attachment 28370 --> https://issues.apache.org/bugzilla/attachment.cgi?id=28370 Round off the difference and allow a error scope < 1000l Round off the difference and allow a error scope < 1000l -- 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1292742 - in /tomcat/trunk/java/org/apache/catalina/websocket: StreamInbound.java WsInputStream.java WsOutbound.java
Author: markt Date: Thu Feb 23 11:30:55 2012 New Revision: 1292742 URL: http://svn.apache.org/viewvc?rev=1292742&view=rev Log: Handle close and pong control frames inside fragmented message. Modified: tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java tomcat/trunk/java/org/apache/catalina/websocket/WsInputStream.java tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java Modified: tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java?rev=1292742&r1=1292741&r2=1292742&view=diff == --- tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java (original) +++ tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java Thu Feb 23 11:30:55 2012 @@ -80,7 +80,7 @@ public abstract class StreamInbound impl } if (opCode == Constants.OPCODE_CLOSE){ -doClose(frame); +getOutbound().close(frame); return SocketState.CLOSED; } else if (opCode == Constants.OPCODE_PING) { doPing(frame); @@ -109,21 +109,6 @@ public abstract class StreamInbound impl } } -private void doClose(WsFrame frame) throws IOException { -if (frame.getPayLoadLength() > 0) { -// Must be status (2 bytes) plus optional message -if (frame.getPayLoadLength() == 1) { -throw new IOException(); -} -int status = (frame.getPayLoad().get() & 0xFF) << 8; -status += frame.getPayLoad().get() & 0xFF; -getOutbound().close(status, frame.getPayLoad()); -} else { -// No status -getOutbound().close(0, null); -} -} - private void doPing(WsFrame frame) throws IOException { getOutbound().pong(frame.getPayLoad()); } Modified: tomcat/trunk/java/org/apache/catalina/websocket/WsInputStream.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/WsInputStream.java?rev=1292742&r1=1292741&r2=1292742&view=diff == --- tomcat/trunk/java/org/apache/catalina/websocket/WsInputStream.java (original) +++ tomcat/trunk/java/org/apache/catalina/websocket/WsInputStream.java Thu Feb 23 11:30:55 2012 @@ -68,7 +68,11 @@ public class WsInputStream extends java. while (frame.isControl()) { if (getFrame().getOpCode() == Constants.OPCODE_PING) { outbound.pong(frame.getPayLoad()); -} else { +} else if (getFrame().getOpCode() == Constants.OPCODE_PONG) { +// NO-OP. Swallow it. +} else if (getFrame().getOpCode() == Constants.OPCODE_CLOSE) { +outbound.close(frame); +} else{ // TODO throw new IOException("TODO"); } Modified: tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java?rev=1292742&r1=1292741&r2=1292742&view=diff == --- tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java (original) +++ tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java Thu Feb 23 11:30:55 2012 @@ -115,6 +115,46 @@ public class WsOutbound { } + +public void close(WsFrame frame) throws IOException { +if (frame.getPayLoadLength() > 0) { +// Must be status (2 bytes) plus optional message +if (frame.getPayLoadLength() == 1) { +throw new IOException(); +} +int status = (frame.getPayLoad().get() & 0xFF) << 8; +status += frame.getPayLoad().get() & 0xFF; + +if (validateCloseStatus(status)) { +// Echo the status back to the client +close(status, frame.getPayLoad()); +} else { +// Invalid close code +close(1002, null); +} +} else { +// No status +close(0, null); +} +} + +private boolean validateCloseStatus(int status) { + +if (status == 1000 || status == 1001 || status == 1002 || +status == 1003 || status == 1007 || status == 1008 || +status == 1009 || status == 1010 || status == 1011 || +(status > 2999 && status < 5000)) { +// Other 1xxx reserved / not permitted +// 2xxx reserved +// 3xxx framework defined +// 4xxx application defined +return true; +} +// <1000 unused +// >4999 undefined +return false; +
svn commit: r1292743 - /tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java
Author: markt Date: Thu Feb 23 11:31:54 2012 New Revision: 1292743 URL: http://svn.apache.org/viewvc?rev=1292743&view=rev Log: Length not end Modified: tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java Modified: tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java?rev=1292743&r1=1292742&r2=1292743&view=diff == --- tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java (original) +++ tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java Thu Feb 23 11:31:54 2012 @@ -174,7 +174,8 @@ public class WsOutbound { upgradeOutbound.write(2 + data.limit() - data.position()); upgradeOutbound.write(status >>> 8); upgradeOutbound.write(status); -upgradeOutbound.write(data.array(), data.position(), data.limit()); +upgradeOutbound.write(data.array(), data.position(), +data.limit() - data.position()); } upgradeOutbound.flush(); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1292744 - /tomcat/trunk/java/org/apache/catalina/websocket/WebSocketServlet.java
Author: markt Date: Thu Feb 23 11:32:31 2012 New Revision: 1292744 URL: http://svn.apache.org/viewvc?rev=1292744&view=rev Log: Improve the Javadoc Modified: tomcat/trunk/java/org/apache/catalina/websocket/WebSocketServlet.java Modified: tomcat/trunk/java/org/apache/catalina/websocket/WebSocketServlet.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/WebSocketServlet.java?rev=1292744&r1=1292743&r2=1292744&view=diff == --- tomcat/trunk/java/org/apache/catalina/websocket/WebSocketServlet.java (original) +++ tomcat/trunk/java/org/apache/catalina/websocket/WebSocketServlet.java Thu Feb 23 11:32:31 2012 @@ -199,7 +199,8 @@ public abstract class WebSocketServlet e * obligation to respect the declared preference * @return null if no sub-protocol is selected or the name of * the protocol which must be one of the protocols listed by - * the client. + * the client. This default implementation always returns + * null. */ protected String selectSubProtocol(List subProtocols) { return null; @@ -207,6 +208,7 @@ public abstract class WebSocketServlet e /** * Create the instance that will process this inbound connection. + * Applications must provide a new instance for each connection. * * @param subProtocol The sub-protocol agreed between the client and * server or null if none was agreed - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1292745 - /tomcat/trunk/java/org/apache/catalina/websocket/WebSocketServlet.java
Author: markt Date: Thu Feb 23 11:33:08 2012 New Revision: 1292745 URL: http://svn.apache.org/viewvc?rev=1292745&view=rev Log: Formatting Modified: tomcat/trunk/java/org/apache/catalina/websocket/WebSocketServlet.java Modified: tomcat/trunk/java/org/apache/catalina/websocket/WebSocketServlet.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/WebSocketServlet.java?rev=1292745&r1=1292744&r2=1292745&view=diff == --- tomcat/trunk/java/org/apache/catalina/websocket/WebSocketServlet.java (original) +++ tomcat/trunk/java/org/apache/catalina/websocket/WebSocketServlet.java Thu Feb 23 11:33:08 2012 @@ -175,6 +175,7 @@ public abstract class WebSocketServlet e } } + /** * Intended to be overridden by sub-classes that wish to verify the origin * of a WebSocket request before processing it. @@ -190,6 +191,7 @@ public abstract class WebSocketServlet e return true; } + /** * Intended to be overridden by sub-classes that wish to select a * sub-protocol if the client provides a list of supported protocols. @@ -206,6 +208,7 @@ public abstract class WebSocketServlet e return null; } + /** * Create the instance that will process this inbound connection. * Applications must provide a new instance for each connection. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1292746 - in /tomcat/trunk: java/org/apache/catalina/websocket/ webapps/examples/WEB-INF/classes/websocket/
Author: markt Date: Thu Feb 23 11:34:06 2012 New Revision: 1292746 URL: http://svn.apache.org/viewvc?rev=1292746&view=rev Log: More docs. Clean-up. Make some methods final. Modified: tomcat/trunk/java/org/apache/catalina/websocket/MessageInbound.java tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/EchoMessage.java tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/EchoStream.java Modified: tomcat/trunk/java/org/apache/catalina/websocket/MessageInbound.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/MessageInbound.java?rev=1292746&r1=1292745&r2=1292746&view=diff == --- tomcat/trunk/java/org/apache/catalina/websocket/MessageInbound.java (original) +++ tomcat/trunk/java/org/apache/catalina/websocket/MessageInbound.java Thu Feb 23 11:34:06 2012 @@ -22,6 +22,13 @@ import java.io.Reader; import java.nio.ByteBuffer; import java.nio.CharBuffer; +/** + * Base implementation of the class used to process WebSocket connections based + * on messages. Applications should extend this class to provide application + * specific functionality. Applications that wish to operate on a stream basis + * rather than a message basis should use {@link StreamInbound}. + */ + public abstract class MessageInbound extends StreamInbound { // 2MB - like maxPostSize Modified: tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java?rev=1292746&r1=1292745&r2=1292746&view=diff == --- tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java (original) +++ tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java Thu Feb 23 11:34:06 2012 @@ -30,38 +30,50 @@ import org.apache.coyote.http11.upgrade. import org.apache.tomcat.util.buf.B2CConverter; import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState; +/** + * Base implementation of the class used to process WebSocket connections based + * on streams. Applications should extend this class to provide application + * specific functionality. Applications that wish to operate on a message basis + * rather than a stream basis should use {@link MessageInbound}. + */ public abstract class StreamInbound implements UpgradeInbound { private UpgradeProcessor processor = null; private WsOutbound outbound; @Override -public void setUpgradeOutbound(UpgradeOutbound upgradeOutbound) { +public final void setUpgradeOutbound(UpgradeOutbound upgradeOutbound) { outbound = new WsOutbound(upgradeOutbound); } @Override -public void setUpgradeProcessor(UpgradeProcessor processor) { +public final void setUpgradeProcessor(UpgradeProcessor processor) { this.processor = processor; } -public WsOutbound getOutbound() { + +/** + * Obtain the outbound side of this WebSocket connection used for writing + * data to the client. + */ +public final WsOutbound getWsOutbound() { return outbound; } + @Override -public SocketState onData() throws IOException { +public final SocketState onData() throws IOException { // Must be start the start of a frame or series of frames try { -WsInputStream wsIs = new WsInputStream(processor, outbound); +WsInputStream wsIs = new WsInputStream(processor, getWsOutbound()); WsFrame frame = wsIs.getFrame(); // TODO User defined extensions may define values for rsv if (frame.getRsv() > 0) { -getOutbound().close(1002, null); +getWsOutbound().close(1002, null); return SocketState.CLOSED; } @@ -80,10 +92,10 @@ public abstract class StreamInbound impl } if (opCode == Constants.OPCODE_CLOSE){ -getOutbound().close(frame); +getWsOutbound().close(frame); return SocketState.CLOSED; } else if (opCode == Constants.OPCODE_PING) { -doPing(frame); +getWsOutbound().pong(frame.getPayLoad()); return SocketState.UPGRADED; } else if (opCode == Constants.OPCODE_PONG) { // NO-OP @@ -91,28 +103,51 @@ public abstract class StreamInbound impl } // Unknown OpCode -getOutbound().close(1002, null); +getWsOutbound().close(1002, null); return SocketState.CLOSED; } catch (MalformedInputException mie) { // Invalid UTF-8 -getOutbound().close(1007, null); +getWsOutbound().close(1007, null); return SocketState.CLOSED; }
svn commit: r1292747 - /tomcat/trunk/java/org/apache/catalina/websocket/MessageInbound.java
Author: markt Date: Thu Feb 23 11:34:43 2012 New Revision: 1292747 URL: http://svn.apache.org/viewvc?rev=1292747&view=rev Log: Javadoc, whitespace, add final Modified: tomcat/trunk/java/org/apache/catalina/websocket/MessageInbound.java Modified: tomcat/trunk/java/org/apache/catalina/websocket/MessageInbound.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/MessageInbound.java?rev=1292747&r1=1292746&r2=1292747&view=diff == --- tomcat/trunk/java/org/apache/catalina/websocket/MessageInbound.java (original) +++ tomcat/trunk/java/org/apache/catalina/websocket/MessageInbound.java Thu Feb 23 11:34:43 2012 @@ -28,7 +28,6 @@ import java.nio.CharBuffer; * specific functionality. Applications that wish to operate on a stream basis * rather than a message basis should use {@link StreamInbound}. */ - public abstract class MessageInbound extends StreamInbound { // 2MB - like maxPostSize @@ -38,8 +37,9 @@ public abstract class MessageInbound ext private ByteBuffer bb = ByteBuffer.allocate(8192); private CharBuffer cb = CharBuffer.allocate(8192); + @Override -protected void onBinaryData(InputStream is) throws IOException { +protected final void onBinaryData(InputStream is) throws IOException { int read = 0; while (read > -1) { bb.position(bb.position() + read); @@ -53,8 +53,9 @@ public abstract class MessageInbound ext bb.clear(); } + @Override -protected void onTextData(Reader r) throws IOException { +protected final void onTextData(Reader r) throws IOException { int read = 0; while (read > -1) { cb.position(cb.position() + read); @@ -69,6 +70,7 @@ public abstract class MessageInbound ext cb.clear(); } + private void resizeByteBuffer() throws IOException { int maxSize = getByteBufferMaxSize(); if (bb.limit() >= maxSize) { @@ -88,6 +90,7 @@ public abstract class MessageInbound ext bb = newBuffer; } + private void resizeCharBuffer() throws IOException { int maxSize = getCharBufferMaxSize(); if (cb.limit() >= maxSize) { @@ -107,24 +110,70 @@ public abstract class MessageInbound ext cb = newBuffer; } -public int getByteBufferMaxSize() { + +/** + * Obtain the current maximum size (in bytes) of the buffer used for binary + * messages. + */ +public final int getByteBufferMaxSize() { return byteBufferMaxSize; } -public void setByteBufferMaxSize(int byteBufferMaxSize) { + +/** + * Set the maximum size (in bytes) of the buffer used for binary messages. + */ +public final void setByteBufferMaxSize(int byteBufferMaxSize) { this.byteBufferMaxSize = byteBufferMaxSize; } -public int getCharBufferMaxSize() { + +/** + * Obtain the current maximum size (in characters) of the buffer used for + * binary messages. + */ +public final int getCharBufferMaxSize() { return charBufferMaxSize; } -public void setCharBufferMaxSize(int charBufferMaxSize) { + +/** + * Set the maximum size (in characters) of the buffer used for textual + * messages. + */ +public final void setCharBufferMaxSize(int charBufferMaxSize) { this.charBufferMaxSize = charBufferMaxSize; } + +/** + * This method is called when there is a binary WebSocket message available + * to process. The message is presented via a ByteBuffer and may have been + * formed from one or more frames. The number of frames used to transmit the + * message is not made visible to the application. + * + * @param message The WebSocket message + * + * @throws IOException If a problem occurs processing the message. Any + * exception will trigger the closing of the WebSocket + * connection. + */ protected abstract void onBinaryMessage(ByteBuffer message) throws IOException; + + +/** + * This method is called when there is a textual WebSocket message available + * to process. The message is presented via a CharBuffer and may have been + * formed from one or more frames. The number of frames used to transmit the + * message is not made visible to the application. + * + * @param message The WebSocket message + * + * @throws IOException If a problem occurs processing the message. Any + * exception will trigger the closing of the WebSocket + * connection. + */ protected abstract void onTextMessage(CharBuffer message) throws IOException; } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional command
svn commit: r1292749 - in /tomcat/trunk/java/org/apache/catalina/websocket: WsFrame.java WsInputStream.java WsOutbound.java
Author: markt Date: Thu Feb 23 11:35:24 2012 New Revision: 1292749 URL: http://svn.apache.org/viewvc?rev=1292749&view=rev Log: More javadoc and cleanup Modified: tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java tomcat/trunk/java/org/apache/catalina/websocket/WsInputStream.java tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java Modified: tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java?rev=1292749&r1=1292748&r2=1292749&view=diff == --- tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java (original) +++ tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java Thu Feb 23 11:35:24 2012 @@ -23,7 +23,7 @@ import org.apache.catalina.util.Conversi import org.apache.coyote.http11.upgrade.UpgradeProcessor; /** - * Represents a WebSocket frame with the exception of the payload for + * Represents a complete WebSocket frame with the exception of the payload for * non-control frames. */ public class WsFrame { @@ -35,6 +35,17 @@ public class WsFrame { private long payloadLength; private ByteBuffer payload; +/** + * Create the new WebSocket frame, reading data from the processor as + * necessary. + * + * @param processor Processor associated with the WebSocket connection on + * which the frame has been sent + * + * @throws IOException If a problem occurs processing the frame. Any + * exception will trigger the closing of the WebSocket + * connection. + */ public WsFrame(UpgradeProcessor processor) throws IOException { int b = processorRead(processor); Modified: tomcat/trunk/java/org/apache/catalina/websocket/WsInputStream.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/WsInputStream.java?rev=1292749&r1=1292748&r2=1292749&view=diff == --- tomcat/trunk/java/org/apache/catalina/websocket/WsInputStream.java (original) +++ tomcat/trunk/java/org/apache/catalina/websocket/WsInputStream.java Thu Feb 23 11:35:24 2012 @@ -37,6 +37,7 @@ public class WsInputStream extends java. private String error = null; + public WsInputStream(UpgradeProcessor processor, WsOutbound outbound) throws IOException { this.processor = processor; @@ -44,10 +45,12 @@ public class WsInputStream extends java. processFrame(); } + public WsFrame getFrame() { return frame; } + private void processFrame() throws IOException { frame = new WsFrame(processor); readThisFragment = 0; @@ -73,8 +76,8 @@ public class WsInputStream extends java. } else if (getFrame().getOpCode() == Constants.OPCODE_CLOSE) { outbound.close(frame); } else{ -// TODO -throw new IOException("TODO"); +// TODO i18n +throw new IOException("Unknown control frame"); } processFrame(); } Modified: tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java?rev=1292749&r1=1292748&r2=1292749&view=diff == --- tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java (original) +++ tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java Thu Feb 23 11:35:24 2012 @@ -25,6 +25,9 @@ import java.nio.charset.CoderResult; import org.apache.coyote.http11.upgrade.UpgradeOutbound; import org.apache.tomcat.util.buf.B2CConverter; +/** + * Provides the means to write WebSocket messages to the client. + */ public class WsOutbound { private static final int DEFAULT_BUFFER_SIZE = 8192; @@ -45,6 +48,18 @@ public class WsOutbound { } +/** + * Adds the data to the buffer for binary data. If a textual message is + * currently in progress that message will be completed and a new binary + * message started. If the buffer for binary data is full, the buffer will + * be flushed and a new binary continuation fragment started. + * + * @param b The byte (only the least significant byte is used) of data to + * send to the client. + * + * @throws IOException If a flush is required and an error occurs writing + * the WebSocket frame to the client + */ public void writeBinaryData(int b) throws IOException { if (bb.position() == bb.capacity()) { doFlush(false); @@ -60,6 +75,17 @@ public class WsOutbound { } +/** + * Adds the data to the buffe
svn commit: r1292758 - /tomcat/native/branches/1.1.x/native/srclib/VERSIONS
Author: mturk Date: Thu Feb 23 12:05:10 2012 New Revision: 1292758 URL: http://svn.apache.org/viewvc?rev=1292758&view=rev Log: Update preferred dependecy versions. Those will be used for producing current windows statically linked binaries Modified: tomcat/native/branches/1.1.x/native/srclib/VERSIONS Modified: tomcat/native/branches/1.1.x/native/srclib/VERSIONS URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/srclib/VERSIONS?rev=1292758&r1=1292757&r2=1292758&view=diff == --- tomcat/native/branches/1.1.x/native/srclib/VERSIONS (original) +++ tomcat/native/branches/1.1.x/native/srclib/VERSIONS Thu Feb 23 12:05:10 2012 @@ -1,4 +1,4 @@ Use the following version of the libraries -- APR 1.3.9, http://apr.apache.org -- OpenSSL 0.9.8k, http://www.openssl.org +- APR 1.4.6, http://apr.apache.org +- OpenSSL 1.0.0g, http://www.openssl.org - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 52746] New: Classloader closed in middle of webapp deployment
https://issues.apache.org/bugzilla/show_bug.cgi?id=52746 Bug #: 52746 Summary: Classloader closed in middle of webapp deployment Product: Tomcat 7 Version: 7.0.16 Platform: PC OS/Version: Linux Status: NEW Severity: regression Priority: P2 Component: Catalina AssignedTo: dev@tomcat.apache.org ReportedBy: fr...@jfrog.org Classification: Unclassified We have an application were all the jars reside in the shared (or common) classloader of Tomcat, and then we are starting multiple webapp using the common jars. This setup works good with Java 1.6 and 1.7 on Tomcat 7.0.14. When using Tomcat 7.0.16-19-22 and 26 (the 4 versions I tested), on both JVM, we are getting the following for a random number of webapps (4 out of 11 always deploys, 7 fails) on a single tomcat instance. So, we tried to debug when, who, why the “java.util.zip.InflaterInputStream” was closed before the web application finished loading the resources and classes. In debug mode with a breaking point on “java.util.zip.InflaterInputStream#close” of course the bug does not happens :( We tested with JDK 1.7.0_01 and 1.6.0_20, on Tomcat 7.0.16, 7.0.19, 7.0.22, 7.0.26. On all configurations we got the issue. This error appears on all kind of resources from the jar (xml, properties, classes, …), during a tomcat call to "javax.servlet.ServletContextListener#contextInitialized". For java 7 we got: Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [META-INF/spring/addons.xml]; nested exception is java.io.IOException: Stream closed at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:408) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE] at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE] at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE] at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE] at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE] at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE] at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE] at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:126) [spring-context-3.0.6.RELEASE.jar:3.0.6.RELEASE] at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:92) [spring-context-3.0.6.RELEASE.jar:3.0.6.RELEASE] at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130) [spring-context-3.0.6.RELEASE.jar:3.0.6.RELEASE] at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467) [spring-context-3.0.6.RELEASE.jar:3.0.6.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397) [spring-context-3.0.6.RELEASE.jar:3.0.6.RELEASE] Caused by: java.io.IOException: Stream closed at java.util.zip.InflaterInputStream.ensureOpen(InflaterInputStream.java:67) [na:1.7.0_01] at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:121) [na:1.7.0_01] at java.io.FilterInputStream.read(FilterInputStream.java:83) [na:1.7.0_01] at com.sun.org.apache.xerces.internal.impl.XMLEntityManager$RewindableInputStream.read(XMLEntityManager.java:2905) [na:1.7.0_01] at com.sun.org.apache.xerces.internal.impl.XMLEntityManager$RewindableInputStream.read(XMLEntityManager.java:2937) [na:1.7.0_01] at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:302) [na:1.7.0_01] at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1750) [na:1.7.0_01] at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.scanLiteral(XMLEntityScanner.java:1071) [na:1.7.0_01] at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanPseudoAttribute(XMLScanner.java:590) [na:1.7.0_01] at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanXMLDeclOrTextDecl(XMLScanner.java:407) [na:1.7.
DO NOT REPLY [Bug 52746] Classloader closed in middle of webapp deployment
https://issues.apache.org/bugzilla/show_bug.cgi?id=52746 Fred Simon changed: What|Removed |Added CC||fr...@jfrog.org -- 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
WebSocket TODOs
All, The bulk of the WebSocket implementation is complete. There are, however, still quite a few TODOs. 1. Autobahn failure of test 7.5.1 (close handling) 2. Autobahn UTF-8 failures. Invalid UTF-8 is not being detected by the Reader. Needs further investigating. 3. Autobhan performance failures. Not all these tests are completing. Need to figure out why. 4. i18n. Fix all the TODOs and ensure there are no hard-coded English messages. 5. Threading. Fix the TODOs associated around multiple threads trying to send messages at the same time. 6. Profiling. Take a look with YourKit and Autobahn's performance tests. If there are obvious bottlenecks, fix them. 7. Add some documentation but mainly rely on the examples and the Javadoc. Once the above is complete, I intend back-porting the implementation to 7.0.x. I'd also like to see a lot more examples. I will probably back-port the generic upgrade support first before the above is complete. Help with any/all of the above welcome. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 51181] Add support for Web Sockets
https://issues.apache.org/bugzilla/show_bug.cgi?id=51181 --- Comment #40 from Mark Thomas 2012-02-23 12:42:40 UTC --- The bulk of the implementation is complete in trunk and should be at a stage where folks can take it out for a spin. Keep in mind it is far from final. One of things where feedback is required is the API so the sooner you start using it, the greater your chances of influencing the API. See the dev list for a more detailed TODO list if you want to help out. -- 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1292772 - in /tomcat/native/branches/1.1.x/native/srclib: BUILDING apr/ apr/NMAKEmakefile apr/NMAKEmakefile.inc apr/apr-enable-ipv6.patch openssl/ openssl/openssl-msvcrt.patch
Author: mturk Date: Thu Feb 23 12:46:14 2012 New Revision: 1292772 URL: http://svn.apache.org/viewvc?rev=1292772&view=rev Log: Add helper files for building windows dependencies (apr and openssl) Added: tomcat/native/branches/1.1.x/native/srclib/BUILDING tomcat/native/branches/1.1.x/native/srclib/apr/ tomcat/native/branches/1.1.x/native/srclib/apr/NMAKEmakefile (with props) tomcat/native/branches/1.1.x/native/srclib/apr/NMAKEmakefile.inc tomcat/native/branches/1.1.x/native/srclib/apr/apr-enable-ipv6.patch (with props) tomcat/native/branches/1.1.x/native/srclib/openssl/ tomcat/native/branches/1.1.x/native/srclib/openssl/openssl-msvcrt.patch (with props) Added: tomcat/native/branches/1.1.x/native/srclib/BUILDING URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/srclib/BUILDING?rev=1292772&view=auto == --- tomcat/native/branches/1.1.x/native/srclib/BUILDING (added) +++ tomcat/native/branches/1.1.x/native/srclib/BUILDING Thu Feb 23 12:46:14 2012 @@ -0,0 +1,42 @@ +Building apr on windows +--- + +Apply apr-enable-ipv6.patch. +This will enable IPV6 support for windows builds. + +Open Visual Studio command prompt and execute +nmake -f NMAKEMakefile BUILD_CPU=x86 + +For building 64-bit version execute +nmake -f NMAKEMakefile BUILD_CPU=x64 + +Make sure you select the correct Visual Studio command prompt +environment before calling nmake so that correct +compiler is setup for the target architecture. + + +Building OpenSSL + + +Apply openssl-msvcrt.patch + +This patch makes sure that static version of OpenSSL libraries +is linked to msvcrt.dll instead statically linking msvcrt. +Without that patch it won't be possible to create statically linked +Tomcat native .dll + +Then follow the standard OpenSSL make procedure ... + +> perl Configure VC-WIN32 +> ms\do_nasm +> nmake -f ms\nt.mak + +For 64-bit Windows use +> perl Configure VC-WIN64A +> ms\do_win64a +> nmake -f ms\nt.mak + +For 64-bit Windows on Itanium processor use +> perl Configure VC-WIN64I +> ms\do_win64i +> nmake -f ms\nt.mak Added: tomcat/native/branches/1.1.x/native/srclib/apr/NMAKEmakefile URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/srclib/apr/NMAKEmakefile?rev=1292772&view=auto == --- tomcat/native/branches/1.1.x/native/srclib/apr/NMAKEmakefile (added) +++ tomcat/native/branches/1.1.x/native/srclib/apr/NMAKEmakefile Thu Feb 23 12:46:14 2012 @@ -0,0 +1,229 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# NMAKEmakefile Master APR makefile. +# Usage: +# DLL=1 Build DLL version +# DEBUG=1 Build DEBUG version of APR +# +# Originally contributed by Mladen Turk +# +# +# + +!IF !DEFINED(APR_DECLARE_STATIC) || "$(APR_DECLARE_STATIC)" == "" +TARGET=DLL +EXTRA_CFLAGS = -DAPR_DECLARE_EXPORT +PROJECT = libapr-1 +!ELSE +TARGET=LIB +EXTRA_CFLAGS = -DAPR_DECLARE_STATIC +PROJECT = apr-1 +!ENDIF + +!IF !DEFINED(SRCDIR) || "$(SRCDIR)" == "" +SRCDIR = . +!ENDIF + +!include + + +!IF "$(TARGET)" != "LIB" +LFLAGS = $(LFLAGS) /version:1.4 +!ENDIF +INCLUDES = -I$(SRCDIR)\include -I$(SRCDIR)\include\arch -I$(SRCDIR)\include\arch\win32 -I$(SRCDIR)\include\arch\unix +PDBFLAGS = -Fo$(WORKDIR)\ -Fd$(WORKDIR)\$(PROJECT)-src +OBJECTS = \ + $(WORKDIR)\apr_atomic.obj \ + $(WORKDIR)\dso.obj \ + $(WORKDIR)\copy.obj \ + $(WORKDIR)\fileacc.obj \ + $(WORKDIR)\filepath_util.obj \ + $(WORKDIR)\fullrw.obj \ + $(WORKDIR)\mktemp.obj \ + $(WORKDIR)\tempdir.obj \ + $(WORKDIR)\buffer.obj \ + $(WORKDIR)\dir.obj \ + $(WORKDIR)\filedup.obj \ + $(WORKDIR)\filepath.obj \ + $(WORKDIR)\filestat.obj \ + $(WORKDIR)\filesys.obj \ + $(WORKDIR)\flock.obj \ + $(WORKDIR)\open.obj \ + $(WORKDIR)\pipe.obj \ + $(WORKDIR)\readwrite.obj \ + $(WORKDIR)\seek.obj \ + $(WORKDIR)\proc_mutex.obj \ + $(WORKDI
svn commit: r1292776 - /tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java
Author: markt Date: Thu Feb 23 12:48:56 2012 New Revision: 1292776 URL: http://svn.apache.org/viewvc?rev=1292776&view=rev Log: More javadoc Modified: tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java Modified: tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java?rev=1292776&r1=1292775&r2=1292776&view=diff == --- tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java (original) +++ tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java Thu Feb 23 12:48:56 2012 @@ -102,6 +102,15 @@ public class WsOutbound { } +/** + * Flush any message (binary or textual) that may be buffered and then send + * the a WebSocket binary message as a single frame with the provided buffer + * as the payload of the message. + * + * @param msgBb The buffer containing the payload + * + * @throws IOException If an error occurs writing to the client + */ public void writeBinaryMessage(ByteBuffer msgBb) throws IOException { if (text != null) { // Empty the buffer @@ -112,6 +121,15 @@ public class WsOutbound { } +/** + * Flush any message (binary or textual) that may be buffered and then send + * the a WebSocket text message as a single frame with the provided buffer + * as the payload of the message. + * + * @param msgBb The buffer containing the payload + * + * @throws IOException If an error occurs writing to the client + */ public void writeTextMessage(CharBuffer msgCb) throws IOException { if (text != null) { // Empty the buffer @@ -122,6 +140,11 @@ public class WsOutbound { } +/** + * Flush any message (binary or textual) that may be buffered. + * + * @throws IOException If an error occurs writing to the client + */ public void flush() throws IOException { doFlush(true); } @@ -142,8 +165,15 @@ public class WsOutbound { } - -public void close(WsFrame frame) throws IOException { +/** + * Respond to a client close by sending a close that echos the status code + * and message. + * + * @param frame The close frame received from a client + * + * @throws IOException If an error occurs writing to the client + */ +protected void close(WsFrame frame) throws IOException { if (frame.getPayLoadLength() > 0) { // Must be status (2 bytes) plus optional message if (frame.getPayLoadLength() == 1) { @@ -184,6 +214,15 @@ public class WsOutbound { } +/** + * Send a close message to the client + * + * @param statusMust be a valid status code or zero to send no code + * @param data Optional message. If message is defined, a valid status + * code must be provided. + * + * @throws IOException If an error occurs writing to the client + */ public void close(int status, ByteBuffer data) throws IOException { // TODO Think about threading requirements for writing. This is not // currently thread safe and writing almost certainly needs to be. @@ -214,6 +253,13 @@ public class WsOutbound { } +/** + * Send a pong message to the client + * + * @param data Optional message. + * + * @throws IOException If an error occurs writing to the client + */ public void pong(ByteBuffer data) throws IOException { // TODO Think about threading requirements for writing. This is not // currently thread safe and writing almost certainly needs to be. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1292777 - /tomcat/trunk/java/org/apache/coyote/spdy/SpdyAprNpnHandler.java
Author: markt Date: Thu Feb 23 12:49:34 2012 New Revision: 1292777 URL: http://svn.apache.org/viewvc?rev=1292777&view=rev Log: Trailing whitespace Modified: tomcat/trunk/java/org/apache/coyote/spdy/SpdyAprNpnHandler.java Modified: tomcat/trunk/java/org/apache/coyote/spdy/SpdyAprNpnHandler.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/spdy/SpdyAprNpnHandler.java?rev=1292777&r1=1292776&r2=1292777&view=diff == --- tomcat/trunk/java/org/apache/coyote/spdy/SpdyAprNpnHandler.java (original) +++ tomcat/trunk/java/org/apache/coyote/spdy/SpdyAprNpnHandler.java Thu Feb 23 12:49:34 2012 @@ -39,27 +39,27 @@ import org.apache.tomcat.util.net.Socket /** * Plugin for APR connector providing SPDY support via NPN negotiation. - * + * * Example: - * - * + * * This requires APR library ( libtcnative-1 ) to be present and compiled * with a recent openssl or a openssl patched with npn support. - * + * * Because we need to auto-detect SPDY and fallback to HTTP ( based on SSL next * proto ) this is implemented in tomcat a special way: * Http11AprProtocol will delegate to Spdy.process if spdy is * negotiated by TLS. - * + * */ public class SpdyAprNpnHandler implements Http11AprProtocol.NpnHandler { @@ -70,7 +70,7 @@ public class SpdyAprNpnHandler implement boolean ssl = true; @Override -public void init(final AbstractEndpoint ep, long sslContext, +public void init(final AbstractEndpoint ep, long sslContext, final Adapter adapter) { if (sslContext == 0) { // Apr endpoint without SSL. @@ -86,8 +86,8 @@ public class SpdyAprNpnHandler implement log.warn("SPDY/NPN not supported"); } } - - + + private final class SpdyContextApr extends SpdyContext { private final AbstractEndpoint ep; @@ -117,7 +117,7 @@ public class SpdyAprNpnHandler implement setCompressSupport(new CompressDeflater6()); } } - + // TODO: write/read should go to SocketWrapper. @Override public int write(byte[] data, int off, int len) { @@ -170,21 +170,21 @@ public class SpdyAprNpnHandler implement return rd; } } - + // apr normally creates a new object on each poll. // For 'upgraded' protocols we need to remember it's handled differently. -Map lightProcessors = +Map lightProcessors = new HashMap(); @Override public SocketState process(SocketWrapper socketO, SocketStatus status, Http11AprProtocol proto, AbstractEndpoint endpoint) { - + SocketWrapper socketW = socketO; long socket = ((Long) socketW.getSocket()).longValue(); SpdyConnectionApr lh = lightProcessors.get(socket); -// Are we getting an HTTP request ? +// Are we getting an HTTP request ? if (lh == null && status != SocketStatus.OPEN) { return null; } @@ -197,7 +197,7 @@ public class SpdyAprNpnHandler implement if (status == SocketStatus.TIMEOUT) { // Called from maintain - we're removed from the poll ((AprEndpoint) endpoint).getCometPoller().add( -socketO.getSocket().longValue(), false); +socketO.getSocket().longValue(), false); return SocketState.LONG; } if (status == SocketStatus.STOP || status == SocketStatus.DISCONNECT || @@ -215,8 +215,8 @@ public class SpdyAprNpnHandler implement // OPEN, no existing socket if (!ssl || SSLExt.checkNPN(socket, SpdyContext.SPDY_NPN)) { // NPN negotiated or not ssl -lh = new SpdyConnectionApr(socketW, spdyContext, ssl); - +lh = new SpdyConnectionApr(socketW, spdyContext, ssl); + int rc = lh.onBlockingSocket(); ss = (rc == SpdyConnection.LONG) ? SocketState.LONG : SocketState.CLOSED; @@ -227,21 +227,21 @@ public class SpdyAprNpnHandler implement return null; } } - + // OPEN is used for both 'first time' and 'new connection' -// In theory we shouldn't get another open while this is in +// In theory we shouldn't get another open while this is in // progress ( only after we add back to the poller ) if (ss == SocketState.LONG) { log.info("Long poll: " + status); ((AprEndpoint) endpoint).getCometPoller().add( -socketO.getSocket().longValue(), false); +socketO.getSocket().longValue(), false); } return ss; } - + public void onClose(SocketWrapper socketWrapper) { } - + } -
svn commit: r1292778 - /tomcat/native/branches/1.1.x/native/srclib/openssl/openssl-msvcrt.patch
Author: mturk Date: Thu Feb 23 12:49:46 2012 New Revision: 1292778 URL: http://svn.apache.org/viewvc?rev=1292778&view=rev Log: axe patch file timestamps Modified: tomcat/native/branches/1.1.x/native/srclib/openssl/openssl-msvcrt.patch Modified: tomcat/native/branches/1.1.x/native/srclib/openssl/openssl-msvcrt.patch URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/srclib/openssl/openssl-msvcrt.patch?rev=1292778&r1=1292777&r2=1292778&view=diff == --- tomcat/native/branches/1.1.x/native/srclib/openssl/openssl-msvcrt.patch (original) +++ tomcat/native/branches/1.1.x/native/srclib/openssl/openssl-msvcrt.patch Thu Feb 23 12:49:46 2012 @@ -1,5 +1,5 @@ util/pl/VC-32.pl.org 2010-09-13 18:28:34.0 +0200 -+++ util/pl/VC-32.pl 2012-02-23 13:19:12.876834604 +0100 +--- util/pl/VC-32.pl util/pl/VC-32.pl @@ -33,7 +33,7 @@ # considered safe to ignore. # - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1292779 - in /tomcat/trunk: java/org/apache/tomcat/spdy/CompressDeflater6.java res/checkstyle/org-import-control.xml
Author: markt Date: Thu Feb 23 12:50:18 2012 New Revision: 1292779 URL: http://svn.apache.org/viewvc?rev=1292779&view=rev Log: Keep checkstyle happy Modified: tomcat/trunk/java/org/apache/tomcat/spdy/CompressDeflater6.java tomcat/trunk/res/checkstyle/org-import-control.xml Modified: tomcat/trunk/java/org/apache/tomcat/spdy/CompressDeflater6.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/spdy/CompressDeflater6.java?rev=1292779&r1=1292778&r2=1292779&view=diff == --- tomcat/trunk/java/org/apache/tomcat/spdy/CompressDeflater6.java (original) +++ tomcat/trunk/java/org/apache/tomcat/spdy/CompressDeflater6.java Thu Feb 23 12:50:18 2012 @@ -25,7 +25,6 @@ import org.apache.tomcat.spdy.SpdyConnec /** * Java6 Deflater with the workaround from tomcat http filters. - * */ public class CompressDeflater6 implements CompressSupport { public static long DICT_ID = 3751956914L; @@ -90,7 +89,7 @@ public class CompressDeflater6 implement public synchronized void compress(SpdyFrame frame, int start) throws IOException { init(); - + if (compressBuffer == null) { compressBuffer = new byte[frame.data.length]; } @@ -134,20 +133,20 @@ public class CompressDeflater6 implement // nvCount is compressed in impl - spec is different init(); - + if (decompressBuffer == null) { decompressBuffer = new byte[frame.data.length]; } - + // will read from dec buffer to frame.data decMax = frame.endData; decOff = start; - + int off = start; int max = frame.data.length; - + zipIn.setInput(frame.data, start, decMax - start); - + while (true) { int rd; try { @@ -169,12 +168,12 @@ public class CompressDeflater6 implement byte[] b = new byte[decompressBuffer.length * 2]; System.arraycopy(decompressBuffer, 0, b, 0, off); decompressBuffer = b; - + } byte[] tmpBuf = decompressBuffer; decompressBuffer = frame.data; frame.data = tmpBuf; - + frame.off = start; frame.endData = off; } Modified: tomcat/trunk/res/checkstyle/org-import-control.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/res/checkstyle/org-import-control.xml?rev=1292779&r1=1292778&r2=1292779&view=diff == --- tomcat/trunk/res/checkstyle/org-import-control.xml (original) +++ tomcat/trunk/res/checkstyle/org-import-control.xml Thu Feb 23 12:50:18 2012 @@ -117,6 +117,9 @@ + + + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1292784 - /tomcat/native/branches/1.1.x/native/srclib/BUILDING
Author: mturk Date: Thu Feb 23 12:51:58 2012 New Revision: 1292784 URL: http://svn.apache.org/viewvc?rev=1292784&view=rev Log: Favor building static APR in example Modified: tomcat/native/branches/1.1.x/native/srclib/BUILDING Modified: tomcat/native/branches/1.1.x/native/srclib/BUILDING URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/srclib/BUILDING?rev=1292784&r1=1292783&r2=1292784&view=diff == --- tomcat/native/branches/1.1.x/native/srclib/BUILDING (original) +++ tomcat/native/branches/1.1.x/native/srclib/BUILDING Thu Feb 23 12:51:58 2012 @@ -5,10 +5,10 @@ Apply apr-enable-ipv6.patch. This will enable IPV6 support for windows builds. Open Visual Studio command prompt and execute -nmake -f NMAKEMakefile BUILD_CPU=x86 +nmake -f NMAKEMakefile BUILD_CPU=x86 APR_DECLARE_STATIC=1 For building 64-bit version execute -nmake -f NMAKEMakefile BUILD_CPU=x64 +nmake -f NMAKEMakefile BUILD_CPU=x64 APR_DECLARE_STATIC=1 Make sure you select the correct Visual Studio command prompt environment before calling nmake so that correct - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Tomcat Wiki] Update of "Roger Mbiama" by Roger Mbiama
Dear Wiki user, You have subscribed to a wiki page or wiki category on "Tomcat Wiki" for change notification. The "Roger Mbiama" page has been changed by Roger Mbiama: http://wiki.apache.org/tomcat/Roger%20Mbiama?action=diff&rev1=2&rev2=3 CategoryHomepage + Projects + Geronimo Apache - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: Tomcat web site UI update
On 15 February 2012 20:04, Jeremy Brown wrote: >>That is a comment that the layout needs to be >>cleaner (a comment I agree with). > > I agree too. I tried to create a cleaner layout and I posted a mockup for > all to see and voice their opinions. > > https://s3.amazonaws.com/jjbosstracker/TomcatMockup.jpg Looks good. There's no obvious link to the Tomcat License - this is a problem with the existing site, but perhaps could be fixed at the same time. > I'll leave it to Mark, Konstantin, Wesley and whomever else to let me know > when it is reasonable to move forward. > > Cheers, Jeremy > > > > On Tue, Feb 14, 2012 at 11:40 AM, Mark Thomas wrote: > >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA1 >> >> On 14/02/2012 16:21, Christopher Schultz wrote: >> > Mark, >> > >> > On 2/13/12 5:28 PM, Mark Thomas wrote: >> >> On 13/02/2012 20:11, Christopher Schultz wrote: >> >>> >> >>> IIRC, Pid did a bunch of work toward that end and it was >> >>> ultimately vetoed >> >> >> >> Reference please. That is not my recollection at all. >> > >> > Markmail remembers: >> > >> > http://markmail.org/message/og235cbvrdluiejg >> >> That isn't a veto. That is a comment that the layout needs to be >> cleaner (a comment I agree with). From a style point of view it is a >> big improvement. >> >> Mark >> >> > >> >> My recollection was that pid started down this road but hasn't >> >> found the time to finish it, or at least get it to a state where >> >> enough was complete that it could be committed. >> > >> > Konstantin liked it for the ROOT webapp, but not the Tomcat main >> > site. Same with Wesley Acheson. >> > >> > -chris >> > >> >> -BEGIN PGP SIGNATURE- >> Version: GnuPG v1.4.9 (MingW32) >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ >> >> iQIcBAEBAgAGBQJPOpx3AAoJEBDAHFovYFnnxEIP/Rvhm+UYlVq5enUzWlPbLmWC >> ZPXcduolPXTVwU2jpIZpSw020677h92kq3dWFL7JSlKNhuHK2C/fS0iI9YYY0Xp/ >> L9qYf7fvzSvzka7wUFJxFXLwPX6uoDAFwFtr+KSBmus3S206elkCCtILB/z06itA >> VE31NVqOmXqLq7ZrqsE+4oxzqdkiJV1Cl1uKfR+O0LRJJ39Yl5+LyjThRDWdandC >> JoWDnJhz/rAWC473X4NWh9q0LXK04uiufvHN3qtq1tbjl2YQ2tkEdcgJilXXCOF/ >> NgcnvBlWw5R6o9w2Hm7X5xu6YAi8FS1sdWZ5QAihMud23pxT4KCUlK7DSzz2v3Yt >> vWXEWpbaOD7kFa2c1Wj8dxED4q9ZB8UZZfBkCpG/AGXA1W1DrygPOePkRCNMzBSe >> L7JWBU5CBJ6avlSnEFMXZIgXg/iVf0bGJUSZr+nL9auoDmJwyN46/HyDeK9ucWyn >> O6TTzCFgCrcI01k7sVt3vrmtX2/JcvF2O0XMGRYTD/6trFWg96eA7NeOab7Rq90S >> S6HcEFWGgM52/SibK49yc1J1oQvwNFHzZ2FNINMLBHRI4FjnbLbwxqF8IcZtKs+5 >> YlbpiiXz+9LIUS8negOTTStXJFqmGaauYMZmIDf7JxFfxozCCQsayifzn+62STrX >> bx3sI4uobJxVqoNNe++B >> =F97+ >> -END PGP SIGNATURE- >> >> - >> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org >> For additional commands, e-mail: dev-h...@tomcat.apache.org >> >> - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1292816 - /tomcat/native/branches/1.1.x/native/srclib/openssl/openssl-msvcrt.patch
Author: mturk Date: Thu Feb 23 14:31:58 2012 New Revision: 1292816 URL: http://svn.apache.org/viewvc?rev=1292816&view=rev Log: Fix missing semicolon in patch file Modified: tomcat/native/branches/1.1.x/native/srclib/openssl/openssl-msvcrt.patch Modified: tomcat/native/branches/1.1.x/native/srclib/openssl/openssl-msvcrt.patch URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/srclib/openssl/openssl-msvcrt.patch?rev=1292816&r1=1292815&r2=1292816&view=diff == --- tomcat/native/branches/1.1.x/native/srclib/openssl/openssl-msvcrt.patch (original) +++ tomcat/native/branches/1.1.x/native/srclib/openssl/openssl-msvcrt.patch Thu Feb 23 14:31:58 2012 @@ -22,7 +22,7 @@ { $ex_libs.=' gdi32.lib advapi32.lib crypt32.lib user32.lib'; $ex_libs.=' bufferoverflowu.lib' if ($FLAVOR =~ /WIN64/ and `cl 2>&1` =~ /14\.00\.4[0-9]{4}\./); -+ $ex_libs.=' $(EXTRA_LIBS)' ++ $ex_libs.=' $(EXTRA_LIBS)'; # WIN32 UNICODE build gets linked with unicows.lib for # backward compatibility with Win9x. $ex_libs="unicows.lib $ex_libs" if ($FLAVOR =~ /WIN32/ and $cflags =~ /\-DUNICODE/); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1292818 - in /tomcat/native/branches/1.1.x/native/srclib/apr: NMAKEmakefile NMAKEmakefile.inc
Author: mturk Date: Thu Feb 23 14:35:43 2012 New Revision: 1292818 URL: http://svn.apache.org/viewvc?rev=1292818&view=rev Log: Use correct set of files for apr-1.4.x Modified: tomcat/native/branches/1.1.x/native/srclib/apr/NMAKEmakefile tomcat/native/branches/1.1.x/native/srclib/apr/NMAKEmakefile.inc Modified: tomcat/native/branches/1.1.x/native/srclib/apr/NMAKEmakefile URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/srclib/apr/NMAKEmakefile?rev=1292818&r1=1292817&r2=1292818&view=diff == --- tomcat/native/branches/1.1.x/native/srclib/apr/NMAKEmakefile (original) +++ tomcat/native/branches/1.1.x/native/srclib/apr/NMAKEmakefile Thu Feb 23 14:35:43 2012 @@ -50,52 +50,54 @@ PDBFLAGS = -Fo$(WORKDIR)\ -Fd$(WORKDIR)\ OBJECTS = \ $(WORKDIR)\apr_atomic.obj \ $(WORKDIR)\dso.obj \ - $(WORKDIR)\copy.obj \ - $(WORKDIR)\fileacc.obj \ - $(WORKDIR)\filepath_util.obj \ - $(WORKDIR)\fullrw.obj \ - $(WORKDIR)\mktemp.obj \ - $(WORKDIR)\tempdir.obj \ $(WORKDIR)\buffer.obj \ + $(WORKDIR)\copy.obj \ $(WORKDIR)\dir.obj \ + $(WORKDIR)\fileacc.obj \ $(WORKDIR)\filedup.obj \ $(WORKDIR)\filepath.obj \ + $(WORKDIR)\filepath_util.obj \ $(WORKDIR)\filestat.obj \ $(WORKDIR)\filesys.obj \ $(WORKDIR)\flock.obj \ + $(WORKDIR)\fullrw.obj \ + $(WORKDIR)\mktemp.obj \ $(WORKDIR)\open.obj \ $(WORKDIR)\pipe.obj \ $(WORKDIR)\readwrite.obj \ $(WORKDIR)\seek.obj \ + $(WORKDIR)\tempdir.obj \ $(WORKDIR)\proc_mutex.obj \ $(WORKDIR)\thread_cond.obj \ $(WORKDIR)\thread_mutex.obj \ $(WORKDIR)\thread_rwlock.obj \ $(WORKDIR)\apr_pools.obj \ - $(WORKDIR)\errorcodes.obj \ - $(WORKDIR)\getopt.obj \ - $(WORKDIR)\otherchild.obj \ - $(WORKDIR)\version.obj \ + $(WORKDIR)\apr_app.obj \ $(WORKDIR)\charset.obj \ $(WORKDIR)\env.obj \ + $(WORKDIR)\errorcodes.obj \ + $(WORKDIR)\getopt.obj \ $(WORKDIR)\internal.obj \ $(WORKDIR)\misc.obj \ + $(WORKDIR)\otherchild.obj \ $(WORKDIR)\rand.obj \ $(WORKDIR)\start.obj \ $(WORKDIR)\utf8.obj \ + $(WORKDIR)\version.obj \ $(WORKDIR)\common.obj \ $(WORKDIR)\mmap.obj \ $(WORKDIR)\inet_ntop.obj \ $(WORKDIR)\inet_pton.obj \ $(WORKDIR)\multicast.obj \ - $(WORKDIR)\sockaddr.obj \ $(WORKDIR)\sendrecv.obj \ + $(WORKDIR)\sockaddr.obj \ $(WORKDIR)\sockets.obj \ + $(WORKDIR)\socket_util.obj \ $(WORKDIR)\sockopt.obj \ $(WORKDIR)\apr_getpass.obj \ + $(WORKDIR)\poll.obj \ $(WORKDIR)\pollcb.obj \ $(WORKDIR)\pollset.obj \ - $(WORKDIR)\poll.obj \ $(WORKDIR)\select.obj \ $(WORKDIR)\apr_random.obj \ $(WORKDIR)\sha2.obj \ @@ -113,7 +115,6 @@ OBJECTS = \ $(WORKDIR)\signals.obj \ $(WORKDIR)\thread.obj \ $(WORKDIR)\threadpriv.obj \ - $(WORKDIR)\access.obj \ $(WORKDIR)\time.obj \ $(WORKDIR)\timestr.obj \ $(WORKDIR)\groupinfo.obj \ @@ -141,6 +142,9 @@ $(BUILDLIB) : $(WORKDIR) : @$(MAKEWORKDIR) +$(SRCDIR)\include\apr.h: $(SRCDIR)\include\apr.hw + -@copy $(SRCDIR)\include\apr.hw $(SRCDIR)\include\apr.h + {$(SRCDIR)\atomic\win32}.c{$(WORKDIR)}.obj: $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $< @@ -204,10 +208,10 @@ $(WORKDIR) : {$(SRCDIR)\user\win32}.c{$(WORKDIR)}.obj: $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $< -$(OBJECTS): $(SRCDIR)\include\*.h $(SRCDIR)\include\arch\*.h $(SRCDIR)\include\arch\win32\*.h $(SRCDIR)\include\arch\unix\*.h +$(OBJECTS): $(SRCDIR)\include\apr.h !IF "$(TARGET)" == "DLL" -$(BUILDRES): libapr.rc $(SRCDIR)\include\*.h +$(BUILDRES): libapr.rc $(SRCDIR)\include\apr.h $(RC) $(RCFLAGS) /i "$(SRCDIR)\include" /d "APR_VERSION_ONLY" /fo $(BUILDRES) libapr.rc $(BUILDBIN): $(WORKDIR) $(OBJECTS) $(BUILDRES) $(LINK) $(LFLAGS) $(OBJECTS) $(BUILDRES) $(LIBS) /pdb:$(BUILDPDB) /out:$(BUILDBIN) @@ -227,3 +231,4 @@ install: $(BUILDINC) $(BUILDLIB) $(WORKD @xcopy "$(SRCDIR)\include\arch\win32\*.h" "$(BUILDINC)\arch\win32" /Y /Q @xcopy "$(WORKDIR)\*.lib" "$(BUILDLIB)" /Y /Q @xcopy "$(WORKDIR)\*.dll" "$(BUILDLIB)" /Y /Q 2>NUL + Modified: tomcat/native/branches/1.1.x/native/srclib/apr/NMAKEmakefile.inc URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/srclib/apr/NMAKEmakefile.inc?rev=1292818&r1=1292817&r2=1292818&view=diff == --- tomcat/native/branches/1.1.x/native/srclib/apr/NMAKEmakefile.inc (original) +++ tomcat/native/branches/1.1.x/native/srclib/apr/NMAKEmakefile.inc Thu Feb 23 14:35:43 2012 @@ -13,334 +13,221 @@ # See the License for the specific
svn commit: r1292819 - /tomcat/native/branches/1.1.x/native/srclib/apr/NMAKEmakefile.inc
Author: mturk Date: Thu Feb 23 14:38:15 2012 New Revision: 1292819 URL: http://svn.apache.org/viewvc?rev=1292819&view=rev Log: Oops wrong copy/paste revert the original content Modified: tomcat/native/branches/1.1.x/native/srclib/apr/NMAKEmakefile.inc Modified: tomcat/native/branches/1.1.x/native/srclib/apr/NMAKEmakefile.inc URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/srclib/apr/NMAKEmakefile.inc?rev=1292819&r1=1292818&r2=1292819&view=diff == --- tomcat/native/branches/1.1.x/native/srclib/apr/NMAKEmakefile.inc (original) +++ tomcat/native/branches/1.1.x/native/srclib/apr/NMAKEmakefile.inc Thu Feb 23 14:38:15 2012 @@ -13,221 +13,335 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# @author Mladen Turk +# +# # # -# NMAKEmakefile Master APR makefile. -# Usage: -# DLL=1 Build DLL version -# DEBUG=1 Build DEBUG version of APR +# Makefile.inc Master makefile definitions. +# This file defines CPU architecture and basic compiler +# and linker parameters. +# Common params: +# CPU Compile for specified CPU. Supported CPU's are: +# X86 (Common x86 architecture) +# X64 (AMD64/EMT64 architecture) +# I64 (Intel IA64 architecture) +# If not specified it will default to the +# PROCESSOR_ARCHITECTURE environment variable +# or to the X86 if not specified. +# WINVERCompile for specified Windows version +# WINNT for Windows 2000 and up(default) +# WINXP for Windows XP and up +# WIN2003 for Windows 2003 and up +# VSITA for Windows Vista and up +# Deprecated targets (may not even compile): +# NT4 for Windows NT4 and up +# WIN9X for Windows 95, 98 and Me +# BUILD Build version +# RETAIL or RELEASE (default) +# DEBUG +# TARGETBuild application target +# EXE Console executable (default) +# GUI Windows GUI executable +# DLL Dynamic Link Library +# LIB Static library +# UNICODE Build unicode version +# If definded and not empty -D_UNICODE is added +# to CFLAGS; -D_MBCS is added otherwise +# Environment variables used: +# EXTRA_CFLAGSAdded to the common CFLAGS +# EXTRA_CXXFLAGS Added to the common CXXFLAGS +# EXTRA_LIBS Added to the common LIBS +# EXTRA_LFLAGSAdded to the common LFLAGS +# EXTRA_RCFLAGS Added to the common RCFLAGS # -# Originally contributed by Mladen Turk +# Compiler tools environment variables: +# CCC compiler (defaults to cl.exe) +# CXX C++ compiler (defaults to $CC -TP) +# CPP C preprocessor (defaults to $CC -EP) +# LINK Linker (defaults to link.exe) +# RCResource compiler (defaults to rc.exe) +# MTManifest toolkit (defaults to mt.exe) +# MLAssembler (defaults to ml.exe or ml64.exe) +# +# Originally contributed by Mladen Turk # # # -!IF !DEFINED(APR_DECLARE_STATIC) || "$(APR_DECLARE_STATIC)" == "" -TARGET=DLL -EXTRA_CFLAGS = -DAPR_DECLARE_EXPORT -PROJECT = libapr-1 +# C/C++ compiler +!IF !DEFINED(CC) || "$(CC)" == "" +CC = cl.exe +!ENDIF +!IF !DEFINED(CXX) || "$(CXX)" == "" +CXX = $(CC) -TP +!ENDIF +!IF !DEFINED(CPP) || "$(CPP)" == "" +CPP = $(CC) -EP +!ENDIF +# Linker +!IF !DEFINED(LINK) || "$(LINK)" == "" +LINK = link.exe +!ENDIF +# Resource Compiler +!IF !DEFINED(RC) || "$(RC)" == "" +RC = rc.exe +!ENDIF +# Manifest toolkit +!IF !DEFINED(MT) || "$(MT)" == "" +MT = mt.exe +!ENDIF + +# Use BUILD_CPU if CPU was not set +!IF !DEFINED(CPU) || "$(CPU)" == "" +!IF "$(BUILD_CPU)" == "i386" || "$(BUILD_CPU)" == "x86" || "$(BUILD_CPU)" == "i686" +CPU=X86 +!ENDIF +!IF "$(BUILD_CPU)" == "amd64" || "$(BUILD_CPU)" == "x86_64" || "$(BUILD_CPU)" == "x64" +CPU=X64 +!ENDIF +!IF "$(BUILD_CPU)" == "ia64" || "$(BUILD_CPU)" == "i64" +CPU=I64 +!ENDIF +!ENDIF +# Figure out CPU from the current host +!IF !DEFINED(CPU) || "$(CPU)" == "" +!IF "$(PROCESSOR_ARCHITECTURE)" == "" +!IF "$(PROCESSOR_ARCHITEW6432)" == "" +CPU=X86 +!ELSE +CPU=$(PROCESSOR_ARCHITEW6432) +!ENDIF
DO NOT REPLY [Bug 52744] [Jasper] JSP files are always recompiled in development mode
https://issues.apache.org/bugzilla/show_bug.cgi?id=52744 --- Comment #2 from xiaming 2012-02-23 15:05:22 UTC --- Anyone could help look into this report? thanks in advance! -- 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1292840 - in /tomcat/native/branches/1.1.x/native: NMAKEmakefile NMAKEmakefile.inc srclib/apr/NMAKEmakefile srclib/apr/NMAKEmakefile.inc
Author: mturk Date: Thu Feb 23 16:15:14 2012 New Revision: 1292840 URL: http://svn.apache.org/viewvc?rev=1292840&view=rev Log: Add command line makefile Added: tomcat/native/branches/1.1.x/native/NMAKEmakefile (with props) tomcat/native/branches/1.1.x/native/NMAKEmakefile.inc - copied unchanged from r1292821, tomcat/native/branches/1.1.x/native/srclib/apr/NMAKEmakefile.inc Removed: tomcat/native/branches/1.1.x/native/srclib/apr/NMAKEmakefile.inc Modified: tomcat/native/branches/1.1.x/native/srclib/apr/NMAKEmakefile Added: tomcat/native/branches/1.1.x/native/NMAKEmakefile URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/NMAKEmakefile?rev=1292840&view=auto == --- tomcat/native/branches/1.1.x/native/NMAKEmakefile (added) +++ tomcat/native/branches/1.1.x/native/NMAKEmakefile Thu Feb 23 16:15:14 2012 @@ -0,0 +1,142 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# NMAKEmakefile Master Tomcat Native makefile. +# Usage: +# STATIC=1 Use static version of the APR +# DEBUG=1 Build DEBUG version of TCN +# +# Originally contributed by Mladen Turk +# +# +# + +!IF !DEFINED(APR_DECLARE_STATIC) || "$(APR_DECLARE_STATIC)" == "" +PROJECT = libtcnative-1 +APR_LIB = libapr-1.lib +!ELSE +EXTRA_CFLAGS = -DAPR_DECLARE_STATIC +PROJECT = tcnative-1 +APR_LIB = apr-1.lib +!ENDIF +TARGET = DLL + +!include + +!IF !DEFINED(SRCDIR) || "$(SRCDIR)" == "" +SRCDIR = . +!ENDIF + +INCLUDES = -I$(SRCDIR)\include $(JAVA_INCLUDES) + +!IFNDEF WITH_APR +WITH_APR = $(SRCDIR)\srclib\apr +LDIRS = /libpath:"$(WITH_APR)\$(WORKDIR)" +!ELSE +LDIRS = /libpath:"$(WITH_APR)\lib" +!ENDIF + +INCLUDES = $(INCLUDES) -I$(WITH_APR)\include -I$(WITH_APR)\include\arch\win32 +!IF DEFINED(WITH_OPENSSL) +INCLUDES = $(INCLUDES) -I$(WITH_OPENSSL)\include +LDIRS = $(LDIRS) /libpath:"$(WITH_OPENSSL)\lib" +!ELSE +WITH_OPENSSL = $(SRCDIR)\srclib\openssl +INCLUDES = $(INCLUDES) $(WITH_OPENSSL)\inc32 +LDIRS = $(LDIRS) /libpath:"$(WITH_OPENSSL)\out32" +!ENDIF + +LFLAGS = $(LFLAGS) /version:1.1 +LFLAGS = $(LFLAGS) user32.lib psapi.lib gdi32.lib shlwapi.lib wldap32.lib ole32.lib +LFLAGS = $(LFLAGS) $(APR_LIB) +LFLAGS = $(LFLAGS) libeay32.lib ssleay32.lib +!IF DEFINED(WITH_OPENSSL) +!ELSE +!ENDIF + +CFLAGS = $(CFLAGS) -DZLIB_WINAPI -DNO_IDEA -DNO_RC5 -DNO_MDC2 -DOPENSSL_NO_IDEA \ + -DOPENSSL_NO_RC5 -DOPENSSL_NO_MDC2 -DHAVE_OPENSSL -DHAVE_SSL_SET_STATE=1 \ + -DTCN_DECLARE_EXPORT + + +PDBFLAGS = -Fo$(WORKDIR)\ -Fd$(WORKDIR)\$(PROJECT)-src +OBJECTS = \ + $(WORKDIR)\address.obj \ + $(WORKDIR)\bb.obj \ + $(WORKDIR)\dir.obj \ + $(WORKDIR)\error.obj \ + $(WORKDIR)\file.obj \ + $(WORKDIR)\info.obj \ + $(WORKDIR)\jnilib.obj \ + $(WORKDIR)\lock.obj \ + $(WORKDIR)\misc.obj \ + $(WORKDIR)\mmap.obj \ + $(WORKDIR)\multicast.obj \ + $(WORKDIR)\network.obj \ + $(WORKDIR)\os.obj \ + $(WORKDIR)\poll.obj \ + $(WORKDIR)\pool.obj \ + $(WORKDIR)\proc.obj \ + $(WORKDIR)\shm.obj \ + $(WORKDIR)\ssl.obj \ + $(WORKDIR)\sslcontext.obj \ + $(WORKDIR)\sslinfo.obj \ + $(WORKDIR)\sslnetwork.obj \ + $(WORKDIR)\sslutils.obj \ + $(WORKDIR)\stdlib.obj \ + $(WORKDIR)\user.obj \ + $(WORKDIR)\thread.obj \ + $(WORKDIR)\ntpipe.obj \ + $(WORKDIR)\registry.obj \ + $(WORKDIR)\system.obj + +BUILDLIB = $(PREFIX)\lib +BUILDBIN = $(WORKDIR)\$(PROJECT).dll +BUILDPDB = $(WORKDIR)\$(PROJECT).pdb +BUILDRES = $(WORKDIR)\$(PROJECT).res +BUILDMAN = $(BUILDBIN).manifest + +all : $(WORKDIR) $(BUILDBIN) + +$(BUILDLIB) : + @if not exist "$(BUILDLIB)\$(NULL)" mkdir "$(BUILDLIB)" + +$(WORKDIR) : + @$(MAKEWORKDIR) + +{$(SRCDIR)\src}.c{$(WORKDIR)}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $< + +{$(SRCDIR)\os\win32}.c{$(WORKDIR)}.obj: + $(CC) $(CFLAGS) $(INCLUDES) $(PDBFLAGS) $< + +$(OBJECTS): $(SRCDIR)\include\*.h + +$(BUILDRES): $(SRCDIR)\os\win32\libtcnative.rc $(SRCDIR)\include\*.h +
svn commit: r1292841 - in /tomcat/native/branches/1.1.x/native: include/tcn_api.h src/jnilib.c
Author: mturk Date: Thu Feb 23 16:21:11 2012 New Revision: 1292841 URL: http://svn.apache.org/viewvc?rev=1292841&view=rev Log: Axe so called public API which was never used. We are always loaded from JVM so no need for useless exports Modified: tomcat/native/branches/1.1.x/native/include/tcn_api.h tomcat/native/branches/1.1.x/native/src/jnilib.c Modified: tomcat/native/branches/1.1.x/native/include/tcn_api.h URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/include/tcn_api.h?rev=1292841&r1=1292840&r2=1292841&view=diff == --- tomcat/native/branches/1.1.x/native/include/tcn_api.h (original) +++ tomcat/native/branches/1.1.x/native/include/tcn_api.h Thu Feb 23 16:21:11 2012 @@ -36,108 +36,6 @@ #include /** - * TCN_DECLARE_EXPORT is defined when building the TCN dynamic library, - * so that all public symbols are exported. - * - * TCN_DECLARE_STATIC is defined when including the TCN public headers, - * to provide static linkage when the dynamic library may be unavailable. - * - * TCN_DECLARE_STATIC and TCN_DECLARE_EXPORT are left undefined when - * including the TCN public headers, to import and link the symbols from - * the dynamic TCN library and assure appropriate indirection and calling - * conventions at compile time. - */ - -#if !defined(WIN32) -/** - * The public TCN functions are declared with TCN_DECLARE(), so they may - * use the most appropriate calling convention. Public APR functions with - * variable arguments must use TCN_DECLARE_NONSTD(). - * - * @deffunc TCN_DECLARE(rettype) apr_func(args); - */ -#define TCN_DECLARE(type)type -/** - * The public TCN functions using variable arguments are declared with - * TCN_DECLARE_NONSTD(), as they must use the C language calling convention. - * - * @deffunc TCN_DECLARE_NONSTD(rettype) apr_func(args, ...); - */ -#define TCN_DECLARE_NONSTD(type) type -/** - * The public TCN variables are declared with TCN_DECLARE_DATA. - * This assures the appropriate indirection is invoked at compile time. - * - * @deffunc TCN_DECLARE_DATA type apr_variable; - * @tip extern TCN_DECLARE_DATA type apr_variable; syntax is required for - * declarations within headers to properly import the variable. - */ -#define TCN_DECLARE_DATA -#elif defined(TCN_DECLARE_STATIC) -#define TCN_DECLARE(type)type __stdcall -#define TCN_DECLARE_NONSTD(type) type -#define TCN_DECLARE_DATA -#elif defined(TCN_DECLARE_EXPORT) -#define TCN_DECLARE(type)__declspec(dllexport) type __stdcall -#define TCN_DECLARE_NONSTD(type) __declspec(dllexport) type -#define TCN_DECLARE_DATA __declspec(dllexport) -#else -/** - * The public TCN functions are declared with TCN_DECLARE(), so they may - * use the most appropriate calling convention. Public APR functions with - * variable arguments must use TCN_DECLARE_NONSTD(). - * - */ -#define TCN_DECLARE(type)__declspec(dllimport) type __stdcall -/** - * The public TCN functions using variable arguments are declared with - * TCN_DECLARE_NONSTD(), as they must use the C language calling convention. - * - */ -#define TCN_DECLARE_NONSTD(type) __declspec(dllimport) type -/** - * The public TCN variables are declared with TCN_DECLARE_DATA. - * This assures the appropriate indirection is invoked at compile time. - * - * @remark extern TCN_DECLARE_DATA type apr_variable; syntax is required for - * declarations within headers to properly import the variable. - */ -#define TCN_DECLARE_DATA __declspec(dllimport) -#endif - -#if !defined(WIN32) || defined(TCN_MODULE_DECLARE_STATIC) -/** - * Declare a dso module's exported module structure as TCN_MODULE_DECLARE_DATA. - * - * Unless TCN_MODULE_DECLARE_STATIC is defined at compile time, symbols - * declared with TCN_MODULE_DECLARE_DATA are always exported. - * @code - * module TCN_MODULE_DECLARE_DATA mod_tag - * @endcode - */ -#if defined(WIN32) -#define TCN_MODULE_DECLARE(type)type __stdcall -#else -#define TCN_MODULE_DECLARE(type)type -#endif -#define TCN_MODULE_DECLARE_NONSTD(type) type -#define TCN_MODULE_DECLARE_DATA -#else -/** - * TCN_MODULE_DECLARE_EXPORT is a no-op. Unless contradicted by the - * TCN_MODULE_DECLARE_STATIC compile-time symbol, it is assumed and defined. - */ -#define TCN_MODULE_DECLARE_EXPORT -#define TCN_MODULE_DECLARE(type) __declspec(dllexport) type __stdcall -#define TCN_MODULE_DECLARE_NONSTD(type) __declspec(dllexport) type -#define TCN_MODULE_DECLARE_DATA __declspec(dllexport) -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/** * @file tcn_api.h * @brief * @@ -146,19 +44,19 @@ extern "C" { /* Return global apr pool */ -TCN_DECLARE(apr_pool_t *) tcn_get_global_pool(void); +apr_pool_t *tcn_get_global_pool(void); /* Return global String class */ -TCN_DECLARE(jclass) tcn_get_string_class(void); +jclass tcn_get_string_class(void); /* R
svn commit: r1292843 - in /tomcat/native/branches/1.1.x/native: NMAKEmakefile libtcnative.dsp tcnative.dsp
Author: mturk Date: Thu Feb 23 16:26:12 2012 New Revision: 1292843 URL: http://svn.apache.org/viewvc?rev=1292843&view=rev Log: Axe TCN_DECLARE_EXPORT define. Not used anywhere Modified: tomcat/native/branches/1.1.x/native/NMAKEmakefile tomcat/native/branches/1.1.x/native/libtcnative.dsp tomcat/native/branches/1.1.x/native/tcnative.dsp Modified: tomcat/native/branches/1.1.x/native/NMAKEmakefile URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/NMAKEmakefile?rev=1292843&r1=1292842&r2=1292843&view=diff == --- tomcat/native/branches/1.1.x/native/NMAKEmakefile (original) +++ tomcat/native/branches/1.1.x/native/NMAKEmakefile Thu Feb 23 16:26:12 2012 @@ -69,8 +69,7 @@ LFLAGS = $(LFLAGS) libeay32.lib ssleay32 !ENDIF CFLAGS = $(CFLAGS) -DZLIB_WINAPI -DNO_IDEA -DNO_RC5 -DNO_MDC2 -DOPENSSL_NO_IDEA \ - -DOPENSSL_NO_RC5 -DOPENSSL_NO_MDC2 -DHAVE_OPENSSL -DHAVE_SSL_SET_STATE=1 \ - -DTCN_DECLARE_EXPORT + -DOPENSSL_NO_RC5 -DOPENSSL_NO_MDC2 -DHAVE_OPENSSL -DHAVE_SSL_SET_STATE=1 PDBFLAGS = -Fo$(WORKDIR)\ -Fd$(WORKDIR)\$(PROJECT)-src Modified: tomcat/native/branches/1.1.x/native/libtcnative.dsp URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/libtcnative.dsp?rev=1292843&r1=1292842&r2=1292843&view=diff == --- tomcat/native/branches/1.1.x/native/libtcnative.dsp (original) +++ tomcat/native/branches/1.1.x/native/libtcnative.dsp Thu Feb 23 16:26:12 2012 @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /Zi /O2 /Oy- /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "../apr/include" /I "../apr/include/arch/win32" /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "../openssl/inc32" /D "NDEBUG" /D "TCN_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /D "NO_IDEA" /D "NO_RC5" /D "NO_MDC2" /D "OPENSSL_NO_IDEA" /D "OPENSSL_NO_RC5" /D "OPENSSL_NO_MDC2" /D "HAVE_OPENSSL" /D HAVE_SSL_SET_STATE=1 /Fd"Release\libtcnative_src" /FD /c +# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./srclib/apr/include" /I "./srclib/apr/include/arch/win32" /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "./srclib/openssl/inc32" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "NO_IDEA" /D "NO_RC5" /D "NO_MDC2" /D "OPENSSL_NO_IDEA" /D "OPENSSL_NO_RC5" /D "OPENSSL_NO_MDC2" /D "HAVE_OPENSSL" /D HAVE_SSL_SET_STATE=1 /Fd"Release\libtcnative_src" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -53,7 +53,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib wldap32.lib psapi.lib ole32.lib shlwapi.lib /nologo /base:"0x6EE0" /subsystem:windows /dll /debug /machine:I386 /opt:ref -# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib wldap32.lib psapi.lib ole32.lib shlwapi.lib rpcrt4.lib libeay32.lib ssleay32.lib /nologo /base:"0x6EE0" /subsystem:windows /dll /debug /machine:I386 /out:"Release/libtcnative-1.dll" /libpath:"../openssl/out32" /libpath:"../openssl/out32dll" /opt:ref +# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib wldap32.lib psapi.lib ole32.lib shlwapi.lib rpcrt4.lib libeay32.lib ssleay32.lib /nologo /base:"0x6EE0" /subsystem:windows /dll /debug /machine:I386 /out:"Release/libtcnative-1.dll" /libpath:"./srclib/openssl/out32" /libpath:"./srclib/openssl/out32dll" /opt:ref !ELSEIF "$(CFG)" == "libtcnative - Win32 Debug" @@ -69,7 +69,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c -# ADD CPP /nologo /MDd /W4 /GX /Zi /Od /I "./include" /I "../apr/include" /I "../apr/include/arch/win32" /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "../openssl/inc32" /D "_DEBUG" /D "TCN_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /D "NO_IDEA" /D "NO_RC5" /D "NO_MDC2" /D "OPENSSL_NO_IDEA" /D "OPENSSL_NO_RC5" /D "OPENSSL_NO_MDC2" /D "HAVE_OPENSSL" /D HAVE_SSL_SET_STATE=1 /Fd"Debug\libtcnative_src" /FD /c +# ADD CPP /nologo /MDd /W4 /GX /Zi /Od /I "./include" /I "./srclib/apr/include" /I "./srclib/apr/include/arch/win32" /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "./srclib/openssl/inc32" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "NO_IDEA" /D "NO_RC5" /D "NO_MDC2" /D "OPENSSL_NO_IDEA" /D "OPENSSL_NO_RC5" /D "OPENSSL_NO_MDC2" /D "HAVE_OPENSSL" /D HAVE_SSL_SET_STATE=1 /Fd"Debug\libtcnative_src" /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -79,7 +79,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo
DO NOT REPLY [Bug 52749] New: Possibly wrong kill option in catalina.sh
https://issues.apache.org/bugzilla/show_bug.cgi?id=52749 Bug #: 52749 Summary: Possibly wrong kill option in catalina.sh Product: Tomcat 7 Version: trunk Platform: PC Status: NEW Severity: normal Priority: P2 Component: Catalina AssignedTo: dev@tomcat.apache.org ReportedBy: gerard-bo...@hotmail.com Classification: Unclassified In catalina.sh the kill direct after the call to org.apache.catalina.startup.Bootstrap should be kill -15 and not kill -0. As it is now the process isn't termed. Met vriendelijke groet, Gerard Borst -- 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1292859 - in /tomcat/native/branches/1.1.x/native: include/ssl_private.h src/sslcontext.c
Author: mturk Date: Thu Feb 23 17:21:50 2012 New Revision: 1292859 URL: http://svn.apache.org/viewvc?rev=1292859&view=rev Log: Add support for loading pkcs12 certificates. Certificate must have .pkcs12 extension Modified: tomcat/native/branches/1.1.x/native/include/ssl_private.h tomcat/native/branches/1.1.x/native/src/sslcontext.c Modified: tomcat/native/branches/1.1.x/native/include/ssl_private.h URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/include/ssl_private.h?rev=1292859&r1=1292858&r2=1292859&view=diff == --- tomcat/native/branches/1.1.x/native/include/ssl_private.h (original) +++ tomcat/native/branches/1.1.x/native/include/ssl_private.h Thu Feb 23 17:21:50 2012 @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include Modified: tomcat/native/branches/1.1.x/native/src/sslcontext.c URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/src/sslcontext.c?rev=1292859&r1=1292858&r2=1292859&view=diff == --- tomcat/native/branches/1.1.x/native/src/sslcontext.c (original) +++ tomcat/native/branches/1.1.x/native/src/sslcontext.c Thu Feb 23 17:21:50 2012 @@ -499,6 +499,53 @@ static X509 *load_pem_cert(tcn_ssl_ctxt_ return cert; } +static int ssl_load_pkcs12(tcn_ssl_ctxt_t *c, const char *file, + EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca) +{ +const char *pass; +charbuff[PEM_BUFSIZE]; +int len, rc = 0; +PKCS12 *p12; +BIO*in; +tcn_pass_cb_t *cb_data = c->cb_data; + +if ((in = BIO_new(BIO_s_file())) == 0) +return 0; +if (BIO_read_filename(in, file) <= 0) { +BIO_free(in); +return 0; +} +p12 = d2i_PKCS12_bio(in, 0); +if (p12 == 0) { +/* Error loading PKCS12 file */ +goto cleanup; +} +/* See if an empty password will do */ +if (PKCS12_verify_mac(p12, "", 0) || PKCS12_verify_mac(p12, 0, 0)) { +pass = ""; +} +else { +if (!cb_data) +cb_data = &tcn_password_callback; +len = SSL_password_callback(buff, PEM_BUFSIZE, 0, cb_data); +if (len < 0) { +/* Passpharse callback error */ +goto cleanup; +} +if (!PKCS12_verify_mac(p12, buff, len)) { +/* Mac verify error (wrong password?) in PKCS12 file */ +goto cleanup; +} +pass = buff; +} +rc = PKCS12_parse(p12, pass, pkey, cert, ca); +cleanup: +if (p12 != 0) +PKCS12_free(p12); +BIO_free(in); +return rc; +} + TCN_IMPLEMENT_CALL(void, SSLContext, setRandom)(TCN_STDARGS, jlong ctx, jstring file) { @@ -522,6 +569,7 @@ TCN_IMPLEMENT_CALL(jboolean, SSLContext, TCN_ALLOC_CSTRING(key); TCN_ALLOC_CSTRING(password); const char *key_file, *cert_file; +const char *p; char err[256]; UNREFERENCED(o); @@ -547,19 +595,30 @@ TCN_IMPLEMENT_CALL(jboolean, SSLContext, rv = JNI_FALSE; goto cleanup; } -if ((c->keys[idx] = load_pem_key(c, key_file)) == NULL) { -ERR_error_string(ERR_get_error(), err); -tcn_Throw(e, "Unable to load certificate key %s (%s)", - key_file, err); -rv = JNI_FALSE; -goto cleanup; +if ((p = strrchr(cert_file, '.')) != NULL && strcmp(p, ".pkcs12") == 0) { +if (!ssl_load_pkcs12(c, cert_file, &c->keys[idx], &c->certs[idx], 0)) { +ERR_error_string(ERR_get_error(), err); +tcn_Throw(e, "Unable to load certificate %s (%s)", + cert_file, err); +rv = JNI_FALSE; +goto cleanup; +} } -if ((c->certs[idx] = load_pem_cert(c, cert_file)) == NULL) { -ERR_error_string(ERR_get_error(), err); -tcn_Throw(e, "Unable to load certificate %s (%s)", - cert_file, err); -rv = JNI_FALSE; -goto cleanup; +else { +if ((c->keys[idx] = load_pem_key(c, key_file)) == NULL) { +ERR_error_string(ERR_get_error(), err); +tcn_Throw(e, "Unable to load certificate key %s (%s)", + key_file, err); +rv = JNI_FALSE; +goto cleanup; +} +if ((c->certs[idx] = load_pem_cert(c, cert_file)) == NULL) { +ERR_error_string(ERR_get_error(), err); +tcn_Throw(e, "Unable to load certificate %s (%s)", + cert_file, err); +rv = JNI_FALSE; +goto cleanup; +} } if (SSL_CTX_use_certificate(c->ctx, c->certs[idx]) <= 0) { ERR_error_string(ERR_get_error(), err); - To unsubscribe, e-mail: dev-unsubscr...@tom
DO NOT REPLY [Bug 52750] New: daemon.sh does not allow to pass more than one option
https://issues.apache.org/bugzilla/show_bug.cgi?id=52750 Bug #: 52750 Summary: daemon.sh does not allow to pass more than one option Product: Tomcat 7 Version: 7.0.26 Platform: Macintosh Status: NEW Severity: normal Priority: P2 Component: Packaging AssignedTo: dev@tomcat.apache.org ReportedBy: jeffma...@jeffmaury.com Classification: Unclassified The daemon.sh that is packaged with 7.0.26 does not allow to pass more than one option (through the -- switch). It appears that the shift statement inside a loop build from the command line parameter does not work as the list has been build before. Ex: daemon.sh --catalina-pid /tmp/c.pid --tomcat-user x start leads to the following error: Usage: daemon.sh ( commands ... ) commands: run Start Tomcat without detaching from console start Start Tomcat stop Stop Tomcat version What version of commons daemon and Tomcat are you running? -- 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 52751] New: Optimized configuration of the system info displayed in the default error page
https://issues.apache.org/bugzilla/show_bug.cgi?id=52751 Bug #: 52751 Summary: Optimized configuration of the system info displayed in the default error page Product: Tomcat 7 Version: trunk Platform: PC Status: NEW Severity: enhancement Priority: P2 Component: Catalina AssignedTo: dev@tomcat.apache.org ReportedBy: polina.gen...@gmail.com Classification: Unclassified Created attachment 28372 --> https://issues.apache.org/bugzilla/attachment.cgi?id=28372 Patch in ErrorReportValve.java and docu page + 2 screenshots Hi, Here's an enhancement patch for the system info displayed in the default error page and the way it is retrieved. The patch makes it possible to reuse the value of the server header configuration if it is available. Thus the system information revealed in the server header and the default error page would be consistent and would be easier to maintain. It is known that system information disclosure is an easy to fix, yet serious security flaw as it opens the door to all attackers who wouldn’t resist exploiting known vulnerabilities for the given system version. That’s why it is recommended (in all Tomcat security configuration guides) to customize both the server header and the server.info property. On the other hand, with this enhancement the protection from system information leakage can be done easier - with only one configuration and without worrying about the side effects of custom changes in the server.info property. Except the patch there are also two screenshots attached: –Default error page when server header is configured -Default error page when server header is not configured Best Regards, Polina -- 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1292878 - in /tomcat/tc7.0.x/trunk: bin/daemon.sh webapps/docs/changelog.xml
Author: mturk Date: Thu Feb 23 18:21:33 2012 New Revision: 1292878 URL: http://svn.apache.org/viewvc?rev=1292878&view=rev Log: Fix BZ52750. Correctly parse command options Modified: tomcat/tc7.0.x/trunk/bin/daemon.sh tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Modified: tomcat/tc7.0.x/trunk/bin/daemon.sh URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/bin/daemon.sh?rev=1292878&r1=1292877&r2=1292878&view=diff == --- tomcat/tc7.0.x/trunk/bin/daemon.sh (original) +++ tomcat/tc7.0.x/trunk/bin/daemon.sh Thu Feb 23 18:21:33 2012 @@ -34,9 +34,9 @@ while [ -h "$ARG0" ]; do done DIRNAME="`dirname $ARG0`" PROGRAM="`basename $ARG0`" -for o +while [ ".$1" != . ] do - case "$o" in + case "$1" in --java-home ) JAVA_HOME="$2" shift; shift; Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1292878&r1=1292877&r2=1292878&view=diff == --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Thu Feb 23 18:21:33 2012 @@ -66,6 +66,10 @@ + +52750: Fix the way how daemon.sh parses command options so +that more then one can be provided. (mturk) + Rearrange validate-eoln target in build.xml so that it could be run ahead of compilation. (kkolinko) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 52750] daemon.sh does not allow to pass more than one option
https://issues.apache.org/bugzilla/show_bug.cgi?id=52750 Mladen Turk changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED OS/Version||All --- Comment #1 from Mladen Turk 2012-02-23 18:22:40 UTC --- Right. Fixed in the 7.0.x (r1292878) branch and will be part of next release. -- 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1292891 - /tomcat/trunk/bin/daemon.sh
Author: markt Date: Thu Feb 23 18:44:02 2012 New Revision: 1292891 URL: http://svn.apache.org/viewvc?rev=1292891&view=rev Log: Fix BZ52750. Correctly parse command options Port of r1292878 from 7.0.x Modified: tomcat/trunk/bin/daemon.sh (contents, props changed) Modified: tomcat/trunk/bin/daemon.sh URL: http://svn.apache.org/viewvc/tomcat/trunk/bin/daemon.sh?rev=1292891&r1=1292890&r2=1292891&view=diff == --- tomcat/trunk/bin/daemon.sh (original) +++ tomcat/trunk/bin/daemon.sh Thu Feb 23 18:44:02 2012 @@ -34,9 +34,9 @@ while [ -h "$ARG0" ]; do done DIRNAME="`dirname $ARG0`" PROGRAM="`basename $ARG0`" -for o +while [ ".$1" != . ] do - case "$o" in + case "$o=1" in --java-home ) JAVA_HOME="$2" shift; shift; Propchange: tomcat/trunk/bin/daemon.sh ('svn:executable' removed) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: svn commit: r1292891 - /tomcat/trunk/bin/daemon.sh
2012/2/23 : > Author: markt > Date: Thu Feb 23 18:44:02 2012 > New Revision: 1292891 > > URL: http://svn.apache.org/viewvc?rev=1292891&view=rev > Log: > Fix BZ52750. Correctly parse command options > Port of r1292878 from 7.0.x > > Modified: > tomcat/trunk/bin/daemon.sh (contents, props changed) > > Modified: tomcat/trunk/bin/daemon.sh > URL: > http://svn.apache.org/viewvc/tomcat/trunk/bin/daemon.sh?rev=1292891&r1=1292890&r2=1292891&view=diff > == > --- tomcat/trunk/bin/daemon.sh (original) > +++ tomcat/trunk/bin/daemon.sh Thu Feb 23 18:44:02 2012 > @@ -34,9 +34,9 @@ while [ -h "$ARG0" ]; do > done > DIRNAME="`dirname $ARG0`" > PROGRAM="`basename $ARG0`" > -for o > +while [ ".$1" != . ] Maybe: while [ -n "$1" ] (though both variants should work work) > do > - case "$o" in > + case "$o=1" in What the above line is about? Was it supposed to be: case "$1" in > --java-home ) > JAVA_HOME="$2" > shift; shift; > > Propchange: tomcat/trunk/bin/daemon.sh > ('svn:executable' removed) > 231 echo "Unkown command: \`$1'" Unknown 232 echo "Usage: $PROGRAM ( commands ... )" $PROGRAM [--options] ( commands ... ) Best regards, Konstantin Kolinko - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: svn commit: r1292891 - /tomcat/trunk/bin/daemon.sh
On 23 February 2012 19:00, Konstantin Kolinko wrote: > 2012/2/23 : >> Author: markt >> Date: Thu Feb 23 18:44:02 2012 >> New Revision: 1292891 >> >> URL: http://svn.apache.org/viewvc?rev=1292891&view=rev >> Log: >> Fix BZ52750. Correctly parse command options >> Port of r1292878 from 7.0.x >> >> Modified: >> tomcat/trunk/bin/daemon.sh (contents, props changed) >> >> Modified: tomcat/trunk/bin/daemon.sh >> URL: >> http://svn.apache.org/viewvc/tomcat/trunk/bin/daemon.sh?rev=1292891&r1=1292890&r2=1292891&view=diff >> == >> --- tomcat/trunk/bin/daemon.sh (original) >> +++ tomcat/trunk/bin/daemon.sh Thu Feb 23 18:44:02 2012 >> @@ -34,9 +34,9 @@ while [ -h "$ARG0" ]; do >> done >> DIRNAME="`dirname $ARG0`" >> PROGRAM="`basename $ARG0`" >> -for o >> +while [ ".$1" != . ] > > Maybe: > while [ -n "$1" ] > (though both variants should work work) > >> do >> - case "$o" in >> + case "$o=1" in > > What the above line is about? I wondered the same myself; it so happens that the "=" key is next to the "Backspace" key, so I suspect the intention was to delete the "o" ... > Was it supposed to be: > case "$1" in > >> --java-home ) >> JAVA_HOME="$2" >> shift; shift; >> >> Propchange: tomcat/trunk/bin/daemon.sh >> ('svn:executable' removed) >> > > 231 echo "Unkown command: \`$1'" > > Unknown > > 232 echo "Usage: $PROGRAM ( commands ... )" > > $PROGRAM [--options] ( commands ... ) > > Best regards, > Konstantin Kolinko > > - > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org > For additional commands, e-mail: dev-h...@tomcat.apache.org > - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 52752] New: AS/400 SEVERE: rg.apache.catalina.LifecycleException: Failed to start component
https://issues.apache.org/bugzilla/show_bug.cgi?id=52752 Bug #: 52752 Summary: AS/400 SEVERE: rg.apache.catalina.LifecycleException: Failed to start component Product: Tomcat 7 Version: 7.0.26 Platform: Other OS/Version: other Status: NEW Severity: major Priority: P2 Component: Catalina AssignedTo: dev@tomcat.apache.org ReportedBy: jnan...@hotmail.com Classification: Unclassified Server version: Apache Tomcat/7.0.26 Server built: Feb 17 2012 02:11:27 Server number: 7.0.26.0 OS Name:OS/400 OS Version: V6R1M0 Architecture: PowerPC JVM Version:1.6.0_11-b03 JVM Vendor: IBM Corporation Trying to install a brand new tomcat 7.0.26 (same error with 7.0.25)and it fails to start. This is without any of my own war files, this is only tomcat's zip file. Attached is the Catalina log: Feb 23, 2012 11:49:44 AM org.apache.juli.logging.DirectJDKLog info INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /QSYS.LIB/QSHELL.LIB:/QSYS.LIB/QTEMP.LIB:/QSYS.LIB/JMILNES.LIB:/QSYS.LIB/GMCOMMON.LIB:/QSYS.LIB/QGPL.LIB Feb 23, 2012 11:49:45 AM org.apache.juli.logging.DirectJDKLog info INFO: Initializing ProtocolHandler ["http-bio-8080"] Feb 23, 2012 11:49:45 AM org.apache.juli.logging.DirectJDKLog info INFO: Initializing ProtocolHandler ["ajp-bio-8009"] Feb 23, 2012 11:49:45 AM org.apache.juli.logging.DirectJDKLog info INFO: Initialization processed in 2096 ms Feb 23, 2012 11:49:45 AM org.apache.juli.logging.DirectJDKLog info INFO: Starting service Catalina Feb 23, 2012 11:49:45 AM org.apache.juli.logging.DirectJDKLog info INFO: Starting Servlet Engine: Apache Tomcat/7.0.26 Feb 23, 2012 11:49:45 AM org.apache.juli.logging.DirectJDKLog info INFO: Deploying web application directory /opt/apache-tomcat-7.0.26/webapps/ROOT Feb 23, 2012 11:49:45 AM org.apache.juli.logging.DirectJDKLog error SEVERE: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]] at java.lang.Throwable.(Throwable.java:218) at java.lang.Exception.(Exception.java:59) at org.apache.catalina.LifecycleException.(LifecycleException.java:74) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1095) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1617) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.ArrayStoreException at java.lang.Throwable.(Throwable.java:181) at java.lang.Exception.(Exception.java:29) at java.lang.RuntimeException.(RuntimeException.java:32) at java.lang.ArrayStoreException.(ArrayStoreException.java:29) at java.util.Arrays.copyOf(Arrays.java:2883) at java.lang.StringCoding.encode(StringCoding.java:277) at java.lang.String.getBytes(String.java:1691) at org.apache.catalina.util.RequestUtil.URLDecode(RequestUtil.java:216) at org.apache.catalina.util.RequestUtil.URLDecode(RequestUtil.java:193) at org.apache.catalina.util.RequestUtil.URLDecode(RequestUtil.java:178) at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3206) at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3183) at org.apache.catalina.deploy.WebXml.configureContext(WebXml.java:1302) at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1310) at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:855) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:345) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5161) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ... 11 more
Re: svn commit: r1292776 - /tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java
2012/2/23 : > Author: markt > Date: Thu Feb 23 12:48:56 2012 > New Revision: 1292776 > > URL: http://svn.apache.org/viewvc?rev=1292776&view=rev > Log: > More javadoc > > Modified: > tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java > > Modified: tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java > URL: > http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java?rev=1292776&r1=1292775&r2=1292776&view=diff > == > --- tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java (original) > +++ tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java Thu Feb > 23 12:48:56 2012 > @@ -102,6 +102,15 @@ public class WsOutbound { > } > > > + /** > + * Flush any message (binary or textual) that may be buffered and then > send > + * the a WebSocket binary message as a single frame with the provided > buffer s/the a/a / > + * as the payload of the message. > + * > + * @param msgBb The buffer containing the payload > + * > + * @throws IOException If an error occurs writing to the client > + */ > public void writeBinaryMessage(ByteBuffer msgBb) throws IOException { > if (text != null) { > // Empty the buffer > @@ -112,6 +121,15 @@ public class WsOutbound { > } > > > + /** > + * Flush any message (binary or textual) that may be buffered and then > send > + * the a WebSocket text message as a single frame with the provided > buffer ditto > + * as the payload of the message. > + * > + * @param msgBb The buffer containing the payload > + * > + * @throws IOException If an error occurs writing to the client > + */ > public void writeTextMessage(CharBuffer msgCb) throws IOException { > if (text != null) { > // Empty the buffer > @@ -122,6 +140,11 @@ public class WsOutbound { > } > > > + /** > + * Flush any message (binary or textual) that may be buffered. > + * > + * @throws IOException If an error occurs writing to the client > + */ > public void flush() throws IOException { > doFlush(true); > } > @@ -142,8 +165,15 @@ public class WsOutbound { > } > > > - > - public void close(WsFrame frame) throws IOException { > + /** > + * Respond to a client close by sending a close that echos the status > code s/echos/echoes/ ? > + * and message. > + * > + * @param frame The close frame received from a client > + * > + * @throws IOException If an error occurs writing to the client > + */ > + protected void close(WsFrame frame) throws IOException { > if (frame.getPayLoadLength() > 0) { > // Must be status (2 bytes) plus optional message > if (frame.getPayLoadLength() == 1) { > @@ -184,6 +214,15 @@ public class WsOutbound { > } > > > + /** > + * Send a close message to the client > + * > + * @param status Must be a valid status code or zero to send no code > + * @param data Optional message. If message is defined, a valid > status > + * code must be provided. > + * > + * @throws IOException If an error occurs writing to the client > + */ > public void close(int status, ByteBuffer data) throws IOException { > // TODO Think about threading requirements for writing. This is not > // currently thread safe and writing almost certainly needs to be. > @@ -214,6 +253,13 @@ public class WsOutbound { > } > > > + /** > + * Send a pong message to the client > + * > + * @param data Optional message. > + * > + * @throws IOException If an error occurs writing to the client > + */ > public void pong(ByteBuffer data) throws IOException { > // TODO Think about threading requirements for writing. This is not > // currently thread safe and writing almost certainly needs to be. > in the pong() method the following: 276 upgradeOutbound.write(data.limit()); 277 upgradeOutbound.write(data.array(), 0, data.limit()); assumes that data.position() is 0. I am not sure that we can assume that in this public method. Best regards, Konstantin Kolinko - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: svn commit: r1292891 - /tomcat/trunk/bin/daemon.sh
2012/2/23 sebb : > On 23 February 2012 19:00, Konstantin Kolinko wrote: >> 2012/2/23 : >>> Author: markt >>> Date: Thu Feb 23 18:44:02 2012 >>> New Revision: 1292891 >>> >>> URL: http://svn.apache.org/viewvc?rev=1292891&view=rev >>> Log: >>> Fix BZ52750. Correctly parse command options >>> Port of r1292878 from 7.0.x >>> >>> Modified: >>> tomcat/trunk/bin/daemon.sh (contents, props changed) >>> >>> Modified: tomcat/trunk/bin/daemon.sh >>> URL: >>> http://svn.apache.org/viewvc/tomcat/trunk/bin/daemon.sh?rev=1292891&r1=1292890&r2=1292891&view=diff >>> == >>> --- tomcat/trunk/bin/daemon.sh (original) >>> +++ tomcat/trunk/bin/daemon.sh Thu Feb 23 18:44:02 2012 >>> @@ -34,9 +34,9 @@ while [ -h "$ARG0" ]; do >>> done >>> DIRNAME="`dirname $ARG0`" >>> PROGRAM="`basename $ARG0`" >>> -for o >>> +while [ ".$1" != . ] >> >> Maybe: >> while [ -n "$1" ] >> (though both variants should work work) >> >>> do >>> - case "$o" in >>> + case "$o=1" in >> >> What the above line is about? > > I wondered the same myself; > it so happens that the "=" key is next to the "Backspace" key, so I > suspect the intention was to delete the "o" ... It is just a typo. Mark was porting Mladen's r1292878 from tc7.0.x and that revision contains $1 in this place. > >> Was it supposed to be: >> case "$1" in >> >>> --java-home ) >>> JAVA_HOME="$2" >>> shift; shift; >>> >>> Propchange: tomcat/trunk/bin/daemon.sh >>> ('svn:executable' removed) >>> >> >> 231 echo "Unkown command: \`$1'" >> >> Unknown >> >> 232 echo "Usage: $PROGRAM ( commands ... )" >> >> $PROGRAM [--options] ( commands ... ) >> >> Best regards, >> Konstantin Kolinko > - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 52752] AS/400 SEVERE: rg.apache.catalina.LifecycleException: Failed to start component
https://issues.apache.org/bugzilla/show_bug.cgi?id=52752 Konstantin Kolinko changed: What|Removed |Added Status|NEW |RESOLVED Resolution||INVALID --- Comment #1 from Konstantin Kolinko 2012-02-23 19:23:25 UTC --- 1. Bugzilla is not a support forum! Please read: http://tomcat.apache.org/bugreport.html#Bugzilla_is_not_a_support_forum 2. > Feb 23, 2012 11:49:45 AM org.apache.juli.logging.DirectJDKLog error > SEVERE: Occurred at line 60 column 34 There is likely an error in one of web.xml files. Please subscribe to the users mailing list and discuss it there. -- 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: svn commit: r1292891 - /tomcat/trunk/bin/daemon.sh
On 02/23/2012 08:00 PM, Konstantin Kolinko wrote: 2012/2/23: Maybe: while [ -n "$1" ] (though both variants should work work) Some solaris shells misbehave on -n. do - case "$o" in + case "$o=1" in What the above line is about? Was it supposed to be: case "$1" in Right, Mark probably made a typo while copying the code form 7.0.x Fixed that (hope mark won't mind :) Regards -- ^TM - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1292913 - /tomcat/trunk/bin/daemon.sh
Author: mturk Date: Thu Feb 23 19:32:51 2012 New Revision: 1292913 URL: http://svn.apache.org/viewvc?rev=1292913&view=rev Log: Fix typo and make the file executable like resto of the .sh scripts Modified: tomcat/trunk/bin/daemon.sh (contents, props changed) Modified: tomcat/trunk/bin/daemon.sh URL: http://svn.apache.org/viewvc/tomcat/trunk/bin/daemon.sh?rev=1292913&r1=1292912&r2=1292913&view=diff == --- tomcat/trunk/bin/daemon.sh (original) +++ tomcat/trunk/bin/daemon.sh Thu Feb 23 19:32:51 2012 @@ -36,7 +36,7 @@ DIRNAME="`dirname $ARG0`" PROGRAM="`basename $ARG0`" while [ ".$1" != . ] do - case "$o=1" in + case "$1" in --java-home ) JAVA_HOME="$2" shift; shift; Propchange: tomcat/trunk/bin/daemon.sh -- svn:executable = * - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 52752] AS/400 SEVERE: rg.apache.catalina.LifecycleException: Failed to start component
https://issues.apache.org/bugzilla/show_bug.cgi?id=52752 jnan...@hotmail.com changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|INVALID | --- Comment #2 from jnan...@hotmail.com 2012-02-23 19:39:40 UTC --- These are not my web.xml files. They come with the standard version of tomcat and a standard version of tomat shound not fail on startup. docs examples host-manager manager ROOT -- 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: svn commit: r1292891 - /tomcat/trunk/bin/daemon.sh
On 23/02/2012 19:07, sebb wrote: > On 23 February 2012 19:00, Konstantin Kolinko wrote: >> 2012/2/23 : >>> - case "$o" in >>> + case "$o=1" in >> >> What the above line is about? > > I wondered the same myself; > it so happens that the "=" key is next to the "Backspace" key, so I > suspect the intention was to delete the "o" ... Yep. Fixed. Tx. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: svn commit: r1292891 - /tomcat/trunk/bin/daemon.sh
On 23/02/2012 19:33, Mladen Turk wrote: > On 02/23/2012 08:00 PM, Konstantin Kolinko wrote: >> 2012/2/23: >> Maybe: >> while [ -n "$1" ] >> (though both variants should work work) >> > > Some solaris shells misbehave on -n. > >>> do >>> - case "$o" in >>> + case "$o=1" in >> >> What the above line is about? >> Was it supposed to be: >>case "$1" in >> > > Right, Mark probably made a typo while copying the code form 7.0.x > Fixed that (hope mark won't mind :) No at all :) Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1292924 - /tomcat/native/branches/1.1.x/native/BUILDING
Author: mturk Date: Thu Feb 23 19:46:58 2012 New Revision: 1292924 URL: http://svn.apache.org/viewvc?rev=1292924&view=rev Log: Explain how to build tcnative with statically linked apr and openssl Modified: tomcat/native/branches/1.1.x/native/BUILDING Modified: tomcat/native/branches/1.1.x/native/BUILDING URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/BUILDING?rev=1292924&r1=1292923&r2=1292924&view=diff == --- tomcat/native/branches/1.1.x/native/BUILDING (original) +++ tomcat/native/branches/1.1.x/native/BUILDING Thu Feb 23 19:46:58 2012 @@ -15,32 +15,42 @@ limitations under the License. - Building from source package: - configure --with-apr=apr_install_location --with-ssl=openssl_install_location - make - - Building from the cvs tree: - sh buildconf --with-apr=apr_source_location. - configure --with-apr=apr_install_location --with-ssl=openssl_install_location - make - - Testing the build: - The make should produce a .so file named libtcnative-1.so. - Build the jar containing the examples by - cd .. - ant jar +Building from source package +- + +> configure --with-apr=apr_install_location --with-ssl=openssl_install_location +> make + +Building from the svn tree +-- + +> sh buildconf --with-apr=apr_source_location. +> configure --with-apr=apr_install_location --with-ssl=openssl_install_location +> make + +Testing the build +- + +The make should produce a .so file named libtcnative-1.so. +Build the jar containing the examples by + +> cd .. +> ant jar Run one of the example (the echo one): - ant run-echo +> ant run-echo - Using it in Tomcat: - 1 - In use of conf/server.xml: -protocol="org.apache.coyote.http11.Http11AprProtocol" - 2 - In bin/setenv.sh add the following: -CATALINA_OPTS="$CATALINA_OPTS -Djava.library.path=tclib_location" -In my machine I am using: -/home/jfclere/native/native/.libs for tclib_location +Using it in Tomcat +-- -NOTES: +1. In use of conf/server.xml: + protocol="org.apache.coyote.http11.Http11AprProtocol" +2. In bin/setenv.sh add the following: + CATALINA_OPTS="$CATALINA_OPTS -Djava.library.path=tclib_location" + In my machine I am using: + /home/jfclere/native/native/.libs for tclib_location + +NOTES +- - configure --disable-openssl: Configure without ssl support. - To use it in Tomcat you may have to add in bin/setenv.sh: LD_LIBRARY_PATH=openssl_install_location/lib; export LD_LIBRARY_PATH @@ -49,3 +59,42 @@ NOTES: - For MAC OS X you must manually add a link cd ${tcnative installdir} ln -d libtcnative-1.dylib libtcnative-1.jnilib + + +Building statically linked library on unixes + + +To statically link apr and openssl dependencies use the following +procedure. + +You will need to build static version of openssl library. + +> ./config --prefix=~/natives/openssl no-shared -fPIC +> make +> make install_sw + +Note that for solaris platform you should use -KPIC instead -fPIC +so that library is compiled with position independent code. + +Apr by default build both static and synamic libraries. + +> ./configure --prefix=~/natives/apr +> make +> make install + +After that edit the ~/natives/apr/lib/libapr-1.la file +and comment or delete the following sections: +dlname='...' and library_names='...' +This is needed so that libtool picks the static version of the library. + +Build Tomcat native by executing + +> ./configure --with-apr=~/natives/apr --with-ssl=~/natives/openssl --prefix=~/natives/tomcat +> make +> make install + +Thats it. You have just build libtchative-1.so with statically linked +apr and openssl. + + + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1292925 - /tomcat/native/branches/1.1.x/native/BUILDING
Author: mturk Date: Thu Feb 23 19:50:40 2012 New Revision: 1292925 URL: http://svn.apache.org/viewvc?rev=1292925&view=rev Log: Run trough spell checker Modified: tomcat/native/branches/1.1.x/native/BUILDING Modified: tomcat/native/branches/1.1.x/native/BUILDING URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/BUILDING?rev=1292925&r1=1292924&r2=1292925&view=diff == --- tomcat/native/branches/1.1.x/native/BUILDING (original) +++ tomcat/native/branches/1.1.x/native/BUILDING Thu Feb 23 19:50:40 2012 @@ -61,7 +61,7 @@ NOTES ln -d libtcnative-1.dylib libtcnative-1.jnilib -Building statically linked library on unixes +Building statically linked library on Unixes To statically link apr and openssl dependencies use the following @@ -73,10 +73,10 @@ You will need to build static version of > make > make install_sw -Note that for solaris platform you should use -KPIC instead -fPIC +Note that for Solaris platform you should use -KPIC instead -fPIC so that library is compiled with position independent code. -Apr by default build both static and synamic libraries. +Apr by default builds both static and dynamic libraries. > ./configure --prefix=~/natives/apr > make @@ -93,7 +93,7 @@ Build Tomcat native by executing > make > make install -Thats it. You have just build libtchative-1.so with statically linked +That's it. You have just build libtcnative-1.so with statically linked apr and openssl. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: Release Tomcat Native 1.1.23
On 02/22/2012 07:22 PM, Costin Manolache wrote: On Wed, Feb 22, 2012 at 9:12 AM, Mladen Turk wrote: I'm trying to provide a way for people to build "libtcnative-2.so" so it can be installed on those systems along with the existing apr, openssl and libtcnative-1, without requiring the installation of 2 versions of openssl, apr. Just committed a brief howto inside native/BUILDING See the last paragraph and check if it works for you. No need for cmake and stuff. The only needed thing is to comment or remove two lines from libapr-1.la file before building tomcat-native. Regards -- ^TM - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: Release Tomcat Native 1.1.23
Thanks, I'll try it. Costin On Thu, Feb 23, 2012 at 11:53 AM, Mladen Turk wrote: > On 02/22/2012 07:22 PM, Costin Manolache wrote: > >> On Wed, Feb 22, 2012 at 9:12 AM, Mladen Turk wrote: >> >> >> I'm trying to provide a way for people to build "libtcnative-2.so" so it >> can be installed on >> those systems along with the existing apr, openssl and libtcnative-1, >> without requiring the installation of 2 versions of openssl, apr. >> >> > Just committed a brief howto inside native/BUILDING > See the last paragraph and check if it works for you. > > No need for cmake and stuff. The only needed thing is to > comment or remove two lines from libapr-1.la file before > building tomcat-native. > > > > Regards > > -- > ^TM > > --**--**- > To unsubscribe, e-mail: > dev-unsubscribe@tomcat.apache.**org > For additional commands, e-mail: dev-h...@tomcat.apache.org > >
DO NOT REPLY [Bug 52752] AS/400 SEVERE: rg.apache.catalina.LifecycleException: Failed to start component
https://issues.apache.org/bugzilla/show_bug.cgi?id=52752 Konstantin Kolinko changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution||INVALID --- Comment #3 from Konstantin Kolinko 2012-02-23 21:07:58 UTC --- I repeat: > Bugzilla is not a support forum! > Please read: > http://tomcat.apache.org/bugreport.html#Bugzilla_is_not_a_support_forum > Please subscribe to the users > mailing list and discuss it there. -- 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1292995 - /tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java
Author: markt Date: Thu Feb 23 22:28:32 2012 New Revision: 1292995 URL: http://svn.apache.org/viewvc?rev=1292995&view=rev Log: Review comments on r1292776 from kkolinko Modified: tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java Modified: tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java?rev=1292995&r1=1292994&r2=1292995&view=diff == --- tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java (original) +++ tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java Thu Feb 23 22:28:32 2012 @@ -104,8 +104,8 @@ public class WsOutbound { /** * Flush any message (binary or textual) that may be buffered and then send - * the a WebSocket binary message as a single frame with the provided buffer - * as the payload of the message. + * a WebSocket binary message as a single frame with the provided buffer as + * the payload of the message. * * @param msgBb The buffer containing the payload * @@ -123,8 +123,8 @@ public class WsOutbound { /** * Flush any message (binary or textual) that may be buffered and then send - * the a WebSocket text message as a single frame with the provided buffer - * as the payload of the message. + * a WebSocket text message as a single frame with the provided buffer as + * the payload of the message. * * @param msgBb The buffer containing the payload * @@ -166,7 +166,7 @@ public class WsOutbound { /** - * Respond to a client close by sending a close that echos the status code + * Respond to a client close by sending a close that echoes the status code * and message. * * @param frame The close frame received from a client @@ -274,7 +274,8 @@ public class WsOutbound { upgradeOutbound.write(0); } else { upgradeOutbound.write(data.limit()); -upgradeOutbound.write(data.array(), 0, data.limit()); +upgradeOutbound.write(data.array(), data.position(), +data.limit() - data.position()); } upgradeOutbound.flush(); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1292996 - in /tomcat/trunk/java/org/apache/catalina/websocket: StreamInbound.java Utf8Decoder.java
Author: markt Date: Thu Feb 23 22:29:12 2012 New Revision: 1292996 URL: http://svn.apache.org/viewvc?rev=1292996&view=rev Log: Hooray for Apache Harmony. Copy Harmony's UTF-8 decoder, add the additional restriction expected by the WebSocket spec and start passing all the UTF-8 releated tests. Added: tomcat/trunk/java/org/apache/catalina/websocket/Utf8Decoder.java Modified: tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java Modified: tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java?rev=1292996&r1=1292995&r2=1292996&view=diff == --- tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java (original) +++ tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java Thu Feb 23 22:29:12 2012 @@ -20,14 +20,12 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; -import java.nio.charset.CodingErrorAction; import java.nio.charset.MalformedInputException; import java.nio.charset.UnmappableCharacterException; import org.apache.coyote.http11.upgrade.UpgradeInbound; import org.apache.coyote.http11.upgrade.UpgradeOutbound; import org.apache.coyote.http11.upgrade.UpgradeProcessor; -import org.apache.tomcat.util.buf.B2CConverter; import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState; /** @@ -83,10 +81,8 @@ public abstract class StreamInbound impl onBinaryData(wsIs); return SocketState.UPGRADED; } else if (opCode == Constants.OPCODE_TEXT) { -InputStreamReader r = new InputStreamReader(wsIs, -B2CConverter.UTF_8.newDecoder() -.onMalformedInput(CodingErrorAction.REPORT) -.onUnmappableCharacter(CodingErrorAction.REPORT)); +InputStreamReader r = +new InputStreamReader(wsIs, new Utf8Decoder()); onTextData(r); return SocketState.UPGRADED; } Added: tomcat/trunk/java/org/apache/catalina/websocket/Utf8Decoder.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/Utf8Decoder.java?rev=1292996&view=auto == --- tomcat/trunk/java/org/apache/catalina/websocket/Utf8Decoder.java (added) +++ tomcat/trunk/java/org/apache/catalina/websocket/Utf8Decoder.java Thu Feb 23 22:29:12 2012 @@ -0,0 +1,207 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.catalina.websocket; + +import java.nio.ByteBuffer; +import java.nio.CharBuffer; +import java.nio.charset.CharsetDecoder; +import java.nio.charset.CoderResult; + +import org.apache.tomcat.util.buf.B2CConverter; + +/** + * Decodes bytes to UTF-8. Extracted from Apache Harmony and modified to reject + * code points from U+D800 to U+DFFF as per RFC3629. The standard Java decoder + * does not reject these. + */ +public class Utf8Decoder extends CharsetDecoder { + +// The next table contains information about UTF-8 charset and +// correspondence of 1st byte to the length of sequence +// For information please visit http://www.ietf.org/rfc/rfc3629.txt +// +// Please note, o means 0, actually. +// --- +// 0 1 2 3 Value +// --- +// oxxx 0xxx +// 11oy 1oxx 0yyy yyxx +// 111o 1oyy 1oxx yyxx +// ouuu 1ouu 1oyy 1oxx 000u yyxx + +private static final int remainingBytes[] = { +// 1oww +-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, +-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, +-1, -1,
Re: svn commit: r1292995 - /tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java
2012/2/24 : > Author: markt > Date: Thu Feb 23 22:28:32 2012 > New Revision: 1292995 > > URL: http://svn.apache.org/viewvc?rev=1292995&view=rev > Log: > Review comments on r1292776 from kkolinko > > Modified: > tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java > > @@ -166,7 +166,7 @@ public class WsOutbound { > > > /** > - * Respond to a client close by sending a close that echos the status > code > + * Respond to a client close by sending a close that echoes the status > code > * and message. > * > * @param frame The close frame received from a client > @@ -274,7 +274,8 @@ public class WsOutbound { > upgradeOutbound.write(0); > } else { > upgradeOutbound.write(data.limit()); The above line has to be changed as well. BTW, what happens if we are passed more than 125 bytes of data? IAE? > - upgradeOutbound.write(data.array(), 0, data.limit()); > + upgradeOutbound.write(data.array(), data.position(), > + data.limit() - data.position()); > } > > upgradeOutbound.flush(); > Best regards, Konstantin Kolinko - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: svn commit: r1292995 - /tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java
On 23/02/2012 23:00, Konstantin Kolinko wrote: > 2012/2/24 : >> Author: markt >> Date: Thu Feb 23 22:28:32 2012 >> New Revision: 1292995 >> >> URL: http://svn.apache.org/viewvc?rev=1292995&view=rev >> Log: >> Review comments on r1292776 from kkolinko >> >> Modified: >>tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java >> >> @@ -166,7 +166,7 @@ public class WsOutbound { >> >> >> /** >> - * Respond to a client close by sending a close that echos the status >> code >> + * Respond to a client close by sending a close that echoes the status >> code >> * and message. >> * >> * @param frame The close frame received from a client >> @@ -274,7 +274,8 @@ public class WsOutbound { >> upgradeOutbound.write(0); >> } else { >> upgradeOutbound.write(data.limit()); > > The above line has to be changed as well. Tx. > BTW, what happens if we are passed more than 125 bytes of data? IAE? Currently? The client should complain and close the connection. We should probably stop that from happening. Mark > >> -upgradeOutbound.write(data.array(), 0, data.limit()); >> +upgradeOutbound.write(data.array(), data.position(), >> +data.limit() - data.position()); >> } >> >> upgradeOutbound.flush(); >> > > Best regards, > Konstantin Kolinko > > - > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org > For additional commands, e-mail: dev-h...@tomcat.apache.org > - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1293015 - /tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java
Author: markt Date: Thu Feb 23 23:05:09 2012 New Revision: 1293015 URL: http://svn.apache.org/viewvc?rev=1293015&view=rev Log: Validate any close payload is UTF-8 Modified: tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java Modified: tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java?rev=1293015&r1=1293014&r2=1293015&view=diff == --- tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java (original) +++ tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java Thu Feb 23 23:05:09 2012 @@ -18,6 +18,8 @@ package org.apache.catalina.websocket; import java.io.IOException; import java.nio.ByteBuffer; +import java.nio.CharBuffer; +import java.nio.charset.CoderResult; import org.apache.catalina.util.Conversions; import org.apache.coyote.http11.upgrade.UpgradeProcessor; @@ -88,6 +90,19 @@ public class WsFrame { // Note: Payload limited to <= 125 bytes by test above payload = ByteBuffer.allocate((int) payloadLength); processorRead(processor, payload); + +if (opCode == Constants.OPCODE_CLOSE && payloadLength > 2) { +// Check close payload - if present - is valid UTF-8 +CharBuffer cb = CharBuffer.allocate((int) payloadLength); +Utf8Decoder decoder = new Utf8Decoder(); +payload.position(2); +CoderResult cr = decoder.decode(payload, cb, true); +payload.position(0); +if (cr.isError()) { +// TODO i18n +throw new IOException("Not UTF-8"); +} +} } else { payload = null; } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1293016 - /tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java
Author: markt Date: Thu Feb 23 23:05:49 2012 New Revision: 1293016 URL: http://svn.apache.org/viewvc?rev=1293016&view=rev Log: Fix NPE in tests Modified: tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java Modified: tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java?rev=1293016&r1=1293015&r2=1293016&view=diff == --- tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java (original) +++ tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java Thu Feb 23 23:05:49 2012 @@ -61,6 +61,10 @@ public class WsOutbound { * the WebSocket frame to the client */ public void writeBinaryData(int b) throws IOException { +if (closed) { +throw new IOException("Closed"); +} + if (bb.position() == bb.capacity()) { doFlush(false); } @@ -87,6 +91,10 @@ public class WsOutbound { * the WebSocket frame to the client */ public void writeTextData(char c) throws IOException { +if (closed) { +throw new IOException("Closed"); +} + if (cb.position() == cb.capacity()) { doFlush(false); } @@ -112,6 +120,10 @@ public class WsOutbound { * @throws IOException If an error occurs writing to the client */ public void writeBinaryMessage(ByteBuffer msgBb) throws IOException { +if (closed) { +throw new IOException("Closed"); +} + if (text != null) { // Empty the buffer flush(); @@ -131,6 +143,10 @@ public class WsOutbound { * @throws IOException If an error occurs writing to the client */ public void writeTextMessage(CharBuffer msgCb) throws IOException { +if (closed) { +throw new IOException("Closed"); +} + if (text != null) { // Empty the buffer flush(); @@ -146,6 +162,9 @@ public class WsOutbound { * @throws IOException If an error occurs writing to the client */ public void flush() throws IOException { +if (closed) { +throw new IOException("Closed"); +} doFlush(true); } @@ -264,7 +283,7 @@ public class WsOutbound { // TODO Think about threading requirements for writing. This is not // currently thread safe and writing almost certainly needs to be. if (closed) { -// TODO - handle this - ISE? +throw new IOException("Closed"); } doFlush(true); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1293017 - /tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java
Author: markt Date: Thu Feb 23 23:06:27 2012 New Revision: 1293017 URL: http://svn.apache.org/viewvc?rev=1293017&view=rev Log: Doh Modified: tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java Modified: tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java?rev=1293017&r1=1293016&r2=1293017&view=diff == --- tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java (original) +++ tomcat/trunk/java/org/apache/catalina/websocket/WsOutbound.java Thu Feb 23 23:06:27 2012 @@ -292,7 +292,7 @@ public class WsOutbound { if (data == null) { upgradeOutbound.write(0); } else { -upgradeOutbound.write(data.limit()); +upgradeOutbound.write(data.limit() - data.position()); upgradeOutbound.write(data.array(), data.position(), data.limit() - data.position()); } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: WebSocket TODOs
On 23/02/2012 12:42, Mark Thomas wrote: > All, > > The bulk of the WebSocket implementation is complete. There are, > however, still quite a few TODOs. > > 1. Autobahn failure of test 7.5.1 (close handling) Fixed. > 2. Autobahn UTF-8 failures. Invalid UTF-8 is not being detected by the > Reader. Needs further investigating. Fixed. (Thank you Apache Harmony). > 3. Autobhan performance failures. Not all these tests are completing. > Need to figure out why. The implementation is horribly slow. See point 6. The rest are still TODO. Mark > 4. i18n. Fix all the TODOs and ensure there are no hard-coded English > messages. > > 5. Threading. Fix the TODOs associated around multiple threads trying to > send messages at the same time. > > 6. Profiling. Take a look with YourKit and Autobahn's performance tests. > If there are obvious bottlenecks, fix them. > > 7. Add some documentation but mainly rely on the examples and the Javadoc. > > > Once the above is complete, I intend back-porting the implementation to > 7.0.x. > > I'd also like to see a lot more examples. > > I will probably back-port the generic upgrade support first before the > above is complete. > > Help with any/all of the above welcome. > > Mark > > - > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org > For additional commands, e-mail: dev-h...@tomcat.apache.org > - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[GUMP@vmgump]: Project tomcat-trunk-validate-eoln (in module tomcat-trunk) failed
To whom it may engage... This is an automated request, but not an unsolicited one. For more information please visit http://gump.apache.org/nagged.html, and/or contact the folk at gene...@gump.apache.org. Project tomcat-trunk-validate-eoln has an issue affecting its community integration. This issue affects 1 projects, and has been outstanding for 11 runs. The current state of this project is 'Failed', with reason 'Build Failed'. For reference only, the following projects are affected by this: - tomcat-trunk-validate-eoln : Tomcat 8.x, a web server implementing Java Servlet 3.1, ... Full details are available at: http://vmgump.apache.org/gump/public/tomcat-trunk/tomcat-trunk-validate-eoln/index.html That said, some information snippets are provided here. The following annotations (debug/informational/warning/error messages) were provided: -INFO- Failed with reason build failed The following work was performed: http://vmgump.apache.org/gump/public/tomcat-trunk/tomcat-trunk-validate-eoln/gump_work/build_tomcat-trunk_tomcat-trunk-validate-eoln.html Work Name: build_tomcat-trunk_tomcat-trunk-validate-eoln (Type: Build) Work ended in a state of : Failed Elapsed: 21 secs Command Line: /usr/lib/jvm/java-6-openjdk/bin/java -Djava.awt.headless=true -Dbuild.sysclasspath=only org.apache.tools.ant.Main -Dgump.merge=/srv/gump/public/gump/work/merge.xml validate-eoln [Working Directory: /srv/gump/public/workspace/tomcat-trunk] CLASSPATH: /usr/lib/jvm/java-6-openjdk/lib/tools.jar:/srv/gump/public/workspace/tomcat-trunk/output/classes:/srv/gump/public/workspace/ant/dist/lib/ant.jar:/srv/gump/public/workspace/ant/dist/lib/ant-launcher.jar:/srv/gump/public/workspace/ant/dist/lib/ant-jmf.jar:/srv/gump/public/workspace/ant/dist/lib/ant-junit.jar:/srv/gump/public/workspace/ant/dist/lib/ant-swing.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-resolver.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-xalan2.jar:/srv/gump/public/workspace/xml-commons/java/build/resolver.jar - Buildfile: /srv/gump/public/workspace/tomcat-trunk/build.xml build-prepare: [mkdir] Created dir: /srv/gump/public/workspace/tomcat-trunk/output/classes [mkdir] Created dir: /srv/gump/public/workspace/tomcat-trunk/output/build [mkdir] Created dir: /srv/gump/public/workspace/tomcat-trunk/output/build/bin [mkdir] Created dir: /srv/gump/public/workspace/tomcat-trunk/output/build/conf [mkdir] Created dir: /srv/gump/public/workspace/tomcat-trunk/output/build/lib [mkdir] Created dir: /srv/gump/public/workspace/tomcat-trunk/output/build/logs [mkdir] Created dir: /srv/gump/public/workspace/tomcat-trunk/output/build/temp [mkdir] Created dir: /srv/gump/public/workspace/tomcat-trunk/output/build/webapps compile-prepare: [copy] Copying 1 file to /srv/gump/public/workspace/tomcat-trunk/java/org/apache/catalina/startup [copy] Copying 1 file to /srv/gump/public/workspace/tomcat-trunk/webapps/docs validate-eoln: [javac] Compiling 1 source file to /srv/gump/public/workspace/tomcat-trunk/output/classes [checkeol] Checking line ends in 2158 file(s) [checkeol] Checking line ends in 79 file(s) [checkeol] Done line ends check in 2237 file(s), 1 error(s) found. [checkeol] The following files have wrong line ends: [ [checkeol] /srv/gump/public/workspace/tomcat-trunk/java/org/apache/catalina/websocket/Utf8Decoder.java: uses CRLF on line 1] BUILD FAILED /srv/gump/public/workspace/tomcat-trunk/build.xml:511: The following files have wrong line ends: [ /srv/gump/public/workspace/tomcat-trunk/java/org/apache/catalina/websocket/Utf8Decoder.java: uses CRLF on line 1] Total time: 21 seconds - To subscribe to this information via syndicated feeds: - RSS: http://vmgump.apache.org/gump/public/tomcat-trunk/tomcat-trunk-validate-eoln/rss.xml - Atom: http://vmgump.apache.org/gump/public/tomcat-trunk/tomcat-trunk-validate-eoln/atom.xml == Gump Tracking Only === Produced by Apache Gump(TM) version 2.3. Gump Run 1124022012, vmgump.apache.org:vmgump:1124022012 Gump E-mail Identifier (unique within run) #12. -- Apache Gump http://gump.apache.org/ [Instance: vmgump] - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 52757] New: China Shoes On www.chinajordansshoes.com
https://issues.apache.org/bugzilla/show_bug.cgi?id=52757 Bug #: 52757 Summary: China Shoes On www.chinajordansshoes.com Product: Tomcat Connectors Version: unspecified Platform: All OS/Version: Mac OS X 10.5 Status: NEW Severity: minor Priority: P2 Component: Common AssignedTo: dev@tomcat.apache.org ReportedBy: jennygood1...@hotmail.com Classification: Unclassified Created attachment 28377 --> https://issues.apache.org/bugzilla/attachment.cgi?id=28377 China Cheap Shoes & Nike Sneakers Description:China Cheap Shoes & Nike Sneakers, Sale Cheap Nike Air Jordans, Cheap Nike Jordan Shoes, Discount Nike Air Max Shoes & Nike Air Shox Shoes From China. Title:China Shoes On www.chinajordansshoes.com Tags:China Shoes,Cheap Jordans,Cheap Shoes Body:Air Jordans, also known simply as Cheap Jordans, are a brand of shoes and athletic apparel produced Cheap Shoes by Nike originally designed for and endorsed China Shoes by the basketball player Michael Jordan. The Air Jordans line is now sold by the Jordan Brand subsidiary of Nike Shoes. Air Jordans were first released in 1985, Nike Air Max with new designs released annually Nike Air Shox More Info At www.chinajordansshoes.com . The many styles and color schemes offered for the Air Jordan Shoes over the years have spurred a large secondary collectors market. Shoe collectors are known to buy Nike Sneakers, sell and trade Air Jordans through eBay Cheap Sneakers, sneaker conventions, consignment stores such as Cheap Nike Shoes Sole Control in Philadelphia and Flight Club in New York City, and sneaker forums such as Cheap Jordan Shoes Niketalk & ISS. Sneakerheads, as collectors are known, classify the Air Jordan line by release year and model: Originals (The first edition of a particular model from its initial launch), Retros (Re-issues of older styles), Retro-pluses (Retro +, Air Jordans that are similar to the Original product, with more up-to-date changes or new color ways), Player Exclusive (PE, Air Jordans that are exclusive to certain athletes in the realm of sports) and Samples. Air Jordan currently sponsors 19 active NBA players Nike Football Shoes. Their main endorser is Dwyane Wade, who plays shooting guard for the Miami Heat. Chris Paul and Carmelo Anthony are also key endorsers. -- 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 52757] China Shoes On www.chinajordansshoes.com
https://issues.apache.org/bugzilla/show_bug.cgi?id=52757 Chuck Caldarale changed: What|Removed |Added Status|NEW |RESOLVED Resolution||INVALID --- Comment #1 from Chuck Caldarale 2012-02-24 02:23:32 UTC --- Bloody spammer. -- 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 52758] New: Jasper illegally implements org.eclipse.jdt.internal.compiler.env.ICompilationUnit from Eclipse
https://issues.apache.org/bugzilla/show_bug.cgi?id=52758 Bug #: 52758 Summary: Jasper illegally implements org.eclipse.jdt.internal.compiler.env.ICompilationUnit from Eclipse Product: Tomcat 7 Version: unspecified Platform: PC Status: NEW Severity: normal Priority: P2 Component: Jasper AssignedTo: dev@tomcat.apache.org ReportedBy: michael_ren...@ca.ibm.com Classification: Unclassified The illegal implementation described in the Eclipse bug (https://bugs.eclipse.org/bugs/show_bug.cgi?id=372351) is causing severe problems for the Eclipse SDK which uses Jasper for our help system. The interface in question is org.eclipse.jdt.internal.compiler.env.ICompilationUnit which resides in an internal package and should not be implemented by clients. The ideal resolution to this problem would be for Jasper to discontinue implementing it, but we would also be fine with Jasper just updating their code to resolve the compilation problems. -- 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: WebSocket TODOs
On 2012/02/23 17:24, "Mark Thomas" wrote: >On 23/02/2012 12:42, Mark Thomas wrote: >> All, >> >> The bulk of the WebSocket implementation is complete. There are, >> however, still quite a few TODOs. >> >> 1. Autobahn failure of test 7.5.1 (close handling) >Fixed. > >> 2. Autobahn UTF-8 failures. Invalid UTF-8 is not being detected by the >> Reader. Needs further investigating. >Fixed. (Thank you Apache Harmony). > >> 3. Autobhan performance failures. Not all these tests are completing. >> Need to figure out why. >The implementation is horribly slow. See point 6. Ran into the same performance issues in our websocket branch. Found that buffering the processor IO streams vastly improved performance. Tried the same thing on the current trunk and got an order of magnitude improvement. The trunk as of now ran Autobahn 9.1.1 (64K payload) in about 500 ms, and ran 9.1.5 (8M payload) in about 55 seconds. Case 9.1.6 (16M) fails. But wrapping the [Input|Output]Streams in UpgradeBioProcessor with Buffered[Input|Output]Streams gives the following: 9.1.1 (64K) ~120 ms (versus 500 ms) 9.1.5 (8M) ~6 sec (versus 55 sec) 9.1.6 (16M) ~12 sec (versus >100 sec) I haven't played with Upgrade[Nio/Apr]Processor to see how they behave. > >The rest are still TODO. > >Mark > >> 4. i18n. Fix all the TODOs and ensure there are no hard-coded English >> messages. >> >> 5. Threading. Fix the TODOs associated around multiple threads trying to >> send messages at the same time. >> >> 6. Profiling. Take a look with YourKit and Autobahn's performance tests. >> If there are obvious bottlenecks, fix them. >> >> 7. Add some documentation but mainly rely on the examples and the >>Javadoc. >> >> >> Once the above is complete, I intend back-porting the implementation to >> 7.0.x. >> >> I'd also like to see a lot more examples. We wrote a nifty chat demo on our branch--will see about porting it to the current trunk. >> >> I will probably back-port the generic upgrade support first before the >> above is complete. >> >> Help with any/all of the above welcome. >> >> Mark >> >> - >> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org >> For additional commands, e-mail: dev-h...@tomcat.apache.org >> > > >- >To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org >For additional commands, e-mail: dev-h...@tomcat.apache.org > - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1293119 - in /tomcat/native/branches/1.1.x: native/configure.in native/include/ssl_private.h native/src/sslutils.c xdocs/miscellaneous/changelog.xml
Author: mturk Date: Fri Feb 24 07:43:44 2012 New Revision: 1293119 URL: http://svn.apache.org/viewvc?rev=1293119&view=rev Log: BZ45392 Apply modified patch. OCSP is enabled is explicitly configure with --enable-ocsp at build time Modified: tomcat/native/branches/1.1.x/native/configure.in tomcat/native/branches/1.1.x/native/include/ssl_private.h tomcat/native/branches/1.1.x/native/src/sslutils.c tomcat/native/branches/1.1.x/xdocs/miscellaneous/changelog.xml Modified: tomcat/native/branches/1.1.x/native/configure.in URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/configure.in?rev=1293119&r1=1293118&r2=1293119&view=diff == --- tomcat/native/branches/1.1.x/native/configure.in (original) +++ tomcat/native/branches/1.1.x/native/configure.in Fri Feb 24 07:43:44 2012 @@ -151,6 +151,17 @@ AC_ARG_ENABLE(openssl, esac ]) +AC_ARG_ENABLE(ocsp, +[AS_HELP_STRING([--enable-openssl],[Turn on OpenSSL OCSP verification support])], +[ + case "${enableval}" in +yes ) + APR_ADDTO(CFLAGS, [-DHAVE_OPENSSL_OCSP]) + AC_MSG_RESULT([Enabling OCSP verification support...]) + ;; + esac +]) + if $use_openssl ; then TCN_CHECK_SSL_TOOLKIT fi Modified: tomcat/native/branches/1.1.x/native/include/ssl_private.h URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/include/ssl_private.h?rev=1293119&r1=1293118&r2=1293119&view=diff == --- tomcat/native/branches/1.1.x/native/include/ssl_private.h (original) +++ tomcat/native/branches/1.1.x/native/include/ssl_private.h Fri Feb 24 07:43:44 2012 @@ -204,6 +204,11 @@ "In order to read them you have to provide the pass phrases.\n" \ "Enter password :" +#define OCSP_STATUS_OK0 +#define OCSP_STATUS_REVOKED 1 +#define OCSP_STATUS_UNKNOWN 2 + + extern void *SSL_temp_keys[SSL_TMP_KEY_MAX]; typedef struct { @@ -308,4 +313,7 @@ voidSSL_vhost_algo_id(const unsi int SSL_CTX_use_certificate_chain(SSL_CTX *, const char *, int); int SSL_callback_SSL_verify(int, X509_STORE_CTX *); int SSL_rand_seed(const char *file); +int SSL_ocsp_request(X509 *cert, X509 *issuer); + + #endif /* SSL_PRIVATE_H */ Modified: tomcat/native/branches/1.1.x/native/src/sslutils.c URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/src/sslutils.c?rev=1293119&r1=1293118&r2=1293119&view=diff == --- tomcat/native/branches/1.1.x/native/src/sslutils.c (original) +++ tomcat/native/branches/1.1.x/native/src/sslutils.c Fri Feb 24 07:43:44 2012 @@ -21,16 +21,31 @@ */ #include "tcn.h" -#include "apr_thread_mutex.h" -#include "apr_poll.h" #ifdef HAVE_OPENSSL +#include "apr_poll.h" #include "ssl_private.h" #ifdef WIN32 extern int WIN32_SSL_password_prompt(tcn_pass_cb_t *data); #endif +#if defined(HAVE_SSL_OCSP) && defined(HAVE_OPENSSL_OCSP) +#define HAS_OCSP_ENABLED 1 +#else +#define HAS_OCSP_ENABLED 0 +#endif +#if HAS_OCSP_ENABLED +#include +#include +/* defines with the values as seen by the asn1parse -dump openssl command */ +#define ASN1_SEQUENCE 0x30 +#define ASN1_OID 0x06 +#define ASN1_STRING 0x86 + +static int ssl_verify_OCSP(int ok, X509_STORE_CTX *ctx); +#endif + /* _ ** ** Additional High-Level Functions for OpenSSL @@ -621,6 +636,8 @@ static int ssl_verify_CRL(int ok, X509_S * This OpenSSL callback function is called when OpenSSL * does client authentication and verifies the certificate chain. */ + + int SSL_callback_SSL_verify(int ok, X509_STORE_CTX *ctx) { /* Get Apache context back through OpenSSL context */ @@ -632,6 +649,7 @@ int SSL_callback_SSL_verify(int ok, X509 int errdepth = X509_STORE_CTX_get_error_depth(ctx); int verify = con->ctx->verify_mode; int depth= con->ctx->verify_depth; +int skip_crl = 0; if (verify == SSL_CVERIFY_UNSET || verify == SSL_CVERIFY_NONE) @@ -642,10 +660,28 @@ int SSL_callback_SSL_verify(int ok, X509 ok = 1; SSL_set_verify_result(ssl, X509_V_OK); } + +#if HAS_OCSP_ENABLED +/* First perform OCSP validation if possible */ +if(ok) { +int ocsp_response = ssl_verify_OCSP(ok, ctx); +if (ocsp_response == OCSP_STATUS_OK ) { +skip_crl = 1; /* we know it is valid we skip crl evaluation */ +} +else if(ocsp_response == OCSP_STATUS_REVOKED ) { +ok = 0 ; +errnum = X509_STORE_CTX_get_error(ctx); +} +else if (ocsp_response == OCSP_STATUS_UNKNOWN) { +/* TODO: do nothing for time being, continue with CRL */ +; +} +} +#endif /* * Additionally perf
svn commit: r1293120 - in /tomcat/native/branches/1.1.x/native: include/ssl_private.h src/sslutils.c
Author: mturk Date: Fri Feb 24 07:46:39 2012 New Revision: 1293120 URL: http://svn.apache.org/viewvc?rev=1293120&view=rev Log: No need for public function Modified: tomcat/native/branches/1.1.x/native/include/ssl_private.h tomcat/native/branches/1.1.x/native/src/sslutils.c Modified: tomcat/native/branches/1.1.x/native/include/ssl_private.h URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/include/ssl_private.h?rev=1293120&r1=1293119&r2=1293120&view=diff == --- tomcat/native/branches/1.1.x/native/include/ssl_private.h (original) +++ tomcat/native/branches/1.1.x/native/include/ssl_private.h Fri Feb 24 07:46:39 2012 @@ -313,7 +313,5 @@ voidSSL_vhost_algo_id(const unsi int SSL_CTX_use_certificate_chain(SSL_CTX *, const char *, int); int SSL_callback_SSL_verify(int, X509_STORE_CTX *); int SSL_rand_seed(const char *file); -int SSL_ocsp_request(X509 *cert, X509 *issuer); - #endif /* SSL_PRIVATE_H */ Modified: tomcat/native/branches/1.1.x/native/src/sslutils.c URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/src/sslutils.c?rev=1293120&r1=1293119&r2=1293120&view=diff == --- tomcat/native/branches/1.1.x/native/src/sslutils.c (original) +++ tomcat/native/branches/1.1.x/native/src/sslutils.c Fri Feb 24 07:46:39 2012 @@ -44,6 +44,7 @@ extern int WIN32_SSL_password_prompt(tcn #define ASN1_STRING 0x86 static int ssl_verify_OCSP(int ok, X509_STORE_CTX *ctx); +static int ssl_ocsp_request(X509 *cert, X509 *issuer); #endif /* _ @@ -1213,8 +1214,7 @@ static int process_ocsp_response(OCSP_RE return o; } - -int SSL_ocsp_request(X509 *cert, X509 *issuer) +static int ssl_ocsp_request(X509 *cert, X509 *issuer) { char **ocsp_urls = NULL; int nid, i; - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1293122 - /tomcat/native/branches/1.1.x/native/src/sslutils.c
Author: mturk Date: Fri Feb 24 07:58:26 2012 New Revision: 1293122 URL: http://svn.apache.org/viewvc?rev=1293122&view=rev Log: Apply additional security check from mod_ssl Modified: tomcat/native/branches/1.1.x/native/src/sslutils.c Modified: tomcat/native/branches/1.1.x/native/src/sslutils.c URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/native/src/sslutils.c?rev=1293122&r1=1293121&r2=1293122&view=diff == --- tomcat/native/branches/1.1.x/native/src/sslutils.c (original) +++ tomcat/native/branches/1.1.x/native/src/sslutils.c Fri Feb 24 07:58:26 2012 @@ -665,17 +665,28 @@ int SSL_callback_SSL_verify(int ok, X509 #if HAS_OCSP_ENABLED /* First perform OCSP validation if possible */ if(ok) { -int ocsp_response = ssl_verify_OCSP(ok, ctx); -if (ocsp_response == OCSP_STATUS_OK ) { -skip_crl = 1; /* we know it is valid we skip crl evaluation */ -} -else if(ocsp_response == OCSP_STATUS_REVOKED ) { -ok = 0 ; -errnum = X509_STORE_CTX_get_error(ctx); +/* If there was an optional verification error, it's not + * possible to perform OCSP validation since the issuer may be + * missing/untrusted. Fail in that case. + */ +if (SSL_VERIFY_ERROR_IS_OPTIONAL(errnum)) { +X509_STORE_CTX_set_error(ctx, X509_V_ERR_APPLICATION_VERIFICATION); +errnum = X509_V_ERR_APPLICATION_VERIFICATION; +ok = 0; } -else if (ocsp_response == OCSP_STATUS_UNKNOWN) { -/* TODO: do nothing for time being, continue with CRL */ -; +else { +int ocsp_response = ssl_verify_OCSP(ok, ctx); +if (ocsp_response == OCSP_STATUS_OK ) { +skip_crl = 1; /* we know it is valid we skip crl evaluation */ +} +else if(ocsp_response == OCSP_STATUS_REVOKED ) { +ok = 0 ; +errnum = X509_STORE_CTX_get_error(ctx); +} +else if (ocsp_response == OCSP_STATUS_UNKNOWN) { +/* TODO: do nothing for time being, continue with CRL */ +; +} } } #endif - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org