summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_http_request.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2018-07-30 17:05:48 +0300
committerIgor Sysoev <igor@sysoev.ru>2018-07-30 17:05:48 +0300
commit69a1169cae8c3f47135bdb205b9284bf6faceffc (patch)
treef58c2ced5554bfc6f1eb30992aa96e786debda0b /src/nxt_http_request.c
parent7f57b6d984affe5ce69d84f7d7b27bcad1ecf655 (diff)
downloadunit-69a1169cae8c3f47135bdb205b9284bf6faceffc.tar.gz
unit-69a1169cae8c3f47135bdb205b9284bf6faceffc.tar.bz2
Sending 408 response on idle connection timeout.
Diffstat (limited to 'src/nxt_http_request.c')
-rw-r--r--src/nxt_http_request.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/nxt_http_request.c b/src/nxt_http_request.c
index 2d6ccb42..06d45247 100644
--- a/src/nxt_http_request.c
+++ b/src/nxt_http_request.c
@@ -22,6 +22,16 @@ static const nxt_http_request_state_t nxt_http_request_init_state;
static const nxt_http_request_state_t nxt_http_request_body_state;
+nxt_time_string_t nxt_http_date_cache = {
+ (nxt_atomic_uint_t) -1,
+ nxt_http_date,
+ "%s, %02d %s %4d %02d:%02d:%02d GMT",
+ nxt_length("Wed, 31 Dec 1986 16:40:00 GMT"),
+ NXT_THREAD_TIME_GMT,
+ NXT_THREAD_TIME_SEC,
+};
+
+
nxt_int_t
nxt_http_init(nxt_task_t *task, nxt_runtime_t *rt)
{
@@ -278,15 +288,6 @@ nxt_http_request_header_send(nxt_task_t *task, nxt_http_request_t *r)
u_char *p, *end;
nxt_http_field_t *server, *date, *content_length;
- static nxt_time_string_t date_cache = {
- (nxt_atomic_uint_t) -1,
- nxt_http_date,
- "%s, %02d %s %4d %02d:%02d:%02d GMT",
- nxt_length("Wed, 31 Dec 1986 16:40:00 GMT"),
- NXT_THREAD_TIME_GMT,
- NXT_THREAD_TIME_SEC,
- };
-
/*
* TODO: "Server", "Date", and "Content-Length" processing should be moved
* to the last header filter.
@@ -307,15 +308,15 @@ nxt_http_request_header_send(nxt_task_t *task, nxt_http_request_t *r)
nxt_http_field_name_set(date, "Date");
- p = nxt_mp_nget(r->mem_pool, date_cache.size);
+ p = nxt_mp_nget(r->mem_pool, nxt_http_date_cache.size);
if (nxt_slow_path(p == NULL)) {
goto fail;
}
- (void) nxt_thread_time_string(task->thread, &date_cache, p);
+ (void) nxt_thread_time_string(task->thread, &nxt_http_date_cache, p);
date->value = p;
- date->value_length = date_cache.size;
+ date->value_length = nxt_http_date_cache.size;
r->resp.date = date;
}