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 7C0A66EB7 for ; Mon, 30 May 2011 08:19:59 +0000 (UTC) Received: (qmail 98188 invoked by uid 500); 30 May 2011 08:19:59 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 97988 invoked by uid 500); 30 May 2011 08:19:54 -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 97974 invoked by uid 99); 30 May 2011 08:19:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 May 2011 08:19:53 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [92.42.190.144] (HELO ok2cons2.nine.ch) (92.42.190.144) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 May 2011 08:19:44 +0000 Received: from [192.168.42.69] (unknown [213.55.131.189]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ok2cons2.nine.ch (Postfix) with ESMTPSA id 16B0D245E42B for ; Mon, 30 May 2011 10:19:23 +0200 (CEST) Subject: Re: Exposing Cookie processing code From: Oleg Kalnichevski To: HttpComponents Project In-Reply-To: References: <1306600595.10836.51.camel@ubuntu> Content-Type: text/plain; charset="UTF-8" Date: Mon, 30 May 2011 10:19:02 +0200 Message-ID: <1306743542.1830.6.camel@ubuntu> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On Sun, 2011-05-29 at 23:11 +0100, sebb wrote: > On 28 May 2011 17:36, Oleg Kalnichevski wrote: > > On Fri, 2011-05-27 at 19:21 +0100, sebb wrote: > >> I'm considering updating JMeter to use the cookie handling from HC4. > >> > >> At present it uses the Commons HC 3.1 code, in particular it relies on > >> the method > >> > >> Cookie[] org.apache.commons.httpclient.cookie.CookieSpecBase.match(String > >> host, int port, String path, boolean secure, Cookie[] cookies) > >> > >> which extracts the relevant cookies from the the cookies array and > >> returns the matching cookies in path name order. > >> > >> There does not seem to be an equivalent method in HC4. As far as I can > >> tell, the cookie match handling is only present in the method > >> > >> void org.apache.http.client.protocol.RequestAddCookies.process(HttpRequest > >> request, HttpContext context) > >> > >> which is not particularly easy to use in isolation. > >> > >> For JMeter it would be useful if the code used to process the list of > >> cookie heaqders could be extracted into a public method, for example: > >> > >> List
getCookieHeaders(CookieStore cookieStore, CookieOrigin > >> cookieOrigin, CookieSpec cookieSpec) > >> > >> This could then be used to generate the headers for the Java and HC3 > >> implementations. > >> > >> Thoughts? > >> > > > > Hi Sebastian > > > > There is not really that much code and I suspect you might be better off > > just coping to JMeter the bits you need. > > Yes, I could do that, but if the code ever needed to be changed then > it would have to be changed in two places... > This works both ways. Changes in the external code can produce side effects on your application. Code re-use is a double-edged sword. Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org