Home
last modified time | relevance | path

Searched hist:56 (Results 101 – 125 of 143) sorted by relevance

123456

/unit/src/
H A Dnxt_socket.hdiff 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 Dnxt_http_parse.hdiff 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 1:fdc027c56872 Mon Jan 23 16:56:00 UTC 2017 Igor Sysoev <igor@sysoev.ru> Introducing tasks.
H A Dnxt_clang.hdiff 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 Dnxt_string.cdiff 704:1fcac04f0a15 Mon Jun 25 13:56:00 UTC 2018 Igor Sysoev <igor@sysoev.ru> Removed '\r' and '\n' artifact macros.
H A Dnxt_buf.hdiff 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 Dnxt_mp.cdiff 64:3728a1601b9b Tue Jun 20 10:56:00 UTC 2017 Igor Sysoev <igor@sysoev.ru> Fixed error in the previous changeset.
H A Dnxt_http_parse.cdiff 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.
H A Dnxt_file.hdiff 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 Dnxt_main.hdiff 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 Dnxt_sockaddr.cdiff 1:fdc027c56872 Mon Jan 23 16:56:00 UTC 2017 Igor Sysoev <igor@sysoev.ru> Introducing tasks.
H A Dnxt_unit.hdiff 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 Dnxt_conf_validation.cdiff 2266:3f66d6e064e2 Tue Dec 06 00:56:00 UTC 2022 Andrew Clayton <a.clayton@nginx.com> Configuration: made large_header_buffers a valid setting.

This is an extension to the previous commit, which made
large_header_buffer_size a valid configuration setting.

This commit makes a related value, large_header_buffers, a valid
configuration setting.

While large_header_buffer_size effectively limits the maximum size of
any single header (although unit will try to pack multiple headers into
a buffer if they wholly fit).

large_header_buffers limits how many of these 'large' buffers are
available. It makes sense to also allow this to be user set.

large_header_buffers is already set by the configuration system in
nxt_router.c it just isn't set as a valid config option in
nxt_conf_validation.c

With this change users can set this option in their config if required
by the following

"settings": {
"http": {
"large_header_buffers": 8
}
},

It retains its default value of 4 if this is not set.

NOTE: This is being released as undocumented and subject to change as it
exposes internal workings of unit.

Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
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.
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
}
}
}
diff 1651:8dcd8563fe99 Mon Oct 12 21:56:00 UTC 2020 Igor Sysoev <igor@sysoev.ru> Using union instead of "void *".
diff 1650:a55c43253f8d Mon Oct 12 21:56:00 UTC 2020 Igor Sysoev <igor@sysoev.ru> Using C99 style declaration.
diff 1649:b687d2da9fa9 Mon Oct 12 21:56:00 UTC 2020 Igor Sysoev <igor@sysoev.ru> Reordering declarations.
/unit/test/
H A Dtest_python_isolation.pydiff 2480:63b9663e2f8f Thu May 25 15:56:00 UTC 2023 Andrei Zeliankou <zelenkov@nginx.com> Tests: assertion related fixes.
H A Dtest_java_websockets.pydiff 2480:63b9663e2f8f Thu May 25 15:56:00 UTC 2023 Andrei Zeliankou <zelenkov@nginx.com> Tests: assertion related fixes.
H A Dtest_asgi_websockets.pydiff 2480:63b9663e2f8f Thu May 25 15:56:00 UTC 2023 Andrei Zeliankou <zelenkov@nginx.com> Tests: assertion related fixes.
H A Dtest_tls.pydiff 2480:63b9663e2f8f Thu May 25 15:56:00 UTC 2023 Andrei Zeliankou <zelenkov@nginx.com> Tests: assertion related fixes.
diff 1904:da7a4754f8bd Thu Jul 01 10:56:00 UTC 2021 Max Romanov <max.romanov@nginx.com> Fixing multiple TLS-enabled listeners initialization.

Because of the incorrect 'last' field assignment, multiple listeners with
a TLS certificate did not initialize properly, which caused a router crash
while establishing a connection.

Test with multiple TLS listeners added.

The issue was introduced in the c548e46fe516 commit.

This closes #561 issue on GitHub.
H A Dtest_routing.pydiff 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.
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 Dtest_go_isolation.pydiff 2480:63b9663e2f8f Thu May 25 15:56:00 UTC 2023 Andrei Zeliankou <zelenkov@nginx.com> Tests: assertion related fixes.
H A Dtest_node_websockets.pydiff 2480:63b9663e2f8f Thu May 25 15:56:00 UTC 2023 Andrei Zeliankou <zelenkov@nginx.com> Tests: assertion related fixes.
H A Dtest_proxy.pydiff 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 Dtest_java_application.pydiff 2480:63b9663e2f8f Thu May 25 15:56:00 UTC 2023 Andrei Zeliankou <zelenkov@nginx.com> Tests: assertion related fixes.
/unit/auto/
H A Dsourcesdiff 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.
/unit/pkg/deb/debian/
H A Drules.indiff 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/
H A DCHANGESdiff 846:b366e89a9b73 Thu Nov 15 12:56:00 UTC 2018 Valentin Bartenev <vbart@nginx.com> Added version 1.6 CHANGES.
/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>

123456