DO NOT REPLY [Bug 44669] try to get help at netscape
https://issues.apache.org/bugzilla/show_bug.cgi?id=44669 Mark Thomas <[EMAIL PROTECTED]> changed: What|Removed |Added Status|NEW |RESOLVED Resolution||INVALID --- Comment #2 from Mark Thomas <[EMAIL PROTECTED]> 2008-03-25 00:45:29 PST --- Bugzilla is not a support forum. Please use the users list. -- 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: svn commit: r640706 [11/12] - in /tomcat/sandbox/tomcat-lite/tomcat-coyote: ./ org/ org/apache/ org/apache/coyote/ org/apache/coyote/http11/ org/apache/coyote/http11/filters/ org/apache/juli/ org/
> > Added: > tomcat/sandbox/tomcat-lite/tomcat-coyote/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java > URL: > http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/tomcat-coyote/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java?rev=640706&view=auto What a bunch of commit on tomcat-lite ! Costin should we expect something usable soon ? Regards
[EMAIL PROTECTED]: Project tomcat-trunk (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 [EMAIL PROTECTED] Project tomcat-trunk has an issue affecting its community integration. This issue affects 1 projects. The current state of this project is 'Failed', with reason 'Build Failed'. For reference only, the following projects are affected by this: - tomcat-trunk : Java Servlet 2.5 & Server Pages JSP 2.1 implementation (for ... Full details are available at: http://vmgump.apache.org/gump/public/tomcat-trunk/tomcat-trunk/index.html That said, some information snippets are provided here. The following annotations (debug/informational/warning/error messages) were provided: -DEBUG- Dependency on commons-daemon exists, no need to add for property commons-daemon.jsvc.tar.gz. -INFO- Failed with reason build failed -DEBUG- Extracted fallback artifacts from Gump Repository The following work was performed: http://vmgump.apache.org/gump/public/tomcat-trunk/tomcat-trunk/gump_work/build_tomcat-trunk_tomcat-trunk.html Work Name: build_tomcat-trunk_tomcat-trunk (Type: Build) Work ended in a state of : Failed Elapsed: 23 secs Command Line: /usr/lib/jvm/java-1.5.0-sun/bin/java -Djava.awt.headless=true org.apache.tools.ant.Main -Dgump.merge=/srv/gump/public/gump/work/merge.xml -Dbuild.sysclasspath=only -Dtomcat-native.tar.gz=/srv/gump/public/workspace/tomcat-trunk/BUILDING.txt -Dcommons-daemon.jsvc.tar.gz=/srv/gump/public/workspace/apache-commons/daemon/dist/bin/jsvc.tar.gz -Dcommons-daemon.jar=/srv/gump/public/workspace/apache-commons/daemon/dist/commons-daemon-24032008.jar -Djasper-jdt.jar=/srv/gump/packages/eclipse-3.1M6/plugins/org.eclipse.jdt.core_3.1.0/jdtcore.jar -Dcommons-logging-api.jar=/srv/gump/public/workspace/apache-commons/logging/target/commons-logging-api-24032008.jar -Dtomcat-dbcp.jar=/srv/gump/public/workspace/tomcat-trunk/tomcat-deps/tomcat-jdbc-24032008.jar [Working Directory: /srv/gump/public/workspace/tomcat-trunk] CLASSPATH: /usr/lib/jvm/java-1.5.0-sun/lib/tools.jar:/srv/gump/public/workspace/tomcat-trunk/output/classes:/srv/gump/public/workspace/ant/dist/lib/ant-jmf.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-trax.jar:/srv/gump/public/workspace/ant/dist/lib/ant-junit.jar:/srv/gump/public/workspace/ant/dist/lib/ant-launcher.jar:/srv/gump/public/workspace/ant/dist/lib/ant-nodeps.jar:/srv/gump/public/workspace/ant/dist/lib/ant.jar:/srv/gump/packages/junit3.8.1/junit.jar:/srv/gump/public/workspace/xml-commons/java/build/resolver.jar:/srv/gump/public/workspace/junit/dist/junit-24032008.jar:/srv/gump/packages/javamail-1.4/mail.jar:/srv/gump/packages/javamail-1.4/lib/mailapi.jar:/srv/gump/packages/jaf-1.1ea/activation.jar:/srv/gump/public/workspace/apache-commons/logging/target/commons-logging-api-24032008.jar:/srv/gump/packages/eclipse-3.1M6/plugins/org.eclipse.jdt.core_ 3.1.0/jdtcore.jar:/srv/gump/public/workspace/tomcat-trunk/tomcat-deps/tomcat-jdbc-24032008.jar:/srv/gump/public/workspace/apache-commons/daemon/dist/commons-daemon-24032008.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/temp [mkdir] Created dir: /srv/gump/public/workspace/tomcat-trunk/output/build/webapps compile: [javac] Compiling 1048 source files to /srv/gump/public/workspace/tomcat-trunk/output/classes [javac] /srv/gump/public/workspace/tomcat-trunk/java/org/apache/catalina/manager/util/SessionUtils.java:121: warning: non-varargs call of varargs method with inexact argument type for last parameter; [javac] cast to java.lang.Class for a varargs call [javac] cast to java.lang.Class[] for a non-varargs call and to suppress this warning [javac] Method readMethod = probableEngine.getClass().getMethod("getLocale", null);//$NON-NLS-1$ [javac] ^ [javac] /srv/gump/public/workspace/tomcat-trunk/java/org/apache/catalina/manager/util/SessionUtils.java:124: warning: non-varargs call of varargs method with inexact argument type for last parameter; [javac] cast to java.lang.Object for a varargs call [javac] cast to java.lang.Object[] for a non-varargs call an
Re: svn commit: r640706 [11/12] - in /tomcat/sandbox/tomcat-lite/tomcat-coyote: ./ org/ org/apache/ org/apache/coyote/ org/apache/coyote/http11/ org/apache/coyote/http11/filters/ org/apache/juli/ org/
I had this on my computer for a while, moved at very slow pace over the years - but it passes all 'watchdog' servlet and most jsp tests. I'll post more when I finish sumitting. Costin On 3/25/08, Henri Gomez <[EMAIL PROTECTED]> wrote: > > > > Added: > > > tomcat/sandbox/tomcat-lite/tomcat-coyote/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java > > URL: > > > http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/tomcat-coyote/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java?rev=640706&view=auto > > > What a bunch of commit on tomcat-lite ! > > Costin should we expect something usable soon ? > > > Regards > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r640849 - in /tomcat/sandbox/tomcat-lite/coyote-extensions: ./ org/ org/apache/ org/apache/coyote/ org/apache/coyote/adapters/ org/apache/tomcat/ org/apache/tomcat/util/ org/apache/tomcat/
Author: costin Date: Tue Mar 25 08:14:18 2008 New Revision: 640849 URL: http://svn.apache.org/viewvc?rev=640849&view=rev Log: New dirs for possible coyote additions Added: tomcat/sandbox/tomcat-lite/coyote-extensions/ tomcat/sandbox/tomcat-lite/coyote-extensions/org/ tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/ tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/ tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/ tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/tomcat/ tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/tomcat/util/ tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/tomcat/util/buf/ tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/tomcat/util/http/ tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/tomcat/util/net/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r640852 - /tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/
Author: costin Date: Tue Mar 25 08:17:03 2008 New Revision: 640852 URL: http://svn.apache.org/viewvc?rev=640852&view=rev Log: A bunch of files to make it easier to load-test, profile, debug coyote. It can also be used to run simple servers with the maximum speed available - no tomcat or servlet engine overhead. To be useful, a couple of extensions to MessageBytes are needed - to make it easier to use. Some of this is from an old experiment, removed than added back. Added: tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/ClientAbortException.java tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/CoyoteServer.java tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/EchoAdapter.java tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/MapperAdapter.java tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/MessageReader.java tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/MessageWriter.java tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/SimpleFileAdapter.java tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/StaticAdapter.java tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/StaticMain.java Added: tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/ClientAbortException.java URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/ClientAbortException.java?rev=640852&view=auto == --- tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/ClientAbortException.java (added) +++ tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/ClientAbortException.java Tue Mar 25 08:17:03 2008 @@ -0,0 +1,144 @@ +/* + * Copyright 1999,2004 The Apache Software Foundation. + * + * Licensed 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.coyote.adapters; + +import java.io.IOException; + +/** + * Wrap an IOException identifying it as being caused by an abort + * of a request by a remote client. + * + * @author Glenn L. Nielsen + * @version $Revision: 304063 $ $Date: 2005-08-18 06:25:18 -0700 (Thu, 18 Aug 2005) $ + */ + +public final class ClientAbortException extends IOException { + + +// Constructors + + +/** + * Construct a new ClientAbortException with no other information. + */ +public ClientAbortException() { + +this(null, null); + +} + + +/** + * Construct a new ClientAbortException for the specified message. + * + * @param message Message describing this exception + */ +public ClientAbortException(String message) { + +this(message, null); + +} + + +/** + * Construct a new ClientAbortException for the specified throwable. + * + * @param throwable Throwable that caused this exception + */ +public ClientAbortException(Throwable throwable) { + +this(null, throwable); + +} + + +/** + * Construct a new ClientAbortException for the specified message + * and throwable. + * + * @param message Message describing this exception + * @param throwable Throwable that caused this exception + */ +public ClientAbortException(String message, Throwable throwable) { + +super(); +this.message = message; +this.throwable = throwable; + +} + + +//-- Instance Variables + + +/** + * The error message passed to our constructor (if any) + */ +protected String message = null; + + +/** + * The underlying exception or error passed to our constructor (if any) + */ +protected Throwable throwable = null; + + +//-- Public Methods + + +/** + * Returns the message associated with this exception, if any. + */ +public String getMessage() { + +return (message); + +} + + +/** + * Returns the cause that caused this exception, if any. + */ +public Throwable getCause() { + +return (throwable); + +} + + +/** + * Return a formatted string that describes this exceptio
svn commit: r640855 [3/6] - in /tomcat/sandbox/tomcat-lite/coyote-nio: ./ org/ org/apache/ org/apache/coyote/ org/apache/coyote/http11/ org/apache/tomcat/ org/apache/tomcat/util/ org/apache/tomcat/uti
Added: tomcat/sandbox/tomcat-lite/coyote-nio/org/apache/tomcat/util/net/NioBlockingSelector.java URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/coyote-nio/org/apache/tomcat/util/net/NioBlockingSelector.java?rev=640855&view=auto == --- tomcat/sandbox/tomcat-lite/coyote-nio/org/apache/tomcat/util/net/NioBlockingSelector.java (added) +++ tomcat/sandbox/tomcat-lite/coyote-nio/org/apache/tomcat/util/net/NioBlockingSelector.java Tue Mar 25 08:23:12 2008 @@ -0,0 +1,367 @@ +/* + * 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.tomcat.util.net; + +import java.io.EOFException; +import java.io.IOException; +import java.net.SocketTimeoutException; +import java.nio.ByteBuffer; +import java.nio.channels.CancelledKeyException; +import java.nio.channels.ClosedChannelException; +import java.nio.channels.SelectionKey; +import java.nio.channels.Selector; +import java.nio.channels.SocketChannel; +import java.util.Iterator; +import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +import org.apache.juli.logging.Log; +import org.apache.juli.logging.LogFactory; +import org.apache.tomcat.util.MutableInteger; +import org.apache.tomcat.util.net.NioEndpoint.KeyAttachment; +import java.util.concurrent.atomic.AtomicInteger; + +public class NioBlockingSelector { + +protected static Log log = LogFactory.getLog(NioBlockingSelector.class); + +private static int threadCounter = 0; + +protected Selector sharedSelector; + +protected BlockPoller poller; +public NioBlockingSelector() { + +} + +public void open(Selector selector) { +sharedSelector = selector; +poller = new BlockPoller(); +poller.selector = sharedSelector; +poller.setDaemon(true); +poller.setName("NioBlockingSelector.BlockPoller-"+(++threadCounter)); +poller.start(); +} + +public void close() { +if (poller!=null) { +poller.disable(); +poller.interrupt(); +poller = null; +} +} + +/** + * Performs a blocking write using the bytebuffer for data to be written + * If the selector parameter is null, then it will perform a busy write that could + * take up a lot of CPU cycles. + * @param buf ByteBuffer - the buffer containing the data, we will write as long as (buf.hasRemaining()==true) + * @param socket SocketChannel - the socket to write data to + * @param writeTimeout long - the timeout for this write operation in milliseconds, -1 means no timeout + * @return int - returns the number of bytes written + * @throws EOFException if write returns -1 + * @throws SocketTimeoutException if the write times out + * @throws IOException if an IO Exception occurs in the underlying socket logic + */ +public int write(ByteBuffer buf, NioChannel socket, long writeTimeout,MutableInteger lastWrite) throws IOException { +SelectionKey key = socket.getIOChannel().keyFor(socket.getPoller().getSelector()); +if ( key == null ) throw new IOException("Key no longer registered"); +KeyAttachment att = (KeyAttachment) key.attachment(); +int written = 0; +boolean timedout = false; +int keycount = 1; //assume we can write +long time = System.currentTimeMillis(); //start the timeout timer +try { +while ( (!timedout) && buf.hasRemaining()) { +if (keycount > 0) { //only write if we were registered for a write +int cnt = socket.write(buf); //write the data +lastWrite.set(cnt); +if (cnt == -1) +throw new EOFException(); +written += cnt; +if (cnt > 0) { +time = System.currentTimeMillis(); //reset our timeout timer +continue; //we successfully wrote, try again without a selector +} +} +try { +if ( att.getWriteLatch()==n
svn commit: r640855 [6/6] - in /tomcat/sandbox/tomcat-lite/coyote-nio: ./ org/ org/apache/ org/apache/coyote/ org/apache/coyote/http11/ org/apache/tomcat/ org/apache/tomcat/util/ org/apache/tomcat/uti
Added: tomcat/sandbox/tomcat-lite/coyote-nio/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/coyote-nio/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java?rev=640855&view=auto == --- tomcat/sandbox/tomcat-lite/coyote-nio/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java (added) +++ tomcat/sandbox/tomcat-lite/coyote-nio/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java Tue Mar 25 08:23:12 2008 @@ -0,0 +1,670 @@ +/* + * 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.tomcat.util.net.jsse; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.net.InetAddress; +import java.net.ServerSocket; +import java.net.Socket; +import java.net.SocketException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.CRL; +import java.security.cert.CRLException; +import java.security.cert.CertPathParameters; +import java.security.cert.CertStore; +import java.security.cert.CertStoreParameters; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.CollectionCertStoreParameters; +import java.security.cert.PKIXBuilderParameters; +import java.security.cert.X509CertSelector; +import java.util.Collection; +import java.util.Vector; + +import javax.net.ssl.CertPathTrustManagerParameters; +import javax.net.ssl.KeyManager; +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.ManagerFactoryParameters; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLException; +import javax.net.ssl.SSLServerSocket; +import javax.net.ssl.SSLServerSocketFactory; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.TrustManager; +import javax.net.ssl.TrustManagerFactory; +import javax.net.ssl.X509KeyManager; + +import org.apache.tomcat.util.res.StringManager; + +/* + 1. Make the JSSE's jars available, either as an installed + extension (copy them into jre/lib/ext) or by adding + them to the Tomcat classpath. + 2. keytool -genkey -alias tomcat -keyalg RSA + Use "changeit" as password ( this is the default we use ) + */ + +/** + * SSL server socket factory. It _requires_ a valid RSA key and + * JSSE. + * + * @author Harish Prabandham + * @author Costin Manolache + * @author Stefan Freyr Stefansson + * @author EKR -- renamed to JSSESocketFactory + * @author Jan Luehe + * @author Bill Barker + */ +public class JSSESocketFactory +extends org.apache.tomcat.util.net.ServerSocketFactory { + +private static StringManager sm = +StringManager.getManager("org.apache.tomcat.util.net.jsse.res"); + +// defaults +static String defaultProtocol = "TLS"; +static boolean defaultClientAuth = false; +static String defaultKeystoreType = "JKS"; +private static final String defaultKeystoreFile += System.getProperty("user.home") + "/.keystore"; +private static final String defaultKeyPass = "changeit"; +static org.apache.juli.logging.Log log = +org.apache.juli.logging.LogFactory.getLog(JSSESocketFactory.class); + +protected boolean initialized; +protected String clientAuth = "false"; +protected SSLServerSocketFactory sslProxy = null; +protected String[] enabledCiphers; + +/** + * Flag to state that we require client authentication. + */ +protected boolean requireClientAuth = false; + +/** + * Flag to state that we would like client authentication. + */ +protected boolean wantClientAuth= false; + + +public JSSESocketFactory () { +} + +public ServerSocket createSocket (int port) +throws IOException +{ +if (!initialized) init(); +ServerSocket socket = sslProxy.createServerSocket(port); +initServerSocket(socket); +return socket; +} + +public ServerSocket createSocket (int port, int backlog) +throws IOException +{ +if (!initialized) init(); +ServerSocket socket = sslProxy.createServerSock
svn commit: r640860 [5/6] - in /tomcat/sandbox/tomcat-lite/coyote-apr: ./ org/ org/apache/ org/apache/coyote/ org/apache/coyote/http11/ org/apache/tomcat/ org/apache/tomcat/jni/ org/apache/tomcat/util
Added: tomcat/sandbox/tomcat-lite/coyote-apr/org/apache/tomcat/jni/Socket.java URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/coyote-apr/org/apache/tomcat/jni/Socket.java?rev=640860&view=auto == --- tomcat/sandbox/tomcat-lite/coyote-apr/org/apache/tomcat/jni/Socket.java (added) +++ tomcat/sandbox/tomcat-lite/coyote-apr/org/apache/tomcat/jni/Socket.java Tue Mar 25 08:26:26 2008 @@ -0,0 +1,529 @@ +/* + * 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.tomcat.jni; + +/* Import needed classes */ +import java.nio.ByteBuffer; + +/** Socket + * + * @author Mladen Turk + * @version $Revision: 467222 $, $Date: 2006-10-23 20:17:11 -0700 (Mon, 23 Oct 2006) $ + */ + +public class Socket { + +/* Standard socket defines */ +public static final int SOCK_STREAM = 0; +public static final int SOCK_DGRAM = 1; +/* + * apr_sockopt Socket option definitions + */ +public static final int APR_SO_LINGER = 1;/** Linger */ +public static final int APR_SO_KEEPALIVE= 2;/** Keepalive */ +public static final int APR_SO_DEBUG= 4;/** Debug */ +public static final int APR_SO_NONBLOCK = 8;/** Non-blocking IO */ +public static final int APR_SO_REUSEADDR= 16; /** Reuse addresses */ +public static final int APR_SO_SNDBUF = 64; /** Send buffer */ +public static final int APR_SO_RCVBUF = 128; /** Receive buffer */ +public static final int APR_SO_DISCONNECTED = 256; /** Disconnected */ +/** For SCTP sockets, this is mapped to STCP_NODELAY internally. */ +public static final int APR_TCP_NODELAY = 512; +public static final int APR_TCP_NOPUSH = 1024; /** No push */ +/** This flag is ONLY set internally when we set APR_TCP_NOPUSH with + * APR_TCP_NODELAY set to tell us that APR_TCP_NODELAY should be turned on + * again when NOPUSH is turned off + */ +public static final int APR_RESET_NODELAY = 2048; +/** Set on non-blocking sockets (timeout != 0) on which the + * previous read() did not fill a buffer completely. the next + * apr_socket_recv() will first call select()/poll() rather than + * going straight into read(). (Can also be set by an application to + * force a select()/poll() call before the next read, in cases where + * the app expects that an immediate read would fail.) + */ +public static final int APR_INCOMPLETE_READ = 4096; +/** like APR_INCOMPLETE_READ, but for write + */ +public static final int APR_INCOMPLETE_WRITE = 8192; +/** Don't accept IPv4 connections on an IPv6 listening socket. + */ +public static final int APR_IPV6_V6ONLY = 16384; +/** Delay accepting of new connections until data is available. + */ +public static final int APR_TCP_DEFER_ACCEPT = 32768; + +/** Define what type of socket shutdown should occur. + * apr_shutdown_how_e enum + */ +public static final int APR_SHUTDOWN_READ = 0; /** no longer allow read request */ +public static final int APR_SHUTDOWN_WRITE = 1; /** no longer allow write requests */ +public static final int APR_SHUTDOWN_READWRITE = 2; /** no longer allow read or write requests */ + +public static final int APR_IPV4_ADDR_OK = 0x01; +public static final int APR_IPV6_ADDR_OK = 0x02; + +/* TODO: Missing: + * APR_INET + * APR_UNSPEC + * APR_INET6 + */ +public static final int APR_UNSPEC = 0; +public static final int APR_INET = 1; +public static final int APR_INET6 = 2; + +public static final int APR_PROTO_TCP = 6; /** TCP */ +public static final int APR_PROTO_UDP = 17; /** UDP */ +public static final int APR_PROTO_SCTP = 132; /** SCTP */ + +/** + * Enum to tell us if we're interested in remote or local socket + * apr_interface_e + */ +public static final int APR_LOCAL = 0; +public static final int APR_REMOTE = 1; + +/* Socket.get types */ +public static final int SOCKET_GET_POOL = 0; +public static final int SOCKET_GET_IMPL = 1; +public static final int SOCKET_GET_A
svn commit: r640860 [2/6] - in /tomcat/sandbox/tomcat-lite/coyote-apr: ./ org/ org/apache/ org/apache/coyote/ org/apache/coyote/http11/ org/apache/tomcat/ org/apache/tomcat/jni/ org/apache/tomcat/util
Added: tomcat/sandbox/tomcat-lite/coyote-apr/org/apache/coyote/http11/InternalAprInputBuffer.java URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/coyote-apr/org/apache/coyote/http11/InternalAprInputBuffer.java?rev=640860&view=auto == --- tomcat/sandbox/tomcat-lite/coyote-apr/org/apache/coyote/http11/InternalAprInputBuffer.java (added) +++ tomcat/sandbox/tomcat-lite/coyote-apr/org/apache/coyote/http11/InternalAprInputBuffer.java Tue Mar 25 08:26:26 2008 @@ -0,0 +1,807 @@ +/* + * 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.coyote.http11; + +import java.io.IOException; +import java.io.EOFException; +import java.net.SocketTimeoutException; +import java.nio.ByteBuffer; + +import org.apache.tomcat.jni.Socket; +import org.apache.tomcat.jni.Status; +import org.apache.tomcat.util.buf.ByteChunk; +import org.apache.tomcat.util.buf.MessageBytes; +import org.apache.tomcat.util.http.MimeHeaders; +import org.apache.tomcat.util.res.StringManager; + +import org.apache.coyote.InputBuffer; +import org.apache.coyote.Request; + +/** + * Implementation of InputBuffer which provides HTTP request header parsing as + * well as transfer decoding. + * + * @author mailto:[EMAIL PROTECTED]">Remy Maucherat + */ +public class InternalAprInputBuffer implements InputBuffer { + + +// -- Constants + + +// --- Constructors + + +/** + * Alternate constructor. + */ +public InternalAprInputBuffer(Request request, int headerBufferSize) { + +this.request = request; +headers = request.getMimeHeaders(); + +buf = new byte[headerBufferSize]; +if (headerBufferSize < (8 * 1024)) { +bbuf = ByteBuffer.allocateDirect(6 * 1500); +} else { +bbuf = ByteBuffer.allocateDirect((headerBufferSize / 1500 + 1) * 1500); +} + +inputStreamInputBuffer = new SocketInputBuffer(); + +filterLibrary = new InputFilter[0]; +activeFilters = new InputFilter[0]; +lastActiveFilter = -1; + +parsingHeader = true; +swallowInput = true; + +} + + +// -- Variables + + +/** + * The string manager for this package. + */ +protected static StringManager sm = +StringManager.getManager(Constants.Package); + + +// - Instance Variables + + +/** + * Associated Coyote request. + */ +protected Request request; + + +/** + * Headers of the associated request. + */ +protected MimeHeaders headers; + + +/** + * State. + */ +protected boolean parsingHeader; + + +/** + * Swallow input ? (in the case of an expectation) + */ +protected boolean swallowInput; + + +/** + * Pointer to the current read buffer. + */ +protected byte[] buf; + + +/** + * Last valid byte. + */ +protected int lastValid; + + +/** + * Position in the buffer. + */ +protected int pos; + + +/** + * Pos of the end of the header in the buffer, which is also the + * start of the body. + */ +protected int end; + + +/** + * Direct byte buffer used to perform actual reading. + */ +protected ByteBuffer bbuf; + + +/** + * Underlying socket. + */ +protected long socket; + + +/** + * Underlying input buffer. + */ +protected InputBuffer inputStreamInputBuffer; + + +/** + * Filter library. + * Note: Filter[0] is always the "chunked" filter. + */ +protected InputFilter[] filterLibrary; + + +/** + * Active filters (in order). + */ +protected InputFilter[] activeFilters; + + +/** + * Index of the last active filter. + */ +protected int lastActiveFilter; + + +// - Properties + + +/** + * Set the underlying socket. + */ +public void setSocket(long socket) { +
Re: svn commit: r640551 - /tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java
[EMAIL PROTECTED] wrote: Author: markt Date: Mon Mar 24 13:09:15 2008 New Revision: 640551 URL: http://svn.apache.org/viewvc?rev=640551&view=rev Log: Clean-up unused import Modified: tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java Modified: tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java?rev=640551&r1=640550&r2=640551&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java Mon Mar 24 13:09:15 2008 @@ -34,7 +34,6 @@ import org.apache.tomcat.util.net.NioEndpoint; import org.apache.tomcat.util.net.NioSelectorPool; import org.apache.tomcat.util.res.StringManager; -import java.io.EOFException; import org.apache.tomcat.util.MutableInteger; /** @@ -479,11 +478,14 @@ buf[pos++] = Constants.SP; // Write message -String message = response.getMessage(); -if (message == null) { +String message = null; +if (org.apache.coyote.Constants.USE_CUSTOM_STATUS_MSG_IN_HEADER) { That breaks the builds. Cheers Jean-Frederic +message = response.getMessage(); +} +if (message == null){ write(HttpMessages.getMessage(status)); } else { -write(message); +write(message.replace('\n', ' ').replace('\r', ' ')); } // End the response status line - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r640888 - /tomcat/trunk/java/org/apache/tomcat/util/http/MimeHeaders.java
Author: jfclere Date: Tue Mar 25 09:38:14 2008 New Revision: 640888 URL: http://svn.apache.org/viewvc?rev=640888&view=rev Log: Add missing public on constructor. Otherwise when using form based authentication: +++ java.lang.NoClassDefFoundError: org/apache/tomcat/util/http/NamesEnumerator at org.apache.tomcat.util.http.MimeHeaders.names(MimeHeaders.java:201) at org.apache.catalina.connector.Request.getHeaderNames(Request.java:1873) at org.apache.catalina.authenticator.FormAuthenticator.saveRequest(FormAuthenticator.java:479) +++ Modified: tomcat/trunk/java/org/apache/tomcat/util/http/MimeHeaders.java Modified: tomcat/trunk/java/org/apache/tomcat/util/http/MimeHeaders.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/MimeHeaders.java?rev=640888&r1=640887&r2=640888&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/MimeHeaders.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/MimeHeaders.java Tue Mar 25 09:38:14 2008 @@ -364,7 +364,7 @@ String next; MimeHeaders headers; -NamesEnumerator(MimeHeaders headers) { +public NamesEnumerator(MimeHeaders headers) { this.headers=headers; pos=0; size = headers.size(); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: svn commit: r640706 [11/12] - in /tomcat/sandbox/tomcat-lite/tomcat-coyote: ./ org/ org/apache/ org/apache/coyote/ org/apache/coyote/http11/ org/apache/coyote/http11/filters/ org/apache/juli/ org/
> > I had this on my computer for a while, moved at very slow pace over > the years - but it passes all 'watchdog' servlet and most jsp tests. > I'll post more when I finish sumitting. Having a tomcat light could be a very good alternative since many users use jetty for quick tests, ie when using maven. Good news to see it come back to life
svn commit: r640897 - /tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java
Author: jfclere Date: Tue Mar 25 10:02:02 2008 New Revision: 640897 URL: http://svn.apache.org/viewvc?rev=640897&view=rev Log: SavedRequest is the only one using T_STR instead T_BYTES. converting to T_BYTES allows to use utf8 encoded querystring with parameters and form based authentication. Modified: tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java Modified: tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java?rev=640897&r1=640896&r2=640897&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/Parameters.java Tue Mar 25 10:02:02 2008 @@ -505,17 +505,12 @@ public void processParameters( MessageBytes data, String encoding ) { if( data==null || data.isNull() || data.getLength() <= 0 ) return; -if( data.getType() == MessageBytes.T_BYTES ) { -ByteChunk bc=data.getByteChunk(); -processParameters( bc.getBytes(), bc.getOffset(), - bc.getLength(), encoding); -} else { -if (data.getType()!= MessageBytes.T_CHARS ) -data.toChars(); -CharChunk cc=data.getCharChunk(); -processParameters( cc.getChars(), cc.getOffset(), - cc.getLength()); +if( data.getType() != MessageBytes.T_BYTES ) { +data.toBytes(); } +ByteChunk bc=data.getByteChunk(); +processParameters( bc.getBytes(), bc.getOffset(), + bc.getLength(), encoding); } /** Debug purpose - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[EMAIL PROTECTED]: Project tomcat-trunk (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 [EMAIL PROTECTED] Project tomcat-trunk has an issue affecting its community integration. This issue affects 1 projects, and has been outstanding for 2 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 : Java Servlet 2.5 & Server Pages JSP 2.1 implementation (for ... Full details are available at: http://vmgump.apache.org/gump/public/tomcat-trunk/tomcat-trunk/index.html That said, some information snippets are provided here. The following annotations (debug/informational/warning/error messages) were provided: -DEBUG- Dependency on commons-daemon exists, no need to add for property commons-daemon.jsvc.tar.gz. -INFO- Failed with reason build failed -INFO- Failed to extract fallback artifacts from Gump Repository The following work was performed: http://vmgump.apache.org/gump/public/tomcat-trunk/tomcat-trunk/gump_work/build_tomcat-trunk_tomcat-trunk.html Work Name: build_tomcat-trunk_tomcat-trunk (Type: Build) Work ended in a state of : Failed Elapsed: 44 secs Command Line: /usr/lib/jvm/java-1.5.0-sun/bin/java -Djava.awt.headless=true org.apache.tools.ant.Main -Dgump.merge=/srv/gump/public/gump/work/merge.xml -Dbuild.sysclasspath=only -Dtomcat-native.tar.gz=/srv/gump/public/workspace/tomcat-trunk/BUILDING.txt -Dcommons-daemon.jsvc.tar.gz=/srv/gump/public/workspace/apache-commons/daemon/dist/bin/jsvc.tar.gz -Dcommons-daemon.jar=/srv/gump/public/workspace/apache-commons/daemon/dist/commons-daemon-25032008.jar -Djasper-jdt.jar=/srv/gump/packages/eclipse-3.1M6/plugins/org.eclipse.jdt.core_3.1.0/jdtcore.jar -Dcommons-logging-api.jar=/srv/gump/public/workspace/apache-commons/logging/target/commons-logging-api-25032008.jar -Dtomcat-dbcp.jar=/srv/gump/public/workspace/tomcat-trunk/tomcat-deps/tomcat-jdbc-25032008.jar [Working Directory: /srv/gump/public/workspace/tomcat-trunk] CLASSPATH: /usr/lib/jvm/java-1.5.0-sun/lib/tools.jar:/srv/gump/public/workspace/tomcat-trunk/output/classes:/srv/gump/public/workspace/ant/dist/lib/ant-jmf.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-trax.jar:/srv/gump/public/workspace/ant/dist/lib/ant-junit.jar:/srv/gump/public/workspace/ant/dist/lib/ant-launcher.jar:/srv/gump/public/workspace/ant/dist/lib/ant-nodeps.jar:/srv/gump/public/workspace/ant/dist/lib/ant.jar:/srv/gump/packages/junit3.8.1/junit.jar:/srv/gump/public/workspace/xml-commons/java/build/resolver.jar:/srv/gump/public/workspace/junit/dist/junit-25032008.jar:/srv/gump/packages/javamail-1.4/mail.jar:/srv/gump/packages/javamail-1.4/lib/mailapi.jar:/srv/gump/packages/jaf-1.1ea/activation.jar:/srv/gump/public/workspace/apache-commons/logging/target/commons-logging-api-25032008.jar:/srv/gump/packages/eclipse-3.1M6/plugins/org.eclipse.jdt.core_ 3.1.0/jdtcore.jar:/srv/gump/public/workspace/tomcat-trunk/tomcat-deps/tomcat-jdbc-25032008.jar:/srv/gump/public/workspace/apache-commons/daemon/dist/commons-daemon-25032008.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/temp [mkdir] Created dir: /srv/gump/public/workspace/tomcat-trunk/output/build/webapps compile: [javac] Compiling 1048 source files to /srv/gump/public/workspace/tomcat-trunk/output/classes [javac] /srv/gump/public/workspace/tomcat-trunk/java/org/apache/catalina/manager/util/SessionUtils.java:121: warning: non-varargs call of varargs method with inexact argument type for last parameter; [javac] cast to java.lang.Class for a varargs call [javac] cast to java.lang.Class[] for a non-varargs call and to suppress this warning [javac] Method readMethod = probableEngine.getClass().getMethod("getLocale", null);//$NON-NLS-1$ [javac] ^ [javac] /srv/gump/public/workspace/tomcat-trunk/java/org/apache/catalina/manager/util/SessionUtils.java:124: warning: non-varargs call of varargs method with inexact argument type for last parameter; [javac] cast to java.lang.Object for a varargs call [javac] cast to
svn commit: r640962 - /tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java
Author: markt Date: Tue Mar 25 13:00:43 2008 New Revision: 640962 URL: http://svn.apache.org/viewvc?rev=640962&view=rev Log: Revert change from some work in progress that snuck in as part of an unrelated commit Modified: tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java Modified: tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java?rev=640962&r1=640961&r2=640962&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java Tue Mar 25 13:00:43 2008 @@ -478,14 +478,11 @@ buf[pos++] = Constants.SP; // Write message -String message = null; -if (org.apache.coyote.Constants.USE_CUSTOM_STATUS_MSG_IN_HEADER) { -message = response.getMessage(); -} -if (message == null){ +String message = response.getMessage(); +if (message == null) { write(HttpMessages.getMessage(status)); } else { -write(message.replace('\n', ' ').replace('\r', ' ')); +write(message); } // End the response status line - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: svn commit: r640551 - /tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java
jean-frederic clere wrote: [EMAIL PROTECTED] wrote: Author: markt Date: Mon Mar 24 13:09:15 2008 New Revision: 640551 URL: http://svn.apache.org/viewvc?rev=640551&view=rev That breaks the builds. Sorry. My bad. Should be fixed now. Mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat Header Injection
I'm continuing to do a security review of Tomcat 5.5 for my company. I noticed that linefeeds get ripped out of header values which stops header injection attacks cold. Whoever did this, I commend you. Many other containers do not. You Rock. Can anyone point me to the code that does this? Best, Jim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat Header Injection
Jim Manico wrote: I'm continuing to do a security review of Tomcat 5.5 for my company. I noticed that linefeeds get ripped out of header values which stops header injection attacks cold. Whoever did this, I commend you. Many other containers do not. You Rock. Can anyone point me to the code that does this? It is in a couple of places. It is usually the same code. Searching for the following should find most of the cases: replace('\n', ' ').replace('\r', ' ') Mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat Header Injection
Jim Manico wrote: I'm continuing to do a security review of Tomcat 5.5 for my company. I noticed that linefeeds get ripped out of header values which stops header injection attacks cold. Whoever did this, I commend you. Many other containers do not. You Rock. InternalInputBuffer.java InternalAprInputBuffer.java InternalNioInputBuffer.java just search for parseHeaders the two first classes are similar, the third one is almost similar, except that it supports non blocking parsing of headers Filip Can anyone point me to the code that does this? Best, Jim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r640994 - /tomcat/trunk/webapps/docs/config/ajp.xml
Author: markt Date: Tue Mar 25 14:27:04 2008 New Revision: 640994 URL: http://svn.apache.org/viewvc?rev=640994&view=rev Log: Fix bug 44541 - document packetSize for the AJP connector. Modified: tomcat/trunk/webapps/docs/config/ajp.xml Modified: tomcat/trunk/webapps/docs/config/ajp.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/ajp.xml?rev=640994&r1=640993&r2=640994&view=diff == --- tomcat/trunk/webapps/docs/config/ajp.xml (original) +++ tomcat/trunk/webapps/docs/config/ajp.xml Tue Mar 25 14:27:04 2008 @@ -258,6 +258,15 @@ execute tasks using the executor rather than an internal thread pool. + + This attribute sets the maximum AJP packet size in Bytes. The maximum + value is 65536. It should be the same as the max_packet_size + directive configured for mod_jk. Normally it is not necessary to change + the maximum packet size. Problems with the default value have been + reported when sending certificates or certificate chains. The default + value is 8192. + + The TCP port number on which this Connector will create a server socket and await incoming connections. Your - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r640998 - /tomcat/tc6.0.x/trunk/STATUS.txt
Author: markt Date: Tue Mar 25 14:31:02 2008 New Revision: 640998 URL: http://svn.apache.org/viewvc?rev=640998&view=rev Log: Propose fix for 44541 Modified: tomcat/tc6.0.x/trunk/STATUS.txt Modified: tomcat/tc6.0.x/trunk/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=640998&r1=640997&r2=640998&view=diff == --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Tue Mar 25 14:31:02 2008 @@ -88,3 +88,9 @@ http://svn.apache.org/viewvc?rev=640584&view=rev +1: markt -1: + +* Document packetSize attribute for AJP connector + https://issues.apache.org/bugzilla/show_bug.cgi?id=44541 + http://svn.apache.org/viewvc?rev=640994&view=rev + +1: markt + -1: - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r641001 - /tomcat/current/tc5.5.x/STATUS.txt
Author: markt Date: Tue Mar 25 14:31:46 2008 New Revision: 641001 URL: http://svn.apache.org/viewvc?rev=641001&view=rev Log: Propose fix for bug 44541 Modified: tomcat/current/tc5.5.x/STATUS.txt Modified: tomcat/current/tc5.5.x/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/current/tc5.5.x/STATUS.txt?rev=641001&r1=641000&r2=641001&view=diff == --- tomcat/current/tc5.5.x/STATUS.txt (original) +++ tomcat/current/tc5.5.x/STATUS.txt Tue Mar 25 14:31:46 2008 @@ -81,3 +81,9 @@ http://svn.apache.org/viewvc?rev=639842&view=rev +1: rjung -1: + +* Document packetSize attribute for AJP connector + https://issues.apache.org/bugzilla/show_bug.cgi?id=44541 + http://svn.apache.org/viewvc?rev=640994&view=rev + +1: markt + -1: - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 44541] Document packetSize attribute
https://issues.apache.org/bugzilla/show_bug.cgi?id=44541 --- Comment #1 from Mark Thomas <[EMAIL PROTECTED]> 2008-03-25 14:30:21 PST --- The has been fixed in trunk and proposed for 5.5.x (and 6.0.x). -- 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r641020 - /tomcat/current/tc5.5.x/STATUS.txt
Author: markt Date: Tue Mar 25 14:37:51 2008 New Revision: 641020 URL: http://svn.apache.org/viewvc?rev=641020&view=rev Log: Votes Modified: tomcat/current/tc5.5.x/STATUS.txt Modified: tomcat/current/tc5.5.x/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/current/tc5.5.x/STATUS.txt?rev=641020&r1=641019&r2=641020&view=diff == --- tomcat/current/tc5.5.x/STATUS.txt (original) +++ tomcat/current/tc5.5.x/STATUS.txt Tue Mar 25 14:37:51 2008 @@ -41,7 +41,7 @@ http://people.apache.org/~rjung/patches/add_commons-io.patch NOTE: there are also references to commons-fileupload in the container build.xml, but I think we don't need to add commons-io there. - +1: rjung, fhanik + +1: rjung, fhanik, markt * Revert back to original patch proposed for UTF8 parsing. This also fixes the regression for 6.0.16 and 5.5.26 (and possibly 4.1.37) mentioned in @@ -79,7 +79,7 @@ * Fix docs re use of maxActive http://svn.apache.org/viewvc?rev=639842&view=rev - +1: rjung + +1: rjung, markt -1: * Document packetSize attribute for AJP connector - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat Header Injection
Thank you very much, Mark and Filip. - Jim Jim Manico wrote: I'm continuing to do a security review of Tomcat 5.5 for my company. I noticed that linefeeds get ripped out of header values which stops header injection attacks cold. Whoever did this, I commend you. Many other containers do not. You Rock. InternalInputBuffer.java InternalAprInputBuffer.java InternalNioInputBuffer.java just search for parseHeaders the two first classes are similar, the third one is almost similar, except that it supports non blocking parsing of headers Filip Can anyone point me to the code that does this? Best, Jim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r641023 - /tomcat/tc6.0.x/trunk/STATUS.txt
Author: markt Date: Tue Mar 25 14:39:34 2008 New Revision: 641023 URL: http://svn.apache.org/viewvc?rev=641023&view=rev Log: Add bug ref Modified: tomcat/tc6.0.x/trunk/STATUS.txt Modified: tomcat/tc6.0.x/trunk/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=641023&r1=641022&r2=641023&view=diff == --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Tue Mar 25 14:39:34 2008 @@ -67,7 +67,7 @@ -1: * Provide more helpful error message when class can't load due to wrong version - https://issues.apache.org/bugzilla/show_bug.cgi?id=44633# + https://issues.apache.org/bugzilla/show_bug.cgi?id=44633 http://svn.apache.org/viewvc?rev=640451&view=rev http://svn.apache.org/viewvc?rev=640559&view=rev (Rainer's improvement) +1: markt, rjung @@ -84,6 +84,7 @@ 2) It's implementation of getHeaderField(String name) is case sensitive. 3) It returns an empty string "", rather than null, for header values which don't exist. + https://issues.apache.org/bugzilla/show_bug.cgi?id=44611 Patch provided by Chris Hubick http://svn.apache.org/viewvc?rev=640584&view=rev +1: markt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r641030 - /tomcat/current/tc5.5.x/STATUS.txt
Author: markt Date: Tue Mar 25 14:55:46 2008 New Revision: 641030 URL: http://svn.apache.org/viewvc?rev=641030&view=rev Log: Propose the alternative fix for BZ44494 that we used in TC6 Modified: tomcat/current/tc5.5.x/STATUS.txt Modified: tomcat/current/tc5.5.x/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/current/tc5.5.x/STATUS.txt?rev=641030&r1=641029&r2=641030&view=diff == --- tomcat/current/tc5.5.x/STATUS.txt (original) +++ tomcat/current/tc5.5.x/STATUS.txt Tue Mar 25 14:55:46 2008 @@ -43,17 +43,6 @@ container build.xml, but I think we don't need to add commons-io there. +1: rjung, fhanik, markt -* Revert back to original patch proposed for UTF8 parsing. - This also fixes the regression for 6.0.16 and 5.5.26 (and possibly 4.1.37) mentioned in - http://issues.apache.org/bugzilla/show_bug.cgi?id=44494 - - The original patch can be viewed - http://svn.apache.org/viewvc?rev=568307&view=rev - http://svn.apache.org/viewvc?rev=568605&view=rev - - +1: fhanik - -1: - * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=44562 http://svn.apache.org/viewvc?rev=635294&view=rev (prior code clean up) http://svn.apache.org/viewvc?rev=635297&view=rev (the actual fix) @@ -87,3 +76,9 @@ http://svn.apache.org/viewvc?rev=640994&view=rev +1: markt -1: + +* Port fix for regression in 5.5.26 (and 4.1.37) that limited uploads to 8k + https://issues.apache.org/bugzilla/show_bug.cgi?id=44494 + http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/InputBuffer.java?view=diff&r1=639890&r2=639891&pathrev=639891 + +1: markt + -1: - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r641031 - /tomcat/tc6.0.x/trunk/STATUS.txt
Author: rjung Date: Tue Mar 25 14:56:34 2008 New Revision: 641031 URL: http://svn.apache.org/viewvc?rev=641031&view=rev Log: Vote. Modified: tomcat/tc6.0.x/trunk/STATUS.txt Modified: tomcat/tc6.0.x/trunk/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=641031&r1=641030&r2=641031&view=diff == --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Tue Mar 25 14:56:34 2008 @@ -93,5 +93,5 @@ * Document packetSize attribute for AJP connector https://issues.apache.org/bugzilla/show_bug.cgi?id=44541 http://svn.apache.org/viewvc?rev=640994&view=rev - +1: markt + +1: markt, rjung -1: - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r641033 - /tomcat/current/tc5.5.x/STATUS.txt
Author: rjung Date: Tue Mar 25 14:58:25 2008 New Revision: 641033 URL: http://svn.apache.org/viewvc?rev=641033&view=rev Log: Vote. Modified: tomcat/current/tc5.5.x/STATUS.txt Modified: tomcat/current/tc5.5.x/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/current/tc5.5.x/STATUS.txt?rev=641033&r1=641032&r2=641033&view=diff == --- tomcat/current/tc5.5.x/STATUS.txt (original) +++ tomcat/current/tc5.5.x/STATUS.txt Tue Mar 25 14:58:25 2008 @@ -74,7 +74,7 @@ * Document packetSize attribute for AJP connector https://issues.apache.org/bugzilla/show_bug.cgi?id=44541 http://svn.apache.org/viewvc?rev=640994&view=rev - +1: markt + +1: markt, rjung -1: * Port fix for regression in 5.5.26 (and 4.1.37) that limited uploads to 8k - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r641042 - /tomcat/current/tc4.1.x/STATUS.txt
Author: rjung Date: Tue Mar 25 15:12:35 2008 New Revision: 641042 URL: http://svn.apache.org/viewvc?rev=641042&view=rev Log: Add proposed docs change patch for TC 4.1: don't include dev snapshots of JK docs, link to released version instead Modified: tomcat/current/tc4.1.x/STATUS.txt Modified: tomcat/current/tc4.1.x/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/current/tc4.1.x/STATUS.txt?rev=641042&r1=641041&r2=641042&view=diff == --- tomcat/current/tc4.1.x/STATUS.txt (original) +++ tomcat/current/tc4.1.x/STATUS.txt Tue Mar 25 15:12:35 2008 @@ -42,3 +42,9 @@ +1: rjung -1: rjung: Didn't check though, if this is actually true for the 4.1 bundled DBCP. + +* Fix docs: don't include dev snapshots of JK docs, link to released version instead + http://people.apache.org/~rjung/patches/tc4_1-jk-docs.patch + +1: rjung + -1: + rjung: Mark, I didn't actually try to build it. I guess it's much easier for you :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r641043 - in /tomcat/trunk/java/org/apache: catalina/connector/InputBuffer.java tomcat/util/buf/B2CConverter.java
Author: markt Date: Tue Mar 25 15:13:49 2008 New Revision: 641043 URL: http://svn.apache.org/viewvc?rev=641043&view=rev Log: Revert original proposal for BZ44494 since an alternative patch was committed to 6.0.x Modified: tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java tomcat/trunk/java/org/apache/tomcat/util/buf/B2CConverter.java Modified: tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java?rev=641043&r1=641042&r2=641043&view=diff == --- tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java (original) +++ tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java Tue Mar 25 15:13:49 2008 @@ -354,9 +354,9 @@ cb.setEnd(0); } -conv.convert(bb, cb); -bb.setOffset(bb.getEnd()); state = CHAR_STATE; +conv.convert(bb, cb, len); +bb.setOffset(bb.getEnd()); return cb.getLength(); Modified: tomcat/trunk/java/org/apache/tomcat/util/buf/B2CConverter.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/buf/B2CConverter.java?rev=641043&r1=641042&r2=641043&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/buf/B2CConverter.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/buf/B2CConverter.java Tue Mar 25 15:13:49 2008 @@ -68,22 +68,31 @@ char result[]=new char[BUFFER_SIZE]; /** Convert a buffer of bytes into a chars + * @deprecated */ public void convert( ByteChunk bb, CharChunk cb ) throws IOException { // Set the ByteChunk as input to the Intermediate reader - iis.setByteChunk( bb ); - convert(cb); + convert(bb, cb, cb.getBuffer().length - cb.getEnd()); } -private void convert(CharChunk cb) +public void convert( ByteChunk bb, CharChunk cb, int limit) +throws IOException +{ +iis.setByteChunk( bb ); +convert(cb, limit); +} + +private void convert(CharChunk cb, int limit) throws IOException { try { // read from the reader - while( iis.available()>0 ) { // conv.ready() ) { - int cnt=conv.read( result, 0, BUFFER_SIZE ); +int count = 0; + while( limit > 0 ) { // conv.ready() ) { +int size = limit < BUFFER_SIZE ? limit : BUFFER_SIZE; + int cnt=conv.read( result, 0, size ); if( cnt <= 0 ) { // End of stream ! - we may be in a bad state if( debug>0) @@ -96,6 +105,7 @@ // XXX go directly cb.append( result, 0, cnt ); +limit -= cnt; } } catch( IOException ex) { if( debug>0) @@ -211,10 +221,6 @@ return super.read( cbuf, off, len ); } -public final int read() throws IOException { -return super.read(); -} - /** Reset the buffer */ public final void recycle() { @@ -229,10 +235,7 @@ not be called if recycling the converter and if data was not flushed. */ final class IntermediateInputStream extends InputStream { -byte buf[]; -int pos; -int len; -int end; +ByteChunk bc = null; public IntermediateInputStream() { } @@ -243,64 +246,18 @@ } public final int read(byte cbuf[], int off, int len) throws IOException { - if( pos >= end ) return -1; - if (pos + len > end) { - len = end - pos; - } - if (len <= 0) { - return 0; - } - System.arraycopy(buf, pos, cbuf, off, len); - pos += len; - return len; + return bc.substract(cbuf, off, len); } public final int read() throws IOException { - return (pos < end ) ? (buf[pos++] & 0xff) : -1; + return bc.substract(); } - + // Internal methods -void setBuffer( byte b[], int p, int l ) { - buf=b; - pos=p; - len=l; - end=pos+len; -} void setByteChunk( ByteChunk mb ) { - buf=mb.getBytes(); - pos=mb.getStart(); - len=mb.getLength(); - end=pos+len; -} - -public int available() throws IOException { -return end-pos; -} - -public boolean markSupported() { -return false; -} - -public int read(byte[] b) throws IOException { -return read(b,0,b.length); -} - -/** - * Repositions this stream to the position at the time the mark method was last called on this input - * stream. - * - * @throws IOException if this stream has not been marked or if the mark has been invalidated. - * @todo Implement this java.io.InputStream m
svn commit: r641051 - /tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java
Author: markt Date: Tue Mar 25 15:21:57 2008 New Revision: 641051 URL: http://svn.apache.org/viewvc?rev=641051&view=rev Log: Apply the patch for BZ44494 that was applied to 6.0.x Modified: tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java Modified: tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java?rev=641051&r1=641050&r2=641051&view=diff == --- tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java (original) +++ tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java Tue Mar 25 15:21:57 2008 @@ -355,7 +355,7 @@ } state = CHAR_STATE; -conv.convert(bb, cb, len); +conv.convert(bb, cb, bb.getLength()); bb.setOffset(bb.getEnd()); return cb.getLength(); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 44673] New: ServletInputStream still readable even when closed
https://issues.apache.org/bugzilla/show_bug.cgi?id=44673 Summary: ServletInputStream still readable even when closed Product: Tomcat 5 Version: Unknown Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: Catalina AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] Created an attachment (id=21716) --> (https://issues.apache.org/bugzilla/attachment.cgi?id=21716) Echo "OK" if the behaviour is correct, "KO" otherwise InputBuffer does not check "closed" in any read, mark, skip operation, thus bytes can be read even when the application has requested to close the inputstream. This causes programming problems to go unnoticed. See the attached test case. -- 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r641057 - /tomcat/current/tc4.1.x/STATUS.txt
Author: markt Date: Tue Mar 25 15:43:49 2008 New Revision: 641057 URL: http://svn.apache.org/viewvc?rev=641057&view=rev Log: Vote Modified: tomcat/current/tc4.1.x/STATUS.txt Modified: tomcat/current/tc4.1.x/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/current/tc4.1.x/STATUS.txt?rev=641057&r1=641056&r2=641057&view=diff == --- tomcat/current/tc4.1.x/STATUS.txt (original) +++ tomcat/current/tc4.1.x/STATUS.txt Tue Mar 25 15:43:49 2008 @@ -39,12 +39,14 @@ * Fix docs re use of maxActive http://svn.apache.org/viewvc?rev=639842&view=rev - +1: rjung + +1: rjung, markt -1: rjung: Didn't check though, if this is actually true for the 4.1 bundled DBCP. + markt: It is * Fix docs: don't include dev snapshots of JK docs, link to released version instead http://people.apache.org/~rjung/patches/tc4_1-jk-docs.patch +1: rjung -1: rjung: Mark, I didn't actually try to build it. I guess it's much easier for you :) + markt: Yep. Your patch is fine. I can't believe there was still a ref to the jk2 docs! \ No newline at end of file - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn client config (was Re: svn commit: r640706 [1/12] - in /tomcat/sandbox/tomcat-lite ...)
On 3/25/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Author: costin > Date: Mon Mar 24 23:01:43 2008 > New Revision: 640706 > > URL: http://svn.apache.org/viewvc?rev=640706&view=rev > Log: > Baseline copy of coyote and tomcat/util from tomcat6 - removed old AIO > connector and all associated files, NIO and APR connectors. > This is not yet minimal, but closer > > > Added: > tomcat/sandbox/tomcat-lite/tomcat-coyote/ > tomcat/sandbox/tomcat-lite/tomcat-coyote/org/ > tomcat/sandbox/tomcat-lite/tomcat-coyote/org/apache/ > tomcat/sandbox/tomcat-lite/tomcat-coyote/org/apache/coyote/ > tomcat/sandbox/tomcat-lite/tomcat-coyote/org/apache/coyote/ActionCode.java > tomcat/sandbox/tomcat-lite/tomcat-coyote/org/apache/coyote/ActionHook.java > tomcat/sandbox/tomcat-lite/tomcat-coyote/org/apache/coyote/Adapter.java No props were added. Please configure your svn client to add the svn:eol-style property. Details [1]. Also affected r{640852,640855,640860}. 'svn propset' [2] can fix this after the fact. -Rahul [1] http://www.apache.org/dev/svn-eol-style.txt [2] http://svnbook.red-bean.com/en/1.0/re23.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r641073 - /tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java
Author: markt Date: Tue Mar 25 16:19:15 2008 New Revision: 641073 URL: http://svn.apache.org/viewvc?rev=641073&view=rev Log: Code clean-up. Remove unused code. Fix generics related warnings. No functional change. Modified: tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java Modified: tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java?rev=641073&r1=641072&r2=641073&view=diff == --- tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java (original) +++ tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java Tue Mar 25 16:19:15 2008 @@ -81,30 +81,12 @@ /** - * Number of bytes read. - */ -private int bytesRead = 0; - - -/** - * Number of chars read. - */ -private int charsRead = 0; - - -/** * Flag which indicates if the input buffer is closed. */ private boolean closed = false; /** - * Byte chunk used to input bytes. - */ -private ByteChunk inputChunk = new ByteChunk(); - - -/** * Encoding to use. */ private String enc; @@ -119,7 +101,8 @@ /** * List of encoders. */ -protected HashMap encoders = new HashMap(); +protected HashMap encoders = +new HashMap(); /** @@ -211,8 +194,6 @@ public void recycle() { state = INITIAL_STATE; -bytesRead = 0; -charsRead = 0; // If usage of mark made the buffer too big, reallocate it if (cb.getChars().length > size) { @@ -481,14 +462,14 @@ gotEnc = true; if (enc == null) enc = DEFAULT_ENCODING; -conv = (B2CConverter) encoders.get(enc); +conv = encoders.get(enc); if (conv == null) { if (SecurityUtil.isPackageProtectionEnabled()){ try{ -conv = (B2CConverter)AccessController.doPrivileged( -new PrivilegedExceptionAction(){ +conv = AccessController.doPrivileged( +new PrivilegedExceptionAction(){ -public Object run() throws IOException{ +public B2CConverter run() throws IOException { return new B2CConverter(enc); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r641076 - in /tomcat/trunk/java/org/apache/catalina/connector: InputBuffer.java LocalStrings.properties
Author: markt Date: Tue Mar 25 16:36:56 2008 New Revision: 641076 URL: http://svn.apache.org/viewvc?rev=641076&view=rev Log: Fix bug 44673. Throw IOE if stream is closed and a call is made to any read(), ready(), mark(), reset(), or skip() method as per javadocs for Reader. Modified: tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java tomcat/trunk/java/org/apache/catalina/connector/LocalStrings.properties Modified: tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java?rev=641076&r1=641075&r2=641076&view=diff == --- tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java (original) +++ tomcat/trunk/java/org/apache/catalina/connector/InputBuffer.java Tue Mar 25 16:36:56 2008 @@ -25,6 +25,7 @@ import java.util.HashMap; import org.apache.catalina.security.SecurityUtil; +import org.apache.catalina.util.StringManager; import org.apache.coyote.ActionCode; import org.apache.coyote.Request; import org.apache.tomcat.util.buf.B2CConverter; @@ -44,6 +45,12 @@ implements ByteChunk.ByteInputChannel, CharChunk.CharInputChannel, CharChunk.CharOutputChannel { +/** + * The string manager for this package. + */ +protected static StringManager sm = +StringManager.getManager(Constants.Package); + // -- Constants @@ -58,7 +65,6 @@ public final int CHAR_STATE = 1; public final int BYTE_STATE = 2; - // - Instance Variables @@ -285,12 +291,20 @@ public int readByte() throws IOException { + +if (closed) +throw new IOException(sm.getString("inputBuffer.streamClosed")); + return bb.substract(); } public int read(byte[] b, int off, int len) throws IOException { + +if (closed) +throw new IOException(sm.getString("inputBuffer.streamClosed")); + return bb.substract(b, off, len); } @@ -346,18 +360,30 @@ public int read() throws IOException { + +if (closed) +throw new IOException(sm.getString("inputBuffer.streamClosed")); + return cb.substract(); } public int read(char[] cbuf) throws IOException { + +if (closed) +throw new IOException(sm.getString("inputBuffer.streamClosed")); + return read(cbuf, 0, cbuf.length); } public int read(char[] cbuf, int off, int len) throws IOException { + +if (closed) +throw new IOException(sm.getString("inputBuffer.streamClosed")); + return cb.substract(cbuf, off, len); } @@ -365,6 +391,10 @@ public long skip(long n) throws IOException { + +if (closed) +throw new IOException(sm.getString("inputBuffer.streamClosed")); + if (n < 0) { throw new IllegalArgumentException(); } @@ -396,6 +426,10 @@ public boolean ready() throws IOException { + +if (closed) +throw new IOException(sm.getString("inputBuffer.streamClosed")); + return (available() > 0); } @@ -407,6 +441,10 @@ public void mark(int readAheadLimit) throws IOException { + +if (closed) +throw new IOException(sm.getString("inputBuffer.streamClosed")); + if (cb.getLength() <= 0) { cb.setOffset(0); cb.setEnd(0); @@ -430,6 +468,10 @@ public void reset() throws IOException { + +if (closed) +throw new IOException(sm.getString("inputBuffer.streamClosed")); + if (state == CHAR_STATE) { if (markPos < 0) { cb.recycle(); Modified: tomcat/trunk/java/org/apache/catalina/connector/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/LocalStrings.properties?rev=641076&r1=641075&r2=641076&view=diff == --- tomcat/trunk/java/org/apache/catalina/connector/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/catalina/connector/LocalStrings.properties Tue Mar 25 16:36:56 2008 @@ -17,7 +17,6 @@ # # CoyoteConnector # - coyoteConnector.alreadyInitialized=The connector has already been initialized coyoteConnector.alreadyStarted=The connector has already been started coyoteConnector.cannotRegisterProtocol=Cannot register MBean for the Protocol @@ -32,18 +31,15 @@ coyoteConnector.MapperRegistration=register Mapper: {0} coyoteConnector.protocolUnregistrationFailed=Protocol handler stop failed - # # CoyoteAdapter # - coyoteAdapter.service=An exception or error occurred in the container during the reques
svn commit: r641077 - /tomcat/tc6.0.x/trunk/STATUS.txt
Author: markt Date: Tue Mar 25 16:40:06 2008 New Revision: 641077 URL: http://svn.apache.org/viewvc?rev=641077&view=rev Log: Propose patch Modified: tomcat/tc6.0.x/trunk/STATUS.txt Modified: tomcat/tc6.0.x/trunk/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=641077&r1=641076&r2=641077&view=diff == --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Tue Mar 25 16:40:06 2008 @@ -95,3 +95,9 @@ http://svn.apache.org/viewvc?rev=640994&view=rev +1: markt, rjung -1: + +* Fix ServletInputStream still readable when closed + https://issues.apache.org/bugzilla/show_bug.cgi?id=44673 + http://svn.apache.org/viewvc?rev=641076&view=rev + +1: markt + -1: - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r641078 - /tomcat/current/tc5.5.x/STATUS.txt
Author: markt Date: Tue Mar 25 16:40:14 2008 New Revision: 641078 URL: http://svn.apache.org/viewvc?rev=641078&view=rev Log: Propose patch Modified: tomcat/current/tc5.5.x/STATUS.txt Modified: tomcat/current/tc5.5.x/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/current/tc5.5.x/STATUS.txt?rev=641078&r1=641077&r2=641078&view=diff == --- tomcat/current/tc5.5.x/STATUS.txt (original) +++ tomcat/current/tc5.5.x/STATUS.txt Tue Mar 25 16:40:14 2008 @@ -82,3 +82,9 @@ http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/InputBuffer.java?view=diff&r1=639890&r2=639891&pathrev=639891 +1: markt -1: + +* Fix ServletInputStream still readable when closed + https://issues.apache.org/bugzilla/show_bug.cgi?id=44673 + http://svn.apache.org/viewvc?rev=641076&view=rev + +1: markt + -1: - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r641079 - in /tomcat: connectors/trunk/jk/jkstatus/conf/ connectors/trunk/jk/jkstatus/example/ connectors/trunk/jk/xdocs/miscellaneous/ container/tc5.5.x/catalina/src/bin/ container/tc5.5.
Author: markt Date: Tue Mar 25 16:47:22 2008 New Revision: 641079 URL: http://svn.apache.org/viewvc?rev=641079&view=rev Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=44556 Use new filename for coommons-logging-api jar Modified: tomcat/connectors/trunk/jk/jkstatus/conf/jkstatus-tasks.xml tomcat/connectors/trunk/jk/jkstatus/example/jkstatus.xml tomcat/connectors/trunk/jk/jkstatus/example/show.xml tomcat/connectors/trunk/jk/xdocs/miscellaneous/jkstatustasks.xml tomcat/container/tc5.5.x/catalina/src/bin/catalina-tasks.xml tomcat/container/tc5.5.x/webapps/docs/class-loader-howto.xml tomcat/container/tc5.5.x/webapps/docs/logging.xml tomcat/container/tc5.5.x/webapps/docs/realm-howto.xml tomcat/current/tc5.5.x/STATUS.txt Modified: tomcat/connectors/trunk/jk/jkstatus/conf/jkstatus-tasks.xml URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/jkstatus/conf/jkstatus-tasks.xml?rev=641079&r1=641078&r2=641079&view=diff == --- tomcat/connectors/trunk/jk/jkstatus/conf/jkstatus-tasks.xml (original) +++ tomcat/connectors/trunk/jk/jkstatus/conf/jkstatus-tasks.xml Tue Mar 25 16:47:22 2008 @@ -26,7 +26,9 @@ - + + + Modified: tomcat/connectors/trunk/jk/jkstatus/example/jkstatus.xml URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/jkstatus/example/jkstatus.xml?rev=641079&r1=641078&r2=641079&view=diff == --- tomcat/connectors/trunk/jk/jkstatus/example/jkstatus.xml (original) +++ tomcat/connectors/trunk/jk/jkstatus/example/jkstatus.xml Tue Mar 25 16:47:22 2008 @@ -25,7 +25,9 @@ - + + + Modified: tomcat/connectors/trunk/jk/jkstatus/example/show.xml URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/jkstatus/example/show.xml?rev=641079&r1=641078&r2=641079&view=diff == --- tomcat/connectors/trunk/jk/jkstatus/example/show.xml (original) +++ tomcat/connectors/trunk/jk/jkstatus/example/show.xml Tue Mar 25 16:47:22 2008 @@ -25,7 +25,9 @@ - + + + Modified: tomcat/connectors/trunk/jk/xdocs/miscellaneous/jkstatustasks.xml URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/xdocs/miscellaneous/jkstatustasks.xml?rev=641079&r1=641078&r2=641079&view=diff == --- tomcat/connectors/trunk/jk/xdocs/miscellaneous/jkstatustasks.xml (original) +++ tomcat/connectors/trunk/jk/xdocs/miscellaneous/jkstatustasks.xml Tue Mar 25 16:47:22 2008 @@ -53,7 +53,9 @@- + + + Modified: tomcat/container/tc5.5.x/catalina/src/bin/catalina-tasks.xml URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/bin/catalina-tasks.xml?rev=641079&r1=641078&r2=641079&view=diff == --- tomcat/container/tc5.5.x/catalina/src/bin/catalina-tasks.xml (original) +++ tomcat/container/tc5.5.x/catalina/src/bin/catalina-tasks.xml Tue Mar 25 16:47:22 2008 @@ -27,7 +27,9 @@ - + + + Modified: tomcat/container/tc5.5.x/webapps/docs/class-loader-howto.xml URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/webapps/docs/class-loader-howto.xml?rev=641079&r1=641078&r2=641079&view=diff == --- tomcat/container/tc5.5.x/webapps/docs/class-loader-howto.xml (original) +++ tomcat/container/tc5.5.x/webapps/docs/class-loader-howto.xml Tue Mar 25 16:47:22 2008 @@ -116,8 +116,8 @@ implementation classes it depends on. $JAVA_HOME/lib/tools.jar - Contains the "javac" compiler used to convert JSP pages into servlet classes. -$CATALINA_HOME/bin/commons-logging-api.jar - Jakarta commons -logging API. +$CATALINA_HOME/bin/commons-logging-api-x.y.z.jar - Jakarta +commons logging API. $CATALINA_HOME/bin/commons-daemon.jar - Jakarta commons daemon API. jmx.jar - The JMX 1.2 implementation. Modified: tomcat/container/tc5.5.x/webapps/docs/logging.xml URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/webapps/docs/lo
DO NOT REPLY [Bug 44556] Filename for commons-logging-api changed, but config files doesn't changed.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44556 Mark Thomas <[EMAIL PROTECTED]> changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED --- Comment #2 from Mark Thomas <[EMAIL PROTECTED]> 2008-03-25 16:45:50 PST --- This has been fixed in svn and will be included in the 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 44494] Requests greater than 8k being truncated.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44494 --- Comment #23 from Remy Maucherat <[EMAIL PROTECTED]> 2008-03-25 18:27:12 PST --- Ok, first of all thanks a lot for the test case (I wouldn't be able to write a good multibyte test to save my life). As with the original bug, the problem is with the limit being incorrect (reading too much causes causes the ByteBuffer to refill itself magically, while the calling code still hasn't seen anything back). In the loop, the limit int represents bytes, but is decremented with the amount of chars read (which works with single byte charsets, obviously ...). The new loop would be (replacing the old convert method): public void convert(ByteChunk bb, CharChunk cb, int limit) throws IOException { iis.setByteChunk(bb); try { // read from the reader int l = 0; while( limit > 0 ) { // conv.ready() ) { int size = limit < BUFFER_SIZE ? limit : BUFFER_SIZE; l = bb.getLength(); int cnt=conv.read( result, 0, size ); if( cnt <= 0 ) { // End of stream ! - we may be in a bad state if( debug>0) log( "EOF" ); // reset(); return; } if( debug > 1 ) log("Converted: " + new String( result, 0, cnt )); cb.setLimit(cb.getStart() + cnt); cb.append( result, 0, cnt ); limit = limit - (l - bb.getLength()); } } catch( IOException ex) { if( debug>0) log( "Reseting the converter " + ex.toString() ); reset(); throw ex; } } -- 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 44494] Requests greater than 8k being truncated.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44494 --- Comment #24 from Filip Hanik <[EMAIL PROTECTED]> 2008-03-25 19:04:21 PST --- when I ran the test: it fails consistently with tomcat/6.0.x/trunk after updating tomcat/trunk to the latest(same fix as in 6.0.x)it also fails consistently. If I revert to revision 640451 in tomcat/trunk, the test seems to work fine How do I make this error happen and how do I spot the error? Do I need to configure any buffer sizes? Filip -- 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 44494] Requests greater than 8k being truncated.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44494 --- Comment #25 from Remy Maucherat <[EMAIL PROTECTED]> 2008-03-25 19:34:24 PST --- The first step is to reproduce the problem (which is easy for me with TC 6.0 trunk and the latest version of the test case). After fixing the update of the limit (because substracting cnt is obviously wrong if limit is inited to bb.length()), then my traces in no longer misbehave and I haven't been able to reproduce any problem. This makes perfect sense to me since with 1 byte charsets (such as regular ascii) cnt is equal to the amount of bytes consumed, and character input was working fine for me after applying my one line fix. -- 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r641134 - in /tomcat/sandbox/tomcat-lite: build.xml external/jasper.jar external/javax.annotation.jar external/javax.servlet.jar resources/coyote-lite.MF resources/deploy.MF resources/tomc
Author: costin Date: Tue Mar 25 20:53:53 2008 New Revision: 641134 URL: http://svn.apache.org/viewvc?rev=641134&view=rev Log: Fix build file (still missing lots of files), remove old Added: tomcat/sandbox/tomcat-lite/resources/coyote-lite.MF (with props) Removed: tomcat/sandbox/tomcat-lite/external/jasper.jar tomcat/sandbox/tomcat-lite/external/javax.annotation.jar tomcat/sandbox/tomcat-lite/external/javax.servlet.jar tomcat/sandbox/tomcat-lite/resources/deploy.MF Modified: tomcat/sandbox/tomcat-lite/build.xml tomcat/sandbox/tomcat-lite/resources/tomcat-lite.MF Modified: tomcat/sandbox/tomcat-lite/build.xml URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/build.xml?rev=641134&r1=641133&r2=641134&view=diff == --- tomcat/sandbox/tomcat-lite/build.xml (original) +++ tomcat/sandbox/tomcat-lite/build.xml Tue Mar 25 20:53:53 2008 @@ -9,117 +9,157 @@ - - + + - + - + + - - + + + + + - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - + - - + - + - + - - - + + - - - - - - - - - - - - - - - + + + - - + + - - - + Added: tomcat/sandbox/tomcat-lite/resources/coyote-lite.MF URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/resources/coyote-lite.MF?rev=641134&view=auto == --- tomcat/sandbox/tomcat-lite/resources/coyote-lite.MF (added) +++ tomcat/sandbox/tomcat-lite/resources/coyote-lite.MF Tue Mar 25 20:53:53 2008 @@ -0,0 +1,2 @@ +Manifest-version: 1.0 +Main-Class: org.apache.coyote.adapters.CoyoteMain Propchange: tomcat/sandbox/tomcat-lite/resources/coyote-lite.MF -- svn:executable = * Modified: tomcat/sandbox/tomcat-lite/resources/tomcat-lite.MF URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/resources/tomcat-lite.MF?rev=641134&r1=641133&r2=641134&view=diff == --- tomcat/sandbox/tomcat-lite/resources/tomcat-lite.MF (original) +++ tomcat/sandbox/tomcat-lite/resources/tomcat-lite.MF Tue Mar 25 20:53:53 2008 @@ -1,2 +1,2 @@ Manifest-version: 1.0 -Main-Class: org.apache.tomcat.lite.TomcatLite +Main-Class: org.apache.tomcat.lite.TomcatLiteMain - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r641135 - in /tomcat/sandbox/tomcat-lite/test/org/apache/tomcat/lite: ./ TomcatLiteNoConnectorTest.java TomcatLiteTest.java
Author: costin Date: Tue Mar 25 21:10:10 2008 New Revision: 641135 URL: http://svn.apache.org/viewvc?rev=641135&view=rev Log: 2 simple tests/examples of starting/embedding tomcat-lite Added: tomcat/sandbox/tomcat-lite/test/org/apache/tomcat/lite/ tomcat/sandbox/tomcat-lite/test/org/apache/tomcat/lite/TomcatLiteNoConnectorTest.java (with props) tomcat/sandbox/tomcat-lite/test/org/apache/tomcat/lite/TomcatLiteTest.java (with props) Added: tomcat/sandbox/tomcat-lite/test/org/apache/tomcat/lite/TomcatLiteNoConnectorTest.java URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/test/org/apache/tomcat/lite/TomcatLiteNoConnectorTest.java?rev=641135&view=auto == --- tomcat/sandbox/tomcat-lite/test/org/apache/tomcat/lite/TomcatLiteNoConnectorTest.java (added) +++ tomcat/sandbox/tomcat-lite/test/org/apache/tomcat/lite/TomcatLiteNoConnectorTest.java Tue Mar 25 21:10:10 2008 @@ -0,0 +1,68 @@ +/* + */ +package org.apache.tomcat.lite; + + + +import junit.framework.TestCase; + +import org.apache.tomcat.servlets.addon.ConfigurableServletContext; +import org.apache.tomcat.util.buf.ByteChunk; + +public class TomcatLiteNoConnectorTest extends TestCase { + + TomcatLite lite = TomcatLite.getServletImpl(); + + void initServer() throws Exception { +ConfigurableServletContext ctx = + (ConfigurableServletContext) lite.addServletContext(null, null, "/test1"); + +ctx.addServlet("test", new SimpleServlet()); +ctx.addMapping("/1stTest", "test"); + +lite.init(); +lite.start(); + } + + public void stopServer() { +lite.stop(); + } + + public void setUp() throws Exception { +initServer(); + } + + public void tearDown() throws Exception { +stopServer(); + } + + public void testSimpleRequest() throws Exception { +ByteChunk out = new ByteChunk(); +ServletRequestImpl req = + lite.createMessage("/test1/1stTest", out); + +// more changes can be made to the req. + +ServletResponseImpl res = lite.service(req); + +assertEquals("Hello world", out.toString()); +// Headers are still in the response +assertEquals(res.getHeader("Foo"), "Bar"); +assertEquals(res.getStatus(), 200); + } + + public void testPostRequest() throws Exception { +ByteChunk out = new ByteChunk(); +ServletRequestImpl req = + lite.createMessage("/test1/1stTest", out); +req.setMethod("POST"); + +ServletResponseImpl res = lite.service(req); + +assertEquals("Hello post world", out.toString()); +// Headers are still in the response +assertEquals(res.getHeader("Foo"), "Post"); +assertEquals(res.getStatus(), 200); + } + +} Propchange: tomcat/sandbox/tomcat-lite/test/org/apache/tomcat/lite/TomcatLiteNoConnectorTest.java -- svn:eol-style = native Added: tomcat/sandbox/tomcat-lite/test/org/apache/tomcat/lite/TomcatLiteTest.java URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/test/org/apache/tomcat/lite/TomcatLiteTest.java?rev=641135&view=auto == --- tomcat/sandbox/tomcat-lite/test/org/apache/tomcat/lite/TomcatLiteTest.java (added) +++ tomcat/sandbox/tomcat-lite/test/org/apache/tomcat/lite/TomcatLiteTest.java Tue Mar 25 21:10:10 2008 @@ -0,0 +1,66 @@ +/* + */ +package org.apache.tomcat.lite; + +import java.io.BufferedInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; + +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import junit.framework.TestCase; + +import org.apache.tomcat.servlets.addon.ConfigurableServletContext; + +public class TomcatLiteTest extends TestCase { + + TomcatLite lite = TomcatLite.getServletImpl(); + + void initServer() throws Exception { +ConfigurableServletContext ctx = + (ConfigurableServletContext) lite.addServletContext(null, null, "/test1"); + +ctx.addServlet("test", new SimpleServlet()); +ctx.addMapping("/1stTest", "test"); + +// Ex: change the default +lite.setPort(8804); + +lite.init(); +lite.start(); + +// At this point we can add contexts and inject requests, if we want to +// do it over HTTP need to start the connector as well. +lite.startConnector(); + } + + public void stopServer() { +lite.stop(); + } + + public void setUp() throws Exception { +initServer(); + } + + public void tearDown() throws Exception { +stopServer(); + } + + public void testSimpleRequest() throws Exception { +URL url = new URL("http://localhost:8804/test1/1stTest";); +URLConnection connection = url.openConnection(); +connection.connect(); +InputStream is = connection.getInputStream(); +
svn commit: r641137 - /tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/
Author: costin Date: Tue Mar 25 21:12:31 2008 New Revision: 641137 URL: http://svn.apache.org/viewvc?rev=641137&view=rev Log: Added missing file, few small corrections and eol Added: tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/CoyoteMain.java (with props) Modified: tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/ClientAbortException.java (props changed) tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/CoyoteServer.java (contents, props changed) tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/EchoAdapter.java (props changed) tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/MapperAdapter.java (props changed) tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/MessageReader.java (props changed) tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/MessageWriter.java (contents, props changed) tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/SimpleFileAdapter.java (contents, props changed) tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/StaticAdapter.java (props changed) tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/StaticMain.java (props changed) Propchange: tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/ClientAbortException.java -- svn:eol-style = native Added: tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/CoyoteMain.java URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/CoyoteMain.java?rev=641137&view=auto == --- tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/CoyoteMain.java (added) +++ tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/CoyoteMain.java Tue Mar 25 21:12:31 2008 @@ -0,0 +1,34 @@ +package org.apache.coyote.adapters; + +import org.apache.coyote.Adapter; +import org.apache.tomcat.util.IntrospectionUtils; + + + +/** + * Serve a static resource, all in RAM. This should be the fastest way to + * send data over HTTP with tomcat - no overhead except the coyote layer. + * + * Used to benchmark and for files/resources that are extremely popular. + */ +public class CoyoteMain extends CoyoteServer { + static Adapter fileAdapter = new SimpleFileAdapter(); + + public CoyoteMain() { + } + + protected void initAdapters() { +addAdapter("/", fileAdapter); + } + + // --- Main - + public static void main( String args[]) throws Exception { +CoyoteMain sa=new CoyoteMain(); +IntrospectionUtils.processArgs(sa, args); +IntrospectionUtils.processArgs(fileAdapter, args); +sa.setArgs(args); +sa.run(); + } + + +} \ No newline at end of file Propchange: tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/CoyoteMain.java -- svn:eol-style = native Modified: tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/CoyoteServer.java URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/CoyoteServer.java?rev=641137&r1=641136&r2=641137&view=diff == --- tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/CoyoteServer.java (original) +++ tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/CoyoteServer.java Tue Mar 25 21:12:31 2008 @@ -56,7 +56,11 @@ adapter = new MapperAdapter(); ((MapperAdapter) adapter).setDefaultAdapter(oldDefault); } - ((MapperAdapter) adapter).getMapper().addWrapper(path, added); + if ("/".equals(path)) { +((MapperAdapter) adapter).setDefaultAdapter(added); + } else { +((MapperAdapter) adapter).getMapper().addWrapper(path, added); + } } } Propchange: tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/CoyoteServer.java -- svn:eol-style = native Propchange: tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/EchoAdapter.java -- svn:eol-style = native Propchange: tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/MapperAdapter.java -- svn:eol-style = native Propchange: tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/
DO NOT REPLY [Bug 44494] Requests greater than 8k being truncated.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44494 --- Comment #26 from Suzuki Yuichiro <[EMAIL PROTECTED]> 2008-03-25 21:11:57 PST --- (In reply to comment #23) > cb.setLimit(cb.getStart() + cnt); > cb.append( result, 0, cnt ); cb.append() doesn't modify cb.start and cb.start is set zero by InputBuffer#realReadChars if markPos == -1. So "cb.getStart() + cnt" is same to or less than bb.length(), and it will be bb.length()/3 if all characters are 3 bytes. (the surplus bytes may exist in the buffer of ReadConvertor) This will break the buffer of CharChunk. If "cb.getEnd() + cnt" is used as alternative, it will overwrite the limit that is set by CoyoteReader#mark method. I guess that may cause another problem. (though mark/reset methods have not worked correctly before that) Yuichiro -- 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r641149 - in /tomcat/sandbox/tomcat-lite: ./ coyote-extensions/org/apache/coyote/adapters/ coyote-nio/org/apache/coyote/http11/ java/org/apache/tomcat/servlets/file/ tomcat-coyote/org/apac
Author: costin Date: Tue Mar 25 21:55:13 2008 New Revision: 641149 URL: http://svn.apache.org/viewvc?rev=641149&view=rev Log: Should build now, still missing some files Removed: tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/EchoAdapter.java tomcat/sandbox/tomcat-lite/java/org/apache/tomcat/servlets/file/Webdav2Servlet.java tomcat/sandbox/tomcat-lite/tomcat-coyote/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java Modified: tomcat/sandbox/tomcat-lite/build.xml tomcat/sandbox/tomcat-lite/coyote-nio/org/apache/coyote/http11/Http11NioProtocol.java tomcat/sandbox/tomcat-lite/tomcat-coyote/org/apache/tomcat/util/IntrospectionUtils.java tomcat/sandbox/tomcat-lite/tomcat-coyote/org/apache/tomcat/util/buf/ByteChunk.java tomcat/sandbox/tomcat-lite/tomcat-coyote/org/apache/tomcat/util/buf/CharChunk.java tomcat/sandbox/tomcat-lite/tomcat-coyote/org/apache/tomcat/util/buf/MessageBytes.java Modified: tomcat/sandbox/tomcat-lite/build.xml URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/build.xml?rev=641149&r1=641148&r2=641149&view=diff == --- tomcat/sandbox/tomcat-lite/build.xml (original) +++ tomcat/sandbox/tomcat-lite/build.xml Tue Mar 25 21:55:13 2008 @@ -20,8 +20,9 @@ - - + + + @@ -168,23 +169,10 @@ - - - - - - - - - - - - - - - - + + Modified: tomcat/sandbox/tomcat-lite/coyote-nio/org/apache/coyote/http11/Http11NioProtocol.java URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/coyote-nio/org/apache/coyote/http11/Http11NioProtocol.java?rev=641149&r1=641148&r2=641149&view=diff == --- tomcat/sandbox/tomcat-lite/coyote-nio/org/apache/coyote/http11/Http11NioProtocol.java (original) +++ tomcat/sandbox/tomcat-lite/coyote-nio/org/apache/coyote/http11/Http11NioProtocol.java Tue Mar 25 21:55:13 2008 @@ -39,7 +39,7 @@ import org.apache.tomcat.util.net.NioChannel; import org.apache.tomcat.util.net.NioEndpoint; import org.apache.tomcat.util.net.NioEndpoint.Handler; -import org.apache.tomcat.util.net.jsse.JSSEImplementation; +import org.apache.tomcat.util.net.SSLImplementation; import org.apache.tomcat.util.net.SecureNioChannel; import org.apache.tomcat.util.net.SocketStatus; import org.apache.tomcat.util.res.StringManager; @@ -56,7 +56,7 @@ */ public class Http11NioProtocol implements ProtocolHandler, MBeanRegistration { -protected JSSEImplementation sslImplementation = null; +protected SSLImplementation sslImplementation = null; public Http11NioProtocol() { cHandler = new Http11ConnectionHandler( this ); @@ -134,7 +134,7 @@ try { ep.init(); -sslImplementation = new JSSEImplementation(); +sslImplementation = SSLImplementation.getInstance("org.apache.tomcat.util.net.jsse.JSSEImplementation"); } catch (Exception ex) { log.error(sm.getString("http11protocol.endpoint.initerror"), ex); throw ex; @@ -579,6 +579,9 @@ public boolean getSSLEnabled() { return ep.isSSLEnabled(); } public void setSSLEnabled(boolean SSLEnabled) { ep.setSSLEnabled(SSLEnabled); } +public NioEndpoint getEndpoint() { + return ep; +} // Connection handler @@ -769,8 +772,8 @@ processor.setMaxKeepAliveRequests(proto.maxKeepAliveRequests); processor.setTimeout(proto.timeout); processor.setDisableUploadTimeout(proto.disableUploadTimeout); -processor.setCompressionMinSize(proto.compressionMinSize); processor.setCompression(proto.compression); +processor.setCompressionMinSize(proto.compressionMinSize); processor.setNoCompressionUserAgents(proto.noCompressionUserAgents); processor.setCompressableMimeTypes(proto.compressableMimeTypes); processor.setRestrictedUserAgents(proto.restrictedUserAgents); Modified: tomcat/sandbox/tomcat-lite/tomcat-coyote/org/apache/tomcat/util/IntrospectionUtils.java URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/tomcat-coyote/org/apache/tomcat/util/IntrospectionUtils.java?rev=641149&r1=641148&r2=641149&view=diff == --- tomcat/sandbox/tomcat-lite/tomcat-coyote/org/apache/tomcat/util/IntrospectionUtils.java (original) +++ tomcat/sandbox/tomcat-lite/tomcat-coyote/org/apache/tomcat/util/IntrospectionUtils.java Tue Mar 25 21:55:13 2008 @@ -741,8 +741,10 @@ String args0[], String args1[], Hashtable aliases) throws Exception { for (int i = 0; i < args.length; i++) {
svn commit: r641160 [4/4] - in /tomcat/sandbox/tomcat-lite/java/org/apache/tomcat: lite/ servlets/addon/ servlets/config/ servlets/file/ servlets/log/ servlets/sec/ servlets/session/ servlets/util/ ut
Modified: tomcat/sandbox/tomcat-lite/java/org/apache/tomcat/servlets/util/RequestUtil.java URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/java/org/apache/tomcat/servlets/util/RequestUtil.java?rev=641160&r1=641159&r2=641160&view=diff == --- tomcat/sandbox/tomcat-lite/java/org/apache/tomcat/servlets/util/RequestUtil.java (original) +++ tomcat/sandbox/tomcat-lite/java/org/apache/tomcat/servlets/util/RequestUtil.java Tue Mar 25 22:36:01 2008 @@ -1,509 +1,509 @@ -/* - * Copyright 1999,2004 The Apache Software Foundation. - * - * Licensed 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.tomcat.servlets.util; - -import java.io.UnsupportedEncodingException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Map; -import java.util.TimeZone; - -import javax.servlet.http.Cookie; - - -/** - * General purpose request parsing and encoding utility methods. - * - * @author Craig R. McClanahan - * @author Tim Tye - * @version $Revision: 302905 $ $Date: 2004-05-26 18:41:54 +0200 (mer., 26 mai 2004) $ - */ - -public final class RequestUtil { - - -/** - * The DateFormat to use for generating readable dates in cookies. - */ -private static SimpleDateFormat format = -new SimpleDateFormat(" , dd-MMM-yy kk:mm:ss zz"); - -static { -format.setTimeZone(TimeZone.getTimeZone("GMT")); -} - - -/** - * Encode a cookie as per RFC 2109. The resulting string can be used - * as the value for a Set-Cookie header. - * - * @param cookie The cookie to encode. - * @return A string following RFC 2109. - */ -public static String encodeCookie(Cookie cookie) { - -StringBuffer buf = new StringBuffer( cookie.getName() ); -buf.append("="); -buf.append(cookie.getValue()); - -if (cookie.getComment() != null) { -buf.append("; Comment=\""); -buf.append(cookie.getComment()); -buf.append("\""); -} - -if (cookie.getDomain() != null) { -buf.append("; Domain=\""); -buf.append(cookie.getDomain()); -buf.append("\""); -} - -long age = cookie.getMaxAge(); -if (cookie.getMaxAge() >= 0) { -buf.append("; Max-Age=\""); -buf.append(cookie.getMaxAge()); -buf.append("\""); -} - -if (cookie.getPath() != null) { -buf.append("; Path=\""); -buf.append(cookie.getPath()); -buf.append("\""); -} - -if (cookie.getSecure()) { -buf.append("; Secure"); -} - -if (cookie.getVersion() > 0) { -buf.append("; Version=\""); -buf.append(cookie.getVersion()); -buf.append("\""); -} - -return (buf.toString()); -} - - -/** - * Filter the specified message string for characters that are sensitive - * in HTML. This avoids potential attacks caused by including JavaScript - * codes in the request URL that is often reported in error messages. - * - * @param message The message string to be filtered - */ -public static String filter(String message) { - -if (message == null) -return (null); - -char content[] = new char[message.length()]; -message.getChars(0, message.length(), content, 0); -StringBuffer result = new StringBuffer(content.length + 50); -for (int i = 0; i < content.length; i++) { -switch (content[i]) { -case '<': -result.append("<"); -break; -case '>': -result.append(">"); -break; -case '&': -result.append("&"); -break; -case '"': -result.append("""); -break; -default: -result.append(content[i]); -} -} -return (result.toString()); - -} - - -/** - * Normalize a relative URI path that may have relative values ("/./", - * "/../", and so on ) it it. WARNING - This method is - * useful only for normalizing application-generated paths. It does not - * try to perform security checks for malicious input. - * - * @param path Relative path to be normalized - */ -public static String
svn commit: r641161 - in /tomcat/sandbox/tomcat-lite/test/org/apache/tomcat/lite: SimpleServlet.java TomcatLiteNoConnectorTest.java
Author: costin Date: Tue Mar 25 22:37:15 2008 New Revision: 641161 URL: http://svn.apache.org/viewvc?rev=641161&view=rev Log: Missed one file, check error response Added: tomcat/sandbox/tomcat-lite/test/org/apache/tomcat/lite/SimpleServlet.java (with props) Modified: tomcat/sandbox/tomcat-lite/test/org/apache/tomcat/lite/TomcatLiteNoConnectorTest.java Added: tomcat/sandbox/tomcat-lite/test/org/apache/tomcat/lite/SimpleServlet.java URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/test/org/apache/tomcat/lite/SimpleServlet.java?rev=641161&view=auto == --- tomcat/sandbox/tomcat-lite/test/org/apache/tomcat/lite/SimpleServlet.java (added) +++ tomcat/sandbox/tomcat-lite/test/org/apache/tomcat/lite/SimpleServlet.java Tue Mar 25 22:37:15 2008 @@ -0,0 +1,22 @@ +/* + */ +package org.apache.tomcat.lite; + +import java.io.IOException; + +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +public class SimpleServlet extends HttpServlet { + public void doGet(HttpServletRequest req, HttpServletResponse res) + throws IOException { +res.setHeader("Foo", "Bar"); +res.getWriter().write("Hello world"); + } + public void doPost(HttpServletRequest req, HttpServletResponse res) + throws IOException { +res.setHeader("Foo", "Post"); +res.getWriter().write("Hello post world"); + } +} \ No newline at end of file Propchange: tomcat/sandbox/tomcat-lite/test/org/apache/tomcat/lite/SimpleServlet.java -- svn:eol-style = native Modified: tomcat/sandbox/tomcat-lite/test/org/apache/tomcat/lite/TomcatLiteNoConnectorTest.java URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/test/org/apache/tomcat/lite/TomcatLiteNoConnectorTest.java?rev=641161&r1=641160&r2=641161&view=diff == --- tomcat/sandbox/tomcat-lite/test/org/apache/tomcat/lite/TomcatLiteNoConnectorTest.java (original) +++ tomcat/sandbox/tomcat-lite/test/org/apache/tomcat/lite/TomcatLiteNoConnectorTest.java Tue Mar 25 22:37:15 2008 @@ -4,6 +4,12 @@ +import java.io.IOException; + +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + import junit.framework.TestCase; import org.apache.tomcat.servlets.addon.ConfigurableServletContext; @@ -11,10 +17,12 @@ public class TomcatLiteNoConnectorTest extends TestCase { - TomcatLite lite = TomcatLite.getServletImpl(); + TomcatLite lite = TomcatLite.getServletImpl(); + ConfigurableServletContext ctx; + void initServer() throws Exception { -ConfigurableServletContext ctx = +ctx = (ConfigurableServletContext) lite.addServletContext(null, null, "/test1"); ctx.addServlet("test", new SimpleServlet()); @@ -63,6 +71,21 @@ // Headers are still in the response assertEquals(res.getHeader("Foo"), "Post"); assertEquals(res.getStatus(), 200); + } + + public void testException() throws IOException, Exception { +ctx.addServlet("testException", new HttpServlet() { + public void doGet(HttpServletRequest req, HttpServletResponse res) +throws IOException { +throw new NullPointerException(); + } +}); +ctx.addMapping("/testException", "testException"); +ByteChunk out = new ByteChunk(); +ServletRequestImpl req = + lite.createMessage("/test1/testException", out); +ServletResponseImpl res = lite.service(req); +assertEquals(res.getStatus(), 500); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r641162 - /tomcat/sandbox/tomcat-lite/.classpath
Author: costin Date: Tue Mar 25 22:46:41 2008 New Revision: 641162 URL: http://svn.apache.org/viewvc?rev=641162&view=rev Log: Classpath for eclipse, 'ant download' before importing ( needs valid ../../tomcat6 build, or tc6.home property ) Modified: tomcat/sandbox/tomcat-lite/.classpath Modified: tomcat/sandbox/tomcat-lite/.classpath URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/.classpath?rev=641162&r1=641161&r2=641162&view=diff == --- tomcat/sandbox/tomcat-lite/.classpath (original) +++ tomcat/sandbox/tomcat-lite/.classpath Tue Mar 25 22:46:41 2008 @@ -1,11 +1,13 @@ - - + + + + + - - - + + - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]