search for: curl_handle

Displaying 9 results from an estimated 9 matches for "curl_handle".

2023 Feb 22
1
[PATCH nbdkit] curl: Try to share as much as possible between handles in the pool
...curl/pool.c | 75 +++++++++++++++++++++++++++++++++++++++-- 3 files changed, 78 insertions(+), 4 deletions(-) diff --git a/plugins/curl/curldefs.h b/plugins/curl/curldefs.h index c2a3432fc..d614379d0 100644 --- a/plugins/curl/curldefs.h +++ b/plugins/curl/curldefs.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...
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
...+++++++++++++++++++++++++-- > 3 files changed, 78 insertions(+), 4 deletions(-) > > diff --git a/plugins/curl/curldefs.h b/plugins/curl/curldefs.h > index c2a3432fc..d614379d0 100644 > --- a/plugins/curl/curldefs.h > +++ b/plugins/curl/curldefs.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 */ > ext...
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.
...n char *proxy_password; +extern const char *proxy_user; +extern bool sslverify; +extern bool tcp_keepalive; +extern bool tcp_nodelay; +extern uint32_t timeout; +extern const char *unix_socket_path; +extern const char *user; +extern const char *user_agent; + +/* The per-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 *auth_headers; +}; + +/* auth-script.c */ +extern int do_auth_script (struct curl_handle *h)...
2020 Jul 15
0
[PATCH nbdkit v2] curl: Implement header and cookie scripts.
...n char *proxy_password; +extern const char *proxy_user; +extern bool sslverify; +extern bool tcp_keepalive; +extern bool tcp_nodelay; +extern uint32_t timeout; +extern const char *unix_socket_path; +extern const char *user; +extern const char *user_agent; + +/* The per-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); +exter...
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 Jan 08
1
[nbdkit PATCH] curl: use CURLINFO_CONTENT_LENGTH_DOWNLOAD_T when available
...atic long protocols = CURLPROTO_ALL; /* Use '-D curl.verbose=1' to set. */ int curl_debug_verbose = 0; +#if CURL_AT_LEAST_VERSION(7, 55, 0) +#define HAVE_CURLINFO_CONTENT_LENGTH_DOWNLOAD_T +#endif + static void curl_load (void) { @@ -290,6 +294,9 @@ curl_open (int readonly) struct curl_handle *h; CURLcode r; double d; +#ifdef HAVE_CURLINFO_CONTENT_LENGTH_DOWNLOAD_T + curl_off_t o; +#endif h = calloc (1, sizeof *h); if (h == NULL) { @@ -377,6 +384,21 @@ curl_open (int readonly) goto err; } +#ifdef HAVE_CURLINFO_CONTENT_LENGTH_DOWNLOAD_T + r = curl_easy_getinfo (...
2020 Jul 20
1
Re: [PATCH nbdkit v2] curl: Implement header and cookie scripts.
...emory life cycles is very helpful (and I suspect you went through several iterations before figuring out an arrangement that works) > + > +/* This is called 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? &...