Re: [PATCH] Fixed 413 custom error page for HTTP/2 and HTTP/3 (ticket #2609)

2024-03-05 Thread Maxim Dounin
>headers_in.content_length_n = 0; > return NGX_OK; > } > #endif The patch is wrong, see here: https://trac.nginx.org/nginx/ticket/1152#comment:6 The issue is in my TODO list. Once properly fixed, you'll be able to merge the fix from freenginx. Alternatively, cons

Re: announcing freenginx.org

2024-02-15 Thread Maxim Dounin
Hello! On Thu, Feb 15, 2024 at 04:49:10PM +0800, Archimedes Gaviola wrote: > On Thu, Feb 15, 2024 at 2:03 AM Maxim Dounin wrote: > > > Hello! > > > > As you probably know, F5 closed Moscow office in 2022, and I no > > longer work for F5 since then. Still, we’ve r

Re: announcing freenginx.org

2024-02-14 Thread Maxim Dounin
Hello! On Thu, Feb 15, 2024 at 01:33:08AM +0300, Vasiliy Soshnikov wrote: > Hello Maxim, > Sad to read it. I can't promise that, but I will try to support your > project by using freenginx at least. > I wish good luck to freenginx! Thanks, appreciated. -- Maxim Dounin

Re: announcing freenginx.org

2024-02-14 Thread Maxim Dounin
Hello! On Wed, Feb 14, 2024 at 10:45:37PM +0100, Sergey Brester wrote: > Hi Maxim, > > it is pity to hear such news... > > I have few comments and questions about, which I enclosed inline below... > > Regards, > Serg. > > 14.02.2024 19:03, Maxim Dounin wrote:

announcing freenginx.org

2024-02-14 Thread Maxim Dounin
://freenginx.org/ The goal is to keep nginx development free from arbitrary corporate actions. Help and contributions are welcome. Hope it will be beneficial for everyone. -- Maxim Dounin http://freenginx.org/ ___ nginx-devel mailing list nginx-devel

Re: Upstream response time populated even when upstream connection timed out.

2024-02-10 Thread Maxim Dounin
there was an error or a timeout. In contrast, $upstream_connect_time and $upstream_header_time are only set when the connection was established or the header was successfully received, respectively. -- Maxim Dounin http://mdounin.ru/ ___ nginx-devel

Re: Segfault when interpreting cached X-Accel-Redirect response

2024-02-06 Thread Maxim Dounin
Hello! On Tue, Feb 06, 2024 at 01:36:20PM +0100, Jan Prachař wrote: > Hello, > > I have one last note bellow. > > On Tue, 2024-02-06 at 14:08 +0300, Maxim Dounin wrote: > > Hello! > > > > On Tue, Feb 06, 2024 at 11:42:40AM +0100, Jan Prachař wrote: > >

Re: Segfault when interpreting cached X-Accel-Redirect response

2024-02-06 Thread Maxim Dounin
Hello! On Tue, Feb 06, 2024 at 11:42:40AM +0100, Jan Prachař wrote: > Hello Maxim, > > On Tue, 2024-02-06 at 00:46 +0300, Maxim Dounin wrote: > > Hello! > > > > On Mon, Feb 05, 2024 at 06:01:54PM +0100, Jan Prachař wrote: > > > > > Hello,

Re: Segfault when interpreting cached X-Accel-Redirect response

2024-02-05 Thread Maxim Dounin
Hello! On Mon, Feb 05, 2024 at 06:01:54PM +0100, Jan Prachař wrote: > Hello, > > thank you for your responses. > > On Sat, 2024-02-03 at 04:25 +0300, Maxim Dounin wrote: > > Hello! > > > > On Fri, Feb 02, 2024 at 01:47:51PM +0100, Jan Prachař wrote: >

Re: Segfault when interpreting cached X-Accel-Redirect response

2024-02-02 Thread Maxim Dounin
,10 +4434,6 @@ ngx_http_upstream_next(ngx_http_request_ u->cache_status = NGX_HTTP_CACHE_STALE; rc = ngx_http_upstream_cache_send(r, u); -if (rc == NGX_DONE) { -return; -} - if (rc == NGX_HTTP_UPSTREAM_INVALID_HEADER) { rc = NGX_HTTP_INTERNAL_SERVER_ERROR; } -- Maxim Dounin http://mdounin.ru/ ___ nginx-devel mailing list nginx-devel@nginx.org https://mailman.nginx.org/mailman/listinfo/nginx-devel

Re: [PATCH] SSL: fixed $ssl_curves allocation error handling

2024-01-29 Thread Maxim Dounin
on_t *c, > } > > curves = ngx_palloc(pool, n * sizeof(int)); > +if (curves == NULL) { > +return NGX_ERROR; > +} > > n = SSL_get1_curves(c->ssl->connection, curves); > len = 0; Looks good. -- Maxim Dounin http://mdounin.ru

Re: [PATCH 2 of 4] Upstream: fixed usage of closed sockets with filter finalization

2024-01-29 Thread Maxim Dounin
Hello! On Mon, Jan 29, 2024 at 05:21:43PM +0400, Sergey Kandaurov wrote: > > > On 29 Jan 2024, at 10:43, Maxim Dounin wrote: > > > > Hello! > > > > On Fri, Jan 26, 2024 at 04:26:00PM +0400, Sergey Kandaurov wrote: > > > >>> On 27 Nov 202

