Home
last modified time | relevance | path

Searched hist:38 (Results 26 – 50 of 56) sorted by path

123

/unit/src/
H A Dnxt_mp.cdiff 832:4f5daf367ff7 Sat Nov 10 04:38:00 UTC 2018 Valentin Bartenev <vbart@nginx.com> Fixed "freed pointer is out of pool" alerts.

The issue was caused by misplacement of allocated blocks in rbtree due
to broken comparison function if the distance between two allocations
did not fit into intptr_t. As the result, nxt_mp_free() could have
failed to find the allocation.

In particular, it was mostly observed when Unit was compiled with
musl C library on 32-bits systems.

This closes #118 issue on GitHub.
H A Dnxt_openssl.cdiff 2223:1019031754fe Wed Jan 16 07:38:00 UTC 2019 Remi Collet <remi@remirepo.net> Preferring system crypto policy.

If we don't call SSL_CTX_set_cipher_list(), then it uses the
system's default.

Link: <https://fedoraproject.org/wiki/Changes/CryptoPolicy>
Link: <https://docs.fedoraproject.org/en-US/packaging-guidelines/CryptoPolicies/>
Link: <https://www.redhat.com/en/blog/consistent-security-crypto-policies-red-hat-enterprise-linux-8>
Signed-off-by: Remi Collet <remi@remirepo.net>
Acked-by: Andrei Belov <defan@nginx.com>
[ alx: add changelog and tweak commit message ]
Signed-off-by: Alejandro Colomar <alx@nginx.com>
H A Dnxt_php_sapi.cdiff 2230:83b2d20d8f5c Fri Sep 16 13:38:00 UTC 2022 Andrew Clayton <a.clayton@nginx.com> PHP: allowed to specify URLs without a trailing '/'.

Both @lucatacconi & @mwoodpatrick reported what appears to be the same
issue on GitHub. Namely that when using the PHP language module and
trying to access a URL that is a directory but without specifying the
trailing '/', they were getting a '503 Service Unavailable' error.

Note: This is when _not_ using the 'script' option.

E.g with the following config

{
"listeners": {
"[::1]:8080": {
"pass": "applications/php"
}
},

"applications": {
"php": {
"type": "php",
"root": "/var/tmp/unit-php"
}
}
}

and with a directory path of /var/tmp/unit-php/foo containing an
index.php, you would see the following

$ curl http://localhost/foo
<title>Error 503</title>
Error 503

However

$ curl http://localhost/foo/

would work and serve up the index.php

This commit fixes the above so you get the desired behaviour without
specifying the trailing '/' by doing the following

1] If the URL doesn't end in .php and doesn't have a trailing '/'
then check if the requested path is a directory.

2) If it is a directory then create a 301 re-direct pointing to it.
This matches the behaviour of the likes of nginx, Apache and
lighttpd.

This also matches the behaviour of the "share" action in Unit.

This doesn't effect the behaviour of the 'script' option which bypasses
the nxt_php_dynamic_request() function.

This also adds a couple of tests to test/test_php_application.py to
ensure this continues to work.

Closes: <https://github.com/nginx/unit/issues/717>
Closes: <https://github.com/nginx/unit/issues/753>
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
diff 1376:2ecb15904ba5 Tue Mar 03 14:38:00 UTC 2020 Tiago Natel de Moura <t.nateldemoura@f5.com> PHP: optimization to avoid surplus chdir(2) calls.

For each request, the worker calls the php_execute_script function
from libphp that changes to the script directory before doing its
work and then restores the process directory before returning. The
chdir(2) calls it performs are unnecessary in Unit design. In simple
benchmarks, profiling shows that the chdir syscall code path (syscall,
FS walk, etc.) is where the CPU spends most of its time.

PHP SAPI semantics requires the script to be run from the script
directory. In Unit's PHP implementation, we have two use cases:

- script
- arbitrary path

The "script" configuration doesn't have much need for a working
directory change: it can be changed once at module initialization.
The module needs to chdir again only if the user's PHP script also
calls chdir to switch to another directory during execution.

If "script" is not used in Unit configuration, we must ensure the
script is run from its directory (thus calling chdir before exec),
but there's no need to restore the working directory later.

