mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-17 18:45:10 +00:00
Merge remote branch 'origin/master' into lua-config
Conflicts: src/conky.cc
This commit is contained in:
commit
ef24f62412
@ -258,7 +258,7 @@ int apcupsd_scan_arg(const char *arg)
|
||||
if (sscanf(arg, "%63s %d", host, &port) != 2)
|
||||
return 1;
|
||||
|
||||
apcupsd.port = htons(port);
|
||||
apcupsd.port = port;
|
||||
strncpy(apcupsd.host, host, sizeof(apcupsd.host));
|
||||
return 0;
|
||||
}
|
||||
|
@ -105,7 +105,6 @@ void ccurl_fetch_data(thread_handle &handle, const ccurl_location_ptr &curloc)
|
||||
chunk.memory = NULL;
|
||||
chunk.size = 0;
|
||||
|
||||
if (curl_global_init(CURL_GLOBAL_ALL) == 0) {
|
||||
curl = curl_easy_init();
|
||||
if (curl) {
|
||||
DBGP("reading curl data from '%s'", curloc->uri);
|
||||
@ -132,8 +131,6 @@ void ccurl_fetch_data(thread_handle &handle, const ccurl_location_ptr &curloc)
|
||||
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
curl_global_cleanup();
|
||||
}
|
||||
}
|
||||
|
||||
void ccurl_thread(thread_handle &handle, const ccurl_location_ptr &curloc);
|
||||
|
12
src/conky.cc
12
src/conky.cc
@ -71,6 +71,9 @@
|
||||
#if defined BUILD_WEATHER_XOAP || defined BUILD_RSS
|
||||
#include <libxml/parser.h>
|
||||
#endif
|
||||
#ifdef BUILD_CURL
|
||||
#include <curl/curl.h>
|
||||
#endif
|
||||
|
||||
/* local headers */
|
||||
#include "core.h"
|
||||
@ -3190,6 +3193,11 @@ int main(int argc, char **argv)
|
||||
g_signal_pending = 0;
|
||||
clear_net_stats();
|
||||
|
||||
#ifdef BUILD_CURL
|
||||
if(curl_global_init(CURL_GLOBAL_ALL))
|
||||
NORM_ERR("curl_global_init() failed, you may not be able to use curl variables");
|
||||
#endif
|
||||
|
||||
/* handle command line parameters that don't change configs */
|
||||
#ifdef BUILD_X11
|
||||
if (!setlocale(LC_CTYPE, "")) {
|
||||
@ -3337,6 +3345,10 @@ int main(int argc, char **argv)
|
||||
|
||||
main_loop();
|
||||
|
||||
#ifdef BUILD_CURL
|
||||
curl_global_cleanup();
|
||||
#endif
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
kvm_close(kd);
|
||||
#endif
|
||||
|
21
src/mail.cc
21
src/mail.cc
@ -698,6 +698,12 @@ static void imap_thread(thread_handle &handle, struct mail_s *mail)
|
||||
int res;
|
||||
fd_set fdset;
|
||||
|
||||
if (fail > 0) {
|
||||
NORM_ERR("Trying IMAP connection again for %s@%s (try %u/%u)",
|
||||
mail->user, mail->host, fail + 1, mail->retries);
|
||||
resolved_host = 0; /* force us to resolve the hostname again */
|
||||
sleep(fail); /* sleep more for the more failures we have */
|
||||
}
|
||||
if (!resolved_host) {
|
||||
memset(&hints, 0, sizeof(struct addrinfo));
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
@ -714,10 +720,6 @@ static void imap_thread(thread_handle &handle, struct mail_s *mail)
|
||||
}
|
||||
resolved_host = 1;
|
||||
}
|
||||
if (fail > 0) {
|
||||
NORM_ERR("Trying IMAP connection again for %s@%s (try %u/%u)",
|
||||
mail->user, mail->host, fail + 1, mail->retries);
|
||||
}
|
||||
do {
|
||||
for (rp = ai; rp != NULL; rp = rp->ai_next) {
|
||||
sockfd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol);
|
||||
@ -1041,6 +1043,13 @@ static void pop3_thread(thread_handle &handle, struct mail_s *mail)
|
||||
struct timeval fetchtimeout;
|
||||
int res;
|
||||
fd_set fdset;
|
||||
|
||||
if (fail > 0) {
|
||||
NORM_ERR("Trying POP3 connection again for %s@%s (try %u/%u)",
|
||||
mail->user, mail->host, fail + 1, mail->retries);
|
||||
resolved_host = 0; /* force us to resolve the hostname again */
|
||||
sleep(fail); /* sleep more for the more failures we have */
|
||||
}
|
||||
if (!resolved_host) {
|
||||
memset(&hints, 0, sizeof(struct addrinfo));
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
@ -1056,10 +1065,6 @@ static void pop3_thread(thread_handle &handle, struct mail_s *mail)
|
||||
break;
|
||||
}
|
||||
resolved_host = 1;
|
||||
}
|
||||
if (fail > 0) {
|
||||
NORM_ERR("Trying POP3 connection again for %s@%s (try %u/%u)",
|
||||
mail->user, mail->host, fail + 1, mail->retries);
|
||||
}
|
||||
do {
|
||||
for (rp = ai; rp != NULL; rp = rp->ai_next) {
|
||||
|
Loading…
Reference in New Issue
Block a user