search for: script_headers

Displaying 2 results from an estimated 2 matches for "script_headers".

2020 Jul 14
3
[PATCH nbdkit RFC 0/2] curl: Implement authorization scripts.
This is an RFC only, at the very least it lacks tests. This implements a rather complex new feature in nbdkit-curl-plugin allowing you to specify an external shell script that can be used to fetch an authorization token for services which requires a token or cookie for access, especially if that token must be renewed periodically. The motivation can be seen in the changes to the docs in patch 2.
2020 Jul 14
0
[PATCH nbdkit RFC 2/2] curl: Implement authorization scripts.
...c pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; + +/* Last time auth-script was run. */ +static time_t last = 0; +static bool auth_script_has_run = false; + +/* List of extra headers and cookies from the output of auth-script. */ +DEFINE_VECTOR_TYPE(string_vector, char *); +static string_vector script_headers = empty_vector; +static string_vector script_cookies = empty_vector; + +/* Called from plugin curl_unload(). */ +void +auth_script_unload (void) +{ + string_vector_iter (&script_headers, (void *) free); + string_vector_iter (&script_cookies, (void *) free); + free (script_headers.ptr); +...