DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11910>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11910 Bugs in example CompressionServletResponseWrapper Summary: Bugs in example CompressionServletResponseWrapper Product: Tomcat 4 Version: 4.1.9 Platform: Other OS/Version: Other Status: NEW Severity: Minor Priority: Other Component: Webapps:Examples AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] 1) This example doesn't support other content-types. PrintWriter in getWriter() method should be created in this way: String charset = getCharsetFromContentType(contentType); if (charset == null) charset = {default charset} writer = new PrintWriter(new OutputStreamWriter(stream, charset)); where getCharsetFromContentType returns charset according to set content-type. 2) There can be problem when somebody sets threshold: Method should look like this: public void write(int b) throws IOException { if (closed) throw new IOException("Cannot write to a closed output stream"); if ((bufferCount >= buffer.length) || (count>=compressionThreshold)) { compressionThresholdReached = true; } if (compressionThresholdReached) { // rajo - bugfix if (bufferCount > 0) { writeToGZip(buffer, 0, bufferCount); bufferCount = 0; } writeToGZip(b); } else { buffer[bufferCount++] = (byte) b; } count++; // rajo - bugfix } Similary method (byte b[], int off, int len). Thanks. -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>