Home
last modified time | relevance | path

Searched hist:59 (Results 101 – 125 of 126) sorted by relevance

123456

/unit/test/
H A Dtest_node_application.pydiff 1029:687f7cc7aae2 Tue Apr 09 17:59:00 UTC 2019 Andrey Zelenkov <zelenkov@nginx.com> Tests: speed up tests.
H A Dtest_tls.pydiff 1029:687f7cc7aae2 Tue Apr 09 17:59:00 UTC 2019 Andrey Zelenkov <zelenkov@nginx.com> Tests: speed up tests.
H A Dtest_php_application.pydiff 1029:687f7cc7aae2 Tue Apr 09 17:59:00 UTC 2019 Andrey Zelenkov <zelenkov@nginx.com> Tests: speed up tests.
/unit/src/
H A Dnxt_main_process.cdiff 2518:b2f9d61b2799 Wed Aug 09 15:59:00 UTC 2023 Andrew Clayton <a.clayton@nginx.com> Wasm: Wire up Wasm language module support to the config system.

This exposes various WebAssembly language module specific options.

The application type is "wasm".

There is a "module" option that is required, this specifies the full
path to the WebAssembly module to be run. This module should be in
binary format, i.e a .wasm file.

There are also currently eight function handlers that can be specified.
Three of them are _required_

1) request_handler

The main driving function. This may be called multiple times for a
single HTTP request if the request is larger than the shared memory.

2) malloc_handler

Used to allocate a chunk of memory at language module startup. This
memory is allocated from the WASM modules address space and is what is
sued for communicating between the WASM module (the guest) and Unit (the
host).

3) free_handler

Used to free the memory from above at language module shutdown.

Then there are the following five _optional_ handlers

1) module_init_handler

If set, called at language module startup.

2) module_end_handler

If set, called at language module shutdown.

3) request_init_handler

If set, called at the start of request. Called only once per HTTP
request.

4) request_end_handler

If set, called once all of a request has been sent to the WASM module.

5) response_end_handler

If set, called at the end of a request, once the WASM module has sent
all its headers and data.

Example config

"applications": {
"luw-echo-request": {
"type": "wasm",
"module": "/path/to/unit-wasm/examples/c/luw-echo-request.wasm",
"request_handler": "luw_request_handler",
"malloc_handler": "luw_malloc_handler",
"free_handler": "luw_free_handler",
"module_init_handler": "luw_module_init_handler",
"module_end_handler": "luw_module_end_handler",
}
}

Reviewed-by: Alejandro Colomar <alx@nginx.com>
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
diff 2377:15ad23116ecc Tue Feb 28 01:59:00 UTC 2023 Andrew Clayton <a.clayton@nginx.com> Socket: Remove Unix domain listen sockets upon reconfigure.

Currently when using Unix domain sockets for requests, if unit is
reconfigured then it will fail if it tries to bind(2) again to a Unix
domain socket with something like

2023/02/25 19:15:50 [alert] 35274#35274 bind(\"unix:/tmp/unit.sock\") failed (98: Address already in use)

When closing such a socket we really need to unlink(2) it. However that
presents a problem in that when running as root, while the main process
runs as root and creates the socket, it's the router process, that runs
as an unprivileged user, e.g nobody, that closes the socket and would
thus remove it, but couldn't due to not having permission, even if the
socket is mode 0666, you need write permissions on the containing
directory to remove a file.

There are several options to solve this, all with varying degrees of
complexity and utility.

1) Give the user who the router process runs as write permission to
the directory containing the listen sockets. These can then be
unlink(2)'d from the router process.

Simple and would work, but perhaps not the most elegant.

2) Using capabilities(7). The router process could temporarily attain
the CAP_DAC_OVERRIDE capability, unlink(7) the socket, then
relinquish the capability until required again.

These are Linux specific (other systems may have similar mechanisms
which would be extra work to support). There is also a, albeit
small, window where the router process is running with elevated
privileges.

3) Have the main process do the unlink(2), it is after all the process
that created the socket.

This is what this commit implements.

We create a new port IPC message type of NXT_PORT_MSG_SOCKET_UNLINK,
that is used by the router process to notify the main process about a
Unix domain socket to unlink(2).

Upon doing a reconfigure the router process will call
nxt_router_listen_socket_release() which will close the socket, we
extend this function in the case of non-abstract Unix domain sockets, so
that it will send a message to the main process containing a copy of the
nxt_sockaddr_t structure that will contain the filename of the socket.

