Re: [nginx] enhance options

2018-02-05 Thread Maxim Dounin
Hello!

On Sun, Feb 04, 2018 at 08:49:12PM +0800, 洪志道 wrote:

> Hi!
> 
> Maybe it's better to keep the options more complete, and consider the
> follow operation as a mistake.
> 
> /usr/local/nginx/sbin/nginx -
> 
> hg diff
> diff -r cbf59d483c9c src/core/nginx.c
> --- a/src/core/nginx.c Tue Jan 16 13:52:03 2018 +0300
> +++ b/src/core/nginx.c Sun Feb 04 07:41:36 2018 -0500
> @@ -753,7 +753,12 @@
>  return NGX_ERROR;
>  }
> 
> -while (*p) {
> +do {
> +
> +if (*p == '\0') {
> +ngx_log_stderr(0, "missing option: \"%s\"", argv[i]);
> +return NGX_ERROR;
> +}
> 
>  switch (*p++) {
> 
> @@ -855,7 +860,8 @@
>  ngx_log_stderr(0, "invalid option: \"%c\"", *(p - 1));
>  return NGX_ERROR;
>  }
> -}
> +
> +} while (*p);
> 
>  next:

Checking *p twice on each loop iteration certainly looks 
superfluous.  Rather, a more logical check would look like:

