w3m

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/w3m.git/
Log | Files | Refs | README

commit 37ca47b3b60b965c500528fd3e16b224bfc47dfb
parent 03498644030bb2cfe97b1bf8447b7c162cabce4e
Author: inu <inu>
Date:   Sun, 10 Dec 2006 10:49:23 +0000

add LiveHTTPHeaders-like option: -reqlog.

Diffstat:
MChangeLog | 6++++++
Mfile.c | 6++----
Mfm.h | 2+-
Mmain.c | 7++++++-
Murl.c | 12++++--------
5 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -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 diff --git a/file.c b/file.c @@ -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); diff --git a/fm.h b/fm.h @@ -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 diff --git a/main.c b/main.c @@ -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(); } diff --git a/url.c b/url.c @@ -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);