W dniu 27.03.2015 o 21:58, Hubert Tarasiuk pisze:
I am attaching corrected patches. I additionally corrected few trailing
whitespace errors that were present in the previous version.
Just found a typo in one of the comments and few more formatting issues.
Now I checked twice, and the patches should be ok. Sorry for that.
Hubert
From 022d6d38aa3b2d1b07be907f101a4212db384fbf Mon Sep 17 00:00:00 2001
From: Hubert Tarasiuk <address@hidden>
Date: Fri, 27 Mar 2015 14:00:33 +0100
Subject: [PATCH 1/2] Factor out set_content_type function from gethttp
* src/http.c (gethttp): Move some code in...
(set_content_type): ... a new function.
---
src/http.c | 37 ++++++++++++++++++++++---------------
1 file changed, 22 insertions(+), 15 deletions(-)
diff --git a/src/http.c b/src/http.c
index 53c9818..97bfa7a 100644
--- a/src/http.c
+++ b/src/http.c
@@ -2330,6 +2330,27 @@ open_output_stream (struct http_stat *hs, int count,
FILE **fp)
return RETROK;
}
+/* Set proper type flags based on type string. */
+static void
+set_content_type (int *dt, const char *type)
+{
+ /* If content-type is not given, assume text/html. This is because
+ of the multitude of broken CGI's that "forget" to generate the
+ content-type. */