annotate src/os/win32/ngx_thread.c @ 8971:1e2f4e9c8195 quic

QUIC: reworked migration handling. The quic connection now holds active, backup and probe paths instead of sockets. The number of migration paths is now limited and cannot be inflated by a bad client or an attacker. The client id is now associated with path rather than socket. This allows to simplify processing of output and connection ids handling. New migration abandons any previously started migrations. This allows to free consumed client ids and request new for use in future migrations and make progress in case when connection id limit is hit during migration. A path now can be revalidated without losing its state. The patch also fixes various issues with NAT rebinding case handling: - paths are now validated (previously, there was no validation and paths were left in limited state) - attempt to reuse id on different path is now again verified (this was broken in 40445fc7c403) - former path is now validated in case of apparent migration
author Vladimir Homutov <vl@nginx.com>
date Wed, 19 Jan 2022 22:39:24 +0300
parents 537259db5af4
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
461
a88a3e4e158f nginx-0.1.5-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1
a88a3e4e158f nginx-0.1.5-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
2 /*
a88a3e4e158f nginx-0.1.5-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
3 * Copyright (C) Igor Sysoev
4412
d620f497c50f Copyright updated.
Maxim Konovalov <maxim@nginx.com>
parents: 2725
diff changeset
4 * Copyright (C) Nginx, Inc.
461
a88a3e4e158f nginx-0.1.5-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
5 */
a88a3e4e158f nginx-0.1.5-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
6
a88a3e4e158f nginx-0.1.5-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
7
a88a3e4e158f nginx-0.1.5-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
8 #include <ngx_config.h>
a88a3e4e158f nginx-0.1.5-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
9 #include <ngx_core.h>
a88a3e4e158f nginx-0.1.5-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
10
a88a3e4e158f nginx-0.1.5-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
11
563
9c2f3ed7a247 nginx-0.3.3-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 501
diff changeset
12 ngx_err_t
9c2f3ed7a247 nginx-0.3.3-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 501
diff changeset
13 ngx_create_thread(ngx_tid_t *tid,
9c2f3ed7a247 nginx-0.3.3-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 501
diff changeset
14 ngx_thread_value_t (__stdcall *func)(void *arg), void *arg, ngx_log_t *log)
461
a88a3e4e158f nginx-0.1.5-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
15 {
2725
d43d73277c5c Win32 master/workers model
Igor Sysoev <igor@sysoev.ru>
parents: 563
diff changeset
16 u_long id;
461
a88a3e4e158f nginx-0.1.5-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
17 ngx_err_t err;
a88a3e4e158f nginx-0.1.5-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
18
6111
537259db5af4 Removed "worker_threads" and "thread_stack_size" directives.
Ruslan Ermilov <ru@nginx.com>
parents: 6110
diff changeset
19 *tid = CreateThread(NULL, 0, func, arg, 0, &id);
461
a88a3e4e158f nginx-0.1.5-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
20
a88a3e4e158f nginx-0.1.5-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
21 if (*tid != NULL) {
2725
d43d73277c5c Win32 master/workers model
Igor Sysoev <igor@sysoev.ru>
parents: 563
diff changeset
22 ngx_log_error(NGX_LOG_NOTICE, log, 0,
d43d73277c5c Win32 master/workers model
Igor Sysoev <igor@sysoev.ru>
parents: 563
diff changeset
23 "create thread " NGX_TID_T_FMT, id);
461
a88a3e4e158f nginx-0.1.5-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
24 return 0;
a88a3e4e158f nginx-0.1.5-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
25 }
a88a3e4e158f nginx-0.1.5-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
26
a88a3e4e158f nginx-0.1.5-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
27 err = ngx_errno;
a88a3e4e158f nginx-0.1.5-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
28 ngx_log_error(NGX_LOG_ALERT, log, err, "CreateThread() failed");
a88a3e4e158f nginx-0.1.5-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
29 return err;
a88a3e4e158f nginx-0.1.5-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
30 }