Re: [PATCH 1 of 4] Fixed request termination with AIO and subrequests (ticket #2555)

2024-01-29 Thread Maxim Dounin
Hello! On Mon, Jan 29, 2024 at 06:07:58PM +0400, Roman Arutyunyan wrote: > Hi, > > On Mon, Jan 29, 2024 at 10:58:09AM +0300, Maxim Dounin wrote: > > Hello! > > > > On Fri, Jan 26, 2024 at 04:02:30PM +0400, Roman Arutyunyan wrote: > > > > > On Mo

Re: nginx-tests SSL tests failing out of the box?

2024-01-29 Thread Maxim Dounin
Hello! On Mon, Jan 29, 2024 at 05:23:15PM +0400, Sergey Kandaurov wrote: > > On 29 Jan 2024, at 07:24, Maxim Dounin wrote: > > > > Hello! > > > > On Sat, Jan 27, 2024 at 07:19:45AM +0300, Maxim Dounin wrote: > > > >> Hello! > >>

Re: Nginx-tests stream_ssl_conf_command.t test hanging indefinitely

2024-01-29 Thread Maxim Dounin
an 2024 01:08:10 GMT > # Content-Type: text/html > # Content-Length: 215 > # Connection: close > # X-Client: CN=end > # X-Verify: FAILED:unsuitable certificate purpose [...] Should be fixed with this patch: https://mailman.nginx.org/pipermail/nginx-devel/2024-January/TSFBB5DWWQKXK

Re: [PATCH 1 of 4] Fixed request termination with AIO and subrequests (ticket #2555)

2024-01-28 Thread Maxim Dounin
Hello! On Fri, Jan 26, 2024 at 04:02:30PM +0400, Roman Arutyunyan wrote: > On Mon, Nov 27, 2023 at 05:50:24AM +0300, Maxim Dounin wrote: > > # HG changeset patch > > # User Maxim Dounin > > # Date 1701049682 -10800 > > # Mon Nov 27 04:48:

Re: [PATCH 4 of 4] AIO operations now add timers (ticket #2162)

2024-01-28 Thread Maxim Dounin
Hello! On Fri, Jan 26, 2024 at 04:27:30PM +0400, Sergey Kandaurov wrote: > > > On 27 Nov 2023, at 06:50, Maxim Dounin wrote: > > > > # HG changeset patch > > # User Maxim Dounin > > # Date 1701050170 -10800 > > # Mon N

Re: [PATCH 3 of 4] Silenced complaints about socket leaks on forced termination

2024-01-28 Thread Maxim Dounin
Hello! On Fri, Jan 26, 2024 at 04:26:21PM +0400, Sergey Kandaurov wrote: > > > On 27 Nov 2023, at 06:50, Maxim Dounin wrote: > > > > # HG changeset patch > > # User Maxim Dounin > > # Date 1701049787 -10800 > > # Mon N

Re: [PATCH 2 of 4] Upstream: fixed usage of closed sockets with filter finalization

2024-01-28 Thread Maxim Dounin
Hello! On Fri, Jan 26, 2024 at 04:26:00PM +0400, Sergey Kandaurov wrote: > > On 27 Nov 2023, at 06:50, Maxim Dounin wrote: > > > > # HG changeset patch > > # User Maxim Dounin > > # Date 1701049758 -10800 > > # Mon Nov

Re: nginx-tests SSL tests failing out of the box?

2024-01-28 Thread Maxim Dounin
Hello! On Sat, Jan 27, 2024 at 07:19:45AM +0300, Maxim Dounin wrote: > Hello! > > On Fri, Jan 26, 2024 at 09:29:58PM +0400, Sergey Kandaurov wrote: > > > On Thu, Jan 25, 2024 at 11:38:57PM +0300, Maxim Dounin wrote: > > > Hello! > > > > > > On Thu,

Re: nginx-tests: Some SSL tests are failing with openssl 3.2.0

2024-01-28 Thread Maxim Dounin
'm wrong. That's a result of incompatible change introduced in the "openssl" application by OpenSSL 3.2.0, it now generates X509v3 certs even if not asked to, just discussed here: https://mailman.nginx.org/pipermail/nginx-devel/2024-January/32O7PUI3XJZZGBMLS2NAH654MS23MVDD.htm

Re: nginx-tests SSL tests failing out of the box?

2024-01-26 Thread Maxim Dounin
Hello! On Fri, Jan 26, 2024 at 09:29:58PM +0400, Sergey Kandaurov wrote: > On Thu, Jan 25, 2024 at 11:38:57PM +0300, Maxim Dounin wrote: > > Hello! > > > > On Thu, Jan 25, 2024 at 06:59:36PM +, Mayerhofer, Austin via > > nginx-devel wrote: > > > >

Re: [PATCH] Enforce that CR precede LF in chunk lines

2024-01-25 Thread Maxim Dounin
ine" robustness exception in 2.2. Message parsing of RFC 9112. And one less might also work, as long as empty lines before the request-line accept bare LF (not sure about Node though). Overall, I don't think there is a big difference here. > > including

Re: nginx-tests SSL tests failing out of the box?

2024-01-25 Thread Maxim Dounin
are using. This might be the case if, for example, Net::SSLeay in your installation was compiled with system LibreSSL as an SSL library - at least on the server side LibreSSL simply does not support session reuse with TLSv1.3. Test suite checks if nginx was c

Re: [PATCH] Enforce that CR precede LF in chunk lines

2024-01-25 Thread Maxim Dounin
nly in chunk size and data lines, where > the standard does not permit LF/CRLF permissiveness. It's also a > delete-only patch, which is always nice :) > > If you all are open to this change, it will also be necessary to fix > up the many LF-delimited chunks that are present w

Re: [PATCH] SSL: Added SSLKEYLOGFILE key material to debug logging

2024-01-24 Thread Maxim Dounin
traffic without generating SSLKEYLOGFILE on > peer, or by using other hacks on nginx host (using GDB, or patched ssl > libraries). Thanks for the patch. Logging session keying material is known to be problematic from ethical point of view. As such, I would rather

Re: Core: Avoid memcpy from NULL

2024-01-24 Thread Maxim Dounin
to review all the differences to ensure there are no real issues introduced by various compiler optimizations. [...] > There is a proposal for C2y to define memcpy(NULL,NULL,0): > https://docs.google.com/document/d/1guH_HgibKrX7t9JfKGfWX2UCPyZOTLsnRfR6UleD1F8/edit > If you feel strongly t

Re: [PATCH] Year 2024

2024-01-23 Thread Maxim Dounin
* Redistribution and use in source and binary forms, with or without > diff --git a/xml/menu.xml b/xml/menu.xml > --- a/xml/menu.xml > +++ b/xml/menu.xml > @@ -59,6 +59,7 @@ > --> > > news > + > > > Looks good. -- Maxim Dounin http://mdounin.ru/ ___ nginx-devel mailing list nginx-devel@nginx.org https://mailman.nginx.org/mailman/listinfo/nginx-devel

Re: [PATCH] Documented opensourcing of the OTel module

2024-01-23 Thread Maxim Dounin
> > > diff --git a/xml/ru/docs/index.xml b/xml/ru/docs/index.xml > --- a/xml/ru/docs/index.xml > +++ b/xml/ru/docs/index.xml > @@ -8,7 +8,7 @@ > link="/ru/docs/" > lang="ru" > - rev="49" > + rev="50"

Re: [PATCH] Avoiding mixed socket families in PROXY protocol v1 (ticket #2594)

2024-01-23 Thread Maxim Dounin
Hello! On Mon, Jan 22, 2024 at 07:48:01PM +0400, Roman Arutyunyan wrote: > Hi, > > On Mon, Jan 22, 2024 at 02:59:21PM +0300, Maxim Dounin wrote: > > Hello! > > > > On Mon, Jan 22, 2024 at 02:49:54PM +0400, Roman Arutyunyan wrote: > > > > > # HG cha

Re: [PATCH] Avoiding mixed socket families in PROXY protocol v1 (ticket #2594)

2024-01-22 Thread Maxim Dounin
not for others. Wouldn't it be better to remember if the PROXY protocol was used to set the address, and use $proxy_protocol_server_addr / $proxy_protocol_server_port in this case? Alternatively, we can use some dummy server address instead, so the client address will be still sent. -- Maxi

Re: [PATCH 1 of 3] Stream: socket peek in preread phase

2024-01-19 Thread Maxim Dounin
Hello! On Fri, Jan 19, 2024 at 03:42:37PM +0400, Sergey Kandaurov wrote: > > > On 18 Jan 2024, at 23:44, Maxim Dounin wrote: > > > > Hello! > > > > On Thu, Jan 18, 2024 at 08:15:33PM +0400, Sergey Kandaurov wrote: > > > >> On Thu, Jan 18,

Re: [PATCH 1 of 3] Stream: socket peek in preread phase

2024-01-18 Thread Maxim Dounin
> +if (c->read->pending_eof) { > > +return NGX_STREAM_OK; > > +} > > + > > +c->buffer->last = c->buffer->pos; > > + > > +return NGX_AGAIN; > > +} > > + > > + > > +static ngx_int_t > > +ngx_stream_preread(ngx_stream_session_t *s, ngx_stream_phase_handler_t *ph) > > +{ > > +ssize_tn; > > +ngx_int_t rc; > > +ngx_connection_t *c; > > + > > +c = s->connection; > > + > > +while (c->read->ready) { > > + > > +n = c->recv(c, c->buffer->last, c->buffer->end - c->buffer->last); > > + > > +if (n == NGX_AGAIN) { > > +return NGX_AGAIN; > > +} > > + > > +if (n == NGX_ERROR || n == 0) { > > +return NGX_STREAM_OK; > > +} > > + > > +c->buffer->last += n; > > + > > +rc = ph->handler(s); > > + > > +if (rc != NGX_AGAIN) { > > +return rc; > > +} > > + > > +if (c->buffer->last == c->buffer->end) { > > +ngx_log_error(NGX_LOG_ERR, c->log, 0, "preread buffer full"); > > +return NGX_STREAM_BAD_REQUEST; > > +} > > +} > > + > > +return NGX_AGAIN; > > +} > > + > > + > > ngx_int_t > > ngx_stream_core_content_phase(ngx_stream_session_t *s, > > ngx_stream_phase_handler_t *ph) > > Looks good. I'm somewhat sceptical about the idea of functionality which depends on the edge-triggered event methods being available. If/when the patch series is reviewed, please make sure it gets my approval before commit. -- Maxim Dounin http://mdounin.ru/ ___ nginx-devel mailing list nginx-devel@nginx.org https://mailman.nginx.org/mailman/listinfo/nginx-devel

Re: This is a question about the "$status" log value when "proxy_read_timeout" occurs.

2024-01-16 Thread Maxim Dounin
happens, the response headers are already sent, so $status contains 200 as sent to the client. For errors happened during sending the response body, consider looking into the error log. Some generic information about successful request completion migh

Re: processing a request without body

2024-01-13 Thread Maxim Dounin
01:19 [debug] 2452969#0: *11 access phase: 8 Note that phase handling continues here: it shouldn't, since request body reading is in progress. This suggested that your code fails to stop phase handling after calling ngx_http_read_client_request_body(): note you should return NGX_DONE

Re: [PATCH] fastcgi_params: added REMOTE_HOST parameter

2024-01-12 Thread Maxim Dounin
Hello! On Fri, Jan 12, 2024 at 11:03:45PM +, Jakub Zelenka wrote: > On Fri, Jan 12, 2024 at 10:20 PM Maxim Dounin wrote: > > > > # HG changeset patch > > > # User Jakub Zelenka > > > # Date 1705078404 0 > > > # Fri

Re: processing a request without body

2024-01-12 Thread Maxim Dounin
phase handler as well? Access phase handlers are called for all requests (unless these are rejected at earlier stages). If in doubt, consider configuring debug logging and add appropriate debug logging to your module, it should make things obvious enough. -- Maxim Dounin http://mdounin.ru/ __

Re: [PATCH] fastcgi_params: added REMOTE_HOST parameter

2024-01-12 Thread Maxim Dounin
$remote_port; > +fastcgi_param REMOTE_HOST$host; > fastcgi_param SERVER_ADDR$server_addr; > fastcgi_param SERVER_PORT$server_port; > fastcgi_param SERVER_NAME$server_name; -- Maxim Dounin http://mdounin.ru/ ___ nginx-devel mailing list nginx-devel@nginx.org https://mailman.nginx.org/mailman/listinfo/nginx-devel

Re: processing a request without body

2024-01-11 Thread Maxim Dounin
l ngx_http_core_run_phases(). See here in the mirror module for an example: https://hg.nginx.org/nginx/file/tip/src/http/modules/ngx_http_mirror_module.c#l144 Hope this helps. -- Maxim Dounin http://mdounin.ru/ ___ nginx-devel mailing list nginx-dev

Re: Core: Avoid memcpy from NULL

2024-01-09 Thread Maxim Dounin
s, this is exactly the "no direct impact" situation as assumed above. If you think there are cases when the code can be miscompiled in practice, and not theoretically, please share. -- Maxim Dounin http://mdounin.ru/ ___ nginx-devel mailing list nginx-devel@nginx.org https://mailman.nginx.org/mailman/listinfo/nginx-devel

Re: [PATCH 4 of 4] AIO operations now add timers (ticket #2162)

2024-01-08 Thread Maxim Dounin
Hello! On Mon, Jan 08, 2024 at 01:31:11PM +, J Carter wrote: > On Mon, 8 Jan 2024 11:25:55 + > J Carter wrote: > > > Hello, > > > > On Mon, 27 Nov 2023 05:50:27 +0300 > > Maxim Dounin wrote: > > > > > # HG changeset patch > >

Re: [PATCH] SSL: raised limit for upstream session size

2024-01-08 Thread Maxim Dounin
Hello! On Tue, Dec 26, 2023 at 12:29:54AM +0400, Sergey Kandaurov wrote: > > On 23 Dec 2023, at 01:46, Maxim Dounin wrote: > > > > Hello! > > > > On Fri, Dec 22, 2023 at 06:28:34PM +0400, Sergey Kandaurov wrote: > > > >> # HG changeset pa

Re: Core: Avoid memcpy from NULL

2024-01-04 Thread Maxim Dounin
of such calls in the codebase, and at least some need serious audit to find out if { 0, NULL } can appear in the call, this is going to be a huge work. And, given that the only expected effect is theoretical correctness of the code, I doubt it worth the effort, espe

Re: Core: Avoid memcpy from NULL

2023-12-31 Thread Maxim Dounin
27;m not exactly against using inline functions here, and I think a solution with inline functions can be accepted provided it is demonstrated that it introduces no measurable performance degradation. Still, I'm very sceptical about the idea of "transitioning away from function-like macros". -- Maxim Dounin http://mdounin.ru/ ___ nginx-devel mailing list nginx-devel@nginx.org https://mailman.nginx.org/mailman/listinfo/nginx-devel

Re: [PATCH 00 of 12] HTTP/3 proxying to upstreams

2023-12-29 Thread Maxim Dounin
Hello! On Thu, Dec 28, 2023 at 05:23:38PM +0300, Vladimir Homutov via nginx-devel wrote: > On Thu, Dec 28, 2023 at 04:31:41PM +0300, Maxim Dounin wrote: > > Hello! > > > > On Wed, Dec 27, 2023 at 04:17:38PM +0300, Vladimir Homutov via nginx-devel > > wrote: > >

Re: [PATCH 00 of 12] HTTP/3 proxying to upstreams

2023-12-28 Thread Maxim Dounin
Hello! On Wed, Dec 27, 2023 at 04:17:38PM +0300, Vladimir Homutov via nginx-devel wrote: > On Wed, Dec 27, 2023 at 02:48:04PM +0300, Maxim Dounin wrote: > > Hello! > > > > On Mon, Dec 25, 2023 at 07:52:41PM +0300, Vladimir Homutov via nginx-devel > > wrote

Re: Re: Don't delete timer of write event when it's delayed.

2023-12-27 Thread Maxim Dounin
nginx started sending the response. It's a one-time choice, and modifications of r->upstream->buffering won't do anything (though also incorrect, as it's not something expected to be modified by modules). Or I understood something incorrectly? -- Maxim Dounin http://mdounin.r

Re: [PATCH 00 of 12] HTTP/3 proxying to upstreams

2023-12-27 Thread Maxim Dounin
e some uncertain plans to make proxy module able to work with other protocols based on the scheme, such as in "proxy_pass fastcgi://127.0.0.1:9000;". This is mostly irrelevant though, and might never happen.) [...] -- Maxim Dounin http://mdounin.ru/ _

Re: Don't delete timer of write event when it's delayed.

2023-12-27 Thread Maxim Dounin
ed_upstream; r->write_event_handler = ngx_http_upstream_process_non_buffered_downstream; r->limit_rate = 0; r->limit_rate_set = 1; (https://hg.nginx.org/nginx/file/release-1.25.3/src/http/ngx_http_upstre

Re: [PATCH] ssl: SSL_get0_verified_chain is available for LibreSSL >= 3.3.6

2023-12-23 Thread Maxim Dounin
Hello! On Fri, Dec 22, 2023 at 05:53:30PM +0400, Sergey Kandaurov wrote: > > > On 21 Dec 2023, at 02:40, Maxim Dounin wrote: > > > > Hello! > > > > On Tue, Dec 19, 2023 at 10:44:00PM +0400, Sergey Kandaurov wrote: > > > >> >

Re: [PATCH] SSL: raised limit for upstream session size

2023-12-22 Thread Maxim Dounin
only justification I can assume here is an SSL session with the client certificate (or even certificate chain) being saved into the session. It might worth looking into what actually happens here. [...] -- Maxim Dounin http://mdounin.ru/ ___ ngin

Re: [PATCH 2 of 2] Win32: extended ngx_random range to 0x7fffffff

2023-12-22 Thread Maxim Dounin
Hello! On Fri, Dec 22, 2023 at 05:52:30PM +0400, Sergey Kandaurov wrote: > On Thu, Dec 21, 2023 at 07:14:40PM +0300, Maxim Dounin wrote: > > Hello! > > > > On Thu, Dec 21, 2023 at 05:37:02PM +0400, Sergey Kandaurov wrote: > > > > > > On 16

Re: [PATCH 2 of 2] Win32: extended ngx_random range to 0x7fffffff

2023-12-21 Thread Maxim Dounin
Hello! On Thu, Dec 21, 2023 at 05:37:02PM +0400, Sergey Kandaurov wrote: > > On 16 Dec 2023, at 06:57, Maxim Dounin wrote: > > > > Hello! > > > > On Sat, Dec 09, 2023 at 08:42:11AM +, J Carter wrote: > > > >> On Sat, 09 Dec 2023 07:46:10

Re: processing a request without body

2023-12-20 Thread Maxim Dounin
This will work with proxying without request buffering, but will be generally more complex to implement. And, obviously, this in case of proxying without request buffering this won't let you to validate request body before the request headers are sent

Re: Core: Avoid memcpy from NULL

2023-12-20 Thread Maxim Dounin
r can be picky. For example, good luck with doing something like "ngx_max(foo & 0xff, bar)". As such, it's certainly not an argument against using checks in macro definitions in the particular patch. -- Maxim Dounin http://mdounin.ru/ ___ nginx-devel mailing list nginx-devel@nginx.org https://mailman.nginx.org/mailman/listinfo/nginx-devel

Re: [PATCH] ssl: SSL_get0_verified_chain is available for LibreSSL >= 3.3.6

2023-12-20 Thread Maxim Dounin
Hello! On Tue, Dec 19, 2023 at 10:44:00PM +0400, Sergey Kandaurov wrote: > > > On 19 Dec 2023, at 12:58, Maxim Dounin wrote: > > > > Hello! > > > > On Tue, Dec 19, 2023 at 02:09:10AM +0400, Sergey Kandaurov wrote: > > > >>> On 24 Nov 2023,

Re: [PATCH] ssl: SSL_get0_verified_chain is available for LibreSSL >= 3.3.6

2023-12-19 Thread Maxim Dounin
Hello! On Tue, Dec 19, 2023 at 12:16:58PM +0100, Илья Шипицин wrote: > вт, 19 дек. 2023 г. в 09:58, Maxim Dounin : > > > Hello! > > > > On Tue, Dec 19, 2023 at 02:09:10AM +0400, Sergey Kandaurov wrote: > > > > > > On 24 Nov 2023, at 00:29, Ilya Shipit

Re: Meaning of proxy_ignore_client_abort

2023-12-19 Thread Maxim Dounin
ort): : Determines whether the connection with a proxied server should : be closed when a client closes the connection without waiting for : a response. While it probably can be improved, it explicitly says "without waiting for a response", and nothing about "when reading a re

Re: [PATCH] ssl: SSL_get0_verified_chain is available for LibreSSL >= 3.3.6

2023-12-19 Thread Maxim Dounin
N_NUMBER" check might be seen as positive even without any additional benefits. Along with that, however, we might want to adjust the LIBRESSL_VERSION_NUMBER check in the ngx_event_openssl.h file, so OPENSSL_VERSION_NUMBER is set to a better value for old LibreSSL versions - for example, to only set OPENSSL_VERSION_NUMBER to 0x101fL for LibreSSL 3.5.0 or above. This might allow to preserve limited compatibility with ancient LibreSSL versions without additional efforts (not tested though). -- Maxim Dounin http://mdounin.ru/ ___ nginx-devel mailing list nginx-devel@nginx.org https://mailman.nginx.org/mailman/listinfo/nginx-devel

Re: Core: Avoid memcpy from NULL

2023-12-15 Thread Maxim Dounin
and there is a constant stream of reports "hey, UB sanitizer reports about memcpy(dst, NULL, 0) in nginx" we might consider actually silencing this by introducing appropriate checks at the interface level. -- Maxim Dounin http://mdounin.ru/ ___ nginx-devel mailing list nginx-devel@nginx.org https://mailman.nginx.org/mailman/listinfo/nginx-devel

Re: [PATCH 2 of 2] Win32: extended ngx_random range to 0x7fffffff

2023-12-15 Thread Maxim Dounin
sig_atomic_t #define NGX_HAVE_GETADDRINFO 1 -#define ngx_random rand +#define ngx_random() \ +((long) (0x7fff & ( ((uint32_t) rand() << 16) \ + ^ ((uint32_t) rand() << 8) \ + ^ ((uint32_t) rand()) ))) + #define ngx_debug_init() -- Maxim Dounin http://mdounin.ru/ ___ nginx-devel mailing list nginx-devel@nginx.org https://mailman.nginx.org/mailman/listinfo/nginx-devel

Re: [PATCH] Add ssl_client_tls_bind variable

2023-12-15 Thread Maxim Dounin
//mailman.nginx.org/pipermail/nginx-devel/2021-June/014090.html -- Maxim Dounin http://mdounin.ru/ ___ nginx-devel mailing list nginx-devel@nginx.org https://mailman.nginx.org/mailman/listinfo/nginx-devel

Re: Core: Avoid memcpy from NULL

2023-12-14 Thread Maxim Dounin
g, 0, > "http2 request body recv %uz", n); For the record, I've already provided some feedback to Ben in the ticket here: https://trac.nginx.org/nginx/ticket/2570 And pointed to the existing thread here: https://mailman.nginx.org/pipermail/nginx-devel/2023-October/PX7VH5A273NLUGSYC7DR2AZRU75CIQ3Q.html https://mailman.nginx.org/pipermail/nginx-devel/2023-December/DCGUEGEFS6TSVIWNEWUEZO3FZMR6ESYZ.html Hope this helps. -- Maxim Dounin http://mdounin.ru/ ___ nginx-devel mailing list nginx-devel@nginx.org https://mailman.nginx.org/mailman/listinfo/nginx-devel

Re: [PATCH] Added asm ISB as asm pause for ngx_cpu_pause() for aarch64

2023-12-13 Thread Maxim Dounin
fidence > 1044.47 +/- 435.826 > 0.800713% +/- 0.334115% > (Student's t, pooled s = 582.792) That's without any caching being used, that is, basically just a result of slightly different compilation, correct? This might be seen as a reference point o

Re: processing a request without body

2023-12-13 Thread Maxim Dounin
st headers, consider using appropriate phase handler, see https://nginx.org/en/docs/dev/development_guide.html#http_phases and the source code for details. -- Maxim Dounin http://mdounin.ru/ ___ nginx-devel mailing list nginx-devel@nginx.org https://mailman.nginx.org/mailman/listinfo/nginx-devel

Re: [PATCH] Added asm ISB as asm pause for ngx_cpu_pause() for aarch64

2023-12-12 Thread Maxim Dounin
Instead, nginx relies on using volatile variables for locks, so these are always loaded from memory by the compiler on pre-lock checks (and will test the updated value if it's changed by other CPUs), and proper barrier semantics of ngx_atomic_cmp_set(). The "memory" clob

Re: [PATCH] Added asm ISB as asm pause for ngx_cpu_pause() for aarch64

2023-12-08 Thread Maxim Dounin
.hTue Nov 14 15:26:02 2023 +0400 > +++ b/src/os/unix/ngx_atomic.hWed Dec 06 09:51:19 2023 -0600 > @@ -66,6 +66,8 @@ > > #if ( __i386__ || __i386 || __amd64__ || __amd64 ) > #define ngx_cpu_pause() __asm__ ("pause") > +#elif ( __aarch64__

Re: Error: nginx: [emerg] unknown directive "stream" in /etc/nginx/nginx.conf:11

2023-12-07 Thread Maxim Dounin
ailing list. Alternatively, reading the docs might be a good idea. Thanks for understanding. -- Maxim Dounin http://mdounin.ru/ ___ nginx-devel mailing list nginx-devel@nginx.org https://mailman.nginx.org/mailman/listinfo/nginx-devel

Re: [PATCH 1 of 2] Core: avoid calling memcpy() in edge cases

2023-12-03 Thread Maxim Dounin
og, 0, Obviously enough, there should be a corresponding change in ngx_http_script_copy_var_code(). Overall, similarly to the other patch in the series, I'm highly sceptical about doing such scattered changes based on the UB sanitizer reports from some test runs. Rather, we should use U

Re: [PATCH 1 of 2] HTTP: uniform overflow checks in ngx_http_alloc_large_header_buffer

2023-11-29 Thread Maxim Dounin
Hello! On Wed, Nov 29, 2023 at 11:24:03AM +0300, Vladimir Homutov via nginx-devel wrote: > On Tue, Nov 28, 2023 at 05:58:23AM +0300, Maxim Dounin wrote: > > Hello! > > > > On Fri, Nov 10, 2023 at 12:11:54PM +0300, Vladimir Homutov via nginx-devel > > wrote: > >

Re: [PATCH 2 of 2] HTTP: removed unused r->port_start

2023-11-29 Thread Maxim Dounin
Hello! On Wed, Nov 29, 2023 at 11:20:33AM +0300, Vladimir Homutov via nginx-devel wrote: > On Tue, Nov 28, 2023 at 05:57:39AM +0300, Maxim Dounin wrote: > > Hello! > > > > On Fri, Nov 10, 2023 at 12:11:55PM +0300, Vladimir Homutov via nginx-devel > > wrote: > >

Re: [PATCH 1 of 2] HTTP: uniform overflow checks in ngx_http_alloc_large_header_buffer

2023-11-27 Thread Maxim Dounin
r->header_end = new + (r->header_end - old); > + > +if (r->header_name_end) { > +r->header_name_end = new + (r->header_name_end - old); > +} > + > +if (r->header_start) { > +r->header_start = new + (r->header_start - old); > +} > + > +if (r->header_end) { > +r->header_end = new + (r->header_end - old); > +} > } > > r->header_in = b; Otherwise looks good. -- Maxim Dounin http://mdounin.ru/ ___ nginx-devel mailing list nginx-devel@nginx.org https://mailman.nginx.org/mailman/listinfo/nginx-devel

Re: [PATCH 2 of 2] HTTP: removed unused r->port_start

2023-11-27 Thread Maxim Dounin
*port_end; > > unsigned http_minor:16; I don't think it's a good change. Rather, we should either remove both, or (eventually) fix these and provide some valid usage of the port as parsed either from the request line or from the Host

[PATCH 1 of 4] Fixed request termination with AIO and subrequests (ticket #2555)

2023-11-26 Thread Maxim Dounin
# HG changeset patch # User Maxim Dounin # Date 1701049682 -10800 # Mon Nov 27 04:48:02 2023 +0300 # Node ID a5e39e9d1f4c84dcbe6a2f9e079372a3d63aef0b # Parent f366007dd23a6ce8e8427c1b3042781b618a2ade Fixed request termination with AIO and subrequests (ticket #2555). When a request was

[PATCH 4 of 4] AIO operations now add timers (ticket #2162)

2023-11-26 Thread Maxim Dounin
# HG changeset patch # User Maxim Dounin # Date 1701050170 -10800 # Mon Nov 27 04:56:10 2023 +0300 # Node ID 00c3e7333145ddb5ea0eeaaa66b3d9c26973c9c2 # Parent 61d08e4cf97cc073200ec32fc6ada9a2d48ffe51 AIO operations now add timers (ticket #2162). Each AIO (thread IO) operation being run is

[PATCH 2 of 4] Upstream: fixed usage of closed sockets with filter finalization

2023-11-26 Thread Maxim Dounin
# HG changeset patch # User Maxim Dounin # Date 1701049758 -10800 # Mon Nov 27 04:49:18 2023 +0300 # Node ID faf0b9defc76b8683af466f8a950c2c241382970 # Parent a5e39e9d1f4c84dcbe6a2f9e079372a3d63aef0b Upstream: fixed usage of closed sockets with filter finalization. When filter finalization

[PATCH 3 of 4] Silenced complaints about socket leaks on forced termination

2023-11-26 Thread Maxim Dounin
# HG changeset patch # User Maxim Dounin # Date 1701049787 -10800 # Mon Nov 27 04:49:47 2023 +0300 # Node ID 61d08e4cf97cc073200ec32fc6ada9a2d48ffe51 # Parent faf0b9defc76b8683af466f8a950c2c241382970 Silenced complaints about socket leaks on forced termination. When graceful shutdown was

[PATCH 0 of 4] aio fixes

2023-11-26 Thread Maxim Dounin
proxy_cache_use_stale.t (Wstat: 0 Tests: 36 Failed: 0) TODO passed: 35 Review and testing appreciated. -- Maxim Dounin http://mdounin.ru/ ___ nginx-devel mailing list nginx-devel@nginx.org https://mailman.nginx.org/mailman/listinfo/nginx-devel

Re: [PATCH] Linux packages: added Ubuntu 23.04 "mantic"

2023-11-11 Thread Maxim Dounin
> @@ -7,7 +7,7 @@ > link="/ru/linux_packages.html" > lang="ru" > - rev="91"> > + rev="92"> > > > > @@ -92,6 +92,11 @@ > x86_64, aarch64/arm64 > > > + > +23.10 “mantic” > +x86_64, aarch64/arm64 > + > + > > Looks good. -- Maxim Dounin http://mdounin.ru/ ___ nginx-devel mailing list nginx-devel@nginx.org https://mailman.nginx.org/mailman/listinfo/nginx-devel

Re: RESTCONF Server-Sent-Event session control in nginx

2023-10-31 Thread Maxim Dounin
nterpreter > CGI interpreter [...] This mailing list is dedicated to nginx development. For questions on how to configure nginx, please use the nginx@ mailing list instead, see http://nginx.org/en/support.html for details. Thank you. -- Maxim Dounin http://mdounin.ru/ ___

Re: [PATCH 2 of 2] HTTP: suppressed possible overflow in interim r->uri_end calculation

2023-10-27 Thread Maxim Dounin
alculated values are never used), I very much object to fixing just the particular items which were reported by a particular sanitizer in particular test runs. Rather, sanitizer results should be used to identify patterns we want to fix (if at all), and then all such patterns should be fixed (or not). -- Maxim Dounin http://mdounin.ru/ ___ nginx-devel mailing list nginx-devel@nginx.org https://mailman.nginx.org/mailman/listinfo/nginx-devel

Re: [PATCH] Linux packages: documented nginx-module-otel package

2023-10-26 Thread Maxim Dounin
verall, I do support the clear distinction between nginx's own modules and 3rd-party modules provided in the packages repository. (But, as correctly noted by Konstantin, this should include njs as well.) -- Maxim Dounin http://mdounin.ru/ _

Re: nginx 1.25.3 changes draft

2023-10-24 Thread Maxim Dounin
Hello! On Tue, Oct 24, 2023 at 05:07:46PM +0400, Sergey Kandaurov wrote: > > > On 24 Oct 2023, at 16:34, Maxim Dounin wrote: > > > > Hello! > > > > > > Changes with nginx 1.25.324 Oct 2023 > > > &

nginx 1.25.3 changes draft

2023-10-24 Thread Maxim Dounin
рока "Status" в заголовке ответа бэкенда с пустой поясняющей фразой обрабатывалась некорректно. *) Исправление: утечки памяти во время переконфигурации при использовании библиотеки PCRE2. Спасибо ZhenZhong Wu. *) Исправления и улучшения в HTTP/3. -- Maxim

Re: [PATCH] HTTP/2: fixed buffer management with HTTP/2 auto-detection

2023-10-20 Thread Maxim Dounin
gt; h2c->state.buffer_used = size; > > h2c->state.handler = handler; > > diff --git a/src/http/v2/ngx_http_v2_module.c > > b/src/http/v2/ngx_http_v2_module.c > > --- a/src/http/v2/ngx_http_v2_module.c > > +++ b/src/http/v2/ngx_http_v2_module.c > > @

Re: [PATCH] Improve performance when starting nginx with a lot of locations

2023-10-17 Thread Maxim Dounin
Hello! On Tue, Oct 17, 2023 at 03:25:41PM +0400, Sergey Kandaurov wrote: > > On 11 Oct 2023, at 02:56, Maxim Dounin wrote: > > > > Hello! > > > > On Thu, Oct 05, 2023 at 10:51:26AM +0900, Yusuke Nojima wrote: > > > >> Thank you for your comment! &

Re: Memory Leak Issue in Nginx PCRE2

2023-10-16 Thread Maxim Dounin
Hello! On Mon, Oct 16, 2023 at 06:19:48PM +0400, Sergey Kandaurov wrote: > > > On 11 Oct 2023, at 02:04, Maxim Dounin wrote: > > > > Hello! > > > > On Wed, Sep 27, 2023 at 01:13:44AM +0800, 上勾拳 wrote: > > > >> Dear Nginx Developers, > >&

Re: [PATCH] Improve performance when starting nginx with a lot of locations

2023-10-10 Thread Maxim Dounin
tion in terms of speed. Thanks for looking. In my limited testing, it is slightly faster than your bottom-up implementation (and significantly faster than the existing insertion sort when many locations are used). Below is the full patch (code unchanged), I'll commit it as soon

Re: Memory Leak Issue in Nginx PCRE2

2023-10-10 Thread Maxim Dounin
; > +} > ngx_regex_compile_context = NULL; > #endif > > I kindly request your assistance in reviewing this matter and considering > the patch for inclusion in Nginx. If you have any questions or need further > information, please feel free to reach out to me. Your

Re: [PATCH] HTTP/2: per-iteration stream handling limit

2023-10-10 Thread Maxim Dounin
As already said, in this case the work nginx is willing to do is no different from other workloads, such as with normal HTTP/2 requests or HTTP/1.x requests. As such, nginx is not considered to be affected by this issue. > > > Thomas > > -Original Message- > From

Re: [PATCH] HTTP/2: per-iteration stream handling limit

2023-10-10 Thread Maxim Dounin
Hello! On Tue, Oct 10, 2023 at 04:46:04PM +0400, Sergey Kandaurov wrote: > > > On 10 Oct 2023, at 16:29, Maxim Dounin wrote: > > > > # HG changeset patch > > # User Maxim Dounin > > # Date 1696940019 -10800 > > # Tue O

Re: [PATCH] HTTP/2: per-iteration stream handling limit

2023-10-10 Thread Maxim Dounin
Hello! On Tue, Oct 10, 2023 at 03:29:02PM +0300, Maxim Dounin wrote: > # HG changeset patch > # User Maxim Dounin > # Date 1696940019 -10800 > # Tue Oct 10 15:13:39 2023 +0300 > # Node ID cdda286c0f1b4b10f30d4eb6a63fefb9b8708ecc > # Parent 3db945fda515014d220151046d02f39

[PATCH] HTTP/2: per-iteration stream handling limit

2023-10-10 Thread Maxim Dounin
# HG changeset patch # User Maxim Dounin # Date 1696940019 -10800 # Tue Oct 10 15:13:39 2023 +0300 # Node ID cdda286c0f1b4b10f30d4eb6a63fefb9b8708ecc # Parent 3db945fda515014d220151046d02f3960bcfca0a HTTP/2: per-iteration stream handling limit. To ensure that attempts to flood servers with

Re: optimize the code for searching file in ngx_conf_open_file

2023-10-07 Thread Maxim Dounin
ontributing_changes.html For more information about nginx coding style, please refer to the code and here: http://nginx.org/en/docs/dev/development_guide.html#code_style Hope this helps. -- Maxim Dounin http://mdounin.ru/ ___ nginx-devel mailing list nginx-devel@nginx.org https://mailman.nginx.org/mailman/listinfo/nginx-devel

Re: [PATCH] Auth basic: Cache credentials if auth_basic_user_file is static

2023-10-03 Thread Maxim Dounin
nless nginx is reloaded) would certainly break POLA, and needs some really good justification. Further, in typical setups the file is effectively cached by the OS itself, making the I/O operations mentioned almost free, especially compared to costs of typical pas

Re: [PATCH] Updated OpenSSL and zlib versions

2023-09-30 Thread Maxim Dounin
"ru" > - rev="22"> > + rev="23"> > > > > @@ -1250,7 +1250,7 @@ > > задаёт путь к исходным текстам библиотеки zlib. > Дистрибутив библиотеки (версию > -1.1.3—1.2.11) нужно вз

Re: [PATCH] Improve performance when starting nginx with a lot of locations

2023-09-29 Thread Maxim Dounin
eak; +} + +if (q2 == ngx_queue_sentinel(tail)) { +break; + } -prev = ngx_queue_prev(prev); +if (cmp(q1, q2) <= 0) { +q1 = ngx_queue_next(q1); +continue; +} -} while (prev != ngx_queue_sentinel(queue)); +ngx_queue_remove(q2); +ngx_queue_insert_before(q1, q2); -ngx_queue_insert_after(prev, q); +q2 = ngx_queue_head(tail); } } diff --git a/src/core/ngx_queue.h b/src/core/ngx_queue.h --- a/src/core/ngx_queue.h +++ b/src/core/ngx_queue.h @@ -47,6 +47,9 @@ struct ngx_queue_s { (h)->prev = x +#define ngx_queue_insert_before ngx_queue_insert_tail + + #define ngx_queue_head(h) \ (h)->next -- Maxim Dounin http://mdounin.ru/ ___ nginx-devel mailing list nginx-devel@nginx.org https://mailman.nginx.org/mailman/listinfo/nginx-devel

Re: [PATCH 2 of 2] Added "max_shutdown_workers" directive

2023-09-25 Thread Maxim Dounin
_workers as if they are shutting down - this looks wrong and can cause reload hang. > +j = i; > +continue; > +} > + > +if (--m == 0) { > +return 0; > +} > +} > + >

Re: [PATCH] Linux packages: removed Ubuntu 22.10 'kinetic' due to EOL

2023-09-22 Thread Maxim Dounin
Fri Sep 22 15:11:23 2023 -0700 > @@ -7,7 +7,7 @@ > link="/ru/linux_packages.html" > lang="ru" > - rev="89"> > + rev="90"> > > > > @@ -88,11 +88,6 @@ > > > > -22.10

Re: [PATCH] Mail: allow auth to the proxy without auth to the backend

2023-09-19 Thread Maxim Dounin
thoughts! From the description it is not clear why "proxy_smtp_auth off;" (which is the default and implies that nginx won't try to authenticate against SMTP backends) does not work for you. Could you please elaborate? [...] -- Maxim Dounin http://mdounin.ru/ ___ nginx-devel mailing list nginx-devel@nginx.org https://mailman.nginx.org/mailman/listinfo/nginx-devel

  1   2   3   4   5   6   7   8   9   10   >