diff --git a/src/core/nginx.c b/src/core/nginx.c
--- a/src/core/nginx.c
+++ b/src/core/nginx.c
@@ -748,7 +748,7 @@ ngx_get_options(int argc, char *const *a
 
 p = (u_char *) argv[i];
 
-if (*p++ != '-') {
+if (*p++ != '-' || *p == '\0') {
 ngx_log_stderr(0, "invalid option: \"%s\"", argv[i]);
 return NGX_ERROR;
 }

Not sure it worth the change though.

-- 
Maxim Dounin
http://mdounin.ru/
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel

Re: [PATCH 2 of 2] Contrib: vim syntax, update 3rd party module directives.

2018-02-05 Thread Maxim Dounin
Hello!

On Thu, Feb 01, 2018 at 11:20:11AM +0200, Gena Makhomed wrote:

> # HG changeset patch
> # User Gena Makhomed 
> # Date 1517476514 -7200
> #  Thu Feb 01 11:15:14 2018 +0200
> # Node ID 2e0de79805eee669cca7e2455010689a3191f268
> # Parent  6db472f8dc8ec04754a42ba22e9663cb7e91f2ab
> Contrib: vim syntax, update 3rd party module directives.
> 
> Add new directives for 3rd party modules.

[...]

Committed, thanks.

-- 
Maxim Dounin
http://mdounin.ru/
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


Re: [PATCH 1 of 2] Contrib: vim syntax, update core module directives.

2018-02-05 Thread Maxim Dounin
Hello!

On Thu, Feb 01, 2018 at 11:19:01AM +0200, Gena Makhomed wrote:

> # HG changeset patch
> # User Gena Makhomed 
> # Date 1517476175 -7200
> #  Thu Feb 01 11:09:35 2018 +0200
> # Node ID 6db472f8dc8ec04754a42ba22e9663cb7e91f2ab
> # Parent  0b72d545f098b407351a1972fba5d29f2e904507
> Contrib: vim syntax, update core module directives.
> 
> "match" is block directive, "upstream_conf" is deprecated
> by patch http://hg.nginx.org/nginx.org/rev/27c53e1cb4b6

[...]

Committed, thanks.

-- 
Maxim Dounin
http://mdounin.ru/
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Contrib: vim syntax, update 3rd party module directives.

2018-02-05 Thread Maxim Dounin
details:   http://hg.nginx.org/nginx/rev/2e0de79805ee
branches:  
changeset: 7196:2e0de79805ee
user:  Gena Makhomed 
date:  Thu Feb 01 11:15:14 2018 +0200
description:
Contrib: vim syntax, update 3rd party module directives.

Add new directives for 3rd party modules.

diffstat:

 contrib/vim/syntax/nginx.vim |  5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diffs (31 lines):

diff --git a/contrib/vim/syntax/nginx.vim b/contrib/vim/syntax/nginx.vim
--- a/contrib/vim/syntax/nginx.vim
+++ b/contrib/vim/syntax/nginx.vim
@@ -954,6 +954,7 @@ syn keyword ngxDirectiveThirdParty conta
 syn keyword ngxDirectiveThirdParty contained nchan_redis_server
 syn keyword ngxDirectiveThirdParty contained nchan_redis_storage_mode
 syn keyword ngxDirectiveThirdParty contained nchan_redis_url
+syn keyword ngxDirectiveThirdParty contained nchan_redis_wait_after_connecting
 syn keyword ngxDirectiveThirdParty contained nchan_shared_memory_size
 syn keyword ngxDirectiveThirdParty contained nchan_storage_engine
 syn keyword ngxDirectiveThirdParty contained nchan_store_messages
@@ -1080,6 +1081,8 @@ syn keyword ngxDirectiveThirdParty conta
 syn keyword ngxDirectiveThirdParty contained tnt_select_limit_max
 syn keyword ngxDirectiveThirdParty contained tnt_send_timeout
 syn keyword ngxDirectiveThirdParty contained tnt_set_header
+syn keyword ngxDirectiveThirdParty contained tnt_update
+syn keyword ngxDirectiveThirdParty contained tnt_upsert
 
 " A module for nginx web server for handling file uploads using 
multipart/form-data encoding (RFC 1867)
 " https://github.com/Austinb/nginx-upload-module
@@ -2106,8 +2109,10 @@ syn keyword ngxDirectiveThirdParty conta
 
 " Embed the power of Lua into NGINX TCP/UDP servers
 " https://github.com/openresty/stream-lua-nginx-module
+syn keyword ngxDirectiveThirdParty contained lua_add_variable
 syn keyword ngxDirectiveThirdParty contained preread_by_lua_block
 syn keyword ngxDirectiveThirdParty contained preread_by_lua_file
+syn keyword ngxDirectiveThirdParty contained preread_by_lua_no_postpone
 
 " nginx-upsync-module
 " https://github.com/weibocom/nginx-upsync-module
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Contrib: vim syntax, update core module directives.

2018-02-05 Thread Maxim Dounin
details:   http://hg.nginx.org/nginx/rev/6db472f8dc8e
branches:  
changeset: 7195:6db472f8dc8e
user:  Gena Makhomed 
date:  Thu Feb 01 11:09:35 2018 +0200
description:
Contrib: vim syntax, update core module directives.

"match" is block directive, "upstream_conf" is deprecated
by patch http://hg.nginx.org/nginx.org/rev/27c53e1cb4b6

diffstat:

 contrib/vim/syntax/nginx.vim |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (35 lines):

diff --git a/contrib/vim/syntax/nginx.vim b/contrib/vim/syntax/nginx.vim
--- a/contrib/vim/syntax/nginx.vim
+++ b/contrib/vim/syntax/nginx.vim
@@ -87,6 +87,7 @@ syn keyword ngxDirectiveBlock contained 
 syn keyword ngxDirectiveBlock contained geo
 syn keyword ngxDirectiveBlock contained map
 syn keyword ngxDirectiveBlock contained split_clients
+syn keyword ngxDirectiveBlock contained match
 
 syn keyword ngxDirectiveImportant contained include
 syn keyword ngxDirectiveImportant contained root
@@ -117,6 +118,7 @@ syn keyword ngxDirectiveDeprecated conta
 syn keyword ngxDirectiveDeprecated contained spdy_recv_buffer_size
 syn keyword ngxDirectiveDeprecated contained spdy_recv_timeout
 syn keyword ngxDirectiveDeprecated contained spdy_streams_index_size
+syn keyword ngxDirectiveDeprecated contained upstream_conf
 
 syn keyword ngxDirective contained absolute_redirect
 syn keyword ngxDirective contained accept_mutex
@@ -324,7 +326,6 @@ syn keyword ngxDirective contained log_n
 syn keyword ngxDirective contained log_subrequest
 syn keyword ngxDirective contained map_hash_bucket_size
 syn keyword ngxDirective contained map_hash_max_size
-syn keyword ngxDirective contained match
 syn keyword ngxDirective contained master_process
 syn keyword ngxDirective contained max_ranges
 syn keyword ngxDirective contained memcached_bind
@@ -582,7 +583,6 @@ syn keyword ngxDirective contained types
 syn keyword ngxDirective contained types_hash_max_size
 syn keyword ngxDirective contained underscores_in_headers
 syn keyword ngxDirective contained uninitialized_variable_warn
-syn keyword ngxDirective contained upstream_conf
 syn keyword ngxDirective contained use
 syn keyword ngxDirective contained user
 syn keyword ngxDirective contained userid
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


Re: Fwd: Proposal: Change folder for PHP CGI scripts

2018-02-05 Thread Maxim Dounin
Hello!

On Sun, Feb 04, 2018 at 07:53:39PM +0100, Benedikt Roßgardt via nginx-devel 
wrote:

> Hi,
> 
> When using the default configuration from the nginx.conf file, I 
> was running into "File not found" issues. The problem for me was 
> that the default configuration is pointing to the /script folder 
> instead of my document root.
> 
> Maybe there is a reason for it, but I propose to use the root 
> document folder instead.

The example configuration in question is just an example, and it 
assumes scripts are in the /scripts folder.  In particular, it 
demostrates that php scripts can be stored in a folder distrinct 
from the document root.

For a typical configuration where php scripts are located under 
the document root there is a fastcgi.conf include file, which 
combines fastcgi_params and "fastcgi_param SCRIPT_FILENAME 
$document_root$fastcgi_script_name".

-- 
Maxim Dounin
http://mdounin.ru/
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel

Re: nginx undocumented directives

2018-02-05 Thread Maxim Dounin
Hello!

On Mon, Feb 05, 2018 at 05:49:28PM +0200, Gena Makhomed wrote:

> On 28.12.2017 15:17, Maxim Dounin wrote:
> 
> >>> smtp_client_buffer
> >>> smtp_greeting_delay
> >>
> >> There are no notes of why these aren't documented.
> > 
> > I guess the reason is that mail documentation is mostly
> > contributed, and was never seriously considered by the
> > documentation project.
> > 
> > The smtp_client_buffer directive is identical to
> > imap_client_buffer, but for the smtp module.
> > 
> > The smtp_greeting_delay directive allows introducing an artificial
> > delay before sending an SMTP greeting, and rejecting clients who
> > fail to wait for a greeting before sending commands.
> 
> One month later:
> 
> directives smtp_client_buffer and smtp_greeting_delay
> 
> still not documented.

That's how opensource works.  If you want something to happen, you 
have two basic options:

1. Wait for someone to do it.

2. Do it yourself.

-- 
Maxim Dounin
http://mdounin.ru/
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


Re: nginx undocumented directives

2018-02-05 Thread Gena Makhomed

On 28.12.2017 15:17, Maxim Dounin wrote:


smtp_client_buffer
smtp_greeting_delay


There are no notes of why these aren't documented.


I guess the reason is that mail documentation is mostly
contributed, and was never seriously considered by the
documentation project.

The smtp_client_buffer directive is identical to
imap_client_buffer, but for the smtp module.

The smtp_greeting_delay directive allows introducing an artificial
delay before sending an SMTP greeting, and rejecting clients who
fail to wait for a greeting before sending commands.


One month later:

directives smtp_client_buffer and smtp_greeting_delay

still not documented.

--
Best regards,
 Gena
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel