nxt_conf_validation.c (1910:b9e844d85f21) nxt_conf_validation.c (1920:7c19530e2502)
1
2/*
3 * Copyright (C) Valentin V. Bartenev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8#include <nxt_conf.h>

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

90static nxt_int_t nxt_conf_vldt_certificate(nxt_conf_validation_t *vldt,
91 nxt_conf_value_t *value, void *data);
92#if (NXT_HAVE_OPENSSL_CONF_CMD)
93static nxt_int_t nxt_conf_vldt_object_conf_commands(nxt_conf_validation_t *vldt,
94 nxt_conf_value_t *value, void *data);
95#endif
96static nxt_int_t nxt_conf_vldt_certificate_element(nxt_conf_validation_t *vldt,
97 nxt_conf_value_t *value);
1
2/*
3 * Copyright (C) Valentin V. Bartenev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8#include <nxt_conf.h>

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

90static nxt_int_t nxt_conf_vldt_certificate(nxt_conf_validation_t *vldt,
91 nxt_conf_value_t *value, void *data);
92#if (NXT_HAVE_OPENSSL_CONF_CMD)
93static nxt_int_t nxt_conf_vldt_object_conf_commands(nxt_conf_validation_t *vldt,
94 nxt_conf_value_t *value, void *data);
95#endif
96static nxt_int_t nxt_conf_vldt_certificate_element(nxt_conf_validation_t *vldt,
97 nxt_conf_value_t *value);
98static nxt_int_t nxt_conf_vldt_tls_cache_size(nxt_conf_validation_t *vldt,
99 nxt_conf_value_t *value, void *data);
100static nxt_int_t nxt_conf_vldt_tls_timeout(nxt_conf_validation_t *vldt,
101 nxt_conf_value_t *value, void *data);
98#endif
99static nxt_int_t nxt_conf_vldt_action(nxt_conf_validation_t *vldt,
100 nxt_conf_value_t *value, void *data);
101static nxt_int_t nxt_conf_vldt_pass(nxt_conf_validation_t *vldt,
102 nxt_conf_value_t *value, void *data);
103static nxt_int_t nxt_conf_vldt_return(nxt_conf_validation_t *vldt,
104 nxt_conf_value_t *value, void *data);
105static nxt_int_t nxt_conf_vldt_proxy(nxt_conf_validation_t *vldt,

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

201
202
203static nxt_conf_vldt_object_t nxt_conf_vldt_setting_members[];
204static nxt_conf_vldt_object_t nxt_conf_vldt_http_members[];
205static nxt_conf_vldt_object_t nxt_conf_vldt_websocket_members[];
206static nxt_conf_vldt_object_t nxt_conf_vldt_static_members[];
207#if (NXT_TLS)
208static nxt_conf_vldt_object_t nxt_conf_vldt_tls_members[];
102#endif
103static nxt_int_t nxt_conf_vldt_action(nxt_conf_validation_t *vldt,
104 nxt_conf_value_t *value, void *data);
105static nxt_int_t nxt_conf_vldt_pass(nxt_conf_validation_t *vldt,
106 nxt_conf_value_t *value, void *data);
107static nxt_int_t nxt_conf_vldt_return(nxt_conf_validation_t *vldt,
108 nxt_conf_value_t *value, void *data);
109static nxt_int_t nxt_conf_vldt_proxy(nxt_conf_validation_t *vldt,

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

205
206
207static nxt_conf_vldt_object_t nxt_conf_vldt_setting_members[];
208static nxt_conf_vldt_object_t nxt_conf_vldt_http_members[];
209static nxt_conf_vldt_object_t nxt_conf_vldt_websocket_members[];
210static nxt_conf_vldt_object_t nxt_conf_vldt_static_members[];
211#if (NXT_TLS)
212static nxt_conf_vldt_object_t nxt_conf_vldt_tls_members[];
213static nxt_conf_vldt_object_t nxt_conf_vldt_session_members[];
209#endif
210static nxt_conf_vldt_object_t nxt_conf_vldt_match_members[];
211static nxt_conf_vldt_object_t nxt_conf_vldt_python_target_members[];
212static nxt_conf_vldt_object_t nxt_conf_vldt_php_common_members[];
213static nxt_conf_vldt_object_t nxt_conf_vldt_php_options_members[];
214static nxt_conf_vldt_object_t nxt_conf_vldt_php_target_members[];
215static nxt_conf_vldt_object_t nxt_conf_vldt_common_members[];
216static nxt_conf_vldt_object_t nxt_conf_vldt_app_limits_members[];

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

373 .name = nxt_string("conf_commands"),
374 .type = NXT_CONF_VLDT_OBJECT,
375#if (NXT_HAVE_OPENSSL_CONF_CMD)
376 .validator = nxt_conf_vldt_object_conf_commands,
377#else
378 .validator = nxt_conf_vldt_unsupported,
379 .u.string = "conf_commands",
380#endif
214#endif
215static nxt_conf_vldt_object_t nxt_conf_vldt_match_members[];
216static nxt_conf_vldt_object_t nxt_conf_vldt_python_target_members[];
217static nxt_conf_vldt_object_t nxt_conf_vldt_php_common_members[];
218static nxt_conf_vldt_object_t nxt_conf_vldt_php_options_members[];
219static nxt_conf_vldt_object_t nxt_conf_vldt_php_target_members[];
220static nxt_conf_vldt_object_t nxt_conf_vldt_common_members[];
221static nxt_conf_vldt_object_t nxt_conf_vldt_app_limits_members[];

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

378 .name = nxt_string("conf_commands"),
379 .type = NXT_CONF_VLDT_OBJECT,
380#if (NXT_HAVE_OPENSSL_CONF_CMD)
381 .validator = nxt_conf_vldt_object_conf_commands,
382#else
383 .validator = nxt_conf_vldt_unsupported,
384 .u.string = "conf_commands",
385#endif
386 }, {
387 .name = nxt_string("session"),
388 .type = NXT_CONF_VLDT_OBJECT,
389 .validator = nxt_conf_vldt_object,
390 .u.members = nxt_conf_vldt_session_members,
381 },
382
383 NXT_CONF_VLDT_END
384};
385
391 },
392
393 NXT_CONF_VLDT_END
394};
395
396
397static nxt_conf_vldt_object_t nxt_conf_vldt_session_members[] = {
398 {
399 .name = nxt_string("cache_size"),
400 .type = NXT_CONF_VLDT_INTEGER,
401 .validator = nxt_conf_vldt_tls_cache_size,
402 }, {
403 .name = nxt_string("timeout"),
404 .type = NXT_CONF_VLDT_INTEGER,
405 .validator = nxt_conf_vldt_tls_timeout,
406 },
407
408 NXT_CONF_VLDT_END
409};
410
411
412static nxt_int_t
413nxt_conf_vldt_tls_cache_size(nxt_conf_validation_t *vldt,
414 nxt_conf_value_t *value, void *data)
415{
416 int64_t cache_size;
417
418 cache_size = nxt_conf_get_number(value);
419
420 if (cache_size < 0) {
421 return nxt_conf_vldt_error(vldt, "The \"cache_size\" number must not "
422 "be negative.");
423 }
424
425 return NXT_OK;
426}
427
428
429static nxt_int_t
430nxt_conf_vldt_tls_timeout(nxt_conf_validation_t *vldt, nxt_conf_value_t *value,
431 void *data)
432{
433 int64_t timeout;
434
435 timeout = nxt_conf_get_number(value);
436
437 if (timeout <= 0) {
438 return nxt_conf_vldt_error(vldt, "The \"timeout\" number must be "
439 "greater than zero.");
440 }
441
442 return NXT_OK;
443}
444
386#endif
387
388
389static nxt_conf_vldt_object_t nxt_conf_vldt_route_members[] = {
390 {
391 .name = nxt_string("match"),
392 .type = NXT_CONF_VLDT_OBJECT,
393 .validator = nxt_conf_vldt_object,

--- 2364 unchanged lines hidden ---
445#endif
446
447
448static nxt_conf_vldt_object_t nxt_conf_vldt_route_members[] = {
449 {
450 .name = nxt_string("match"),
451 .type = NXT_CONF_VLDT_OBJECT,
452 .validator = nxt_conf_vldt_object,

--- 2364 unchanged lines hidden ---