http server: do not close connections after reply 66/12966/2
authorFlorin Coras <fcoras@cisco.com>
Fri, 8 Jun 2018 09:02:13 +0000 (02:02 -0700)
committerDave Barach <openvpp@barachs.net>
Fri, 8 Jun 2018 20:30:16 +0000 (20:30 +0000)
Change-Id: I7add46258fe44bc4d23d805ffc7eae75e37cab82
Signed-off-by: Florin Coras <fcoras@cisco.com>
src/vnet/session-apps/http_server.c

index 6a2e6cd..9ad1297 100644 (file)
@@ -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;