links

lynx-like text mode web browser
git clone anongit@rnpnr.xyz:links.git
Log | Files | Refs | Feed | README | LICENSE

Commit: 610e1ab18922fab1d0059a5adcc7ab00fe4cd6c7
Parent: 52f7302d357d81efc5af0f7a8651b215fe120904
Author: opask
Date:   Thu,  9 Aug 2018 04:41:17 -0600

cleanup unused http header options

Diffstat:
Mdefault.c | 5+----
Mlinks.h | 9---------
Mmenu.c | 67++++++++++++++++---------------------------------------------------
3 files changed, 17 insertions(+), 64 deletions(-)

diff --git a/default.c b/default.c @@ -1534,7 +1534,7 @@ struct proxies proxies = { "", "", "", "", "", "", 0 }; struct ssl_options ssl_options = { SSL_WARN_ON_INVALID_CERTIFICATE, 0, "", "", "" }; -struct http_options http_options = { 0, 1, 1, 0, 0, 0, 0, { 0, 0, REFERER_REAL_SAME_SERVER, "", "", "" } }; +struct http_options http_options = { 0, 1, 1, 0, 0, 0, 0, { 0, "", "" } }; struct ftp_options ftp_options = { "somebody@host.domain", 0, 0, 0, 1 }; struct smb_options smb_options = { 0 }; @@ -1662,9 +1662,6 @@ static struct option links_options[] = { {1, gen_cmd, num_rd, num_wr, 0, 1, &http_options.no_compression, "http_bugs.no_compression", "http-bugs.no-compression"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &http_options.retry_internal_errors, "http_bugs.retry_internal_errors", "http-bugs.retry-internal-errors"}, {1, gen_cmd, num_rd, num_wr, 0, 1, &http_options.header.fake_firefox, "fake_firefox", "http.fake-firefox"}, - {1, gen_cmd, num_rd, num_wr, 0, 1, &http_options.header.do_not_track, "http_do_not_track", "http.do-not-track"}, - {1, gen_cmd, num_rd, num_wr, 0, 4, &http_options.header.referer, "http_referer", "http.referer"}, - {1, gen_cmd, str_rd, str_wr, 0, MAX_STR_LEN, &http_options.header.fake_referer, "fake_referer", "http.fake-referer"}, {1, gen_cmd, str_rd, str_wr, 0, MAX_STR_LEN, &http_options.header.fake_useragent, "fake_useragent", "http.fake-user-agent"}, {1, gen_cmd, str_rd, str_wr, 0, MAX_STR_LEN, &http_options.header.extra_header, "http.extra_header", "http.extra-header"}, {1, gen_cmd, str_rd, str_wr, 0, MAX_STR_LEN, ftp_options.anon_pass, "ftp.anonymous_password", "ftp.anonymous-password"}, diff --git a/links.h b/links.h @@ -3554,12 +3554,6 @@ struct ipv6_options { extern struct ipv6_options ipv6_options; -#define REFERER_NONE 0 -#define REFERER_SAME_URL 1 -#define REFERER_FAKE 2 -#define REFERER_REAL 3 -#define REFERER_REAL_SAME_SERVER 4 - struct proxies { unsigned char http_proxy[MAX_STR_LEN]; unsigned char ftp_proxy[MAX_STR_LEN]; @@ -3588,9 +3582,6 @@ extern struct ssl_options ssl_options; struct http_header_options { int fake_firefox; - int do_not_track; - int referer; - unsigned char fake_referer[MAX_STR_LEN]; unsigned char fake_useragent[MAX_STR_LEN]; unsigned char extra_header[MAX_STR_LEN]; }; diff --git a/menu.c b/menu.c @@ -1261,8 +1261,6 @@ void reset_settings_for_tor(void) http_options.no_accept_charset = 0; http_options.no_compression = 0; http_options.retry_internal_errors = 0; - http_options.header.do_not_track = 0; - http_options.header.referer = proxies.only_proxies ? REFERER_NONE : REFERER_REAL_SAME_SERVER; http_options.header.extra_header[0] = 0; ftp_options.eprt_epsv = 0; @@ -1671,7 +1669,7 @@ static unsigned char * const http_labels[] = { TEXT_(T_USE_HTTP_10), TEXT_(T_ALL TEXT_(T_DO_NOT_ADVERTISE_COMPRESSION_SUPPORT), TEXT_(T_RETRY_ON_INTERNAL_ERRORS), NULL }; -static unsigned char * const http_header_labels[] = { TEXT_(T_FAKE_FIREFOX), TEXT_(T_DO_NOT_TRACK), TEXT_(T_REFERER_NONE), TEXT_(T_REFERER_SAME_URL), TEXT_(T_REFERER_FAKE), TEXT_(T_REFERER_REAL_SAME_SERVER), TEXT_(T_REFERER_REAL), TEXT_(T_FAKE_REFERER), TEXT_(T_FAKE_USERAGENT), TEXT_(T_EXTRA_HEADER), NULL }; +static unsigned char * const http_header_labels[] = { TEXT_(T_FAKE_FIREFOX), TEXT_(T_FAKE_USERAGENT), TEXT_(T_EXTRA_HEADER), NULL }; static void httpheadopt_fn(struct dialog_data *dlg) { @@ -1733,54 +1731,21 @@ static int dlg_http_header_options(struct dialog_data *dlg, struct dialog_item_d d->items[0].gid = 0; d->items[0].dlen = sizeof(int); d->items[0].data = (void *)&header->fake_firefox; - d->items[1].type = D_CHECKBOX; - d->items[1].gid = 0; - d->items[1].dlen = sizeof(int); - d->items[1].data = (void *)&header->do_not_track; - d->items[2].type = D_CHECKBOX; - d->items[2].gid = 1; - d->items[2].gnum = REFERER_NONE; - d->items[2].dlen = sizeof(int); - d->items[2].data = (void *)&header->referer; - d->items[3].type = D_CHECKBOX; - d->items[3].gid = 1; - d->items[3].gnum = REFERER_SAME_URL; - d->items[3].dlen = sizeof(int); - d->items[3].data = (void *)&header->referer; - d->items[4].type = D_CHECKBOX; - d->items[4].gid = 1; - d->items[4].gnum = REFERER_FAKE; - d->items[4].dlen = sizeof(int); - d->items[4].data = (void *)&header->referer; - d->items[5].type = D_CHECKBOX; - d->items[5].gid = 1; - d->items[5].gnum = REFERER_REAL_SAME_SERVER; - d->items[5].dlen = sizeof(int); - d->items[5].data = (void *)&header->referer; - d->items[6].type = D_CHECKBOX; - d->items[6].gid = 1; - d->items[6].gnum = REFERER_REAL; - d->items[6].dlen = sizeof(int); - d->items[6].data = (void *)&header->referer; - - d->items[7].type = D_FIELD; - d->items[7].dlen = MAX_STR_LEN; - d->items[7].data = header->fake_referer; - d->items[8].type = D_FIELD; - d->items[8].dlen = MAX_STR_LEN; - d->items[8].data = header->fake_useragent; - d->items[9].type = D_FIELD; - d->items[9].dlen = MAX_STR_LEN; - d->items[9].data = header->extra_header; - d->items[10].type = D_BUTTON; - d->items[10].gid = B_ENTER; - d->items[10].fn = ok_dialog; - d->items[10].text = TEXT_(T_OK); - d->items[11].type = D_BUTTON; - d->items[11].gid = B_ESC; - d->items[11].fn = cancel_dialog; - d->items[11].text = TEXT_(T_CANCEL); - d->items[12].type = D_END; + d->items[1].type = D_FIELD; + d->items[1].dlen = MAX_STR_LEN; + d->items[1].data = header->fake_useragent; + d->items[2].type = D_FIELD; + d->items[2].dlen = MAX_STR_LEN; + d->items[2].data = header->extra_header; + d->items[3].type = D_BUTTON; + d->items[3].gid = B_ENTER; + d->items[3].fn = ok_dialog; + d->items[3].text = TEXT_(T_OK); + d->items[4].type = D_BUTTON; + d->items[4].gid = B_ESC; + d->items[4].fn = cancel_dialog; + d->items[4].text = TEXT_(T_CANCEL); + d->items[5].type = D_END; do_dialog(dlg->win->term, d, getml(d, NULL)); return 0; }