Displaying 6 results from an estimated 6 matches for "do_scripts".
2023 Feb 22
1
[PATCH nbdkit] curl: Try to share as much as possible between handles in the pool
...ldefs.h
@@ -117,9 +117,10 @@ struct curl_handle {
};
/* pool.c */
+extern void load_pool (void);
+extern void unload_pool (void);
extern struct curl_handle *get_handle (void);
extern void put_handle (struct curl_handle *ch);
-extern void free_all_handles (void);
/* scripts.c */
extern int do_scripts (struct curl_handle *ch);
diff --git a/plugins/curl/curl.c b/plugins/curl/curl.c
index b5927b5b4..b8624a6f8 100644
--- a/plugins/curl/curl.c
+++ b/plugins/curl/curl.c
@@ -101,6 +101,8 @@ curl_load (void)
nbdkit_error ("libcurl initialization failed: %d", (int) r);
exit (EXIT_FAI...
2020 Jul 15
0
[PATCH nbdkit v2] curl: Implement header and cookie scripts.
...-connection handle. */
+struct curl_handle {
+ CURL *c;
+ bool accept_range;
+ int64_t exportsize;
+ char errbuf[CURL_ERROR_SIZE];
+ char *write_buf;
+ uint32_t write_count;
+ const char *read_buf;
+ uint32_t read_count;
+ struct curl_slist *headers_copy;
+};
+
+/* scripts.c */
+extern int do_scripts (struct curl_handle *h);
+extern void scripts_unload (void);
+
+#endif /* NBDKIT_CURLDEFS_H */
diff --git a/plugins/curl/curl.c b/plugins/curl/curl.c
index 50eef1a8..8731a506 100644
--- a/plugins/curl/curl.c
+++ b/plugins/curl/curl.c
@@ -48,9 +48,11 @@
#include <nbdkit-plugin.h>
-#includ...
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.
2023 Feb 22
2
[PATCH nbdkit] curl: Try to share as much as possible between handles in the pool
I'm mainly posting this to the list as a back-up. It does work, it
does _not_ improve performance in any noticable way. However I'm
having lots of trouble getting HTTP/2 to work (with or without this
patch) and that's stopping me from testing anything properly.
Rich.
2023 Feb 22
1
[PATCH nbdkit] curl: Try to share as much as possible between handles in the pool
...};
>
> /* pool.c */
> +extern void load_pool (void);
> +extern void unload_pool (void);
> extern struct curl_handle *get_handle (void);
> extern void put_handle (struct curl_handle *ch);
> -extern void free_all_handles (void);
>
> /* scripts.c */
> extern int do_scripts (struct curl_handle *ch);
> diff --git a/plugins/curl/curl.c b/plugins/curl/curl.c
> index b5927b5b4..b8624a6f8 100644
> --- a/plugins/curl/curl.c
> +++ b/plugins/curl/curl.c
> @@ -101,6 +101,8 @@ curl_load (void)
> nbdkit_error ("libcurl initialization failed: %d",...
2020 Jul 20
1
Re: [PATCH nbdkit v2] curl: Implement header and cookie scripts.
...es sense.
> @@ -450,7 +490,11 @@ curl_open (int readonly)
>
> /* Get the file size and also whether the remote HTTP server
> * supports byte ranges.
> + *
> + * We must run the scripts if necessary and set headers in the
> + * handle.
> */
> + if (do_scripts (h) == -1) goto err;
Okay, code matches my guess above - you DO check on each client
interaction, and run the script as-needed, rather than kicking off a
background thread that runs the script on a blind timeout cycle.
> +++ b/plugins/curl/scripts.c
> +
> + /* Set headers and cookies...