cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 InternalOutputBuffer.java Constants.java
remm2004/11/12 02:51:49 Modified:util/java/org/apache/tomcat/util/buf MessageBytes.java CharChunk.java ByteChunk.java http11/src/java/org/apache/coyote/http11 InternalOutputBuffer.java Constants.java Log: - Move convertToBytes to ByteChunk. - Some small optimizations. - The recycle method of MB was called far too often (ex: when calling setChars). This needs some testing. Revision ChangesPath 1.20 +35 -14 jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/buf/MessageBytes.java Index: MessageBytes.java === RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/buf/MessageBytes.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- MessageBytes.java 29 Aug 2004 17:14:41 - 1.19 +++ MessageBytes.java 12 Nov 2004 10:51:49 - 1.20 @@ -121,14 +121,18 @@ /** * Sets the content to the specified subarray of bytes. * - * @param b the ascii bytes + * @param b the bytes * @param off the start offset of the bytes * @param len the length of the bytes */ public void setBytes(byte[] b, int off, int len) { - recycle(); // a new value is set, cached values must reset - byteC.setBytes( b, off, len ); - type=T_BYTES; +byteC.setBytes( b, off, len ); +type=T_BYTES; +hasStrValue=false; +hasHashCode=false; +hasIntValue=false; +hasLongValue=false; +hasDateValue=false; } /** Set the encoding. If the object was constructed from bytes[]. any @@ -144,12 +148,21 @@ byteC.setEncoding(enc); } -/** Sets the content to be a char[] +/** + * Sets the content to be a char[] + * + * @param c the bytes + * @param off the start offset of the bytes + * @param len the length of the bytes */ public void setChars( char[] c, int off, int len ) { - recycle(); - charC.setChars( c, off, len ); - type=T_CHARS; +charC.setChars( c, off, len ); +type=T_CHARS; +hasStrValue=false; +hasHashCode=false; +hasIntValue=false; +hasLongValue=false; +hasDateValue=false; } /** Remove the cached string value. Use it after a conversion on the @@ -165,15 +178,19 @@ } } -/** Set the content to be a string +/** + * Set the content to be a string */ public void setString( String s ) { - recycle(); if (s == null) return; - strValue=s; - hasStrValue=true; - type=T_STR; +strValue=s; +hasStrValue=true; +hasHashCode=false; +hasIntValue=false; +hasLongValue=false; +hasDateValue=false; +type=T_STR; } // Conversion and getters @@ -553,7 +570,6 @@ /** Set the buffer to the representation of an int */ public void setInt(int i) { - recycle(); byteC.allocate(16, 32); int current = i; byte[] buf = byteC.getBuffer(); @@ -571,6 +587,7 @@ current = current / 10; buf[end++] = HexUtils.HEX[digit]; } +byteC.setOffset(0); byteC.setEnd(end); // Inverting buffer end--; @@ -585,7 +602,11 @@ end--; } intValue=i; +hasStrValue=false; +hasHashCode=false; hasIntValue=true; +hasLongValue=false; +hasDateValue=false; type=T_BYTES; } 1.18 +5 -7 jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/buf/CharChunk.java Index: CharChunk.java === RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/buf/CharChunk.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- CharChunk.java18 Oct 2004 23:19:36 - 1.17 +++ CharChunk.java12 Nov 2004 10:51:49 - 1.18 @@ -133,12 +133,10 @@ } public void setChars( char[] c, int off, int len ) { - recycle(); - isSet=true; - buff=c; - start=off; - end=start + len; - limit=end; +buff=c; +start=off; +end=start + len; +isSet=true; } /** Maximum amount of data in this buffer. @@ -192,7 +190,7 @@ } public int getOffset() { - return getStart(); + return start; } /** 1.23 +19 -5
cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 InternalOutputBuffer.java Constants.java Http11Processor.java
remm2004/10/01 16:36:15 Modified:http11/src/java/org/apache/coyote/http11 InternalOutputBuffer.java Constants.java Http11Processor.java Log: - Fix a oops with my usage of constant bytes arrays. So, ok, I can't do that. - Use a byte array for server. Revision ChangesPath 1.24 +1 -1 jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/InternalOutputBuffer.java Index: InternalOutputBuffer.java === RCS file: /home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/InternalOutputBuffer.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- InternalOutputBuffer.java 31 Aug 2004 23:52:51 - 1.23 +++ InternalOutputBuffer.java 1 Oct 2004 23:36:15 - 1.24 @@ -682,7 +682,7 @@ * * @param b data to be written */ -protected void write(byte[] b) { +public void write(byte[] b) { // Writing the byte chunk to the output buffer System.arraycopy(b, 0, buf, pos, b.length); 1.24 +12 -10 jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Constants.java Index: Constants.java === RCS file: /home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Constants.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- Constants.java29 Sep 2004 09:54:28 - 1.23 +++ Constants.java1 Oct 2004 23:36:15 - 1.24 @@ -41,9 +41,15 @@ /** + * CRLF. + */ +public static final String CRLF = \r\n; + + +/** * Server string. */ -public static final byte[] SERVER_BYTES = convertToBytes(Apache-Coyote/1.1); +public static final byte[] SERVER_BYTES = convertToBytes(Server: Apache-Coyote/1.1 + CRLF); /** @@ -112,21 +118,17 @@ public static final int DEFAULT_HTTP_HEADER_BUFFER_SIZE = 48 * 1024; -/** - * CRLF. - */ -public static final String CRLF = \r\n; - - /* Various constant strings */ public static final byte[] CRLF_BYTES = convertToBytes(CRLF); public static final byte[] COLON_BYTES = convertToBytes(: ); -public static final byte[] CONNECTION_BYTES = convertToBytes(Connection); +public static final String CONNECTION = Connection; +public static final String CLOSE = close; public static final byte[] CLOSE_BYTES = convertToBytes(close); +public static final String KEEPALIVE = keep-alive; public static final byte[] KEEPALIVE_BYTES = convertToBytes(keep-alive); -public static final byte[] CHUNKED_BYTES = convertToBytes(chunked); +public static final String CHUNKED = chunked; public static final byte[] ACK_BYTES = convertToBytes(HTTP/1.1 100 Continue + CRLF + CRLF); -public static final byte[] TRANSFERENCODING_BYTES = convertToBytes(Transfer-Encoding); +public static final String TRANSFERENCODING = Transfer-Encoding; /** 1.112 +10 -15 jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11Processor.java Index: Http11Processor.java === RCS file: /home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11Processor.java,v retrieving revision 1.111 retrieving revision 1.112 diff -u -r1.111 -r1.112 --- Http11Processor.java 29 Sep 2004 09:54:28 - 1.111 +++ Http11Processor.java 1 Oct 2004 23:36:15 - 1.112 @@ -1500,9 +1500,7 @@ outputBuffer.addActiveFilter (outputFilters[Constants.CHUNKED_FILTER]); contentDelimitation = true; -headers.addValue(Constants.TRANSFERENCODING_BYTES, -0, Constants.TRANSFERENCODING_BYTES.length).setBytes -(Constants.CHUNKED_BYTES, 0, Constants.CHUNKED_BYTES.length); + headers.addValue(Constants.TRANSFERENCODING).setString(Constants.CHUNKED); } else { outputBuffer.addActiveFilter (outputFilters[Constants.IDENTITY_FILTER]); @@ -1531,14 +1529,6 @@ } headers.setValue(Date).setString(date); -// Add server header -if (server != null) { -headers.setValue(Server).setString(server); -} else { -headers.setValue(Server).setBytes(Constants.SERVER_BYTES, -0, Constants.SERVER_BYTES.length); -} - // FIXME: Add transfer encoding header if ((entityBody) (!contentDelimitation)) {
Re: cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 InternalOutputBuffer.java Constants.java Http11Processor.java
I am out of the office until Monday 4 October. If your enquiry is urgent please contact [EMAIL PROTECTED], otherwise I will get back to you on my return. Best Regards, Jim Ansdell See (Nottingham) dl: 0115 9129179 f: 0115 9484345 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 InternalOutputBuffer.java
remm2004/07/15 07:33:38 Modified:http11/src/java/org/apache/coyote/http11 InternalOutputBuffer.java Log: - Add better support for CharChunk for response headers. Revision ChangesPath 1.22 +41 -2 jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/InternalOutputBuffer.java Index: InternalOutputBuffer.java === RCS file: /home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/InternalOutputBuffer.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- InternalOutputBuffer.java 24 Feb 2004 08:50:56 - 1.21 +++ InternalOutputBuffer.java 15 Jul 2004 14:33:38 - 1.22 @@ -22,6 +22,7 @@ import java.security.PrivilegedAction; import org.apache.tomcat.util.buf.ByteChunk; +import org.apache.tomcat.util.buf.CharChunk; import org.apache.tomcat.util.buf.MessageBytes; import org.apache.tomcat.util.http.HttpMessages; import org.apache.tomcat.util.http.MimeHeaders; @@ -607,11 +608,12 @@ */ protected void write(MessageBytes mb) { -mb.toBytes(); - if (mb.getType() == MessageBytes.T_BYTES) { ByteChunk bc = mb.getByteChunk(); write(bc); +} else if (mb.getType() == MessageBytes.T_CHARS) { +CharChunk cc = mb.getCharChunk(); +write(cc); } else { write(mb.toString()); } @@ -632,6 +634,43 @@ System.arraycopy(bc.getBytes(), bc.getStart(), buf, pos, bc.getLength()); pos = pos + bc.getLength(); + +} + + +/** + * This method will write the contents of the specyfied char + * buffer to the output stream, without filtering. This method is meant to + * be used to write the response header. + * + * @param bc data to be written + */ +protected void write(CharChunk cc) { + +int start = cc.getStart(); +int end = cc.getEnd(); +char[] cbuf = cc.getBuffer(); +for (int i = start; i end; i++) { +char c = cbuf[i]; +// Note: This is clearly incorrect for many strings, +// but is the only consistent approach within the current +// servlet framework. It must suffice until servlet output +// streams properly encode their output. +if ((c 0xff00) != 0) { +// High order byte must be zero +//log(Header character is not iso8859_1, + +//not supported yet: + c, Log.ERROR ) ; +} +if (c != 9) { +if ((c = 0) (c = 31)) { +c = ' '; +} +if (c == 127) { +c = ' '; +} +} +buf[pos++] = (byte) c; +} } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 InternalOutputBuffer.java
[EMAIL PROTECTED] wrote: billbarker2003/09/29 22:40:27 Modified:http11/src/java/org/apache/coyote/http11 Tag: coyote_10 InternalOutputBuffer.java Log: Trying to escape the dreaded tab-police. -1. The fix was already present. I had even sent you a mail quoting the code portion fixing the issue. Remy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 InternalOutputBuffer.java
Remy Maucherat wrote: [EMAIL PROTECTED] wrote: billbarker2003/09/29 22:40:27 Modified:http11/src/java/org/apache/coyote/http11 Tag: coyote_10 InternalOutputBuffer.java Log: Trying to escape the dreaded tab-police. -1. The fix was already present. I had even sent you a mail quoting the code portion fixing the issue. After checking, I didn't send Bill the reference patch. Oops. Here it is: remm2003/09/12 03:28:38 Modified:http11/src/java/org/apache/coyote/http11 Tag: coyote_10 InternalOutputBuffer.java Log: - Port patch: add filering for control chars in the HTTP header. Revision ChangesPath No revision No revision 1.16.2.1 +9 -1 jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/InternalOutputBuffer.java Index: InternalOutputBuffer.java === RCS file: /home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/InternalOutputBuffer.java,v retrieving revision 1.16 retrieving revision 1.16.2.1 diff -u -r1.16 -r1.16.2.1 --- InternalOutputBuffer.java 22 Nov 2002 15:55:32 - 1.16 +++ InternalOutputBuffer.java 12 Sep 2003 10:28:38 - 1.16.2.1 @@ -490,7 +490,7 @@ */ public void endHeaders() { -write(Constants.CRLF); +write(Constants.CRLF_BYTES); } @@ -627,6 +627,14 @@ // High order byte must be zero //log(Header character is not iso8859_1, + //not supported yet: + c, Log.ERROR ) ; +} +if (c != 9) { +if ((c = 0) (c = 31)) { +c = ' '; +} +if (c == 127) { +c = ' '; +} } buf[pos++] = (byte) c; } Remy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 InternalOutputBuffer.java
billbarker2003/09/30 19:36:14 Modified:http11/src/java/org/apache/coyote/http11 Tag: coyote_10 InternalOutputBuffer.java Log: Revert patch. Revision ChangesPath No revision No revision 1.16.2.4 +2 -4 jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/InternalOutputBuffer.java Index: InternalOutputBuffer.java === RCS file: /home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/InternalOutputBuffer.java,v retrieving revision 1.16.2.3 retrieving revision 1.16.2.4 diff -u -r1.16.2.3 -r1.16.2.4 --- InternalOutputBuffer.java 30 Sep 2003 05:40:27 - 1.16.2.3 +++ InternalOutputBuffer.java 1 Oct 2003 02:36:14 - 1.16.2.4 @@ -425,12 +425,10 @@ write( ); // Write message -String message = response.getMessage(); -if (message == null) { +if (response.getMessage() == null) { write(HttpMessages.getMessage(status)); } else { -message = message.replace('\r', ' ').replace('\n', ' '); -write(message); +write(response.getMessage()); } // End the response status line - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 InternalOutputBuffer.java
billbarker2003/09/29 22:38:15 Modified:http11/src/java/org/apache/coyote/http11 Tag: coyote_10 InternalOutputBuffer.java Log: Port the no-nl patch from the Head branch. Revision ChangesPath No revision No revision 1.16.2.2 +4 -2 jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/InternalOutputBuffer.java Index: InternalOutputBuffer.java === RCS file: /home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/InternalOutputBuffer.java,v retrieving revision 1.16.2.1 retrieving revision 1.16.2.2 diff -u -r1.16.2.1 -r1.16.2.2 --- InternalOutputBuffer.java 12 Sep 2003 10:28:38 - 1.16.2.1 +++ InternalOutputBuffer.java 30 Sep 2003 05:38:15 - 1.16.2.2 @@ -425,10 +425,12 @@ write( ); // Write message -if (response.getMessage() == null) { +String message = response.getMessage(); +if (message == null) { write(HttpMessages.getMessage(status)); } else { -write(response.getMessage()); + message = message.replace('\r', ' ').replace('\n', ' '); +write(message); } // End the response status line - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 InternalOutputBuffer.java
billbarker2003/09/29 22:40:27 Modified:http11/src/java/org/apache/coyote/http11 Tag: coyote_10 InternalOutputBuffer.java Log: Trying to escape the dreaded tab-police. Revision ChangesPath No revision No revision 1.16.2.3 +1 -1 jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/InternalOutputBuffer.java Index: InternalOutputBuffer.java === RCS file: /home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/InternalOutputBuffer.java,v retrieving revision 1.16.2.2 retrieving revision 1.16.2.3 diff -u -r1.16.2.2 -r1.16.2.3 --- InternalOutputBuffer.java 30 Sep 2003 05:38:15 - 1.16.2.2 +++ InternalOutputBuffer.java 30 Sep 2003 05:40:27 - 1.16.2.3 @@ -429,7 +429,7 @@ if (message == null) { write(HttpMessages.getMessage(status)); } else { - message = message.replace('\r', ' ').replace('\n', ' '); +message = message.replace('\r', ' ').replace('\n', ' '); write(message); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 InternalOutputBuffer.java
remm2003/09/12 03:28:38 Modified:http11/src/java/org/apache/coyote/http11 Tag: coyote_10 InternalOutputBuffer.java Log: - Port patch: add filering for control chars in the HTTP header. Revision ChangesPath No revision No revision 1.16.2.1 +9 -1 jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/InternalOutputBuffer.java Index: InternalOutputBuffer.java === RCS file: /home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/InternalOutputBuffer.java,v retrieving revision 1.16 retrieving revision 1.16.2.1 diff -u -r1.16 -r1.16.2.1 --- InternalOutputBuffer.java 22 Nov 2002 15:55:32 - 1.16 +++ InternalOutputBuffer.java 12 Sep 2003 10:28:38 - 1.16.2.1 @@ -490,7 +490,7 @@ */ public void endHeaders() { -write(Constants.CRLF); +write(Constants.CRLF_BYTES); } @@ -627,6 +627,14 @@ // High order byte must be zero //log(Header character is not iso8859_1, + //not supported yet: + c, Log.ERROR ) ; +} +if (c != 9) { +if ((c = 0) (c = 31)) { +c = ' '; +} +if (c == 127) { +c = ' '; +} } buf[pos++] = (byte) c; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 InternalOutputBuffer.java
remm2003/09/11 00:03:58 Modified:http11/src/java/org/apache/coyote/http11 InternalOutputBuffer.java Log: - Filter out all control chars from the response header, as mandated by the HTTP specification. Revision ChangesPath 1.18 +9 -2 jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/InternalOutputBuffer.java Index: InternalOutputBuffer.java === RCS file: /home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/InternalOutputBuffer.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- InternalOutputBuffer.java 22 May 2003 18:21:08 - 1.17 +++ InternalOutputBuffer.java 11 Sep 2003 07:03:58 - 1.18 @@ -429,7 +429,6 @@ if (message == null) { write(HttpMessages.getMessage(status)); } else { -message = message.replace('\n', ' ').replace('\r', ' '); write(message); } @@ -492,7 +491,7 @@ */ public void endHeaders() { -write(Constants.CRLF); +write(Constants.CRLF_BYTES); } @@ -629,6 +628,14 @@ // High order byte must be zero //log(Header character is not iso8859_1, + //not supported yet: + c, Log.ERROR ) ; +} +if (c != 9) { +if ((c = 0) (c = 31)) { +c = ' '; +} +if (c == 127) { +c = ' '; +} } buf[pos++] = (byte) c; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 InternalOutputBuffer.java
remm2002/11/22 07:55:32 Modified:http11/src/java/org/apache/coyote/http11 InternalOutputBuffer.java Log: - If an IOE happens during the commit, the response is never flagged as committed (so would get generated multiple times in the OB depending on how much commit is used in the rest of the processing). - Fix bug 14760 (ok, there really was a bug, although it has almost zero actual impact). Revision ChangesPath 1.16 +4 -4 jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/InternalOutputBuffer.java Index: InternalOutputBuffer.java === RCS file: /home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/InternalOutputBuffer.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- InternalOutputBuffer.java 10 Oct 2002 13:14:55 - 1.15 +++ InternalOutputBuffer.java 22 Nov 2002 15:55:32 - 1.16 @@ -536,15 +536,15 @@ protected void commit() throws IOException { +// The response is now committed +committed = true; +response.setCommitted(true); + if (pos 0) { // Sending the response header buffer outputStream.write(buf, 0, pos); outputStream.flush(); // Is it really necessary ? } - -// The response is now committed -committed = true; -response.setCommitted(true); } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 InternalOutputBuffer.java
remm02/04/01 09:50:46 Modified:http11/src/java/org/apache/coyote/http11 InternalOutputBuffer.java Log: - Fix problems handling null strings. - isNull wasn't a good way to test the type of the MB (use getType instead). Revision ChangesPath 1.12 +6 -4 jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/InternalOutputBuffer.java Index: InternalOutputBuffer.java === RCS file: /home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/InternalOutputBuffer.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- InternalOutputBuffer.java 28 Mar 2002 02:34:11 - 1.11 +++ InternalOutputBuffer.java 1 Apr 2002 17:50:46 - 1.12 @@ -545,12 +545,11 @@ protected void write(MessageBytes mb) { mb.toBytes(); -ByteChunk bc = mb.getByteChunk(); -if (!bc.isNull()) { -// Writing the byte chunk to the output buffer + +if (mb.getType() == MessageBytes.T_BYTES) { +ByteChunk bc = mb.getByteChunk(); write(bc); } else { -// Using toString write(mb.toString()); } @@ -582,6 +581,9 @@ * @param s data to be written */ protected void write(String s) { + +if (s == null) +return; // From the Tomcat 3.3 HTTP/1.0 connector int len = s.length(); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 InternalOutputBuffer.java
remm02/03/10 23:12:07 Modified:http11/src/java/org/apache/coyote/http11 InternalOutputBuffer.java Log: - Write the message cause specified in the response. Revision ChangesPath 1.10 +5 -1 jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/InternalOutputBuffer.java Index: InternalOutputBuffer.java === RCS file: /home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/InternalOutputBuffer.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- InternalOutputBuffer.java 10 Jan 2002 16:58:17 - 1.9 +++ InternalOutputBuffer.java 11 Mar 2002 07:12:07 - 1.10 @@ -407,7 +407,11 @@ write( ); // Write message -write(HttpMessages.getMessage(status)); +if (response.getMessage() == null) { +write(HttpMessages.getMessage(status)); +} else { +write(response.getMessage()); +} // End the response status line write(Constants.CRLF); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]