Our implementation disables mandatory chdir calls with the SAPI
option SAPI_OPTION_NO_CHDIR, instead calling chdir only when needed.

To detect the user's calls to chdir, a simple "unit" extension is
added that hooks the built-in chdir() PHP call.
H A Dnxt_port.hdiff 424:38b478d79178 Wed Dec 27 14:46:00 UTC 2017 Max Romanov <max.romanov@nginx.com> Changing worker selection precedence.

This patch increase precedence of non-started worker over busy worker.

1. idle worker;
2. start new worker;
3. busy worker, but can accept request in advance;
H A Dnxt_port_socket.cdiff 1005:7000543fffde Tue Mar 05 12:38:00 UTC 2019 Max Romanov <max.romanov@nginx.com> Improving port message fragment recognition.

This is required to assemble fragmented messages correctly. Stream
identifier is unique only for messages generated within a process, but
the (stream, pid) pair should be enough to avoid collisions. Adding
reply_port seems redundant because it's enough to add stream to a pid.

This closes #199 issue on GitHub.
Thanks to 洪志道 (Hong Zhi Dao).
diff 1004:306ceaf8927d Tue Mar 05 12:38:00 UTC 2019 Max Romanov <max.romanov@nginx.com> Fixing EAGAIN processing for port message send.

Sending large plain (exceeding port's max_size, not in shared memory) messages
causes message fragmentation. First message fragment is sent successfully,
but the next fragment may fail with the EAGAIN error. In this case, the
message has to be pushed back to queue head for additional processing.

Related to #167 issue on GitHub.
diff 1002:ba4c745528cf Tue Mar 05 12:38:00 UTC 2019 Max Romanov <max.romanov@nginx.com> Including port message header into message size limit.

Before this fix, large plain message (i.e. configuration) send may fail
with the 'Message too big' error, because internal fragmentation
implementation does not account for 16 byte message header.

This closes #167 issue on GitHub.
H A Dnxt_router.cdiff 2230:83b2d20d8f5c Fri Sep 16 13:38:00 UTC 2022 Andrew Clayton <a.clayton@nginx.com> PHP: allowed to specify URLs without a trailing '/'.

Both @lucatacconi & @mwoodpatrick reported what appears to be the same
issue on GitHub. Namely that when using the PHP language module and
trying to access a URL that is a directory but without specifying the
trailing '/', they were getting a '503 Service Unavailable' error.

Note: This is when _not_ using the 'script' option.

E.g with the following config

{
"listeners": {
"[::1]:8080": {
"pass": "applications/php"
}
},

"applications": {
"php": {
"type": "php",
"root": "/var/tmp/unit-php"
}
}
}

and with a directory path of /var/tmp/unit-php/foo containing an
index.php, you would see the following

$ curl http://localhost/foo
<title>Error 503</title>
Error 503

However

$ curl http://localhost/foo/

would work and serve up the index.php

This commit fixes the above so you get the desired behaviour without
specifying the trailing '/' by doing the following

1] If the URL doesn't end in .php and doesn't have a trailing '/'
then check if the requested path is a directory.

2) If it is a directory then create a 301 re-direct pointing to it.
This matches the behaviour of the likes of nginx, Apache and
lighttpd.

This also matches the behaviour of the "share" action in Unit.

This doesn't effect the behaviour of the 'script' option which bypasses
the nxt_php_dynamic_request() function.

This also adds a couple of tests to test/test_php_application.py to
ensure this continues to work.

Closes: <https://github.com/nginx/unit/issues/717>
Closes: <https://github.com/nginx/unit/issues/753>
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
diff 615:38d50cba8f00 Thu Apr 05 14:19:00 UTC 2018 Max Romanov <max.romanov@nginx.com> Stopping timed out application process.
diff 424:38b478d79178 Wed Dec 27 14:46:00 UTC 2017 Max Romanov <max.romanov@nginx.com> Changing worker selection precedence.

This patch increase precedence of non-started worker over busy worker.

