Return-Path: X-Original-To: apmail-hc-dev-archive@www.apache.org Delivered-To: apmail-hc-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4F22E93C9 for ; Sat, 1 Oct 2011 20:36:58 +0000 (UTC) Received: (qmail 87903 invoked by uid 500); 1 Oct 2011 20:36:58 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 87819 invoked by uid 500); 1 Oct 2011 20:36:58 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 87811 invoked by uid 99); 1 Oct 2011 20:36:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Oct 2011 20:36:58 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Oct 2011 20:36:55 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id E9EB82A4B44 for ; Sat, 1 Oct 2011 20:36:33 +0000 (UTC) Date: Sat, 1 Oct 2011 20:36:33 +0000 (UTC) From: "Rajika Kumarasiri (Commented) (JIRA)" To: dev@hc.apache.org Message-ID: <2110948623.652.1317501393959.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1099183337.1539.1317099312570.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (HTTPCORE-278) Making CharsetEncoder/CharsetDecoder CodingErrorAction to be configurable MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HTTPCORE-278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13118902#comment-13118902 ] Rajika Kumarasiri commented on HTTPCORE-278: -------------------------------------------- The updated patch with the changes + test cases for both I/O models. Rajika > Making CharsetEncoder/CharsetDecoder CodingErrorAction to be configurable > ------------------------------------------------------------------------- > > Key: HTTPCORE-278 > URL: https://issues.apache.org/jira/browse/HTTPCORE-278 > Project: HttpComponents HttpCore > Issue Type: Improvement > Reporter: Rajika Kumarasiri > Attachments: HTTPCORE-278.patch, HTTPCORE-278.patch, HTTPCORE-278.patch > > > Due to various character encoding complexities such as the system is configured to receive UTF-16 and but receives UTF-8 streams etc.. following exception throws by the httpcore library[0]. > At this point the connection will be dropped. But upon receiving this kind of errors we can recover if we configure CharsetEncoder/CharsetDecoder with a CodingErrorAction [1] where the action can be report (default), ignore and resume or replace and resume the coding logic. I think this choice should be a configuration option in SessionInputBufferImpl/SessionOutputBufferImpl constructors. > A possible patch will follow. > Rajika > [0] - java.nio.charset.MalformedInputException: Input length = 1 > at java.nio.charset.CoderResult.throwException(Unknown Source) > at org.apache.http.impl.nio.reactor.SessionInputBufferImpl.readLine(SessionInputBufferImpl.java:189) > at org.apache.http.impl.nio.codecs.AbstractMessageParser.parse(AbstractMessageParser.java:169) > at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:154) > at org.apache.http.impl.nio.DefaultClientIOEventDispatch.inputReady(DefaultClientIOEventDispatch.java:148) > at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:161) > at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:339) > at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:319) > at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:275) > at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104) > at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:528) > at java.lang.Thread.run(Unknown Source) > [1] - http://download.oracle.com/javase/6/docs/api/java/nio/charset/CodingErrorAction.html -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org