1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[curl] Allow to set outgoing interface

Command line option "bind-address" is reused for it.
This commit is contained in:
Witold Filipczyk 2024-11-19 12:09:00 +01:00
parent a6ad697fe4
commit 27af8266a4
2 changed files with 9 additions and 0 deletions

View File

@ -513,6 +513,10 @@ do_ftpes(struct connection *conn)
curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, (curl_off_t)get_opt_long("protocol.ftp.curl_max_recv_speed", NULL));
curl_easy_setopt(curl, CURLOPT_MAX_SEND_SPEED_LARGE, (curl_off_t)get_opt_long("protocol.ftp.curl_max_send_speed", NULL));
char *interface = get_cmd_opt_str("bind-address");
if (interface && *interface) {
curl_easy_setopt(curl, CURLOPT_INTERFACE, interface);
}
//curl_easy_setopt(curl, CURLOPT_XFERINFODATA, conn);
//curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, progress_callback);

View File

@ -207,6 +207,11 @@ do_http(struct connection *conn)
curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, (curl_off_t)get_opt_long("protocol.http.curl_max_recv_speed", NULL));
curl_easy_setopt(curl, CURLOPT_MAX_SEND_SPEED_LARGE, (curl_off_t)get_opt_long("protocol.http.curl_max_send_speed", NULL));
char *interface = get_cmd_opt_str("bind-address");
if (interface && *interface) {
curl_easy_setopt(curl, CURLOPT_INTERFACE, interface);
}
if (conn->uri->protocol == PROTOCOL_HTTPS) {
char *ciphers = get_opt_str("protocol.https.curl_tls13_ciphers", NULL);