Return-Path: Delivered-To: apmail-jakarta-httpcomponents-commits-archive@www.apache.org Received: (qmail 16713 invoked from network); 30 Apr 2007 16:01:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Apr 2007 16:01:47 -0000 Received: (qmail 967 invoked by uid 500); 30 Apr 2007 16:01:54 -0000 Delivered-To: apmail-jakarta-httpcomponents-commits-archive@jakarta.apache.org Received: (qmail 945 invoked by uid 500); 30 Apr 2007 16:01:54 -0000 Mailing-List: contact httpcomponents-commits-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: httpcomponents-dev@jakarta.apache.org Delivered-To: mailing list httpcomponents-commits@jakarta.apache.org Received: (qmail 936 invoked by uid 99); 30 Apr 2007 16:01:53 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Apr 2007 09:01:53 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Apr 2007 09:01:47 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id B0E2A1A983E; Mon, 30 Apr 2007 09:01:26 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r533783 - /jakarta/httpcomponents/httpcore/trunk/module-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java Date: Mon, 30 Apr 2007 16:01:26 -0000 To: httpcomponents-commits@jakarta.apache.org From: olegk@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070430160126.B0E2A1A983E@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: olegk Date: Mon Apr 30 09:01:25 2007 New Revision: 533783 URL: http://svn.apache.org/viewvc?view=rev&rev=533783 Log: Fixed a number of bugs in the reverse proxy sample Modified: jakarta/httpcomponents/httpcore/trunk/module-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java Modified: jakarta/httpcomponents/httpcore/trunk/module-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java?view=diff&rev=533783&r1=533782&r2=533783 ============================================================================== --- jakarta/httpcomponents/httpcore/trunk/module-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java (original) +++ jakarta/httpcomponents/httpcore/trunk/module-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java Mon Apr 30 09:01:25 2007 @@ -95,7 +95,7 @@ .setParameter(HttpProtocolParams.USER_AGENT, "Jakarta-HttpComponents-NIO/1.1"); // Target host - HttpHost targetHost = new HttpHost("localhost", 80); + HttpHost targetHost = new HttpHost("localhost", 8080); final ConnectingIOReactor connectingIOReactor = new DefaultConnectingIOReactor( 1, params); @@ -303,11 +303,11 @@ if (decoder.isCompleted()) { // Update connection state - connState.setOriginState(ConnState.REQUEST_BODY_DONE); + connState.setClientState(ConnState.REQUEST_BODY_DONE); // Suspend client input conn.suspendInput(); } else { - connState.setOriginState(ConnState.REQUEST_BODY_STREAM); + connState.setClientState(ConnState.REQUEST_BODY_STREAM); } } catch (IOException ex) { @@ -629,7 +629,7 @@ } try { - ByteBuffer src = connState.getOutBuffer(); + ByteBuffer src = connState.getInBuffer(); src.flip(); if (src.hasRemaining()) { int bytesWritten = encoder.write(src);