1. idle worker;
2. start new worker;
3. busy worker, but can accept request in advance;
diff 317:94010c8bd7bc Fri Sep 15 11:38:00 UTC 2017 Valentin Bartenev <vbart@nginx.com> Fixed port handlers arrays.
diff 119:22bc18e61479 Thu Jul 06 15:38:00 UTC 2017 Max Romanov <max.romanov@nginx.com> Router: read configuration from port.

Controller: stub to send configuration from POST body "as is" to router.
diff 58:506c889e2682 Fri Jun 09 18:38:00 UTC 2017 Valentin Bartenev <vbart@nginx.com> Fixed building by GCC 7 (broken in 0b10a73d4993).
H A Dnxt_router.hdiff 119:22bc18e61479 Thu Jul 06 15:38:00 UTC 2017 Max Romanov <max.romanov@nginx.com> Router: read configuration from port.

Controller: stub to send configuration from POST body "as is" to router.
H A Dnxt_socketpair.cdiff 1003:a7122e3c6e06 Tue Mar 05 12:38:00 UTC 2019 Max Romanov <max.romanov@nginx.com> Handling ENOBUFS error same was as EAGAIN.

Unlike EAGAIN, ENOBUFS returned on OSX when trying to send many relatively
small (64 bytes) fragments.

Found during investigation of #167 issue on GitHub.
H A Dnxt_thread_pool.cdiff 157:38ae841c09ae Fri Jul 14 17:34:00 UTC 2017 Igor Sysoev <igor@sysoev.ru> Thread pools: various fixes.
H A Dnxt_unit_request.hdiff 2230:83b2d20d8f5c Fri Sep 16 13:38:00 UTC 2022 Andrew Clayton <a.clayton@nginx.com> PHP: allowed to specify URLs without a trailing '/'.

Both @lucatacconi & @mwoodpatrick reported what appears to be the same
issue on GitHub. Namely that when using the PHP language module and
trying to access a URL that is a directory but without specifying the
trailing '/', they were getting a '503 Service Unavailable' error.

Note: This is when _not_ using the 'script' option.

E.g with the following config

{
"listeners": {
"[::1]:8080": {
"pass": "applications/php"
}
},

"applications": {
"php": {
"type": "php",
"root": "/var/tmp/unit-php"
}
}
}

and with a directory path of /var/tmp/unit-php/foo containing an
index.php, you would see the following

$ curl http://localhost/foo
<title>Error 503</title>
Error 503

However

$ curl http://localhost/foo/

would work and serve up the index.php

This commit fixes the above so you get the desired behaviour without
specifying the trailing '/' by doing the following

1] If the URL doesn't end in .php and doesn't have a trailing '/'
then check if the requested path is a directory.

2) If it is a directory then create a 301 re-direct pointing to it.
This matches the behaviour of the likes of nginx, Apache and
lighttpd.

This also matches the behaviour of the "share" action in Unit.

This doesn't effect the behaviour of the 'script' option which bypasses
the nxt_php_dynamic_request() function.

This also adds a couple of tests to test/test_php_application.py to
ensure this continues to work.

Closes: <https://github.com/nginx/unit/issues/717>
Closes: <https://github.com/nginx/unit/issues/753>
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
/unit/src/python/
H A Dnxt_python.cdiff 2251:6e5a9550ead3 Thu Nov 17 21:56:00 UTC 2022 Andrew Clayton <a.clayton@nginx.com> Python: Added support for Python 3.11.

Python 3.8 added a new Python initialisation configuration API[0].

Python 3.11 marked the old API as deprecated resulting in the following
compiler warnings which we treat as errors, failing the build

src/python/nxt_python.c: In function ‘nxt_python_start’:
src/python/nxt_python.c:130:13: error: ‘Py_SetProgramName’ is deprecated [-Werror=deprecated-declarations]
130 | Py_SetProgramName(nxt_py_home);
| ^~~~~~~~~~~~~~~~~
In file included from /opt/python-3.11/include/python3.11/Python.h:94,
from src/python/nxt_python.c:7:
/opt/python-3.11/include/python3.11/pylifecycle.h:37:38: note: declared here
37 | Py_DEPRECATED(3.11) PyAPI_FUNC(void) Py_SetProgramName(const wchar_t *);
| ^~~~~~~~~~~~~~~~~
src/python/nxt_python.c:134:13: error: ‘Py_SetPythonHome’ is deprecated [-Werror=deprecated-declarations]
134 | Py_SetPythonHome(nxt_py_home);
| ^~~~~~~~~~~~~~~~
/opt/python-3.11/include/python3.11/pylifecycle.h:40:38: note: declared here
40 | Py_DEPRECATED(3.11) PyAPI_FUNC(void) Py_SetPythonHome(const wchar_t *);
| ^~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

