mirror of
https://github.com/rkd77/elinks.git
synced 2024-10-01 03:36:26 -04:00
[curl] send_cookies
This commit is contained in:
parent
235d998a6a
commit
2c978637f0
@ -34,6 +34,9 @@
|
|||||||
#include "elinks.h"
|
#include "elinks.h"
|
||||||
|
|
||||||
#include "cache/cache.h"
|
#include "cache/cache.h"
|
||||||
|
#ifdef CONFIG_COOKIES
|
||||||
|
#include "cookies/cookies.h"
|
||||||
|
#endif
|
||||||
#include "config/options.h"
|
#include "config/options.h"
|
||||||
#include "intl/libintl.h"
|
#include "intl/libintl.h"
|
||||||
#include "main/select.h"
|
#include "main/select.h"
|
||||||
@ -181,6 +184,7 @@ do_http(struct connection *conn)
|
|||||||
CURLMcode rc;
|
CURLMcode rc;
|
||||||
char *optstr;
|
char *optstr;
|
||||||
int no_verify = get_blacklist_flags(conn->uri) & SERVER_BLACKLIST_NO_CERT_VERIFY;
|
int no_verify = get_blacklist_flags(conn->uri) & SERVER_BLACKLIST_NO_CERT_VERIFY;
|
||||||
|
struct string *cookies;
|
||||||
|
|
||||||
http->easy = curl;
|
http->easy = curl;
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_fwrite);
|
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_fwrite);
|
||||||
@ -194,6 +198,17 @@ do_http(struct connection *conn)
|
|||||||
curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, my_fwrite_header);
|
curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, my_fwrite_header);
|
||||||
curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING, "");
|
curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING, "");
|
||||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L);
|
curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L);
|
||||||
|
/* set Referer: automatically when following redirects */
|
||||||
|
curl_easy_setopt(curl, CURLOPT_AUTOREFERER, 1L);
|
||||||
|
|
||||||
|
#ifdef CONFIG_COOKIES
|
||||||
|
cookies = send_cookies(conn->uri);
|
||||||
|
|
||||||
|
if (cookies) {
|
||||||
|
curl_easy_setopt(curl, CURLOPT_COOKIE, cookies->source);
|
||||||
|
done_string(cookies);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (auth) {
|
if (auth) {
|
||||||
curl_easy_setopt(curl, CURLOPT_USERNAME, auth->user);
|
curl_easy_setopt(curl, CURLOPT_USERNAME, auth->user);
|
||||||
|
Loading…
Reference in New Issue
Block a user