130 |
} |
} |
131 |
|
|
132 |
static void curl_set_proxy(CURL *curl, proxy_t *proxy) { |
static void curl_set_proxy(CURL *curl, proxy_t *proxy) { |
133 |
if(proxy) { |
if(proxy && proxy->host) { |
134 |
if(proxy->ignore_hosts) |
if(proxy->ignore_hosts) |
135 |
printf("WARNING: Proxy \"ignore_hosts\" unsupported!\n"); |
printf("WARNING: Proxy \"ignore_hosts\" unsupported!\n"); |
136 |
|
|
139 |
curl_easy_setopt(curl, CURLOPT_PROXY, proxy->host); |
curl_easy_setopt(curl, CURLOPT_PROXY, proxy->host); |
140 |
curl_easy_setopt(curl, CURLOPT_PROXYPORT, proxy->port); |
curl_easy_setopt(curl, CURLOPT_PROXYPORT, proxy->port); |
141 |
|
|
142 |
if(proxy->use_authentication) { |
if(proxy->use_authentication && |
143 |
|
proxy->authentication_user && proxy->authentication_password) { |
144 |
printf("gcvote: use auth for user %s\n", proxy->authentication_user); |
printf("gcvote: use auth for user %s\n", proxy->authentication_user); |
145 |
|
|
146 |
char *cred = g_strdup_printf("%s:%s", |
char *cred = g_strdup_printf("%s:%s", |
157 |
void gcvote_request_free(gcvote_request_t *request) { |
void gcvote_request_free(gcvote_request_t *request) { |
158 |
/* decrease refcount and only free structure if no references are left */ |
/* decrease refcount and only free structure if no references are left */ |
159 |
request->refcount--; |
request->refcount--; |
160 |
if(request->refcount) { |
if(request->refcount > 0) { |
161 |
printf("gcvote: still %d references, keeping request\n", |
printf("gcvote: still %d references, keeping request\n", |
162 |
request->refcount); |
request->refcount); |
163 |
return; |
return; |