In the main process the handler that we have defined,
nxt_main_port_socket_unlink_handler(), for this message type will run
and allow us to look for the socket in question in the listen_sockets
array and remove it and unlink(2) the socket.

This then allows the reconfigure to work if it tries to bind(2) again to
a socket that previously existed.

Link: <https://github.com/nginx/unit/issues/669>
Link: <https://github.com/nginx/unit/pull/735>
Reviewed-by: Alejandro Colomar <alx@nginx.com>
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
diff 1927:ac8d11e34427 Tue Aug 03 10:59:00 UTC 2021 Max Romanov <max.romanov@nginx.com> Fixed dead assignments.

Found by Clang Static Analyzer.
240:36bafba970b5 Mon Aug 28 23:59:00 UTC 2017 Igor Sysoev <igor@sysoev.ru> The master process has been renamed to the main process.
H A Dnxt_router.cdiff 2377:15ad23116ecc Tue Feb 28 01:59:00 UTC 2023 Andrew Clayton <a.clayton@nginx.com> Socket: Remove Unix domain listen sockets upon reconfigure.

Currently when using Unix domain sockets for requests, if unit is
reconfigured then it will fail if it tries to bind(2) again to a Unix
domain socket with something like

2023/02/25 19:15:50 [alert] 35274#35274 bind(\"unix:/tmp/unit.sock\") failed (98: Address already in use)

When closing such a socket we really need to unlink(2) it. However that
presents a problem in that when running as root, while the main process
runs as root and creates the socket, it's the router process, that runs
as an unprivileged user, e.g nobody, that closes the socket and would
thus remove it, but couldn't due to not having permission, even if the
socket is mode 0666, you need write permissions on the containing
directory to remove a file.

There are several options to solve this, all with varying degrees of
complexity and utility.

1) Give the user who the router process runs as write permission to
the directory containing the listen sockets. These can then be
unlink(2)'d from the router process.

Simple and would work, but perhaps not the most elegant.

2) Using capabilities(7). The router process could temporarily attain
the CAP_DAC_OVERRIDE capability, unlink(7) the socket, then
relinquish the capability until required again.

These are Linux specific (other systems may have similar mechanisms
which would be extra work to support). There is also a, albeit
small, window where the router process is running with elevated
privileges.

3) Have the main process do the unlink(2), it is after all the process
that created the socket.

This is what this commit implements.

We create a new port IPC message type of NXT_PORT_MSG_SOCKET_UNLINK,
that is used by the router process to notify the main process about a
Unix domain socket to unlink(2).

Upon doing a reconfigure the router process will call
nxt_router_listen_socket_release() which will close the socket, we
extend this function in the case of non-abstract Unix domain sockets, so
that it will send a message to the main process containing a copy of the
nxt_sockaddr_t structure that will contain the filename of the socket.

In the main process the handler that we have defined,
nxt_main_port_socket_unlink_handler(), for this message type will run
and allow us to look for the socket in question in the listen_sockets
array and remove it and unlink(2) the socket.

This then allows the reconfigure to work if it tries to bind(2) again to
a socket that previously existed.

Link: <https://github.com/nginx/unit/issues/669>
Link: <https://github.com/nginx/unit/pull/735>
Reviewed-by: Alejandro Colomar <alx@nginx.com>
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
diff 2208:26af8eadc943 Thu Sep 29 19:59:00 UTC 2022 Andrew Clayton <a.clayton@nginx.com> Renamed a couple of members of nxt_unit_request_t.

This is a preparatory patch that renames the 'local' and 'local_length'
members of the nxt_unit_request_t structure to 'local_addr' and
'local_addr_length' in preparation for the adding of 'local_port' and
'local_port_length' members.

Suggested-by: Zhidao HONG <z.hong@f5.com>
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
diff 2126:8542c8141a13 Tue Jun 07 05:59:00 UTC 2022 Max Romanov <max.romanov@nginx.com> Removing unused tracking fields and functions.

The message tracking is unused since 1d84b9e4b459 commit.

This fixes the issue found by Coverity (CID 376263).
diff 1733:dab8544b5440 Mon Dec 07 22:59:00 UTC 2020 Valentin Bartenev <vbart@nginx.com> PHP: populating PHP_AUTH_* server variables.

This closes #498 issue on GitHub.
diff 1541:59dbab152ff3 Sun Aug 09 07:22:00 UTC 2020 Max Romanov <max.romanov@nginx.com> Fixing connection remote sockaddr leakage.

