From 6db339b3d7a391f196e7c4b725a4ed0bd00f31cf Mon Sep 17 00:00:00 2001 From: Tatsuya Kinoshita Date: Wed, 4 May 2011 16:23:02 +0900 Subject: Adding upstream version 0.5.2 --- url.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'url.c') diff --git a/url.c b/url.c index 9d8c5df..4faafce 100644 --- a/url.c +++ b/url.c @@ -1,10 +1,14 @@ -/* $Id: url.c,v 1.89 2004/04/16 18:47:19 ukai Exp $ */ +/* $Id: url.c,v 1.95 2007/05/23 15:06:06 inu Exp $ */ #include "fm.h" +#ifndef __MINGW32_VERSION #include #include #include #include #include +#else +#include +#endif /* __MINGW32_VERSION */ #include #include @@ -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] = { @@ -1453,7 +1462,8 @@ init_stream(URLFile *uf, int scheme, InputStream stream) uf->scheme = scheme; uf->encoding = ENC_7BIT; uf->is_cgi = FALSE; - uf->compression = 0; + uf->compression = CMP_NOCOMPRESS; + uf->content_encoding = CMP_NOCOMPRESS; uf->guess_type = NULL; uf->ext = NULL; uf->modtime = -1; @@ -1526,12 +1536,12 @@ openURL(char *url, ParsedURL *pu, ParsedURL *current, /* local CGI: POST */ uf.stream = newFileStream(localcgi_post(pu->real_file, pu->query, request, option->referer), - (void (*)())pclose); + (void (*)())fclose); else /* lodal CGI: GET */ uf.stream = newFileStream(localcgi_get(pu->real_file, pu->query, option->referer), - (void (*)())pclose); + (void (*)())fclose); if (uf.stream) { uf.is_cgi = TRUE; uf.scheme = pu->scheme = SCM_LOCAL_CGI; @@ -1693,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 @@ -1703,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) @@ -1717,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); -- cgit v1.2.3