diff options
author | Tatsuya Kinoshita <tats@vega.ocn.ne.jp> | 2011-05-04 07:24:02 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@vega.ocn.ne.jp> | 2011-05-04 07:24:02 +0000 |
commit | d6d37ee0c991ead2b1613c0af242d2e603313d87 (patch) | |
tree | f54ef4313b0db75941e44bf480c5b9edfa16e208 /url.c | |
parent | Releasing debian version 0.5.1-5.1 (diff) | |
download | w3m-debian/0.5.2-1.tar.gz w3m-debian/0.5.2-1.zip |
Releasing debian version 0.5.2-1debian/0.5.2-1
Diffstat (limited to 'url.c')
-rw-r--r-- | url.c | 23 |
1 files changed, 14 insertions, 9 deletions
@@ -1,10 +1,14 @@ -/* $Id: url.c,v 1.93 2006/05/29 12:54:26 inu Exp $ */ +/* $Id: url.c,v 1.95 2007/05/23 15:06:06 inu Exp $ */ #include "fm.h" +#ifndef __MINGW32_VERSION #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <netdb.h> +#else +#include <winsock.h> +#endif /* __MINGW32_VERSION */ #include <signal.h> #include <setjmp.h> @@ -31,6 +35,11 @@ #define write(a,b,c) write_s(a,b,c) #endif /* __WATT32__ */ +#ifdef __MINGW32_VERSION +#define write(a,b,c) send(a,b,c, 0) +#define close(fd) closesocket(fd) +#endif + #ifdef INET6 /* see rc.c, "dns_order" and dnsorders[] */ int ai_family_order_table[7][3] = { @@ -1694,9 +1703,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 +1712,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 +1725,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); |