Earlier patch 1bf971f83571 fixes connection leakage. But connection
free requires separate remote sockaddr release.
diff 1123:96c52626c673 Wed Aug 14 20:59:00 UTC 2019 Max Romanov <max.romanov@nginx.com> Renaming supplemental request structures in router.

- nxt_req_app_link_t -> nxt_request_app_link_t
- nxt_req_conn_link_t -> nxt_request_rpc_data_t

Corresponding abbreviated field names also changed:
- ra -> req_app_link
- rc -> req_rpc_data
diff 240:36bafba970b5 Mon Aug 28 23:59:00 UTC 2017 Igor Sysoev <igor@sysoev.ru> The master process has been renamed to the main process.
diff 138:59fc46dd5e1d Mon Jul 10 18:07:00 UTC 2017 Igor Sysoev <igor@sysoev.ru> Introducing thread-safe nxt_random().
H A Dnxt_router.hdiff 1123:96c52626c673 Wed Aug 14 20:59:00 UTC 2019 Max Romanov <max.romanov@nginx.com> Renaming supplemental request structures in router.

- nxt_req_app_link_t -> nxt_request_app_link_t
- nxt_req_conn_link_t -> nxt_request_rpc_data_t

Corresponding abbreviated field names also changed:
- ra -> req_app_link
- rc -> req_rpc_data
diff 240:36bafba970b5 Mon Aug 28 23:59:00 UTC 2017 Igor Sysoev <igor@sysoev.ru> The master process has been renamed to the main process.
H A Dnxt_application.cdiff 2518:b2f9d61b2799 Wed Aug 09 15:59:00 UTC 2023 Andrew Clayton <a.clayton@nginx.com> Wasm: Wire up Wasm language module support to the config system.

This exposes various WebAssembly language module specific options.

The application type is "wasm".

There is a "module" option that is required, this specifies the full
path to the WebAssembly module to be run. This module should be in
binary format, i.e a .wasm file.

There are also currently eight function handlers that can be specified.
Three of them are _required_

1) request_handler

The main driving function. This may be called multiple times for a
single HTTP request if the request is larger than the shared memory.

2) malloc_handler

Used to allocate a chunk of memory at language module startup. This
memory is allocated from the WASM modules address space and is what is
sued for communicating between the WASM module (the guest) and Unit (the
host).

3) free_handler

Used to free the memory from above at language module shutdown.

Then there are the following five _optional_ handlers

1) module_init_handler

If set, called at language module startup.

2) module_end_handler

If set, called at language module shutdown.

3) request_init_handler

If set, called at the start of request. Called only once per HTTP
request.

4) request_end_handler

If set, called once all of a request has been sent to the WASM module.

5) response_end_handler

If set, called at the end of a request, once the WASM module has sent
all its headers and data.

Example config

"applications": {
"luw-echo-request": {
"type": "wasm",
"module": "/path/to/unit-wasm/examples/c/luw-echo-request.wasm",
"request_handler": "luw_request_handler",
"malloc_handler": "luw_malloc_handler",
"free_handler": "luw_free_handler",
"module_init_handler": "luw_module_init_handler",
"module_end_handler": "luw_module_end_handler",
}
}

Reviewed-by: Alejandro Colomar <alx@nginx.com>
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
diff 240:36bafba970b5 Mon Aug 28 23:59:00 UTC 2017 Igor Sysoev <igor@sysoev.ru> The master process has been renamed to the main process.
H A Dnxt_conf.cdiff 839:d9099392bae1 Thu Nov 15 08:59:00 UTC 2018 Valentin Bartenev <vbart@nginx.com> Fixed discovering of modules on 64-bit big-endian systems.

The nxt_conf_map_object() function used nxt_int_t for NXT_CONF_MAP_INT, which
was 8 bytes long on 64-bit systems.

But the nxt_port_main_start_worker_handler() used it to map into the int field
of the nxt_common_app_conf_t structure, which was 4 bytes. As the result, on
a 64-bit big-endian system all the meaningful module type numbers were assigned
into the gap above the "type" field.

The bug was discovered on IBM/S390x.
H A Dnxt_h1proto.cdiff 1927:ac8d11e34427 Tue Aug 03 10:59:00 UTC 2021 Max Romanov <max.romanov@nginx.com> Fixed dead assignments.

Found by Clang Static Analyzer.
diff 1733:dab8544b5440 Mon Dec 07 22:59:00 UTC 2020 Valentin Bartenev <vbart@nginx.com> PHP: populating PHP_AUTH_* server variables.

