diff options
author | Dai Sato <satodai@w3m.jp> | 2006-12-10 10:49:23 +0000 |
---|---|---|
committer | Dai Sato <satodai@w3m.jp> | 2006-12-10 10:49:23 +0000 |
commit | dd02a73fcf0ebfd09989ac04cde013ae4ff2cce6 (patch) | |
tree | 3c3b6588273a6e10a635861dd4f84085f1b4a9d3 | |
parent | mailcap.c (acceptableMimeTypes): change default accept: line (diff) | |
download | w3m-dd02a73fcf0ebfd09989ac04cde013ae4ff2cce6.tar.gz w3m-dd02a73fcf0ebfd09989ac04cde013ae4ff2cce6.zip |
add LiveHTTPHeaders-like option: -reqlog.
Diffstat (limited to '')
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | file.c | 8 | ||||
-rw-r--r-- | fm.h | 4 | ||||
-rw-r--r-- | main.c | 9 | ||||
-rw-r--r-- | url.c | 14 |
5 files changed, 24 insertions, 19 deletions
@@ -1,3 +1,9 @@ +2006-12-10 noz + + * [20051124052846@w3mbbs] LiveHTTPHeaders + * file.c, fm.h, main.c, url.c: add -reqlog option which makes + ~/.w3m/request.log like LiveHTTPHeaders of FireFox. + 2006-08-07 Fumitoshi UKAI <ukai@debian.or.jp> * mailcap.c (acceptableMimeTypes): change default accept: line @@ -8754,4 +8760,4 @@ a * [w3m-dev 03276] compile error on EWS4800 * release-0-2-1 * import w3m-0.2.1 -$Id: ChangeLog,v 1.969 2006/08/07 03:10:26 ukai Exp $ +$Id: ChangeLog,v 1.970 2006/12/10 10:49:23 inu Exp $ @@ -1,4 +1,4 @@ -/* $Id: file.c,v 1.246 2006/06/12 11:51:59 inu Exp $ */ +/* $Id: file.c,v 1.247 2006/12/10 10:49:23 inu Exp $ */ #include "fm.h" #include <sys/types.h> #include "myctype.h" @@ -614,14 +614,12 @@ readHeader(URLFile *uf, Buffer *newBuf, int thru, ParsedURL *pu) if (uf->scheme == SCM_NEWS && tmp->ptr[0] == '.') Strshrinkfirst(tmp, 1); #endif -#ifdef HTTP_DEBUG - { + if(w3m_reqlog){ FILE *ff; - ff = fopen("zzrequest", "a"); + ff = fopen(w3m_reqlog, "a"); Strfputs(tmp, ff); fclose(ff); } -#endif /* HTTP_DEBUG */ if (src) Strfputs(tmp, src); cleanup_line(tmp, HEADER_MODE); @@ -1,4 +1,4 @@ -/* $Id: fm.h,v 1.131 2006/04/08 11:33:16 inu Exp $ */ +/* $Id: fm.h,v 1.132 2006/12/10 10:49:23 inu Exp $ */ /* * w3m: WWW wo Miru utility * @@ -870,7 +870,7 @@ global DownloadList *LastDL init(NULL); global int CurrentKey; global char *CurrentKeyData; global char *CurrentCmdData; - +global char *w3m_reqlog; extern char *w3m_version; #define DUMP_BUFFER 0x01 @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.252 2006/05/29 12:42:22 inu Exp $ */ +/* $Id: main.c,v 1.253 2006/12/10 10:49:23 inu Exp $ */ #define MAINPROGRAM #include "fm.h" #include <signal.h> @@ -249,6 +249,7 @@ fusage(FILE * f, int err) fprintf(f, " -config file specify config file\n"); fprintf(f, " -help print this usage message\n"); fprintf(f, " -version print w3m version\n"); + fprintf(f, " -reqlog write request logfile\n"); fprintf(f, " -debug DO NOT USE\n"); if (show_params_p) show_params(f); @@ -725,8 +726,12 @@ main(int argc, char **argv, char **envp) else if (!strcmp("-dummy", argv[i])) { /* do nothing */ } - else if (!strcmp("-debug", argv[i])) + else if (!strcmp("-debug", argv[i])) { w3m_debug = TRUE; + } + else if (!strcmp("-reqlog",argv[i])) { + w3m_reqlog=rcFile("request.log"); + } else { usage(); } @@ -1,4 +1,4 @@ -/* $Id: url.c,v 1.93 2006/05/29 12:54:26 inu Exp $ */ +/* $Id: url.c,v 1.94 2006/12/10 10:49:23 inu Exp $ */ #include "fm.h" #include <sys/types.h> #include <sys/socket.h> @@ -1694,9 +1694,8 @@ openURL(char *url, ParsedURL *pu, ParsedURL *current, SSL_write(sslh, tmp->ptr, tmp->length); else write(sock, tmp->ptr, tmp->length); -#ifdef HTTP_DEBUG - { - FILE *ff = fopen("zzrequest", "a"); + if(w3m_reqlog){ + FILE *ff = fopen(w3m_reqlog, "a"); if (sslh) fputs("HTTPS: request via SSL\n", ff); else @@ -1704,7 +1703,6 @@ openURL(char *url, ParsedURL *pu, ParsedURL *current, fwrite(tmp->ptr, sizeof(char), tmp->length, ff); fclose(ff); } -#endif /* HTTP_DEBUG */ if (hr->command == HR_COMMAND_POST && request->enctype == FORM_ENCTYPE_MULTIPART) { if (sslh) @@ -1718,13 +1716,11 @@ openURL(char *url, ParsedURL *pu, ParsedURL *current, #endif /* USE_SSL */ { write(sock, tmp->ptr, tmp->length); -#ifdef HTTP_DEBUG - { - FILE *ff = fopen("zzrequest", "a"); + if(w3m_reqlog){ + FILE *ff = fopen(w3m_reqlog, "a"); fwrite(tmp->ptr, sizeof(char), tmp->length, ff); fclose(ff); } -#endif /* HTTP_DEBUG */ if (hr->command == HR_COMMAND_POST && request->enctype == FORM_ENCTYPE_MULTIPART) write_from_file(sock, request->body); |