search for: curl_easy_setopt

Displaying 20 results from an estimated 27 matches for "curl_easy_setopt".

2020 Jan 17
1
[PATCH nbdkit] Add cainfo and capath options to curl plugin
...tes.\n" \ "cookie=<COOKIE> Set HTTP/HTTPS cookies.\n" \ "password=<PASSWORD> The password for the user account.\n" \ "protocols=PROTO,PROTO,.. Limit protocols allowed.\n" \ @@ -369,6 +381,10 @@ curl_open (int readonly) curl_easy_setopt (h->c, CURLOPT_PROXYPASSWORD, proxy_password); if (cookie) curl_easy_setopt (h->c, CURLOPT_COOKIE, cookie); + if (cainfo) + curl_easy_setopt (h->c, CURLOPT_CAINFO, cainfo); + if (capath) + curl_easy_setopt (h->c, CURLOPT_CAPATH, capath); /* Get the file size and als...
2019 Sep 23
0
Re: [PATCH nbdkit v2] server: public: Add nbdkit_parse_* functions for safely parsing integers.
...> @@ -62,7 +62,7 @@ static const char *proxy_user = NULL; > static char *proxy_password = NULL; > static char *cookie = NULL; > static bool sslverify = true; > -static long timeout = 0; > +static uint32_t timeout = 0; > @@ -334,7 +336,7 @@ curl_open (int readonly) > curl_easy_setopt (h->c, CURLOPT_REDIR_PROTOCOLS, protocols); > } > if (timeout > 0) > - curl_easy_setopt (h->c, CURLOPT_TIMEOUT, timeout); > + curl_easy_setopt (h->c, CURLOPT_TIMEOUT, (long) timeout); I might have left a comment here (the cast is necessary because curl_easy_seto...
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.
2019 Sep 23
2
[PATCH nbdkit v2] server: public: Add nbdkit_parse_* functions for safely parsing integers.
...{ + if (nbdkit_parse_uint32_t ("timeout", value, &timeout) == -1) + return -1; + if (timeout < 0) { nbdkit_error ("'timeout' must be 0 or a positive timeout in seconds"); return -1; } @@ -334,7 +336,7 @@ curl_open (int readonly) curl_easy_setopt (h->c, CURLOPT_REDIR_PROTOCOLS, protocols); } if (timeout > 0) - curl_easy_setopt (h->c, CURLOPT_TIMEOUT, timeout); + curl_easy_setopt (h->c, CURLOPT_TIMEOUT, (long) timeout); if (!sslverify) { curl_easy_setopt (h->c, CURLOPT_SSL_VERIFYPEER, 0L); curl_easy_se...
2020 Jul 14
0
[PATCH nbdkit RFC 2/2] curl: Implement authorization scripts.
...*h) +{ + struct curl_slist *p; + size_t i; + + /* Curl does not save a copy of the headers passed to + * CURLOPT_HTTPHEADER so we have to store it in the handle ourselves + * and be careful to unset it in the Curl handle before we free the + * list. + */ + if (h->auth_headers) { + curl_easy_setopt (h->c, CURLOPT_HTTPHEADER, NULL); + curl_slist_free_all (h->auth_headers); + h->auth_headers = NULL; + } + + /* Copy the header=... parameters. */ + for (p = headers; p != NULL; p = p->next) { + h->auth_headers = curl_slist_append (h->auth_headers, p->data); + if...
2013 Oct 30
2
Re: Using certtool to generate certificates for ESXi
Hi Daniel, thanks for the reply - The procedure I use is the same as I use for XenServer, and the certificate exchange works just fine. The only thing I'm a bit unclear on, is the location of the CA cert, which in the case of XenServer, I simply put it in /etc/pki/CA. And when I start the libvirtd daemon, it successfully picks it up. If I put the Server key and cert in /etc/vmware/ssl for
2018 Dec 04
3
patch to support custom HTTP headers in download.file() and url()
...ma: no-cache"); + if (!tmp) { + curl_slist_free_all(headers); + error(_("out of memory")); + } + headers = tmp; } CURLM *mhnd = curl_multi_init(); @@ -521,8 +540,7 @@ in_do_curlDownload(SEXP call, SEXP op, SEXP args, SEXP rho) #if (LIBCURL_VERSION_MINOR >= 25) curl_easy_setopt(hnd[i], CURLOPT_TCP_KEEPALIVE, 1L); #endif - if (!cacheOK) - curl_easy_setopt(hnd[i], CURLOPT_HTTPHEADER, slist1); + curl_easy_setopt(hnd[i], CURLOPT_HTTPHEADER, headers); /* check that destfile can be written */ file = translateChar(STRING_ELT(sfile, i)); @@ -660,7 +678,7 @@ in_do_curlDow...
2019 Sep 23
2
Re: [PATCH nbdkit] server: public: Add nbdkit_parse_* functions for safely parsing integers.
...unsigned_long? Those differ between 32- and 64-bit platforms, at > which point, it's often better to explicitly call out the intended size. So I'll say why I added these. It may not be a good reason, but here goes :-) There are two external APIs we use which need long types, libcurl (curl_easy_setopt) and libssh (ssh_options_set). The existing parameters had type long (I don't think unsigned long is actually used) which we passed directly to one of these APIs. To use another type would involve a slightly awkward check + cast, with the danger that the code would break on the rarely tested...
2023 Feb 22
1
[PATCH nbdkit] curl: Try to share as much as possible between handles in the pool
...ee share data. */ + curl_share_cleanup (share); + + for (i = 0; i < ARRAY_SIZE (lockarray); ++i) + pthread_rwlock_destroy (&lockarray[i]); } /* Get a handle from the pool. @@ -221,6 +262,9 @@ allocate_handle (void) goto err; } + /* Share settings with other handles. */ + curl_easy_setopt (ch->c, CURLOPT_SHARE, share); + /* Various options we always set. * * NB: Both here and below constants must be explicitly long because @@ -519,3 +563,30 @@ free_handle (struct curl_handle *ch) curl_slist_free_all (ch->headers_copy); free (ch); } + +static void +lock_cb (...
2020 Jul 15
0
[PATCH nbdkit v2] curl: Implement header and cookie scripts.
...0,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; h->accept_range = false; curl_easy_setopt (h->c, CURLOPT_NOBODY, 1); /* No Body, not nobody! */ curl_easy_setopt (h->c, CURLOPT_HEADERFUNCTION, header_cb); @@ -608,6 +652,8 @@ curl_close (void *handle) struct curl_handle *h = handle; curl_easy_cleanup (h->c); + if (h->headers_copy) + curl_slist_free_all (h->he...
2011 Jul 19
1
Is libvirt supported on Citrix Xenserver?
...once I connect to virsh and give a 'quit' command I get&nbsp; "* glibc detected *** virsh: double free or corruption (fasttop):". Please find below the actual memory dump. &nbsp; Note: I have disabled the SSL certificate verification in xenapi_driver.c by&nbsp;setting curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0) &amp; curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0). &nbsp; &nbsp; [root at sharmila libvirt-0.9.2]# virsh -c "xenapi://localhost" Enter username for localhost: root Enter root's password for localhost: Welcome to virsh, the virtualiz...
2011 Apr 29
4
You don't check for malloc failure
...{ int len = strlen (client->username) + strlen (client->password) + 2; userpwd = malloc (len); + if (userpwd == NULL) { + abort(); + } snprintf (userpwd, len, "%s:%s", client->username, client->password); curl_easy_setopt (url->handle, CURLOPT_USERPWD, userpwd); } @@ -307,6 +310,9 @@ { int len = strlen (client->username) + strlen (client->password) + 2; userpwd = malloc (len); + if (userpwd == NULL) { + abort(); + } snprintf (u...
2020 Nov 16
1
help with "too many clients awaiting authentication"
Hello guys, Today we faced an unique problem. We have about 120 stations and we are reaching 40k simultaneous listeners monday/friday (~ 11 AM GMT -3). We also use url auth to log, audit and build audience reports. But today, at the end of the day we were about 10k simultaneous and listeners start get errors (403, busy, please try again later), and after digging, delete logs and restart
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.
2009 Aug 19
2
RGoogleDocs/RCurl through proxy
Dear list, I am trying to use RGoogleDocs, but I am connecting through a proxy server. I know RCurl is used for the connection, which should be able to deal with proxies and such. How do I set this up for RCurl? And can I use those settings with RGoogleDocs as well? I have the name of the proxy server and the port number. (Windows XP). thanks, Remko
2012 Oct 30
2
RCurl - curlPerform - Time out?!?
Hi, I am working with the RCurl package and I am using the curlPerform function for an soap-query. The problem is that the code is usually working well, but sometimes the connection gets lost. So I wrote a while-loop to repeat the query if anything might happened so that the same query runs again, but if the query-faults it takes a very long time for the repetition. My question is if there
2004 Aug 06
0
icecast2 ogg vorbis client request headers
...2 programs : /*****************************************************************************/ #include <stdio.h> #include <curl/curl.h> int main(void) { CURL *curl; CURLcode res; int i = 0; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://localhost:8500/test.html"); for (i=0;i<1000;i++) { res = curl_easy_perform(curl); if (res != 0) { fprintf(stderr, "Curl failed: %d\n", res);...
2004 Aug 06
3
icecast2 ogg vorbis client request headers
On Monday 05 April 2004 13:04, oddsock wrote: > At 07:41 PM 4/4/2004, you wrote: > >That was your plan. > > > >My plan is to provide what currently exists (htpasswd-like) and a 'script' > >authenticator which just calls an external program, as Geoff described. > > > >Both are, of course, possible. Your "URL call" (this is a very strange way
2012 Oct 10
0
[LLVMdev] Solicit code review (change to CodeGen)
LGTM. I will commit. On Oct 10, 2012, at 1:20 PM, Shuxin Yang <shuxin.llvm at gmail.com> wrote: > Hi, > > The attached is the fix to radar://11663049. The optimization can be outlined by following rules: > > (select (x != c), e, c) -> select (x != c), e, x), > (select (x == c), c, e) -> select (x == c), x, e) > where the <c> is an integer
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.