Check-in [aeafbabd54]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Increase timeout on connections, allow self signed https
Timelines: family | ancestors | trunk
Files: files | file ages | folders
SHA1: aeafbabd544df45ae64fe1e997cd4fd9b08b603d
User & Date: bapt 2015-01-19 10:38:16
Context
2015-01-19
10:38
Increase timeout on connections, allow self signed https Leaf check-in: aeafbabd54 user: bapt tags: trunk
2014-06-16
23:07
Set a default timeout check-in: 8f1dcd5982 user: bapt tags: trunk
Changes

Changes to cplanet.c.

442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457


458
459
460
461
462
463
464
	}

	curl_global_init(CURL_GLOBAL_ALL);
	if ((curl = curl_easy_init()) == NULL)
		errx(1, "Unable to initalise curl");

	curl_easy_setopt(curl, CURLOPT_URL, url);
	curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 10);
	curl_easy_setopt(curl, CURLOPT_HEADER, 0);
	curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
	curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
	curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_to_buffer);
	curl_easy_setopt(curl, CURLOPT_WRITEDATA, rawfeed);
	curl_easy_setopt(curl, CURLOPT_USERAGENT, "cplanet/"CPLANET_VERSION);
	curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING, "gzip");
	curl_easy_setopt(curl, CURLOPT_TIMEOUT, 400);



	res = curl_easy_perform(curl);

	if (res != CURLE_OK || utstring_len(rawfeed) == 0) {
		curl_easy_cleanup(curl);
		warnx("An error occured while fetching %s: %s", url, curl_easy_strerror(res));
		free(feed.xmlpath->data);







|








>
>







442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
	}

	curl_global_init(CURL_GLOBAL_ALL);
	if ((curl = curl_easy_init()) == NULL)
		errx(1, "Unable to initalise curl");

	curl_easy_setopt(curl, CURLOPT_URL, url);
	curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 30);
	curl_easy_setopt(curl, CURLOPT_HEADER, 0);
	curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
	curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
	curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_to_buffer);
	curl_easy_setopt(curl, CURLOPT_WRITEDATA, rawfeed);
	curl_easy_setopt(curl, CURLOPT_USERAGENT, "cplanet/"CPLANET_VERSION);
	curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING, "gzip");
	curl_easy_setopt(curl, CURLOPT_TIMEOUT, 400);
	curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0);
	curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0);

	res = curl_easy_perform(curl);

	if (res != CURLE_OK || utstring_len(rawfeed) == 0) {
		curl_easy_cleanup(curl);
		warnx("An error occured while fetching %s: %s", url, curl_easy_strerror(res));
		free(feed.xmlpath->data);