summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-06-08 02:02:13 -0700
committerDave Barach <openvpp@barachs.net>2018-06-08 20:30:16 +0000
commit898cd8f83d56ece9df9f02d54170a96f7cf6d500 (patch)
treebebf49a4cc7efe6cf62806106007bea257932d48 /src
parent048a4e5a000017d0d632ebf02dcc23d9bf9ccf72 (diff)
http server: do not close connections after reply
Change-Id: I7add46258fe44bc4d23d805ffc7eae75e37cab82 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/vnet/session-apps/http_server.c51
1 files changed, 29 insertions, 22 deletions
diff --git a/src/vnet/session-apps/http_server.c b/src/vnet/session-apps/http_server.c
index 6a2e6cda1a2..9ad1297b901 100644
--- a/src/vnet/session-apps/http_server.c
+++ b/src/vnet/session-apps/http_server.c
@@ -87,30 +87,37 @@ free_http_process (http_server_args * args)
vec_add1 (hsm->free_http_cli_process_node_indices, node_index);
}
-static const char
- *http_response = "HTTP/1.1 200 OK\r\n"
- "Content-Type: text/html\r\n"
- "Expires: Mon, 11 Jan 1970 10:10:10 GMT\r\n"
- "Connection: close\r\n"
- "Pragma: no-cache\r\n" "Content-Length: %d\r\n\r\n%s";
-
-static const char
- *http_error_template = "HTTP/1.1 %s\r\n"
- "Content-Type: text/html\r\n"
- "Expires: Mon, 11 Jan 1970 10:10:10 GMT\r\n"
- "Connection: close\r\n" "Pragma: no-cache\r\n" "Content-Length: 0\r\n\r\n";
+/* *INDENT-OFF* */
+static const char *http_response =
+ "HTTP/1.1 200 OK\r\n"
+ "Content-Type: text/html\r\n"
+ "Expires: Mon, 11 Jan 1970 10:10:10 GMT\r\n"
+ "Connection: keep-alive \r\n"
+ "Pragma: no-cache\r\n"
+ "Content-Length: %d\r\n\r\n%s";
+
+static const char *http_error_template =
+ "HTTP/1.1 %s\r\n"
+ "Content-Type: text/html\r\n"
+ "Expires: Mon, 11 Jan 1970 10:10:10 GMT\r\n"
+ "Connection: close\r\n"
+ "Pragma: no-cache\r\n"
+ "Content-Length: 0\r\n\r\n";
/* Header, including incantation to suppress favicon.ico requests */
-static const char
- *html_header_template = "<html><head><title>%v</title>"
- "</head><link rel=\"icon\" href=\"data:,\"><body><pre>";
-
-static const char *html_footer = "</pre></body></html>\r\n";
-
-static const char
- *html_header_static = "<html><head><title>static reply</title></head>"
- "<link rel=\"icon\" href=\"data:,\"><body><pre>hello</pre></body>"
- "</html>\r\n";
+static const char *html_header_template =
+ "<html><head><title>%v</title></head>"
+ "<link rel=\"icon\" href=\"data:,\">"
+ "<body><pre>";
+
+static const char *html_footer =
+ "</pre></body></html>\r\n";
+
+static const char *html_header_static =
+ "<html><head><title>static reply</title></head>"
+ "<link rel=\"icon\" href=\"data:,\">"
+ "<body><pre>hello</pre></body></html>\r\n";
+/* *INDENT-ON* */
static u8 *static_http;