From aa6e63371697ca158bd9b1fe9e68ecbd59fbf72a Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sat, 20 Nov 2010 09:48:03 -0500 Subject: In FastCGI, signal 304 with a header, not the usual HTTP/1.1 line --- include/urweb.h | 2 ++ src/c/cgi.c | 2 ++ src/c/fastcgi.c | 2 ++ src/c/http.c | 2 ++ src/c/request.c | 2 +- src/cjr_print.sml | 2 +- 6 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/urweb.h b/include/urweb.h index e9e330b8..4816537a 100644 --- a/include/urweb.h +++ b/include/urweb.h @@ -286,4 +286,6 @@ uw_Basis_int uw_Basis_rand(uw_context); extern int uw_time_max; +extern int uw_supports_direct_status; + #endif diff --git a/src/c/cgi.c b/src/c/cgi.c index fe7dc564..50d64f58 100644 --- a/src/c/cgi.c +++ b/src/c/cgi.c @@ -137,3 +137,5 @@ void uw_do_expunge(uw_context ctx, uw_Basis_client cli, void *data) { void uw_post_expunge(uw_context ctx, void *data) { } + +int uw_supports_direct_status = 1; diff --git a/src/c/fastcgi.c b/src/c/fastcgi.c index 4e20cc01..756ed3b0 100644 --- a/src/c/fastcgi.c +++ b/src/c/fastcgi.c @@ -618,3 +618,5 @@ void uw_do_expunge(uw_context ctx, uw_Basis_client cli, void *data) { void uw_post_expunge(uw_context ctx, void *data) { } + +int uw_supports_direct_status = 0; diff --git a/src/c/http.c b/src/c/http.c index 5754d229..d52661ce 100644 --- a/src/c/http.c +++ b/src/c/http.c @@ -358,3 +358,5 @@ void uw_do_expunge(uw_context ctx, uw_Basis_client cli, void *data) { void uw_post_expunge(uw_context ctx, void *data) { } + +int uw_supports_direct_status = 1; diff --git a/src/c/request.c b/src/c/request.c index 190a327f..52006e85 100644 --- a/src/c/request.c +++ b/src/c/request.c @@ -211,7 +211,7 @@ request_result uw_request(uw_request_context rc, uw_context ctx, if (id && pass) { unsigned idn = atoi(id); uw_client_connect(idn, atoi(pass), sock, send, close, logger_data, log_error); - log_error(logger_data, "Processed request for messages by client %u\n\n", idn); + log_debug(logger_data, "Processed request for messages by client %u\n\n", idn); return KEEP_OPEN; } else { diff --git a/src/cjr_print.sml b/src/cjr_print.sml index 29f94fe6..e440a53d 100644 --- a/src/cjr_print.sml +++ b/src/cjr_print.sml @@ -2924,7 +2924,7 @@ fun p_file env (ds, ps) = newline, box [string "uw_clear_headers(ctx);", newline, - string "uw_write_header(ctx, \"HTTP/1.1 304 Not Modified\\r\\n\");", + string "uw_write_header(ctx, uw_supports_direct_status ? \"HTTP/1.1 304 Not Modified\\r\\n\" : \"Status: 304 Not Modified\\r\\n\");", newline, string "return;", newline], -- cgit v1.2.3