commit 3f79023e4744d86c5faf14a194208dfb4ceff3be
parent 5c6f94a0f64f08e8189a8b65b4166590310fd525
Author: inu <inu>
Date: Fri, 7 Apr 2006 15:48:56 +0000
Introduce option show_cookie and set it TRUE by default.
Diffstat:
4 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,6 +1,12 @@
2006-04-07 Dai Sato <satodai@w3m.jp>
* [w3m-dev-en 01060] Some patches
+ * file.c, fm.h, rc.c: Introduce option show_cookie and set it TRUE by default. If set to FALSE received cookies will not be shown.
+ * This fixes Debian bug #253547: w3m: Too slow receiving cookies.
+
+2006-04-07 Dai Sato <satodai@w3m.jp>
+
+ * [w3m-dev-en 01060] Some patches
* parsetagx.c: Replace '\n' (newline) with ' ' (space) in attributes of html tags instead of ignoring them.
* Fixes Debian bug #326167: w3m: new lines in hidden form fields are stripped
diff --git a/file.c b/file.c
@@ -836,13 +836,15 @@ readHeader(URLFile *uf, Buffer *newBuf, int thru, ParsedURL *pu)
}
if (pu && name->length > 0) {
int err;
- if (flag & COO_SECURE)
- disp_message_nsec("Received a secured cookie", FALSE, 1,
+ if (show_cookie) {
+ if (flag & COO_SECURE)
+ disp_message_nsec("Received a secured cookie", FALSE, 1,
TRUE, FALSE);
- else
- disp_message_nsec(Sprintf("Received cookie: %s=%s",
+ else
+ disp_message_nsec(Sprintf("Received cookie: %s=%s",
name->ptr, value->ptr)->ptr,
FALSE, 1, TRUE, FALSE);
+ }
err =
add_cookie(pu, name, value, expires, domain, path, flag,
comment, version, port, commentURL);
@@ -874,10 +876,12 @@ readHeader(URLFile *uf, Buffer *newBuf, int thru, ParsedURL *pu)
emsg =
"This cookie was rejected to prevent security violation.";
record_err_message(emsg);
- disp_message_nsec(emsg, FALSE, 1, TRUE, FALSE);
+ if (show_cookie)
+ disp_message_nsec(emsg, FALSE, 1, TRUE, FALSE);
}
else
- disp_message_nsec(Sprintf
+ if (show_cookie)
+ disp_message_nsec(Sprintf
("Accepting invalid cookie: %s=%s",
name->ptr, value->ptr)->ptr, FALSE,
1, TRUE, FALSE);
diff --git a/fm.h b/fm.h
@@ -1076,6 +1076,7 @@ global MouseAction mouse_action;
#ifdef USE_COOKIE
global int default_use_cookie init(TRUE);
global int use_cookie init(FALSE);
+global int show_cookie init(TRUE);
global int accept_cookie init(FALSE);
#define ACCEPT_BAD_COOKIE_DISCARD 0
#define ACCEPT_BAD_COOKIE_ACCEPT 1
diff --git a/rc.c b/rc.c
@@ -192,6 +192,7 @@ static int OptionEncode = FALSE;
#endif /* USE_SSL */
#ifdef USE_COOKIE
#define CMT_USECOOKIE N_("Enable cookie processing")
+#define CMT_SHOWCOOKIE N_("Print a message when receiving a cookie")
#define CMT_ACCEPTCOOKIE N_("Accept cookies")
#define CMT_ACCEPTBADCOOKIE N_("Action to be taken on invalid cookie")
#define CMT_COOKIE_REJECT_DOMAINS N_("Domains to reject cookies from")
@@ -552,6 +553,8 @@ struct param_ptr params7[] = {
#ifdef USE_COOKIE
struct param_ptr params8[] = {
{"use_cookie", P_INT, PI_ONOFF, (void *)&use_cookie, CMT_USECOOKIE, NULL},
+ {"show_cookie", P_INT, PI_ONOFF, (void *)&show_cookie,
+ CMT_SHOWCOOKIE, NULL},
{"accept_cookie", P_INT, PI_ONOFF, (void *)&accept_cookie,
CMT_ACCEPTCOOKIE, NULL},
{"accept_bad_cookie", P_INT, PI_SEL_C, (void *)&accept_bad_cookie,