search for: run_cookie_script

Displaying 3 results from an estimated 3 matches for "run_cookie_script".

2020 Jul 20
1
Re: [PATCH nbdkit v2] curl: Implement header and cookie scripts.
...led with the lock held when we must run or re-run the > + * header-script. > + */ > +static int > +run_header_script (struct curl_handle *h) > +{ > + > +/* This is called with the lock held when we must run or re-run the > + * 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 e...
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 15
0
[PATCH nbdkit v2] curl: Implement header and cookie scripts.
...d 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 request. + * + * Because the thread model is NBDKIT_THREAD_MODEL_SERIALIZE_REQUESTS + * we can be assured of exclusive access to curl_handle here. + */ +int +do_scripts (struct curl_handle *h) +{ + time_t now;...