Displaying 3 results from an estimated 3 matches for "cookies_from_script".
2020 Jul 15
0
[PATCH nbdkit v2] curl: Implement header and cookie scripts.
...tatic bool header_script_has_run = false;
+static bool cookie_script_has_run = false;
+static unsigned header_iteration = 0;
+static unsigned cookie_iteration = 0;
+
+/* Last set of headers and cookies generated by the scripts. */
+static struct curl_slist *headers_from_script = NULL;
+static char *cookies_from_script = NULL;
+
+void
+scripts_unload (void)
+{
+ curl_slist_free_all (headers_from_script);
+ free (cookies_from_script);
+}
+
+static int run_header_script (struct curl_handle *);
+static int run_cookie_script (struct curl_handle *);
+
+/* This is called from any thread just before we make a curl req...
2020 Jul 15
2
[PATCH nbdkit v2] curl: Implement header and cookie scripts.
Evolution of this patch series:
https://www.redhat.com/archives/libguestfs/2020-July/thread.html#00073
Instead of auth-script, this implements header-script and
cookie-script. It can be used for similar purposes but the
implementation is somewhat saner.
Rich.
2020 Jul 20
1
Re: [PATCH nbdkit v2] curl: Implement header and cookie scripts.
...gt; + * cookie-script.
> + */
> +static int
> +run_cookie_script (struct curl_handle *h)
> +{
> + int fd;
These two look similar, is it worth refactoring into a common helper
routine?
> +
> + nbdkit_debug ("cookie-script returned %scookies",
> + cookies_from_script ? "" : "no ");
This would fail ease-of-translation if we used gettext, but we don't ;)
Overall a pretty slick solution!
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org