/unit/test/ |
H A D | test_go_isolation.py | diff 2480:63b9663e2f8f Thu May 25 15:56:00 UTC 2023 Andrei Zeliankou <zelenkov@nginx.com> Tests: assertion related fixes.
|
H A D | test_client_ip.py | diff 2478:c08289a08a73 Thu May 25 15:56:00 UTC 2023 Andrei Zeliankou <zelenkov@nginx.com> Tests: unified setup method usage.
To make fixtures accessible inside of setup methods in tests all these methods are renamed to the "setup_method_fixture" and decorated by autouse flag.
Also all setup methods moved to the top of the files.
|
H A D | test_asgi_websockets.py | diff 2480:63b9663e2f8f Thu May 25 15:56:00 UTC 2023 Andrei Zeliankou <zelenkov@nginx.com> Tests: assertion related fixes.
|
H A D | test_forwarded_header.py | diff 2478:c08289a08a73 Thu May 25 15:56:00 UTC 2023 Andrei Zeliankou <zelenkov@nginx.com> Tests: unified setup method usage.
To make fixtures accessible inside of setup methods in tests all these methods are renamed to the "setup_method_fixture" and decorated by autouse flag.
Also all setup methods moved to the top of the files.
|
H A D | conftest.py | diff 1852:74a7d5e98a88 Wed Apr 14 14:56:00 UTC 2021 Andrei Zeliankou <zelenkov@nginx.com> Tests: fixed "skip" descriptors check flag for controller.
|
H A D | test_status.py | diff 2480:63b9663e2f8f Thu May 25 15:56:00 UTC 2023 Andrei Zeliankou <zelenkov@nginx.com> Tests: assertion related fixes.
|
H A D | test_ruby_isolation.py | diff 2479:208ef4e1186a Thu May 25 15:56:00 UTC 2023 Andrei Zeliankou <zelenkov@nginx.com> Tests: "temp_dir" fixture used were possible.
|
H A D | test_python_isolation_chroot.py | diff 2480:63b9663e2f8f Thu May 25 15:56:00 UTC 2023 Andrei Zeliankou <zelenkov@nginx.com> Tests: assertion related fixes.
|
H A D | test_go_isolation_rootfs.py | diff 2480:63b9663e2f8f Thu May 25 15:56:00 UTC 2023 Andrei Zeliankou <zelenkov@nginx.com> Tests: assertion related fixes.
|
/unit/src/ruby/ |
H A D | nxt_ruby.c | diff 2608:2091b078cdf6 Mon Oct 23 13:24:00 UTC 2023 Andrew Clayton <a.clayton@nginx.com> Ruby: Handle response field arrays
@xeron on GitHub reported an issue whereby with a Rails 7.1 application they were getting the following error
2023/10/22 20:57:28 [error] 56#56 [unit] #8: Ruby: Wrong header entry 'value' from application 2023/10/22 20:57:28 [error] 56#56 [unit] #8: Ruby: Failed to run ruby script
After some back and forth debugging it turns out rack was trying to send back a header comprised of an array of values. E.g
app = Proc.new do |env| ["200", { "Content-Type" => "text/plain", "X-Array-Header" => ["Item-1", "Item-2"], }, ["Hello World\n"]] end
run app
It seems this became a possibility in rack v3.0[0]
So along with a header value type of T_STRING we need to also allow T_ARRAY.
If we get a T_ARRAY we need to build up the header field using the given values.
E.g
"X-Array-Header" => ["Item-1", "", "Item-3", "Item-4"],
becomes
X-Array-Header: Item-1; ; Item-3; Item-4
[0]: <https://github.com/rack/rack/blob/main/UPGRADE-GUIDE.md?plain=1#L26>
Reported-by: Ivan Larionov <xeron.oskom@gmail.com> Closes: <https://github.com/nginx/unit/issues/974> Link: <https://github.com/nginx/unit/pull/998> Tested-by: Timo Stark <t.stark@nginx.com> Signed-off-by: Andrew Clayton <a.clayton@nginx.com> diff 2608:2091b078cdf6 Mon Oct 23 13:24:00 UTC 2023 Andrew Clayton <a.clayton@nginx.com> Ruby: Handle response field arrays
@xeron on GitHub reported an issue whereby with a Rails 7.1 application they were getting the following error
2023/10/22 20:57:28 [error] 56#56 [unit] #8: Ruby: Wrong header entry 'value' from application 2023/10/22 20:57:28 [error] 56#56 [unit] #8: Ruby: Failed to run ruby script
After some back and forth debugging it turns out rack was trying to send back a header comprised of an array of values. E.g
app = Proc.new do |env| ["200", { "Content-Type" => "text/plain", "X-Array-Header" => ["Item-1", "Item-2"], }, ["Hello World\n"]] end
run app
It seems this became a possibility in rack v3.0[0]
So along with a header value type of T_STRING we need to also allow T_ARRAY.
If we get a T_ARRAY we need to build up the header field using the given values.
E.g
"X-Array-Header" => ["Item-1", "", "Item-3", "Item-4"],
becomes
X-Array-Header: Item-1; ; Item-3; Item-4
[0]: <https://github.com/rack/rack/blob/main/UPGRADE-GUIDE.md?plain=1#L26>
Reported-by: Ivan Larionov <xeron.oskom@gmail.com> Closes: <https://github.com/nginx/unit/issues/974> Link: <https://github.com/nginx/unit/pull/998> Tested-by: Timo Stark <t.stark@nginx.com> Signed-off-by: Andrew Clayton <a.clayton@nginx.com> diff 2608:2091b078cdf6 Mon Oct 23 13:24:00 UTC 2023 Andrew Clayton <a.clayton@nginx.com> Ruby: Handle response field arrays
@xeron on GitHub reported an issue whereby with a Rails 7.1 application they were getting the following error
2023/10/22 20:57:28 [error] 56#56 [unit] #8: Ruby: Wrong header entry 'value' from application 2023/10/22 20:57:28 [error] 56#56 [unit] #8: Ruby: Failed to run ruby script
After some back and forth debugging it turns out rack was trying to send back a header comprised of an array of values. E.g
app = Proc.new do |env| ["200", { "Content-Type" => "text/plain", "X-Array-Header" => ["Item-1", "Item-2"], }, ["Hello World\n"]] end
run app
It seems this became a possibility in rack v3.0[0]
So along with a header value type of T_STRING we need to also allow T_ARRAY.
If we get a T_ARRAY we need to build up the header field using the given values.
E.g
"X-Array-Header" => ["Item-1", "", "Item-3", "Item-4"],
becomes
X-Array-Header: Item-1; ; Item-3; Item-4
[0]: <https://github.com/rack/rack/blob/main/UPGRADE-GUIDE.md?plain=1#L26>
Reported-by: Ivan Larionov <xeron.oskom@gmail.com> Closes: <https://github.com/nginx/unit/issues/974> Link: <https://github.com/nginx/unit/pull/998> Tested-by: Timo Stark <t.stark@nginx.com> Signed-off-by: Andrew Clayton <a.clayton@nginx.com> diff 2608:2091b078cdf6 Mon Oct 23 13:24:00 UTC 2023 Andrew Clayton <a.clayton@nginx.com> Ruby: Handle response field arrays
@xeron on GitHub reported an issue whereby with a Rails 7.1 application they were getting the following error
2023/10/22 20:57:28 [error] 56#56 [unit] #8: Ruby: Wrong header entry 'value' from application 2023/10/22 20:57:28 [error] 56#56 [unit] #8: Ruby: Failed to run ruby script
After some back and forth debugging it turns out rack was trying to send back a header comprised of an array of values. E.g
app = Proc.new do |env| ["200", { "Content-Type" => "text/plain", "X-Array-Header" => ["Item-1", "Item-2"], }, ["Hello World\n"]] end
run app
It seems this became a possibility in rack v3.0[0]
So along with a header value type of T_STRING we need to also allow T_ARRAY.
If we get a T_ARRAY we need to build up the header field using the given values.
E.g
"X-Array-Header" => ["Item-1", "", "Item-3", "Item-4"],
becomes
X-Array-Header: Item-1; ; Item-3; Item-4
[0]: <https://github.com/rack/rack/blob/main/UPGRADE-GUIDE.md?plain=1#L26>
Reported-by: Ivan Larionov <xeron.oskom@gmail.com> Closes: <https://github.com/nginx/unit/issues/974> Link: <https://github.com/nginx/unit/pull/998> Tested-by: Timo Stark <t.stark@nginx.com> Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
/unit/src/java/nginx/unit/websocket/ |
H A D | DigestAuthenticator.java | diff 2601:a117af8c7477 Mon Nov 20 15:56:00 UTC 2023 Sergey A. Osokin <sergey.osokin@nginx.com> Fixed the MD5Encoder deprecation warning.
|
/unit/src/ |
H A D | nxt_php_sapi.c | diff 1199:a9973782258d Mon Sep 23 11:56:00 UTC 2019 Sergey Kandaurov <pluknet@nginx.com> PHP: zeroing the whole file_handle structure.
Fixes segfaults with PHP 7.4.
|
H A D | nxt_unit.h | diff 877:ed8b1aaefdd1 Wed Dec 19 12:56:00 UTC 2018 Alexander Borisov <alexander.borisov@nginx.com> libunit: added generation of version header file.
|
H A D | nxt_atomic.h | diff 2084:7d479274f334 Sat Apr 30 17:20:00 UTC 2022 Alejandro Colomar <alx.manpages@gmail.com> Fixed #define style.
We had a mix of styles for declaring function-like macros:
Style A: #define \ foo() \ do { \ ... \ } while (0)
Style B: #define foo() \ do { \ ... \ } while (0)
We had a similar number of occurences of each style:
$ grep -rnI '^\w*(.*\\' | wc -l 244 $ grep -rn 'define.*(.*)' | wc -l 239
(Those regexes aren't perfect, but a very decent approximation.)
Real examples:
$ find src -type f | xargs sed -n '/^nxt_double_is_zero/,/^$/p' nxt_double_is_zero(f) \ (fabs(f) <= FLT_EPSILON)
$ find src -type f | xargs sed -n '/define nxt_http_field_set/,/^$/p' #define nxt_http_field_set(_field, _name, _value) \ do { \ (_field)->name_length = nxt_length(_name); \ (_field)->value_length = nxt_length(_value); \ (_field)->name = (u_char *) _name; \ (_field)->value = (u_char *) _value; \ } while (0)
I'd like to standardize on a single style for them, and IMO, having the identifier in the same line as #define is a better option for the following reasons:
- Programmers are used to `#define foo() ...` (readability). - One less line of code. - The program for finding them is really simple (see below).
function grep_ngx_func() { if (($# != 1)); then >&2 echo "Usage: ${FUNCNAME[0]} <func>"; return 1; fi;
find src -type f \ | grep '\.[ch]$' \ | xargs grep -l "$1" \ | sort \ | xargs pcregrep -Mn "(?s)^\$[\w\s*]+?^$1\(.*?^}";
find src -type f \ | grep '\.[ch]$' \ | xargs grep -l "$1" \ | sort \ | xargs pcregrep -Mn "(?s)define $1\(.*?^$" \ | sed -E '1s/^[^:]+:[0-9]+:/&\n\n/'; }
$ grep_ngx_func Usage: grep_ngx_func <func>
$ grep_ngx_func nxt_http_field_set src/nxt_http.h:98:
#define nxt_http_field_set(_field, _name, _value) \ do { \ (_field)->name_length = nxt_length(_name); \ (_field)->value_length = nxt_length(_value); \ (_field)->name = (u_char *) _name; \ (_field)->value = (u_char *) _value; \ } while (0)
$ grep_ngx_func nxt_sprintf src/nxt_sprintf.c:56:
u_char * nxt_cdecl nxt_sprintf(u_char *buf, u_char *end, const char *fmt, ...) { u_char *p; va_list args;
va_start(args, fmt); p = nxt_vsprintf(buf, end, fmt, args); va_end(args);
return p; }
................ Scripted change: ................
$ find src -type f \ | grep '\.[ch]$' \ | xargs sed -i '/define *\\$/{N;s/ *\\\n/ /;s/ //}'
|
H A D | nxt_sprintf.c | diff 2084:7d479274f334 Sat Apr 30 17:20:00 UTC 2022 Alejandro Colomar <alx.manpages@gmail.com> Fixed #define style.
We had a mix of styles for declaring function-like macros:
Style A: #define \ foo() \ do { \ ... \ } while (0)
Style B: #define foo() \ do { \ ... \ } while (0)
We had a similar number of occurences of each style:
$ grep -rnI '^\w*(.*\\' | wc -l 244 $ grep -rn 'define.*(.*)' | wc -l 239
(Those regexes aren't perfect, but a very decent approximation.)
Real examples:
$ find src -type f | xargs sed -n '/^nxt_double_is_zero/,/^$/p' nxt_double_is_zero(f) \ (fabs(f) <= FLT_EPSILON)
$ find src -type f | xargs sed -n '/define nxt_http_field_set/,/^$/p' #define nxt_http_field_set(_field, _name, _value) \ do { \ (_field)->name_length = nxt_length(_name); \ (_field)->value_length = nxt_length(_value); \ (_field)->name = (u_char *) _name; \ (_field)->value = (u_char *) _value; \ } while (0)
I'd like to standardize on a single style for them, and IMO, having the identifier in the same line as #define is a better option for the following reasons:
- Programmers are used to `#define foo() ...` (readability). - One less line of code. - The program for finding them is really simple (see below).
function grep_ngx_func() { if (($# != 1)); then >&2 echo "Usage: ${FUNCNAME[0]} <func>"; return 1; fi;
find src -type f \ | grep '\.[ch]$' \ | xargs grep -l "$1" \ | sort \ | xargs pcregrep -Mn "(?s)^\$[\w\s*]+?^$1\(.*?^}";
find src -type f \ | grep '\.[ch]$' \ | xargs grep -l "$1" \ | sort \ | xargs pcregrep -Mn "(?s)define $1\(.*?^$" \ | sed -E '1s/^[^:]+:[0-9]+:/&\n\n/'; }
$ grep_ngx_func Usage: grep_ngx_func <func>
$ grep_ngx_func nxt_http_field_set src/nxt_http.h:98:
#define nxt_http_field_set(_field, _name, _value) \ do { \ (_field)->name_length = nxt_length(_name); \ (_field)->value_length = nxt_length(_value); \ (_field)->name = (u_char *) _name; \ (_field)->value = (u_char *) _value; \ } while (0)
$ grep_ngx_func nxt_sprintf src/nxt_sprintf.c:56:
u_char * nxt_cdecl nxt_sprintf(u_char *buf, u_char *end, const char *fmt, ...) { u_char *p; va_list args;
va_start(args, fmt); p = nxt_vsprintf(buf, end, fmt, args); va_end(args);
return p; }
................ Scripted change: ................
$ find src -type f \ | grep '\.[ch]$' \ | xargs sed -i '/define *\\$/{N;s/ *\\\n/ /;s/ //}' diff 704:1fcac04f0a15 Mon Jun 25 13:56:00 UTC 2018 Igor Sysoev <igor@sysoev.ru> Removed '\r' and '\n' artifact macros.
|
H A D | nxt_controller.c | diff 106:a30dda81de1d Wed Jun 28 15:56:00 UTC 2017 Valentin Bartenev <vbart@nginx.com> Configuration: reduced names of structures, functions, and macros. diff 56:92b4984ca3c1 Tue Jun 06 15:57:00 UTC 2017 Igor Sysoev <igor@sysoev.ru> C99 style declaration of connection states.
|
H A D | nxt_http_route.c | diff 1991:61155eb41a96 Fri Nov 05 14:56:00 UTC 2021 Zhidao HONG <z.hong@f5.com> Router: matching query string support.
The "query" option matches decoded arguments, including plus ('+') to space (' '). Like "uri", it can be a string or an array of strings.
|
H A D | nxt_http.h | diff 1991:61155eb41a96 Fri Nov 05 14:56:00 UTC 2021 Zhidao HONG <z.hong@f5.com> Router: matching query string support.
The "query" option matches decoded arguments, including plus ('+') to space (' '). Like "uri", it can be a string or an array of strings.
|
H A D | nxt_main.h | diff 2433:56bf272df01d Mon Mar 27 18:28:00 UTC 2023 Andrew Clayton <a.clayton@nginx.com> Remove a bunch of dead code.
This removes a bunch of unused files that would have been touched by subsequent commits that switch to using nxt_bool_t (AKA unit6_t) in structures.
In auto/sources we have
NXT_LIB_SRC0=" \ src/nxt_buf_filter.c \ src/nxt_job_file.c \ src/nxt_stream_module.c \ src/nxt_stream_source.c \ src/nxt_upstream_source.c \ src/nxt_http_source.c \ src/nxt_fastcgi_source.c \ src/nxt_fastcgi_record_parse.c \ \ src/nxt_mem_pool_cleanup.h \ src/nxt_mem_pool_cleanup.c \ "
None of these seem to actually be used anywhere (other than within themselves). That variable is _not_ referenced anywhere else.
Also remove the unused related header files: src/nxt_buf_filter.h, src/nxt_fastcgi_source.h, src/nxt_http_source.h, src/nxt_job_file.h, src/nxt_stream_source.h and src/nxt_upstream_source.h
Also, these files do not seem to be used, no mention under auto/ or build/
src/nxt_file_cache.c src/nxt_cache.c src/nxt_job_file_cache.c
src/nxt_cache.h is #included in src/nxt_main.h, but AFAICT is not actually used.
With all the above removed
$ ./configure --openssl --debug --tests && make -j && make -j tests && make libnxt
all builds.
Buildbot passes.
NOTE: You may need to do a 'make clean' before the next build attempt.
Reviewed-by: Alejandro Colomar <alx@nginx.com> Signed-off-by: Andrew Clayton <a.clayton@nginx.com> diff 1:fdc027c56872 Mon Jan 23 16:56:00 UTC 2017 Igor Sysoev <igor@sysoev.ru> Introducing tasks.
|
H A D | nxt_process.h | diff 1708:4463c1fc26fd Mon Nov 16 17:56:00 UTC 2020 Tiago Natel de Moura <t.nateldemoura@f5.com> Isolation: added option to disable "procfs" mount.
Now users can disable the default procfs mount point in the rootfs.
{ "isolation": { "automount": { "procfs": false } } }
|
H A D | nxt_http_parse.c | diff 2084:7d479274f334 Sat Apr 30 17:20:00 UTC 2022 Alejandro Colomar <alx.manpages@gmail.com> Fixed #define style.
We had a mix of styles for declaring function-like macros:
Style A: #define \ foo() \ do { \ ... \ } while (0)
Style B: #define foo() \ do { \ ... \ } while (0)
We had a similar number of occurences of each style:
$ grep -rnI '^\w*(.*\\' | wc -l 244 $ grep -rn 'define.*(.*)' | wc -l 239
(Those regexes aren't perfect, but a very decent approximation.)
Real examples:
$ find src -type f | xargs sed -n '/^nxt_double_is_zero/,/^$/p' nxt_double_is_zero(f) \ (fabs(f) <= FLT_EPSILON)
$ find src -type f | xargs sed -n '/define nxt_http_field_set/,/^$/p' #define nxt_http_field_set(_field, _name, _value) \ do { \ (_field)->name_length = nxt_length(_name); \ (_field)->value_length = nxt_length(_value); \ (_field)->name = (u_char *) _name; \ (_field)->value = (u_char *) _value; \ } while (0)
I'd like to standardize on a single style for them, and IMO, having the identifier in the same line as #define is a better option for the following reasons:
- Programmers are used to `#define foo() ...` (readability). - One less line of code. - The program for finding them is really simple (see below).
function grep_ngx_func() { if (($# != 1)); then >&2 echo "Usage: ${FUNCNAME[0]} <func>"; return 1; fi;
find src -type f \ | grep '\.[ch]$' \ | xargs grep -l "$1" \ | sort \ | xargs pcregrep -Mn "(?s)^\$[\w\s*]+?^$1\(.*?^}";
find src -type f \ | grep '\.[ch]$' \ | xargs grep -l "$1" \ | sort \ | xargs pcregrep -Mn "(?s)define $1\(.*?^$" \ | sed -E '1s/^[^:]+:[0-9]+:/&\n\n/'; }
$ grep_ngx_func Usage: grep_ngx_func <func>
$ grep_ngx_func nxt_http_field_set src/nxt_http.h:98:
#define nxt_http_field_set(_field, _name, _value) \ do { \ (_field)->name_length = nxt_length(_name); \ (_field)->value_length = nxt_length(_value); \ (_field)->name = (u_char *) _name; \ (_field)->value = (u_char *) _value; \ } while (0)
$ grep_ngx_func nxt_sprintf src/nxt_sprintf.c:56:
u_char * nxt_cdecl nxt_sprintf(u_char *buf, u_char *end, const char *fmt, ...) { u_char *p; va_list args;
va_start(args, fmt); p = nxt_vsprintf(buf, end, fmt, args); va_end(args);
return p; }
................ Scripted change: ................
$ find src -type f \ | grep '\.[ch]$' \ | xargs sed -i '/define *\\$/{N;s/ *\\\n/ /;s/ //}' diff 1126:50a8b6ded8e2 Thu Aug 15 21:56:00 UTC 2019 Max Romanov <max.romanov@nginx.com> Improving response header fields processing.
Fields are filtered one by one before being added to fields list. This avoids adding and then skipping connection-specific fields. diff 704:1fcac04f0a15 Mon Jun 25 13:56:00 UTC 2018 Igor Sysoev <igor@sysoev.ru> Removed '\r' and '\n' artifact macros.
|
/unit/src/wasm/ |
H A D | nxt_wasm.h | diff 2558:9bcb190bc8be Thu Sep 14 19:35:00 UTC 2023 Andrew Clayton <a.clayton@nginx.com> Wasm: Allow uploads larger than 4GiB.
Currently Wasm modules are limited to a 32bit address space (until at least the memory64 work is completed). All the counters etc in the request structure were u32's. Which matched with 32bit memory limitation.
However there is really no need to not allow >4GiB uploads that can be saved off to disk or some such.
To do this we just need to increase the ->content_len & ->total_content_sent members to u64's.
However because we need the request structure to have the exact same layout on 32bit (for Wasm modules) as it does on 64bit we need to re-jig the order of some of these members and add a four-byte padding member.
Thus the request structure now looks like on 64bit (as shown by pahole(1))
struct nxt_wasm_request_s { uint32_t method_off; /* 0 4 */ uint32_t method_len; /* 4 4 */ uint32_t version_off; /* 8 4 */ uint32_t version_len; /* 12 4 */ uint32_t path_off; /* 16 4 */ uint32_t path_len; /* 20 4 */ uint32_t query_off; /* 24 4 */ uint32_t query_len; /* 28 4 */ uint32_t remote_off; /* 32 4 */ uint32_t remote_len; /* 36 4 */ uint32_t local_addr_off; /* 40 4 */ uint32_t local_addr_len; /* 44 4 */ uint32_t local_port_off; /* 48 4 */ uint32_t local_port_len; /* 52 4 */ uint32_t server_name_off; /* 56 4 */ uint32_t server_name_len; /* 60 4 */ /* --- cacheline 1 boundary (64 bytes) --- */ uint64_t content_len; /* 64 8 */ uint64_t total_content_sent; /* 72 8 */ uint32_t content_sent; /* 80 4 */ uint32_t content_off; /* 84 4 */ uint32_t request_size; /* 88 4 */ uint32_t nfields; /* 92 4 */ uint32_t tls; /* 96 4 */ char __pad[4]; /* 100 4 */ nxt_wasm_http_field_t fields[]; /* 104 0 */
/* size: 104, cachelines: 2, members: 25 */ /* last cacheline: 40 bytes */ };
and the same structure (taken from unit-wasm) compiled as 32bit
struct luw_req { u32 method_off; /* 0 4 */ u32 method_len; /* 4 4 */ u32 version_off; /* 8 4 */ u32 version_len; /* 12 4 */ u32 path_off; /* 16 4 */ u32 path_len; /* 20 4 */ u32 query_off; /* 24 4 */ u32 query_len; /* 28 4 */ u32 remote_off; /* 32 4 */ u32 remote_len; /* 36 4 */ u32 local_addr_off; /* 40 4 */ u32 local_addr_len; /* 44 4 */ u32 local_port_off; /* 48 4 */ u32 local_port_len; /* 52 4 */ u32 server_name_off; /* 56 4 */ u32 server_name_len; /* 60 4 */ /* --- cacheline 1 boundary (64 bytes) --- */ u64 content_len; /* 64 8 */ u64 total_content_sent; /* 72 8 */ u32 content_sent; /* 80 4 */ u32 content_off; /* 84 4 */ u32 request_size; /* 88 4 */ u32 nr_fields; /* 92 4 */ u32 tls; /* 96 4 */ char __pad[4]; /* 100 4 */ struct luw_hdr_field fields[]; /* 104 0 */
/* size: 104, cachelines: 2, members: 25 */ /* last cacheline: 40 bytes */ };
We can see the structures have the same layout, same size and no padding.
We need the __pad member as otherwise I saw gcc and clang on Alpine Linux automatically add the 'packed' attribute to the structure which made the two structures not match.
Link: <https://github.com/WebAssembly/memory64> Link: <https://github.com/nginx/unit-wasm> Signed-off-by: Andrew Clayton <a.clayton@nginx.com> diff 2558:9bcb190bc8be Thu Sep 14 19:35:00 UTC 2023 Andrew Clayton <a.clayton@nginx.com> Wasm: Allow uploads larger than 4GiB.
Currently Wasm modules are limited to a 32bit address space (until at least the memory64 work is completed). All the counters etc in the request structure were u32's. Which matched with 32bit memory limitation.
However there is really no need to not allow >4GiB uploads that can be saved off to disk or some such.
To do this we just need to increase the ->content_len & ->total_content_sent members to u64's.
However because we need the request structure to have the exact same layout on 32bit (for Wasm modules) as it does on 64bit we need to re-jig the order of some of these members and add a four-byte padding member.
Thus the request structure now looks like on 64bit (as shown by pahole(1))
struct nxt_wasm_request_s { uint32_t method_off; /* 0 4 */ uint32_t method_len; /* 4 4 */ uint32_t version_off; /* 8 4 */ uint32_t version_len; /* 12 4 */ uint32_t path_off; /* 16 4 */ uint32_t path_len; /* 20 4 */ uint32_t query_off; /* 24 4 */ uint32_t query_len; /* 28 4 */ uint32_t remote_off; /* 32 4 */ uint32_t remote_len; /* 36 4 */ uint32_t local_addr_off; /* 40 4 */ uint32_t local_addr_len; /* 44 4 */ uint32_t local_port_off; /* 48 4 */ uint32_t local_port_len; /* 52 4 */ uint32_t server_name_off; /* 56 4 */ uint32_t server_name_len; /* 60 4 */ /* --- cacheline 1 boundary (64 bytes) --- */ uint64_t content_len; /* 64 8 */ uint64_t total_content_sent; /* 72 8 */ uint32_t content_sent; /* 80 4 */ uint32_t content_off; /* 84 4 */ uint32_t request_size; /* 88 4 */ uint32_t nfields; /* 92 4 */ uint32_t tls; /* 96 4 */ char __pad[4]; /* 100 4 */ nxt_wasm_http_field_t fields[]; /* 104 0 */
/* size: 104, cachelines: 2, members: 25 */ /* last cacheline: 40 bytes */ };
and the same structure (taken from unit-wasm) compiled as 32bit
struct luw_req { u32 method_off; /* 0 4 */ u32 method_len; /* 4 4 */ u32 version_off; /* 8 4 */ u32 version_len; /* 12 4 */ u32 path_off; /* 16 4 */ u32 path_len; /* 20 4 */ u32 query_off; /* 24 4 */ u32 query_len; /* 28 4 */ u32 remote_off; /* 32 4 */ u32 remote_len; /* 36 4 */ u32 local_addr_off; /* 40 4 */ u32 local_addr_len; /* 44 4 */ u32 local_port_off; /* 48 4 */ u32 local_port_len; /* 52 4 */ u32 server_name_off; /* 56 4 */ u32 server_name_len; /* 60 4 */ /* --- cacheline 1 boundary (64 bytes) --- */ u64 content_len; /* 64 8 */ u64 total_content_sent; /* 72 8 */ u32 content_sent; /* 80 4 */ u32 content_off; /* 84 4 */ u32 request_size; /* 88 4 */ u32 nr_fields; /* 92 4 */ u32 tls; /* 96 4 */ char __pad[4]; /* 100 4 */ struct luw_hdr_field fields[]; /* 104 0 */
/* size: 104, cachelines: 2, members: 25 */ /* last cacheline: 40 bytes */ };
We can see the structures have the same layout, same size and no padding.
We need the __pad member as otherwise I saw gcc and clang on Alpine Linux automatically add the 'packed' attribute to the structure which made the two structures not match.
Link: <https://github.com/WebAssembly/memory64> Link: <https://github.com/nginx/unit-wasm> Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
/unit/pkg/deb/debian/ |
H A D | rules.in | diff 1749:4ec154f7ebd7 Wed Dec 16 06:56:00 UTC 2020 Andrei Belov <defan@nginx.com> Packages: the NOTICE file added to debian binaries.
This resolves the following lintian error: https://lintian.debian.org/tags/missing-notice-file-for-apache-license.html
While here, changed upstream changelog name to conform with the policy: https://lintian.debian.org/tags/wrong-name-for-upstream-changelog.html
|
/unit/auto/ |
H A D | make | diff 877:ed8b1aaefdd1 Wed Dec 19 12:56:00 UTC 2018 Alexander Borisov <alexander.borisov@nginx.com> libunit: added generation of version header file.
|
H A D | sources | diff 2433:56bf272df01d Mon Mar 27 18:28:00 UTC 2023 Andrew Clayton <a.clayton@nginx.com> Remove a bunch of dead code.
This removes a bunch of unused files that would have been touched by subsequent commits that switch to using nxt_bool_t (AKA unit6_t) in structures.
In auto/sources we have
NXT_LIB_SRC0=" \ src/nxt_buf_filter.c \ src/nxt_job_file.c \ src/nxt_stream_module.c \ src/nxt_stream_source.c \ src/nxt_upstream_source.c \ src/nxt_http_source.c \ src/nxt_fastcgi_source.c \ src/nxt_fastcgi_record_parse.c \ \ src/nxt_mem_pool_cleanup.h \ src/nxt_mem_pool_cleanup.c \ "
None of these seem to actually be used anywhere (other than within themselves). That variable is _not_ referenced anywhere else.
Also remove the unused related header files: src/nxt_buf_filter.h, src/nxt_fastcgi_source.h, src/nxt_http_source.h, src/nxt_job_file.h, src/nxt_stream_source.h and src/nxt_upstream_source.h
Also, these files do not seem to be used, no mention under auto/ or build/
src/nxt_file_cache.c src/nxt_cache.c src/nxt_job_file_cache.c
src/nxt_cache.h is #included in src/nxt_main.h, but AFAICT is not actually used.
With all the above removed
$ ./configure --openssl --debug --tests && make -j && make -j tests && make libnxt
all builds.
Buildbot passes.
NOTE: You may need to do a 'make clean' before the next build attempt.
Reviewed-by: Alejandro Colomar <alx@nginx.com> Signed-off-by: Andrew Clayton <a.clayton@nginx.com> diff 106:a30dda81de1d Wed Jun 28 15:56:00 UTC 2017 Valentin Bartenev <vbart@nginx.com> Configuration: reduced names of structures, functions, and macros. diff 1:fdc027c56872 Mon Jan 23 16:56:00 UTC 2017 Igor Sysoev <igor@sysoev.ru> Introducing tasks.
|