From dd02a73fcf0ebfd09989ac04cde013ae4ff2cce6 Mon Sep 17 00:00:00 2001 From: Dai Sato Date: Sun, 10 Dec 2006 10:49:23 +0000 Subject: add LiveHTTPHeaders-like option: -reqlog. --- url.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'url.c') diff --git a/url.c b/url.c index 86c2d47..61d5168 100644 --- a/url.c +++ b/url.c @@ -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 #include @@ -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); -- cgit v1.2.3