We actually have a few config scenarios: Python < 3, Python >= 3.0 < 3.8
and for Python 3 we have two configs where we select one based on
virtual environment setup.

Factor out the Python 3 config initialisation into its own function. We
actually create two functions, one for Python 3.8+ and one for older
Python 3. We pick the right function to use at build time.

The new API also has error checking (where the old API doesn't) which we
handle.

[0]: https://peps.python.org/pep-0587/

Closes: <https://github.com/nginx/unit/issues/710>
[ Andrew: Expanded upon patch from @sandeep-gh ]
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
diff 2251:6e5a9550ead3 Thu Nov 17 21:56:00 UTC 2022 Andrew Clayton <a.clayton@nginx.com> Python: Added support for Python 3.11.

Python 3.8 added a new Python initialisation configuration API[0].

Python 3.11 marked the old API as deprecated resulting in the following
compiler warnings which we treat as errors, failing the build

src/python/nxt_python.c: In function ‘nxt_python_start’:
src/python/nxt_python.c:130:13: error: ‘Py_SetProgramName’ is deprecated [-Werror=deprecated-declarations]
130 | Py_SetProgramName(nxt_py_home);
| ^~~~~~~~~~~~~~~~~
In file included from /opt/python-3.11/include/python3.11/Python.h:94,
from src/python/nxt_python.c:7:
/opt/python-3.11/include/python3.11/pylifecycle.h:37:38: note: declared here
37 | Py_DEPRECATED(3.11) PyAPI_FUNC(void) Py_SetProgramName(const wchar_t *);
| ^~~~~~~~~~~~~~~~~
src/python/nxt_python.c:134:13: error: ‘Py_SetPythonHome’ is deprecated [-Werror=deprecated-declarations]
134 | Py_SetPythonHome(nxt_py_home);
| ^~~~~~~~~~~~~~~~
/opt/python-3.11/include/python3.11/pylifecycle.h:40:38: note: declared here
40 | Py_DEPRECATED(3.11) PyAPI_FUNC(void) Py_SetPythonHome(const wchar_t *);
| ^~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

We actually have a few config scenarios: Python < 3, Python >= 3.0 < 3.8
and for Python 3 we have two configs where we select one based on
virtual environment setup.

Factor out the Python 3 config initialisation into its own function. We
actually create two functions, one for Python 3.8+ and one for older
Python 3. We pick the right function to use at build time.

The new API also has error checking (where the old API doesn't) which we
handle.

[0]: https://peps.python.org/pep-0587/

Closes: <https://github.com/nginx/unit/issues/710>
[ Andrew: Expanded upon patch from @sandeep-gh ]
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
/unit/test/
H A Dconftest.pydiff 1769:b7cd1517081e Fri Jan 08 10:38:00 UTC 2021 Tiago Natel de Moura <t.nateldemoura@f5.com> Tests: fixed test_respawn.py to act upon test processes.

Running `test_respawn_` test cases on a machine with Unit
daemon in background would fail tests because `ps ax` was
used without filtering out other unit instances.

This patch also prevents from tests killing other Unit
processes not related to tests.
H A Dtest_access_log.pydiff 1017:887a4bbabf1e Tue Mar 26 20:38:00 UTC 2019 Andrey Zelenkov <zelenkov@nginx.com> Tests: style.
H A Dtest_configuration.pydiff 1017:887a4bbabf1e Tue Mar 26 20:38:00 UTC 2019 Andrey Zelenkov <zelenkov@nginx.com> Tests: style.
diff 1006:25028f521ae1 Tue Mar 05 12:38:00 UTC 2019 Max Romanov <max.romanov@nginx.com> Introducing one more large config test, but without sockets.
H A Dtest_go_application.pydiff 1017:887a4bbabf1e Tue Mar 26 20:38:00 UTC 2019 Andrey Zelenkov <zelenkov@nginx.com> Tests: style.
H A Dtest_http_header.pydiff 1017:887a4bbabf1e Tue Mar 26 20:38:00 UTC 2019 Andrey Zelenkov <zelenkov@nginx.com> Tests: style.
H A Dtest_java_application.pydiff 1017:887a4bbabf1e Tue Mar 26 20:38:00 UTC 2019 Andrey Zelenkov <zelenkov@nginx.com> Tests: style.
H A Dtest_node_application.pydiff 1017:887a4bbabf1e Tue Mar 26 20:38:00 UTC 2019 Andrey Zelenkov <zelenkov@nginx.com> Tests: style.
H A Dtest_perl_application.pydiff 1017:887a4bbabf1e Tue Mar 26 20:38:00 UTC 2019 Andrey Zelenkov <zelenkov@nginx.com> Tests: style.
H A Dtest_php_application.pydiff 2230:83b2d20d8f5c Fri Sep 16 13:38:00 UTC 2022 Andrew Clayton <a.clayton@nginx.com> PHP: allowed to specify URLs without a trailing '/'.

Both @lucatacconi & @mwoodpatrick reported what appears to be the same
issue on GitHub. Namely that when using the PHP language module and
trying to access a URL that is a directory but without specifying the
trailing '/', they were getting a '503 Service Unavailable' error.

Note: This is when _not_ using the 'script' option.

E.g with the following config

{
"listeners": {
"[::1]:8080": {
"pass": "applications/php"
}
},

"applications": {
"php": {
"type": "php",
"root": "/var/tmp/unit-php"
}
}
}

and with a directory path of /var/tmp/unit-php/foo containing an
index.php, you would see the following

$ curl http://localhost/foo
<title>Error 503</title>
Error 503

However

$ curl http://localhost/foo/

would work and serve up the index.php

This commit fixes the above so you get the desired behaviour without
specifying the trailing '/' by doing the following

1] If the URL doesn't end in .php and doesn't have a trailing '/'
then check if the requested path is a directory.

2) If it is a directory then create a 301 re-direct pointing to it.
This matches the behaviour of the likes of nginx, Apache and
lighttpd.

