--- parser3/src/targets/cgi/parser3.C 2001/03/22 15:30:47 1.31 +++ parser3/src/targets/cgi/parser3.C 2001/03/22 21:33:37 1.34 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: parser3.C,v 1.31 2001/03/22 15:30:47 paf Exp $ + $Id: parser3.C,v 1.34 2001/03/22 21:33:37 paf Exp $ */ #ifdef HAVE_CONFIG_H @@ -95,9 +95,14 @@ static void add_header_attribute(const c printf("%s: %s\n", key, value); } +/// @todo intelligent cache-control static void send_header(const char *buf, size_t size) { - if(cgi) // header | body delimiter + if(cgi) { + puts("Cache-Control: no-cache"); + + // header | body delimiter puts(""); + } } static void send_body(const char *buf, size_t size) { @@ -117,12 +122,13 @@ static void send_body(const char *buf, s // main int main(int argc, char *argv[]) { - // TODO:umask(2); -//\#ifdef WIN32 + umask(2); + +#ifdef WIN32 setmode(fileno(stdin), _O_BINARY); setmode(fileno(stdout), _O_BINARY); setmode(fileno(stderr), _O_BINARY); -//\#endif +#endif // were we started as CGI? cgi= @@ -193,7 +199,6 @@ int main(int argc, char *argv[]) { // c:\windows root_auto_path=(char *)pool.malloc(MAX_STRING); GetWindowsDirectory(root_auto_path, MAX_STRING); - strcat(root_auto_path, "/"); #else // ~nobody root_auto_path=getenv("HOME"); @@ -203,7 +208,6 @@ int main(int argc, char *argv[]) { char *site_auto_path=(char *)pool.malloc(MAX_STRING); strncpy(site_auto_path, argv[0], MAX_STRING); // filespec of my binary rsplit(site_auto_path, '/'); rsplit(site_auto_path, '\\');// strip filename - strcat(site_auto_path, "/"); // process the request request.core(pool.exception(), @@ -226,7 +230,7 @@ int main(int argc, char *argv[]) { // header (*service_funcs.output_header_attribute)("content-type", "text/plain"); char content_length_cstr[MAX_NUMBER]; - snprintf(content_length_cstr, MAX_NUMBER, "%d", content_length); + snprintf(content_length_cstr, MAX_NUMBER, "%lu", content_length); (*service_funcs.output_header_attribute)("content-length", content_length_cstr);