From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60831) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNO8x-0001eH-4z for qemu-devel@nongnu.org; Fri, 29 Aug 2014 11:31:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XNO8q-0007v7-6k for qemu-devel@nongnu.org; Fri, 29 Aug 2014 11:31:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40202) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNO8p-0007v1-Ub for qemu-devel@nongnu.org; Fri, 29 Aug 2014 11:31:08 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7TFV7pd008818 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 29 Aug 2014 11:31:07 -0400 Message-ID: <54009CB9.5050302@redhat.com> Date: Fri, 29 Aug 2014 16:31:05 +0100 From: Matthew Booth MIME-Version: 1.0 References: <1409324592-31888-1-git-send-email-rjones@redhat.com> <1409324592-31888-2-git-send-email-rjones@redhat.com> <540097D2.2020200@redhat.com> In-Reply-To: <540097D2.2020200@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] curl: Allow a cookie or cookies to be sent with http/https requests. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , "Richard W.M. Jones" , qemu-devel@nongnu.org Cc: famz@redhat.com, stefanha@redhat.com On 29/08/14 16:10, Eric Blake wrote: > On 08/29/2014 09:03 AM, Richard W.M. Jones wrote: >> In order to access VMware ESX efficiently, we need to send a session >> cookie. This patch is very simple and just allows you to send that >> session cookie. It punts on the question of how you get the session >> cookie in the first place, but in practice you can just run a `curl' >> command against the server and extract the cookie that way. >> > >> +++ b/qemu-options.hx >> @@ -2351,6 +2351,11 @@ multiple of 512 bytes. It defaults to 256k. >> @item sslverify >> Whether to verify the remote server's certificate when connecting over SSL. It >> can have the value 'on' or 'off'. It defaults to 'on'. >> + >> +@item cookie >> +Send this cookie (it can also be a list of cookies separated by ';') with >> +each outgoing request. Only supported when using protocols such as HTTP >> +which support cookies, otherwise ignored. > > ';' has to be quoted to enter it in the shell command line (but then > again, the cookie probably contains literal " which also has to be quoted). > > We still don't have a QMP mapping for curl device hotplug. But when we > gain one, do we really want to have a single (long) string containing > multiple cookies, or would it be better to make this an array argument? > On the command-line, which is nicer, taking the cookie option multiple > times ('file.cookie=xyz,file.cookie.abc'), taking it as an automatic > array ('file.cookie.0=xyz,file.cookie.1=abc') or forcing the user to > cram all cookies into a single option ('file.cookie="xyz;abc"')? I thought about this, too. We're really only passing on curl's cookie syntax: http://curl.haxx.se/libcurl/c/CURLOPT_COOKIE.html So even if we did it differently, the driver would still have to reconstruct this string with ';' separation and handle escaping issues. I doubt this will be a commonly used option, and even less frequently used with multiple cookies, if ever[1]. Given that it is possible to use multiple cookies without massive effort, I think the substantially simpler code is a reasonable trade-off. Matt [1] Feel free to lart me with this at a later date ;) -- Matthew Booth Red Hat Engineering, Virtualisation Team Phone: +442070094448 (UK) GPG ID: D33C3490 GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490