Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 87229 invoked from network); 5 Sep 2006 16:27:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Sep 2006 16:27:27 -0000 Received: (qmail 33364 invoked by uid 500); 5 Sep 2006 16:27:23 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 33313 invoked by uid 500); 5 Sep 2006 16:27:23 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 33302 invoked by uid 99); 5 Sep 2006 16:27:23 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Sep 2006 09:27:23 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [195.186.18.63] (HELO mail15.bluewin.ch) (195.186.18.63) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Sep 2006 09:27:22 -0700 Received: from [192.168.0.2] (81.62.186.93) by mail15.bluewin.ch (Bluewin 7.3.116) id 44E2F92C0051B83E for commons-user@jakarta.apache.org; Tue, 5 Sep 2006 16:26:58 +0000 Subject: RE: How to make HttpClient NOT send "Proxy-Connection: Keep-Alive"? From: Oleg Kalnichevski To: Jakarta Commons Users List In-Reply-To: <0C260F619E428642BFA6380177C3ADF304160B7E@exmsea005.us.wamu.net> References: <0C260F619E428642BFA6380177C3ADF304160B7E@exmsea005.us.wamu.net> Content-Type: text/plain Date: Tue, 05 Sep 2006 18:26:57 +0200 Message-Id: <1157473618.4983.48.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Tue, 2006-09-05 at 09:12 -0700, Karr, David wrote: > I'm confused. This seemed like it would work. I added two subclasses, > one called "GetMethodNoKeepAlive", and the other > "PostMethodNoKeepAlive". I created instances of those instead of > "GetMethod" and "PostMethod". Each of the subclasses has an empty > "addProxyConnectionHeader" method, except for a print statement saying > it got there. I monitored the execution in Ethereal. When it executed, > I saw the print statements execute, but my timing behavior made it look > like it made no difference. In my Ethereal results, I still see the > "Proxy-Connection: Keep-Alive" when it connects to the external host. > David, Are you using SSL tunneling by any chance? Oleg > I even tried overriding the "shouldCloseConnection" method to return > true, in both classes. Still no effect. > > > -----Original Message----- > > From: Oleg Kalnichevski [mailto:olegk@apache.org] > > Sent: Tuesday, September 05, 2006 5:00 AM > > To: Jakarta Commons Users List > > Cc: Karr, David > > Subject: Re: How to make HttpClient NOT send > > "Proxy-Connection: Keep-Alive"? > > > > On Wed, 2006-08-30 at 15:04 -0700, Karr, David wrote: > > > This may seem strange, but is it possible to make > > HttpClient NOT send > > > the "Proxy-Connection: Keep-Alive" header? > > > > > > > David, > > > > There's no elegant solution to this problem. The only way to > > work the problem around is to subclass method classes (such > > as GetMethod, PostMethod, and so on) and override the > > HttpMethodBase#addProxyConnectionHeader method > > > > Oleg > > > > > I'm trying to write a test tool to load test an outside web > > service, > > > but doing it in a way that is somewhat consistent with an internal > > > application that will be calling that outside web service. My test > > > tool can send the message multiple times so we can generate > > statistics > > > on the roundtrip time. What I first noticed is that when I send N > > > messages on a thread, the 2nd-Nth message is faster than the first > > > one. After examining the protocol behavior in Ethereal, I noticed > > > that HttpClient appears to be sending a "Proxy-Connection: > > Keep-Alive" > > > header. If I modified my test code to add a manual delay (9-10 > > > seconds) between each message send, then the 2nd-Nth > > message timings > > > were about the same as the first one. > > > > > > I'd prefer not to have that manual delay between each message. For > > > the sake of getting consistent results, is there any way to disable > > > the sending of the "Proxy-Connection: Keep-Alive" header? > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > > > For additional commands, e-mail: > > commons-user-help@jakarta.apache.org > > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org