diff --git a/libhtmlw/HTML-PSformat.c b/libhtmlw/HTML-PSformat.c index b484afb..fa12f89 100644 --- a/libhtmlw/HTML-PSformat.c +++ b/libhtmlw/HTML-PSformat.c @@ -41,7 +41,7 @@ * permission of John Bradley. */ -#include +#include #include #include @@ -173,7 +173,6 @@ static float GetDpi ARG1(HTMLWidget, hw) { look at the problem, the following pre-ANSI code should workaround the problem." */ static int PSprintf ARG1V(char *,format, ...) { - va_dcl va_list args; int len; char *s; @@ -198,9 +197,7 @@ static int PSprintf ARG1V(char *,format, ...) { } #else /* not BROKEN_SOLARIS_COMPILER_STDARG */ static int -PSprintf (format, va_alist) -char* format; -va_dcl +PSprintf (char* format, ...) { int len; char *s; @@ -214,7 +211,7 @@ va_dcl } PS_string = s; } - va_start(args); + va_start(args, format); len = vsprintf(PS_string+PS_len, format, args); /* this is a hack to make it work on systems were vsprintf(s,...) * returns s, instead of the len. diff --git a/libhtmlw/HTML.c b/libhtmlw/HTML.c index 00d7e61..e5f9e6b 100644 --- a/libhtmlw/HTML.c +++ b/libhtmlw/HTML.c @@ -53,6 +53,7 @@ ****************************************************************************/ #include +#include #include "HTMLP.h" #include "DrawingArea.h" #include diff --git a/src/http.c b/src/http.c index 816e832..e28aeba 100644 --- a/src/http.c +++ b/src/http.c @@ -221,6 +221,7 @@ int s; static char *format_get = "\ GET %s HTTP/1.0\n\ +Host: %s\n\ User-Agent: %s\n\ Accept: */*\n\ %s\ @@ -229,6 +230,7 @@ Accept: */*\n\ static char *format_get2 = "\ GET %s?%s HTTP/1.0\n\ +Host: %s\n\ User-Agent: %s\n\ Accept: */*\n\ %s\ @@ -237,6 +239,7 @@ Accept: */*\n\ static char *format_post = "\ POST %s HTTP/1.0\n\ +Host: %s\n\ User-Agent: %s\n\ Accept: */*\n\ Content-length: %d\n\ @@ -249,6 +252,7 @@ Content-type: %s\n\ static char *format_get_crlf = "\ GET %s HTTP/1.0\r\n\ +Host: %s\r\n\ User-Agent: %s\r\n\ Accept: */*\r\n\ %s\ @@ -257,6 +261,7 @@ Accept: */*\r\n\ static char *format_get2_crlf = "\ GET %s?%s HTTP/1.0\r\n\ +Host: %s\r\n\ User-Agent: %s\r\n\ Accept: */*\r\n\ %s\ @@ -265,6 +270,7 @@ Accept: */*\r\n\ static char *format_post_crlf = "\ POST %s HTTP/1.0\r\n\ +Host: %s\r\n\ User-Agent: %s\n\ Accept: */*\r\n\ Content-length: %d\r\n\ @@ -405,6 +411,14 @@ int crlf; char *query; char *auth_info = NULL; char *format; + char* c_host; + + c_host = malloc(strlen(up->hostname) + 10); /* not a good code but should work */ + if(up->port == 0){ + sprintf(c_host, "%s", up->hostname); + }else{ + sprintf(c_host, "%s:%d", up->hostname, up->port); + } if (up->data_type == NULL) data_type = "application/x-www-form-urlencoded"; else data_type = up->data_type; @@ -431,11 +445,13 @@ int crlf; strlen(up->request_data) + strlen(extra_header) + strlen(auth_info) + - strlen(USER_AGENT) + 1); + strlen(USER_AGENT) + + strlen(c_host) + 1); sprintf (query, format, filename, up->request_data, + c_host, USER_AGENT, extra_header, auth_info); @@ -449,10 +465,12 @@ int crlf; strlen(data_type) + strlen(extra_header) + strlen(auth_info) + - strlen(USER_AGENT) + 1); + strlen(USER_AGENT) + + strlen(c_host) + 1); sprintf (query, format, filename, + c_host, USER_AGENT, strlen(up->request_data), data_type, @@ -469,16 +487,19 @@ int crlf; strlen(format) + strlen(extra_header) + strlen(auth_info) + - strlen(USER_AGENT) + 1); + strlen(USER_AGENT) + + strlen(c_host) + 1); sprintf (query, format, filename, + c_host, USER_AGENT, extra_header, auth_info); } free(auth_info); + free(c_host); return(query); } diff --git a/src/util.c b/src/util.c index cb31145..72afc7a 100644 --- a/src/util.c +++ b/src/util.c @@ -331,7 +331,11 @@ ReapChild() * checked into it. This gets us off the ground with SYSV. RSE@GMI */ #if defined(WNOHANG) && !defined(SYSV) && !defined(SVR4) +#ifdef __linux__ + int st; +#else union wait st; +#endif do {