Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@apache.org Received: (qmail 47839 invoked from network); 21 Aug 2002 20:35:46 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 21 Aug 2002 20:35:46 -0000 Received: (qmail 6606 invoked by uid 97); 21 Aug 2002 20:36:09 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-dev@jakarta.apache.org Received: (qmail 6589 invoked by uid 97); 21 Aug 2002 20:36:09 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 6576 invoked by uid 50); 21 Aug 2002 20:36:08 -0000 Date: 21 Aug 2002 20:36:08 -0000 Message-ID: <20020821203608.6575.qmail@nagoya.betaversion.org> From: bugzilla@apache.org To: tomcat-dev@jakarta.apache.org Cc: Subject: DO NOT REPLY [Bug 11910] New: - Bugs in example CompressionServletResponseWrapper X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . 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: tomcat-dev@jakarta.apache.org ReportedBy: lolo@elline.sk 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: For additional commands, e-mail: