--- /dev/null
+charon.plugins.curl.redir = -1
+ Maximum number of redirects followed by the plugin, set to 0 to disable
+ following redirects, set to -1 for no limit.
* Timeout for a transfer
*/
long timeout;
+
+ /**
+ * Maximum number of redirects to follow
+ */
+ long redir;
};
/**
curl_easy_setopt(this->curl, CURLOPT_TIMEOUT, this->timeout);
}
curl_easy_setopt(this->curl, CURLOPT_CONNECTTIMEOUT, CONNECT_TIMEOUT);
+ curl_easy_setopt(this->curl, CURLOPT_FOLLOWLOCATION, TRUE);
+ curl_easy_setopt(this->curl, CURLOPT_MAXREDIRS, this->redir);
curl_easy_setopt(this->curl, CURLOPT_WRITEFUNCTION, (void*)curl_cb);
curl_easy_setopt(this->curl, CURLOPT_WRITEDATA, &data);
if (this->headers)
},
.curl = curl_easy_init(),
.cb = fetcher_default_callback,
+ .redir = lib->settings->get_int(lib->settings, "%s.plugins.curl.redir",
+ -1, lib->ns),
);
if (!this->curl)