From ab540c378cdc4fe569ed8383d36901425d148df2 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Wed, 23 Aug 2017 15:43:57 -0600 Subject: [PATCH] ircd::http: Increase these buffers (unnecessary; todo optimize). --- ircd/http.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ircd/http.cc b/ircd/http.cc index b540d5f0b..39bb0f87b 100644 --- a/ircd/http.cc +++ b/ircd/http.cc @@ -394,7 +394,7 @@ ircd::http::response::response(const code &code, const write_closure &closure, const std::initializer_list &headers) { - char status_line[64]; const auto status_line_len + char status_line[128]; const auto status_line_len { snprintf(status_line, sizeof(status_line), "HTTP/1.1 %u %s\r\n", uint(code), @@ -412,7 +412,7 @@ ircd::http::response::response(const code &code, const time_t ltime(time(nullptr)); struct tm *const tm(localtime(<ime)); - char date_line[64]; const auto date_line_len + char date_line[128]; const auto date_line_len { code < 400 || code >= 500? strftime(date_line, sizeof(date_line), "Date: %a, %d %b %Y %T %z\r\n", tm): @@ -422,7 +422,7 @@ ircd::http::response::response(const code &code, char cache_line[64]; const auto cache_line_len { //TODO: real cache control subsystem - code == OK || (code >= 403 && code <= 405) || (code >= 300 && code < 400)? + (code >= 200 && code < 300) || (code >= 403 && code <= 405) || (code >= 300 && code < 400)? snprintf(cache_line, sizeof(cache_line), "Cache-Control: %s\r\n", "no-cache"): 0 @@ -455,8 +455,9 @@ ircd::http::response::response(const code &code, { status_line, size_t(status_line_len) }, { server_line, size_t(server_line_len) }, { date_line, size_t(date_line_len) }, - { content_len, size_t(content_len_len) }, + { cache_line, size_t(cache_line_len) }, { user_headers, size_t(user_headers_len) }, + { content_len, size_t(content_len_len) }, { "\r\n", 2 }, { content.data(), content.size() }, };