Author: remy.maucherat(a)jboss.com
Date: 2007-09-04 10:44:39 -0400 (Tue, 04 Sep 2007)
New Revision: 258
Modified:
trunk/java/org/apache/catalina/connector/InputBuffer.java
trunk/java/org/apache/catalina/core/StandardContext.java
trunk/java/org/apache/catalina/loader/WebappLoader.java
trunk/java/org/apache/tomcat/util/buf/B2CConverter.java
trunk/java/org/apache/tomcat/util/net/SSLSupport.java
Log:
- Logging cleanups.
- C2B fixes.
Modified: trunk/java/org/apache/catalina/connector/InputBuffer.java
===================================================================
--- trunk/java/org/apache/catalina/connector/InputBuffer.java 2007-09-03 14:06:32 UTC (rev
257)
+++ trunk/java/org/apache/catalina/connector/InputBuffer.java 2007-09-04 14:44:39 UTC (rev
258)
@@ -292,7 +292,8 @@
if (coyoteRequest == null)
return -1;
- state = BYTE_STATE;
+ if(state == INITIAL_STATE)
+ state = BYTE_STATE;
int result = coyoteRequest.doRead(bb);
@@ -325,6 +326,8 @@
public void realWriteChars(char c[], int off, int len)
throws IOException {
markPos = -1;
+ cb.setOffset(0);
+ cb.setEnd(0);
}
@@ -351,12 +354,9 @@
cb.setEnd(0);
}
- int limit = bb.getLength()+cb.getStart();
- if( cb.getLimit() < limit )
- cb.setLimit(limit);
- conv.convert(bb, cb);
+ state = CHAR_STATE;
+ conv.convert(bb, cb, len);
bb.setOffset(bb.getEnd());
- state = CHAR_STATE;
return cb.getLength();
Modified: trunk/java/org/apache/catalina/core/StandardContext.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardContext.java 2007-09-03 14:06:32 UTC (rev
257)
+++ trunk/java/org/apache/catalina/core/StandardContext.java 2007-09-04 14:44:39 UTC (rev
258)
@@ -4084,8 +4084,6 @@
public synchronized void start() throws LifecycleException {
//if (lazy ) return;
if (started) {
- if(log.isInfoEnabled())
- log.info(sm.getString("containerBase.alreadyStarted",
logName()));
return;
}
if( !initialized ) {
Modified: trunk/java/org/apache/catalina/loader/WebappLoader.java
===================================================================
--- trunk/java/org/apache/catalina/loader/WebappLoader.java 2007-09-03 14:06:32 UTC (rev
257)
+++ trunk/java/org/apache/catalina/loader/WebappLoader.java 2007-09-04 14:44:39 UTC (rev
258)
@@ -627,9 +627,7 @@
// Log and continue anyway, this is not critical
log.error("Error registering jndi stream handler", e);
} catch (Throwable t) {
- // This is likely a dual registration
- log.info("Dual registration of jndi stream handler: "
- + t.getMessage());
+ // This is likely a dual registration, ignore
}
}
Modified: trunk/java/org/apache/tomcat/util/buf/B2CConverter.java
===================================================================
--- trunk/java/org/apache/tomcat/util/buf/B2CConverter.java 2007-09-03 14:06:32 UTC (rev
257)
+++ trunk/java/org/apache/tomcat/util/buf/B2CConverter.java 2007-09-04 14:44:39 UTC (rev
258)
@@ -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)
@@ -225,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() {
}
@@ -239,39 +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();
}
- public int available() throws IOException {
- return end-pos;
- }
// -------------------- 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;
+ bc = mb;
}
}
Modified: trunk/java/org/apache/tomcat/util/net/SSLSupport.java
===================================================================
--- trunk/java/org/apache/tomcat/util/net/SSLSupport.java 2007-09-03 14:06:32 UTC (rev
257)
+++ trunk/java/org/apache/tomcat/util/net/SSLSupport.java 2007-09-04 14:44:39 UTC (rev
258)
@@ -61,7 +61,9 @@
new CipherData("_WITH_RC4_128_", 128),
new CipherData("_WITH_DES40_CBC_", 40),
new CipherData("_WITH_DES_CBC_", 56),
- new CipherData("_WITH_3DES_EDE_CBC_", 168)
+ new CipherData("_WITH_3DES_EDE_CBC_", 168),
+ new CipherData("_WITH_AES_128_CBC_", 128),
+ new CipherData("_WITH_AES_256_CBC_", 256)
};
/**