This closes #498 issue on GitHub.
H A Dnxt_runtime.hdiff 240:36bafba970b5 Mon Aug 28 23:59:00 UTC 2017 Igor Sysoev <igor@sysoev.ru> The master process has been renamed to the main process.
H A Dnxt_process.cdiff 240:36bafba970b5 Mon Aug 28 23:59:00 UTC 2017 Igor Sysoev <igor@sysoev.ru> The master process has been renamed to the main process.
diff 138:59fc46dd5e1d Mon Jul 10 18:07:00 UTC 2017 Igor Sysoev <igor@sysoev.ru> Introducing thread-safe nxt_random().
H A Dnxt_port_socket.cdiff 344:a9523e0b926b Wed Oct 04 11:59:00 UTC 2017 Max Romanov <max.romanov@nginx.com> Optimized send message allocations.

For empty write queue cases, it is possible to avoid allocation and enqueue
send message structures. Send message initialized on stack and passed to
write handler. If immediate write fails, send message allocated from engine
pool and enqueued.
H A Dnxt_conf_validation.cdiff 2518:b2f9d61b2799 Wed Aug 09 15:59:00 UTC 2023 Andrew Clayton <a.clayton@nginx.com> Wasm: Wire up Wasm language module support to the config system.

This exposes various WebAssembly language module specific options.

The application type is "wasm".

There is a "module" option that is required, this specifies the full
path to the WebAssembly module to be run. This module should be in
binary format, i.e a .wasm file.

There are also currently eight function handlers that can be specified.
Three of them are _required_

1) request_handler

The main driving function. This may be called multiple times for a
single HTTP request if the request is larger than the shared memory.

2) malloc_handler

Used to allocate a chunk of memory at language module startup. This
memory is allocated from the WASM modules address space and is what is
sued for communicating between the WASM module (the guest) and Unit (the
host).

3) free_handler

Used to free the memory from above at language module shutdown.

Then there are the following five _optional_ handlers

1) module_init_handler

If set, called at language module startup.

2) module_end_handler

If set, called at language module shutdown.

3) request_init_handler

If set, called at the start of request. Called only once per HTTP
request.

4) request_end_handler

If set, called once all of a request has been sent to the WASM module.

5) response_end_handler

If set, called at the end of a request, once the WASM module has sent
all its headers and data.

Example config

"applications": {
"luw-echo-request": {
"type": "wasm",
"module": "/path/to/unit-wasm/examples/c/luw-echo-request.wasm",
"request_handler": "luw_request_handler",
"malloc_handler": "luw_malloc_handler",
"free_handler": "luw_free_handler",
"module_init_handler": "luw_module_init_handler",
"module_end_handler": "luw_module_end_handler",
}
}

Reviewed-by: Alejandro Colomar <alx@nginx.com>
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
diff 2079:0dcffa83cac2 Fri Mar 11 00:59:00 UTC 2022 Alejandro Colomar <alx.manpages@gmail.com> Added NXT_MAYBE_UNUSED for __attribute__((__unused__)).

When testing some configurations of compilers and OSes, I noticed
that clang(1) 13 on Debian caused a function to be compiled but
unused, and the compiler triggered a compile error.

To avoid that error, use __attribute__((__unused__)). Let's call
our wrapper NXT_MAYBE_UNUSED, since it describes itself more
precisely than the GCC attribute name. It's also the name that
C2x (likely C23) has given to the standard attribute, which is
[[maybe_unused]], so it's also likely to be more readable because
of that name being in ISO C.
diff 1326:09f9d521f71f Tue Dec 24 13:59:00 UTC 2019 Axel Duch <axel.duch@nginx.com> Router: introducing routing on listener address.
diff 285:9ce1b6dd2664 Wed Sep 06 15:59:00 UTC 2017 Max Romanov <max.romanov@nginx.com> Spreading user validation for php and go apps.
H A Dnxt_php_sapi.cdiff 2208:26af8eadc943 Thu Sep 29 19:59:00 UTC 2022 Andrew Clayton <a.clayton@nginx.com> Renamed a couple of members of nxt_unit_request_t.

This is a preparatory patch that renames the 'local' and 'local_length'
members of the nxt_unit_request_t structure to 'local_addr' and
'local_addr_length' in preparation for the adding of 'local_port' and
'local_port_length' members.

Suggested-by: Zhidao HONG <z.hong@f5.com>
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
diff 1733:dab8544b5440 Mon Dec 07 22:59:00 UTC 2020 Valentin Bartenev <vbart@nginx.com> PHP: populating PHP_AUTH_* server variables.

