Home
last modified time | relevance | path

Searched refs:ctx (Results 1 – 25 of 85) sorted by relevance

1234

/unit/test/
H A Dtest_tls_sni.py31 def check_cert(host, expect, ctx): argument
39 context=ctx,
159 ctx = config_bundles(bundles)
175 ctx = config_bundles(bundles)
181 context=ctx,
198 ctx = config_bundles(bundles)
215 ctx = config_bundles(bundles)
230 ctx = config_bundles(bundles)
247 ctx = config_bundles(bundles)
259 ctx = config_bundles(bundles)
[all …]
H A Dtest_tls_tickets.py52 if ctx is None:
53 ctx = Context(TLSv1_2_METHOD)
55 conn = Connection(ctx, sock)
66 ctx,
87 sess, ctx, reused = connect()
91 sess, ctx, reused = connect(ctx, sess)
114 sess, ctx, _ = connect()
133 sess, ctx, _ = connect()
152 sess, ctx, _ = connect()
159 sess, ctx, _ = connect()
[all …]
H A Dtest_tls_session.py51 def connect(ctx=None, session=None): argument
54 if ctx is None:
55 ctx = Context(TLSv1_2_METHOD)
57 ctx.set_options(OP_NO_TICKET)
59 conn = Connection(ctx, sock)
71 ctx,
81 _, sess, ctx, reused = connect()
84 _, _, _, reused = connect(ctx, sess)
89 _, sess, ctx, reused = connect()
92 _, _, _, reused = connect(ctx, sess)
[all …]
/unit/src/
H A Dnxt_sha1.c50 (void) nxt_sha1_body(ctx, ctx->buffer, 64); in nxt_sha1_update()
75 (void) nxt_sha1_body(ctx, ctx->buffer, 64); in nxt_sha1_final()
83 ctx->buffer[56] = (u_char) (ctx->bytes >> 56); in nxt_sha1_final()
84 ctx->buffer[57] = (u_char) (ctx->bytes >> 48); in nxt_sha1_final()
85 ctx->buffer[58] = (u_char) (ctx->bytes >> 40); in nxt_sha1_final()
86 ctx->buffer[59] = (u_char) (ctx->bytes >> 32); in nxt_sha1_final()
87 ctx->buffer[60] = (u_char) (ctx->bytes >> 24); in nxt_sha1_final()
89 ctx->buffer[62] = (u_char) (ctx->bytes >> 8); in nxt_sha1_final()
90 ctx->buffer[63] = (u_char) ctx->bytes; in nxt_sha1_final()
92 (void) nxt_sha1_body(ctx, ctx->buffer, 64); in nxt_sha1_final()
[all …]
H A Dnxt_polarssl.c39 nxt_polarssl_ctx_t *ctx; in nxt_polarssl_server_init() local
45 ctx = nxt_zalloc(sizeof(nxt_polarssl_ctx_t)); in nxt_polarssl_server_init()
46 if (ctx == NULL) { in nxt_polarssl_server_init()
50 n = ssl_init(&ctx->ssl); in nxt_polarssl_server_init()
56 ssl_set_endpoint(&ctx->ssl, SSL_IS_SERVER ); in nxt_polarssl_server_init()
58 conf->ctx = ctx; in nxt_polarssl_server_init()
61 n = x509parse_crtfile(&ctx->certificate, conf->certificate); in nxt_polarssl_server_init()
69 rsa_init(&ctx->key, RSA_PKCS_V15, 0); in nxt_polarssl_server_init()
71 n = x509parse_keyfile(&ctx->key, conf->certificate_key, NULL); in nxt_polarssl_server_init()
79 ssl_set_own_cert(&ctx->ssl, &ctx->certificate, &ctx->key); in nxt_polarssl_server_init()
H A Dnxt_unit.c489 ctx = &lib->main_ctx.ctx; in nxt_unit_init()
567 return ctx; in nxt_unit_init()
715 ctx_impl->req.req.ctx = &ctx_impl->ctx; in nxt_unit_ctx_init()
730 ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx); in nxt_unit_ctx_use()
742 ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx); in nxt_unit_ctx_release()
1249 ctx_impl = nxt_container_of(ctx, nxt_unit_ctx_impl_t, ctx); in nxt_unit_ctx_ready()
1479 ctx = req->ctx; in nxt_unit_request_check_response_port()
1767 req_impl->req.ctx = ctx; in nxt_unit_request_info_get()
1795 ctx = req->ctx; in nxt_unit_request_info_release()
4094 if (nxt_fast_path(ctx == &ctx_impl->ctx)) { in nxt_unit_awake_ctx()
[all …]
H A Dnxt_http_variables.c246 r = ctx; in nxt_http_var_request_time()
270 r = ctx; in nxt_http_var_method()
284 r = ctx; in nxt_http_var_request_uri()
297 r = ctx; in nxt_http_var_uri()
310 r = ctx; in nxt_http_var_host()
324 r = ctx; in nxt_http_var_remote_addr()
347 r = ctx; in nxt_http_var_time_local()
396 r = ctx; in nxt_http_var_request_line()
411 r = ctx; in nxt_http_var_request_id()
438 r = ctx; in nxt_http_var_body_bytes_sent()
[all …]
H A Dnxt_php_sapi.c239 if (nxt_slow_path(ctx == NULL || ctx->req == NULL)) { in PHP_FUNCTION()
267 ctx->req = NULL; in PHP_FUNCTION()
1016 nxt_memzero(&ctx, sizeof(ctx)); in nxt_php_request_handler()
1018 ctx.req = req; in nxt_php_request_handler()
1077 p = nxt_cpymem(tpath, ctx->root->start, ctx->root->length); in nxt_php_dynamic_request()
1093 ctx->script_filename.length = ctx->root->length in nxt_php_dynamic_request()
1107 ctx->script_name.start = p + ctx->root->length; in nxt_php_dynamic_request()
1109 p = nxt_cpymem(p, ctx->root->start, ctx->root->length); in nxt_php_dynamic_request()
1118 ctx->chdir = 1; in nxt_php_dynamic_request()
1235 nxt_php_vcwd_chdir(ctx->req, ctx->script_dirname.start);
[all …]
H A Dnxt_http_return.c80 nxt_http_return_ctx_t *ctx; in nxt_http_return() local
106 ctx = NULL; in nxt_http_return()
110 if (nxt_slow_path(ctx == NULL)) { in nxt_http_return()
119 if (ctx != NULL) { in nxt_http_return()
120 ctx->encoded = conf->encoded; in nxt_http_return()
123 nxt_http_return_send_ready(task, r, ctx); in nxt_http_return()
182 nxt_http_return_ctx_t *ctx; in nxt_http_return_send_ready() local
185 ctx = data; in nxt_http_return_send_ready()
187 if (ctx != NULL) { in nxt_http_return_send_ready()
188 if (ctx->location.length > 0) { in nxt_http_return_send_ready()
[all …]
H A Dnxt_http_response.c11 static nxt_int_t nxt_http_response_status(void *ctx, nxt_http_field_t *field,
13 static nxt_int_t nxt_http_response_skip(void *ctx, nxt_http_field_t *field,
15 static nxt_int_t nxt_http_response_field(void *ctx, nxt_http_field_t *field,
45 nxt_http_response_status(void *ctx, nxt_http_field_t *field, in nxt_http_response_status() argument
51 r = ctx; in nxt_http_response_status()
69 nxt_http_response_skip(void *ctx, nxt_http_field_t *field, uintptr_t data) in nxt_http_response_skip() argument
78 nxt_http_response_field(void *ctx, nxt_http_field_t *field, uintptr_t offset) in nxt_http_response_field() argument
82 r = ctx; in nxt_http_response_field()
H A Dnxt_unit.h97 nxt_unit_ctx_t *ctx; member
216 int nxt_unit_run_ctx(nxt_unit_ctx_t *ctx);
218 int nxt_unit_run_shared(nxt_unit_ctx_t *ctx);
229 int nxt_unit_run_once(nxt_unit_ctx_t *ctx);
338 void nxt_unit_free(nxt_unit_ctx_t *ctx, void *p);
366 #define nxt_unit_debug(ctx, fmt, ARGS...) \ argument
374 #define nxt_unit_debug(ctx, fmt, ARGS...) argument
381 #define nxt_unit_warn(ctx, fmt, ARGS...) \ argument
387 #define nxt_unit_error(ctx, fmt, ARGS...) \ argument
388 nxt_unit_log(ctx, NXT_UNIT_LOG_ERR, fmt, ##ARGS)
[all …]
H A Dnxt_websocket_accept.c57 nxt_sha1_t ctx; in nxt_websocket_accept() local
60 nxt_sha1_init(&ctx); in nxt_websocket_accept()
61 nxt_sha1_update(&ctx, key, 24); in nxt_websocket_accept()
62 nxt_sha1_update(&ctx, accept_guid, nxt_length(accept_guid)); in nxt_websocket_accept()
63 nxt_sha1_final(bin_accept, &ctx); in nxt_websocket_accept()
H A Dnxt_java.c72 jobject ctx; member
203 nxt_unit_ctx_t *ctx; in nxt_java_start() local
447 rc = nxt_unit_run(ctx); in nxt_java_start()
449 nxt_java_join_threads(ctx, c); in nxt_java_start()
457 nxt_unit_done(ctx); in nxt_java_start()
484 env = req->ctx->data; in nxt_java_request_handler()
565 env = ws->req->ctx->data; in nxt_java_websocket_handler()
598 env = req->ctx->data; in nxt_java_close_handler()
618 java_data = ctx->unit->data; in nxt_java_ready_handler()
673 (void) nxt_unit_run(ctx); in nxt_java_thread_func()
[all …]
H A Dnxt_sha1.h19 NXT_EXPORT void nxt_sha1_init(nxt_sha1_t *ctx);
20 NXT_EXPORT void nxt_sha1_update(nxt_sha1_t *ctx, const void *data, size_t size);
21 NXT_EXPORT void nxt_sha1_final(u_char result[20], nxt_sha1_t *ctx);
H A Dnxt_http_static.c49 nxt_http_static_ctx_t *ctx);
221 ctx->action = action; in nxt_http_static()
222 ctx->need_body = need_body; in nxt_http_static()
232 nxt_http_static_ctx_t *ctx) in nxt_http_static_iterate() argument
239 conf = ctx->action->u.conf; in nxt_http_static_iterate()
325 ctx = data; in nxt_http_static_send_ready()
326 action = ctx->action; in nxt_http_static_send_ready()
333 shr = &ctx->share; in nxt_http_static_send_ready()
387 chr = &ctx->chroot; in nxt_http_static_send_ready()
685 action = ctx->action; in nxt_http_static_next()
[all …]
H A Dnxt_openssl.c297 SSL_CTX *ctx; in nxt_openssl_server_init() local
303 ctx = SSL_CTX_new(SSLv23_server_method()); in nxt_openssl_server_init()
304 if (ctx == NULL) { in nxt_openssl_server_init()
314 bundle->ctx = ctx; in nxt_openssl_server_init()
397 SSL_CTX_set_verify_depth(ctx, 1); in nxt_openssl_server_init()
438 SSL_CTX_free(ctx); in nxt_openssl_server_init()
569 SSL_CONF_CTX_set_ssl_ctx(cctx, ctx);
1144 SSL_CTX_free(bundle->ctx);
1165 SSL_CTX *ctx; local
1178 ctx = conf->bundle->ctx;
[all …]
/unit/src/wasm/
H A Dnxt_rt_wasmtime.c25 wasmtime_context_t *ctx; member
110 nxt_wasm_ctx_t *ctx = env; in nxt_wasm_set_resp_status() local
112 ctx->status = args[0].of.i32; in nxt_wasm_set_resp_status()
151 args[i++].of.i32 = ctx->baddr_off; in nxt_wasmtime_execute_request()
261 ctx->fh[i].func = item.of.func; in nxt_wasmtime_get_function_exports()
330 ctx->baddr = wasmtime_memory_data(rt_ctx->ctx, &rt_ctx->memory); in nxt_wasmtime_init_memory()
332 ctx->baddr += ctx->baddr_off; in nxt_wasmtime_init_memory()
339 nxt_wasmtime_init(nxt_wasm_ctx_t *ctx) in nxt_wasmtime_init() argument
359 fp = fopen(ctx->module_path, "r"); in nxt_wasmtime_init()
386 nxt_wasmtime_wasi_init(ctx); in nxt_wasmtime_init()
[all …]
H A Dnxt_wasm.h128 int (*init)(nxt_wasm_ctx_t *ctx);
129 void (*destroy)(const nxt_wasm_ctx_t *ctx);
130 int (*exec_request)(const nxt_wasm_ctx_t *ctx);
131 void (*exec_hook)(const nxt_wasm_ctx_t *ctx, nxt_wasm_fh_t hook);
138 extern void nxt_wasm_do_response_end(nxt_wasm_ctx_t *ctx);
139 extern void nxt_wasm_do_send_response(nxt_wasm_ctx_t *ctx, uint32_t offset);
140 extern void nxt_wasm_do_send_headers(nxt_wasm_ctx_t *ctx, uint32_t offset);
/unit/src/test/
H A Dnxt_unit_app_test.c48 nxt_unit_ctx_t *ctx; in main() local
60 ctx = nxt_unit_init(&init); in main()
61 if (ctx == NULL) { in main()
65 err = nxt_unit_run(ctx); in main()
85 nxt_unit_done(ctx); in main()
94 ready_handler(nxt_unit_ctx_t *ctx) in ready_handler() argument
98 nxt_unit_debug(ctx, "ready"); in ready_handler()
124 nxt_unit_ctx_t *ctx; in worker() local
127 if (ctx == NULL) { in worker()
133 rc = nxt_unit_run(ctx); in worker()
[all …]
H A Dnxt_unit_websocket_echo.c88 nxt_unit_ctx_t *ctx; in main() local
96 ctx = nxt_unit_init(&init); in main()
97 if (ctx == NULL) { in main()
101 nxt_unit_run(ctx); in main()
102 nxt_unit_done(ctx); in main()
/unit/go/
H A Dnxt_cgo_lib.c13 static ssize_t nxt_cgo_port_send(nxt_unit_ctx_t *ctx, nxt_unit_port_t *port,
15 static ssize_t nxt_cgo_port_recv(nxt_unit_ctx_t *ctx, nxt_unit_port_t *port,
22 nxt_unit_ctx_t *ctx; in nxt_cgo_run() local
37 ctx = nxt_unit_init(&init); in nxt_cgo_run()
38 if (ctx == NULL) { in nxt_cgo_run()
42 rc = nxt_unit_run_ctx(ctx); in nxt_cgo_run()
44 nxt_unit_done(ctx); in nxt_cgo_run()
51 nxt_cgo_port_send(nxt_unit_ctx_t *ctx, nxt_unit_port_t *port, in nxt_cgo_port_send() argument
60 nxt_cgo_port_recv(nxt_unit_ctx_t *ctx, nxt_unit_port_t *port, in nxt_cgo_port_recv() argument
/unit/src/java/
H A Dnxt_jni_Context.c112 nxt_java_service(JNIEnv *env, jobject ctx, jobject jreq, jobject jresp) in nxt_java_service() argument
114 (*env)->CallVoidMethod(env, ctx, nxt_java_Context_service, jreq, jresp); in nxt_java_service()
119 nxt_java_stopContext(JNIEnv *env, jobject ctx) in nxt_java_stopContext() argument
121 (*env)->CallVoidMethod(env, ctx, nxt_java_Context_stop); in nxt_java_stopContext()
130 nxt_unit_ctx_t *ctx; in nxt_java_Context_log() local
132 ctx = nxt_jlong2ptr(ctx_ptr); in nxt_java_Context_log()
139 nxt_unit_log(ctx, NXT_UNIT_LOG_INFO, "%.*s", msg_len, msg_str); in nxt_java_Context_log()
151 nxt_unit_ctx_t *ctx; in nxt_java_Context_trace() local
153 ctx = nxt_jlong2ptr(ctx_ptr); in nxt_java_Context_trace()
160 nxt_unit_debug(ctx, "%.*s", msg_len, msg_str); in nxt_java_Context_trace()
/unit/src/python/
H A Dnxt_python_asgi.c395 ctx_data = ctx->data; in nxt_python_asgi_run()
424 ctx_data = ctx->data; in nxt_py_asgi_remove_reader()
1019 nxt_unit_debug(ctx, "asgi_add_port %d %p %p", port->in_fd, ctx, port); in nxt_py_asgi_add_port()
1032 nxt_unit_debug(ctx, "asgi_add_reader %d %p %p", port->in_fd, ctx, port); in nxt_py_asgi_add_reader()
1034 ctx_data = ctx->data; in nxt_py_asgi_add_reader()
1109 nxt_unit_debug(ctx, "asgi_quit %p", ctx); in nxt_py_asgi_quit()
1194 nxt_unit_debug(ctx, "asgi_port_read(%p,%p): %d", ctx, port, rc); in nxt_py_asgi_port_read()
1295 ctx = data; in nxt_py_asgi_calc_size()
1297 ctx->fields_count++; in nxt_py_asgi_calc_size()
1320 ctx = data; in nxt_py_asgi_add_field()
[all …]
/unit/test/java/path_translation/
H A Dapp.java32 ServletContext ctx = request.getServletContext(); in doGet() local
37 response.addHeader("X-Real-Path", "" + ctx.getRealPath(path)); in doGet()
38 response.addHeader("X-Resource", "" + ctx.getResource(path)); in doGet()
40 Set<String> paths = ctx.getResourcePaths(path); in doGet()
44 InputStream is = ctx.getResourceAsStream(path); in doGet()
/unit/src/nodejs/unit-http/
H A Dunit.h40 static void shm_ack_handler_cb(nxt_unit_ctx_t *ctx);
41 void shm_ack_handler(nxt_unit_ctx_t *ctx);
43 static int add_port(nxt_unit_ctx_t *ctx, nxt_unit_port_t *port);
44 static void remove_port(nxt_unit_t *unit, nxt_unit_ctx_t *ctx,
47 static void quit_cb(nxt_unit_ctx_t *ctx);
48 void quit(nxt_unit_ctx_t *ctx);

1234