nxt_controller.c (673:9fa79c719a17) nxt_controller.c (703:2d536dde84d2)
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) Valentin V. Bartenev
5 * Copyright (C) NGINX, Inc.
6 */
7
8#include <nxt_main.h>

--- 1153 unchanged lines hidden (view full) ---

1162 static nxt_str_t offset_str = nxt_string("offset");
1163 static nxt_str_t line_str = nxt_string("line");
1164 static nxt_str_t column_str = nxt_string("column");
1165
1166 static nxt_time_string_t date_cache = {
1167 (nxt_atomic_uint_t) -1,
1168 nxt_controller_date,
1169 "%s, %02d %s %4d %02d:%02d:%02d GMT",
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) Valentin V. Bartenev
5 * Copyright (C) NGINX, Inc.
6 */
7
8#include <nxt_main.h>

--- 1153 unchanged lines hidden (view full) ---

1162 static nxt_str_t offset_str = nxt_string("offset");
1163 static nxt_str_t line_str = nxt_string("line");
1164 static nxt_str_t column_str = nxt_string("column");
1165
1166 static nxt_time_string_t date_cache = {
1167 (nxt_atomic_uint_t) -1,
1168 nxt_controller_date,
1169 "%s, %02d %s %4d %02d:%02d:%02d GMT",
1170 sizeof("Wed, 31 Dec 1986 16:40:00 GMT") - 1,
1170 nxt_length("Wed, 31 Dec 1986 16:40:00 GMT"),
1171 NXT_THREAD_TIME_GMT,
1172 NXT_THREAD_TIME_SEC,
1173 };
1174
1175 switch (resp->status) {
1176
1177 case 200:
1178 nxt_str_set(&status_line, "200 OK");

--- 80 unchanged lines hidden (view full) ---

1259 }
1260
1261 nxt_memzero(&pretty, sizeof(nxt_conf_json_pretty_t));
1262
1263 body->mem.free = nxt_conf_json_print(body->mem.free, value, &pretty);
1264
1265 body->mem.free = nxt_cpymem(body->mem.free, "\r\n", 2);
1266
1171 NXT_THREAD_TIME_GMT,
1172 NXT_THREAD_TIME_SEC,
1173 };
1174
1175 switch (resp->status) {
1176
1177 case 200:
1178 nxt_str_set(&status_line, "200 OK");

--- 80 unchanged lines hidden (view full) ---

1259 }
1260
1261 nxt_memzero(&pretty, sizeof(nxt_conf_json_pretty_t));
1262
1263 body->mem.free = nxt_conf_json_print(body->mem.free, value, &pretty);
1264
1265 body->mem.free = nxt_cpymem(body->mem.free, "\r\n", 2);
1266
1267 size = sizeof("HTTP/1.1 " "\r\n") - 1 + status_line.length
1268 + sizeof("Server: " NXT_SERVER "\r\n") - 1
1269 + sizeof("Date: Wed, 31 Dec 1986 16:40:00 GMT\r\n") - 1
1270 + sizeof("Content-Type: application/json\r\n") - 1
1271 + sizeof("Content-Length: " "\r\n") - 1 + NXT_SIZE_T_LEN
1272 + sizeof("Connection: close\r\n") - 1
1273 + sizeof("\r\n") - 1;
1267 size = nxt_length("HTTP/1.1 " "\r\n") + status_line.length
1268 + nxt_length("Server: " NXT_SERVER "\r\n")
1269 + nxt_length("Date: Wed, 31 Dec 1986 16:40:00 GMT\r\n")
1270 + nxt_length("Content-Type: application/json\r\n")
1271 + nxt_length("Content-Length: " "\r\n") + NXT_SIZE_T_LEN
1272 + nxt_length("Connection: close\r\n")
1273 + nxt_length("\r\n");
1274
1275 b = nxt_buf_mem_alloc(c->mem_pool, size, 0);
1276 if (nxt_slow_path(b == NULL)) {
1277 nxt_controller_conn_close(task, c, req);
1278 return;
1279 }
1280
1281 b->next = body;

--- 53 unchanged lines hidden ---
1274
1275 b = nxt_buf_mem_alloc(c->mem_pool, size, 0);
1276 if (nxt_slow_path(b == NULL)) {
1277 nxt_controller_conn_close(task, c, req);
1278 return;
1279 }
1280
1281 b->next = body;

--- 53 unchanged lines hidden ---