This also matches the behaviour of the "share" action in Unit.

This doesn't effect the behaviour of the 'script' option which bypasses
the nxt_php_dynamic_request() function.

This also adds a couple of tests to test/test_php_application.py to
ensure this continues to work.

Closes: <https://github.com/nginx/unit/issues/717>
Closes: <https://github.com/nginx/unit/issues/753>
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
diff 1017:887a4bbabf1e Tue Mar 26 20:38:00 UTC 2019 Andrey Zelenkov <zelenkov@nginx.com> Tests: style.
H A Dtest_php_basic.pydiff 1017:887a4bbabf1e Tue Mar 26 20:38:00 UTC 2019 Andrey Zelenkov <zelenkov@nginx.com> Tests: style.
H A Dtest_python_application.pydiff 1017:887a4bbabf1e Tue Mar 26 20:38:00 UTC 2019 Andrey Zelenkov <zelenkov@nginx.com> Tests: style.
H A Dtest_python_basic.pydiff 1017:887a4bbabf1e Tue Mar 26 20:38:00 UTC 2019 Andrey Zelenkov <zelenkov@nginx.com> Tests: style.
H A Dtest_python_environment.pydiff 1017:887a4bbabf1e Tue Mar 26 20:38:00 UTC 2019 Andrey Zelenkov <zelenkov@nginx.com> Tests: style.
H A Dtest_respawn.pydiff 1769:b7cd1517081e Fri Jan 08 10:38:00 UTC 2021 Tiago Natel de Moura <t.nateldemoura@f5.com> Tests: fixed test_respawn.py to act upon test processes.

Running `test_respawn_` test cases on a machine with Unit
daemon in background would fail tests because `ps ax` was
used without filtering out other unit instances.

This patch also prevents from tests killing other Unit
processes not related to tests.
1471:38ede0766e1a Tue May 12 16:59:00 UTC 2020 Andrei Zeliankou <zelenkov@nginx.com> Tests: added respawn tests.

123