This closes #498 issue on GitHub.
H A Dnxt_port.cdiff 240:36bafba970b5 Mon Aug 28 23:59:00 UTC 2017 Igor Sysoev <igor@sysoev.ru> The master process has been renamed to the main process.
H A Dnxt_http_parse.cdiff 59:773604145544 Fri Jun 09 18:49:00 UTC 2017 Valentin Bartenev <vbart@nginx.com> HTTP parser: fixed handling header fields with missing colon.
H A Dnxt_http_route.cdiff 1326:09f9d521f71f Tue Dec 24 13:59:00 UTC 2019 Axel Duch <axel.duch@nginx.com> Router: introducing routing on listener address.
H A Dnxt_controller.cdiff 240:36bafba970b5 Mon Aug 28 23:59:00 UTC 2017 Igor Sysoev <igor@sysoev.ru> The master process has been renamed to the main process.
H A Dnxt_http.hdiff 1733:dab8544b5440 Mon Dec 07 22:59:00 UTC 2020 Valentin Bartenev <vbart@nginx.com> PHP: populating PHP_AUTH_* server variables.

This closes #498 issue on GitHub.
H A Dnxt_unit.cdiff 2126:8542c8141a13 Tue Jun 07 05:59:00 UTC 2022 Max Romanov <max.romanov@nginx.com> Removing unused tracking fields and functions.

The message tracking is unused since 1d84b9e4b459 commit.

This fixes the issue found by Coverity (CID 376263).
/unit/auto/
H A Dsourcesdiff 2175:e83cff38d672 Wed Aug 03 12:42:00 UTC 2022 Alejandro Colomar <alx.manpages@gmail.com> Removed dead code.

nxt_sockaddr_ntop() stopped being used in commit (git) 029942f4eb71.
It has been replaced mostly by nxt_sockaddr_text().

commit 029942f4eb7196c2cff0d0e26bc6ff274138f7d8
Author: Igor Sysoev <igor@sysoev.ru>
Date: Wed Feb 22 15:09:59 2017 +0300

I/O operations refactoring.

nxt_job_sockaddr_parse() stopped being used in commit (git) 794248090a74.

commit 794248090a74f31cbfcf24ea8c835df2d4d21073
Author: Igor Sysoev <igor@sysoev.ru>
Date: Wed Mar 4 14:04:08 2020 +0300

Legacy upstream code removed.

Also, remove functions and types used only by those two functions:

nxt_job_sockaddr_unix_parse()
nxt_job_sockaddr_inet6_parse()
nxt_job_sockaddr_inet_parse()
nxt_job_sockaddr_parse_t
nxt_job_resolve()
nxt_job_resolve_t
diff 240:36bafba970b5 Mon Aug 28 23:59:00 UTC 2017 Igor Sysoev <igor@sysoev.ru> The master process has been renamed to the main process.
H A Dmakediff 2439:4cabfc9895f4 Mon Apr 24 15:59:00 UTC 2023 Alejandro Colomar <alx@nginx.com> Docs: moved uintd.8 to man8/ subdirectory.

Reviewed-by: Artem Konev <a.konev@f5.com>
Signed-off-by: Alejandro Colomar <alx@nginx.com>
/unit/auto/modules/
H A Djavadiff 2571:59a0b60a5cdb Tue Oct 10 15:55:00 UTC 2023 Sergey A. Osokin <sergey.osokin@nginx.com> Update third-party components for the Java module.
H A Dpythondiff 1237:59eaa56b8f5c Tue Oct 22 13:04:00 UTC 2019 Max Romanov <max.romanov@nginx.com> Python: fixing build for Python 3.8.

Thanks to tonyafanasyev.
This is related to #331 issue on GitHub.
/unit/docs/
H A Dchanges.xmldiff 2202:29b3edfb613d Mon Sep 19 10:59:00 UTC 2022 Andrei Zeliankou <zelenkov@nginx.com> Version bump.
diff 1733:dab8544b5440 Mon Dec 07 22:59:00 UTC 2020 Valentin Bartenev <vbart@nginx.com> PHP: populating PHP_AUTH_* server variables.

This closes #498 issue on GitHub.
diff 1722:8d987b7880f9 Thu Nov 19 16:59:00 UTC 2020 Valentin Bartenev <vbart@nginx.com> Added version 1.21.0 CHANGES.
diff 1227:b061a97ee704 Thu Oct 03 14:59:00 UTC 2019 Andrei Belov <defan@nginx.com> Reorder entries in changes.xml to match chronological order.

123456