[nginx] Style.

2023-02-03 Thread Sergey Kandaurov
details:   https://hg.nginx.org/nginx/rev/1c3b78d7cdc9
branches:  
changeset: 8123:1c3b78d7cdc9
user:  Maxim Dounin 
date:  Sat Jan 28 05:20:23 2023 +0300
description:
Style.

diffstat:

 src/event/ngx_event_connectex.c   |  4 ++--
 src/http/modules/ngx_http_flv_module.c|  2 +-
 src/http/modules/ngx_http_static_module.c |  4 ++--
 src/http/ngx_http_file_cache.c|  4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diffs (54 lines):

diff -r 106328a70f4e -r 1c3b78d7cdc9 src/event/ngx_event_connectex.c
--- a/src/event/ngx_event_connectex.c   Sat Jan 28 01:29:45 2023 +0300
+++ b/src/event/ngx_event_connectex.c   Sat Jan 28 05:20:23 2023 +0300
@@ -127,8 +127,8 @@ void ngx_iocp_wait_events(int main)
 conn[0] = NULL;
 
 for ( ;; ) {
-offset = (nevents == WSA_MAXIMUM_WAIT_EVENTS + 1) ? 1: 0;
-timeout = (nevents == 1 && !first) ? 6: INFINITE;
+offset = (nevents == WSA_MAXIMUM_WAIT_EVENTS + 1) ? 1 : 0;
+timeout = (nevents == 1 && !first) ? 6 : INFINITE;
 
 n = WSAWaitForMultipleEvents(nevents - offset, events[offset],
  0, timeout, 0);
diff -r 106328a70f4e -r 1c3b78d7cdc9 src/http/modules/ngx_http_flv_module.c
--- a/src/http/modules/ngx_http_flv_module.cSat Jan 28 01:29:45 2023 +0300
+++ b/src/http/modules/ngx_http_flv_module.cSat Jan 28 05:20:23 2023 +0300
@@ -232,7 +232,7 @@ ngx_http_flv_handler(ngx_http_request_t 
 b->file_pos = start;
 b->file_last = of.size;
 
-b->in_file = b->file_last ? 1: 0;
+b->in_file = b->file_last ? 1 : 0;
 b->last_buf = (r == r->main) ? 1 : 0;
 b->last_in_chain = 1;
 
diff -r 106328a70f4e -r 1c3b78d7cdc9 src/http/modules/ngx_http_static_module.c
--- a/src/http/modules/ngx_http_static_module.c Sat Jan 28 01:29:45 2023 +0300
+++ b/src/http/modules/ngx_http_static_module.c Sat Jan 28 05:20:23 2023 +0300
@@ -265,8 +265,8 @@ ngx_http_static_handler(ngx_http_request
 b->file_pos = 0;
 b->file_last = of.size;
 
-b->in_file = b->file_last ? 1: 0;
-b->last_buf = (r == r->main) ? 1: 0;
+b->in_file = b->file_last ? 1 : 0;
+b->last_buf = (r == r->main) ? 1 : 0;
 b->last_in_chain = 1;
 
 b->file->fd = of.fd;
diff -r 106328a70f4e -r 1c3b78d7cdc9 src/http/ngx_http_file_cache.c
--- a/src/http/ngx_http_file_cache.cSat Jan 28 01:29:45 2023 +0300
+++ b/src/http/ngx_http_file_cache.cSat Jan 28 05:20:23 2023 +0300
@@ -1600,8 +1600,8 @@ ngx_http_cache_send(ngx_http_request_t *
 b->file_pos = c->body_start;
 b->file_last = c->length;
 
-b->in_file = (c->length - c->body_start) ? 1: 0;
-b->last_buf = (r == r->main) ? 1: 0;
+b->in_file = (c->length - c->body_start) ? 1 : 0;
+b->last_buf = (r == r->main) ? 1 : 0;
 b->last_in_chain = 1;
 
 b->file->fd = c->file.fd;
___
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style.

2022-12-15 Thread Sergey Kandaurov
details:   https://hg.nginx.org/nginx/rev/3108d4d668e4
branches:  
changeset: 8116:3108d4d668e4
user:  BullerDu 
date:  Fri Dec 16 01:15:15 2022 +0400
description:
Style.

diffstat:

 src/core/ngx_conf_file.c|  4 ++--
 src/event/ngx_event_udp.c   |  2 +-
 src/os/unix/ngx_udp_sendmsg_chain.c |  2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r d85ce1df2313 -r 3108d4d668e4 src/core/ngx_conf_file.c
--- a/src/core/ngx_conf_file.c  Fri Dec 16 01:15:13 2022 +0400
+++ b/src/core/ngx_conf_file.c  Fri Dec 16 01:15:15 2022 +0400
@@ -544,8 +544,8 @@ ngx_conf_read_token(ngx_conf_t *cf)
 }
 
 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
-  "unexpected end of file, "
-  "expecting \";\" or \"}\"");
+   "unexpected end of file, "
+   "expecting \";\" or \"}\"");
 return NGX_ERROR;
 }
 
diff -r d85ce1df2313 -r 3108d4d668e4 src/event/ngx_event_udp.c
--- a/src/event/ngx_event_udp.c Fri Dec 16 01:15:13 2022 +0400
+++ b/src/event/ngx_event_udp.c Fri Dec 16 01:15:15 2022 +0400
@@ -88,7 +88,7 @@ ngx_event_recvmsg(ngx_event_t *ev)
 msg.msg_controllen = sizeof(msg_control);
 
 ngx_memzero(_control, sizeof(msg_control));
-   }
+}
 #endif
 
 n = recvmsg(lc->fd, , 0);
diff -r d85ce1df2313 -r 3108d4d668e4 src/os/unix/ngx_udp_sendmsg_chain.c
--- a/src/os/unix/ngx_udp_sendmsg_chain.c   Fri Dec 16 01:15:13 2022 +0400
+++ b/src/os/unix/ngx_udp_sendmsg_chain.c   Fri Dec 16 01:15:15 2022 +0400
@@ -335,7 +335,7 @@ ngx_get_srcaddr_cmsg(struct cmsghdr *cms
 #endif
 
 
- #if (NGX_HAVE_IP_RECVDSTADDR)
+#if (NGX_HAVE_IP_RECVDSTADDR)
 
 if (cmsg->cmsg_level == IPPROTO_IP
 && cmsg->cmsg_type == IP_RECVDSTADDR
___
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style: added missing "static" specifiers.

2021-10-21 Thread Maxim Dounin
details:   https://hg.nginx.org/nginx/rev/46a02ed7c966
branches:  
changeset: 7940:46a02ed7c966
user:  Maxim Dounin 
date:  Thu Oct 21 18:43:13 2021 +0300
description:
Style: added missing "static" specifiers.

Mostly found by gcc -Wtraditional, per "non-static declaration of ...
follows static declaration [-Wtraditional]" warnings.

diffstat:

 src/event/ngx_event_openssl.c  |  2 +-
 src/stream/ngx_stream_ssl_module.c |  7 ---
 2 files changed, 5 insertions(+), 4 deletions(-)

diffs (43 lines):

diff -r 9e7de0547f09 -r 46a02ed7c966 src/event/ngx_event_openssl.c
--- a/src/event/ngx_event_openssl.c Thu Oct 21 18:38:38 2021 +0300
+++ b/src/event/ngx_event_openssl.c Thu Oct 21 18:43:13 2021 +0300
@@ -2767,7 +2767,7 @@ ngx_ssl_write(ngx_connection_t *c, u_cha
 
 #ifdef SSL_READ_EARLY_DATA_SUCCESS
 
-ssize_t
+static ssize_t
 ngx_ssl_write_early(ngx_connection_t *c, u_char *data, size_t size)
 {
 intn, sslerr;
diff -r 9e7de0547f09 -r 46a02ed7c966 src/stream/ngx_stream_ssl_module.c
--- a/src/stream/ngx_stream_ssl_module.cThu Oct 21 18:38:38 2021 +0300
+++ b/src/stream/ngx_stream_ssl_module.cThu Oct 21 18:43:13 2021 +0300
@@ -23,7 +23,8 @@ static ngx_int_t ngx_stream_ssl_init_con
 ngx_connection_t *c);
 static void ngx_stream_ssl_handshake_handler(ngx_connection_t *c);
 #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
-int ngx_stream_ssl_servername(ngx_ssl_conn_t *ssl_conn, int *ad, void *arg);
+static int ngx_stream_ssl_servername(ngx_ssl_conn_t *ssl_conn, int *ad,
+void *arg);
 #endif
 #ifdef TLSEXT_TYPE_application_layer_protocol_negotiation
 static int ngx_stream_ssl_alpn_select(ngx_ssl_conn_t *ssl_conn,
@@ -451,7 +452,7 @@ ngx_stream_ssl_handshake_handler(ngx_con
 
 #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
 
-int
+static int
 ngx_stream_ssl_servername(ngx_ssl_conn_t *ssl_conn, int *ad, void *arg)
 {
 return SSL_TLSEXT_ERR_OK;
@@ -502,7 +503,7 @@ ngx_stream_ssl_alpn_select(ngx_ssl_conn_
 
 #ifdef SSL_R_CERT_CB_ERROR
 
-int
+static int
 ngx_stream_ssl_certificate(ngx_ssl_conn_t *ssl_conn, void *arg)
 {
 ngx_str_tcert, key;
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style.

2019-02-25 Thread Maxim Dounin
details:   https://hg.nginx.org/nginx/rev/0f0c75caa038
branches:  
changeset: 7458:0f0c75caa038
user:  Maxim Dounin 
date:  Mon Feb 25 16:41:08 2019 +0300
description:
Style.

diffstat:

 src/http/ngx_http_request.c |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diffs (11 lines):

diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -833,6 +833,7 @@ ngx_http_ssl_handshake_handler(ngx_conne
 ngx_http_close_connection(c);
 }
 
+
 #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
 
 int
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style.

2018-03-13 Thread Roman Arutyunyan
details:   http://hg.nginx.org/nginx/rev/0f811890f2f0
branches:  
changeset: 7228:0f811890f2f0
user:  Roman Arutyunyan 
date:  Mon Mar 12 18:38:53 2018 +0300
description:
Style.

diffstat:

 src/stream/ngx_stream_ssl_preread_module.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (16 lines):

diff -r 79eb4f7b6725 -r 0f811890f2f0 src/stream/ngx_stream_ssl_preread_module.c
--- a/src/stream/ngx_stream_ssl_preread_module.cMon Mar 12 16:03:08 
2018 +0300
+++ b/src/stream/ngx_stream_ssl_preread_module.cMon Mar 12 18:38:53 
2018 +0300
@@ -437,9 +437,9 @@ ngx_stream_ssl_preread_parse_record(ngx_
 }
 
 if (left < size) {
-   ngx_log_debug0(NGX_LOG_DEBUG_STREAM, ctx->log, 0,
-  "ssl preread: failed to parse handshake");
-   return NGX_DECLINED;
+ngx_log_debug0(NGX_LOG_DEBUG_STREAM, ctx->log, 0,
+   "ssl preread: failed to parse handshake");
+return NGX_DECLINED;
 }
 }
 
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style.

2018-03-05 Thread Maxim Dounin
details:   http://hg.nginx.org/nginx/rev/1ab290cf5267
branches:  
changeset: 7224:1ab290cf5267
user:  Maxim Dounin 
date:  Mon Mar 05 21:35:08 2018 +0300
description:
Style.

diffstat:

 src/stream/ngx_stream_log_module.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff --git a/src/stream/ngx_stream_log_module.c 
b/src/stream/ngx_stream_log_module.c
--- a/src/stream/ngx_stream_log_module.c
+++ b/src/stream/ngx_stream_log_module.c
@@ -868,7 +868,8 @@ ngx_stream_log_json_variable(ngx_stream_
 
 
 static size_t
-ngx_stream_log_unescaped_variable_getlen(ngx_stream_session_t *s, uintptr_t 
data)
+ngx_stream_log_unescaped_variable_getlen(ngx_stream_session_t *s,
+uintptr_t data)
 {
 ngx_stream_variable_value_t  *value;
 
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style.

2017-09-22 Thread Ruslan Ermilov
details:   http://hg.nginx.org/nginx/rev/6d1f3bb72b07
branches:  
changeset: 7111:6d1f3bb72b07
user:  Ruslan Ermilov 
date:  Fri Sep 22 18:37:49 2017 +0300
description:
Style.

diffstat:

 src/stream/ngx_stream_variables.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 3b1b81e248bc -r 6d1f3bb72b07 src/stream/ngx_stream_variables.c
--- a/src/stream/ngx_stream_variables.c Fri Sep 22 13:10:49 2017 +0300
+++ b/src/stream/ngx_stream_variables.c Fri Sep 22 18:37:49 2017 +0300
@@ -460,7 +460,7 @@ ngx_stream_get_variable(ngx_stream_sessi
 static ngx_int_t
 ngx_stream_variable_binary_remote_addr(ngx_stream_session_t *s,
  ngx_stream_variable_value_t *v, uintptr_t data)
- {
+{
 struct sockaddr_in   *sin;
 #if (NGX_HAVE_INET6)
 struct sockaddr_in6  *sin6;
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style.

2017-09-13 Thread Maxim Dounin
details:   http://hg.nginx.org/nginx/rev/b38a8f0ca4a2
branches:  
changeset: 7101:b38a8f0ca4a2
user:  Maxim Dounin 
date:  Wed Sep 13 15:51:52 2017 +0300
description:
Style.

diffstat:

 src/core/ngx_parse_time.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (21 lines):

diff --git a/src/core/ngx_parse_time.c b/src/core/ngx_parse_time.c
--- a/src/core/ngx_parse_time.c
+++ b/src/core/ngx_parse_time.c
@@ -44,14 +44,15 @@ ngx_parse_http_time(u_char *value, size_
 }
 }
 
-for (p++; p < end; p++)
+for (p++; p < end; p++) {
 if (*p != ' ') {
 break;
 }
+}
 
 if (end - p < 18) {
 return NGX_ERROR;
-}
+}
 
 if (fmt != isoc) {
 if (*p < '0' || *p > '9' || *(p + 1) < '0' || *(p + 1) > '9') {
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style.

2017-08-10 Thread Maxim Dounin
details:   http://hg.nginx.org/nginx/rev/f684178faec9
branches:  
changeset: 7088:f684178faec9
user:  Maxim Dounin 
date:  Thu Aug 10 22:21:20 2017 +0300
description:
Style.

diffstat:

 src/core/ngx_regex.c |  4 ++--
 src/http/modules/ngx_http_scgi_module.c  |  2 +-
 src/http/modules/ngx_http_uwsgi_module.c |  8 
 3 files changed, 7 insertions(+), 7 deletions(-)

diffs (71 lines):

diff --git a/src/core/ngx_regex.c b/src/core/ngx_regex.c
--- a/src/core/ngx_regex.c
+++ b/src/core/ngx_regex.c
@@ -262,7 +262,7 @@ ngx_pcre_free_studies(void *data)
 part = >part;
 elts = part->elts;
 
-for (i = 0 ; /* void */ ; i++) {
+for (i = 0; /* void */ ; i++) {
 
 if (i >= part->nelts) {
 if (part->next == NULL) {
@@ -326,7 +326,7 @@ ngx_regex_module_init(ngx_cycle_t *cycle
 part = _pcre_studies->part;
 elts = part->elts;
 
-for (i = 0 ; /* void */ ; i++) {
+for (i = 0; /* void */ ; i++) {
 
 if (i >= part->nelts) {
 if (part->next == NULL) {
diff --git a/src/http/modules/ngx_http_scgi_module.c 
b/src/http/modules/ngx_http_scgi_module.c
--- a/src/http/modules/ngx_http_scgi_module.c
+++ b/src/http/modules/ngx_http_scgi_module.c
@@ -819,7 +819,7 @@ ngx_http_scgi_create_request(ngx_http_re
 key = e.pos;
 #endif
 code = *(ngx_http_script_code_pt *) e.ip;
-code((ngx_http_script_engine_t *) & e);
+code((ngx_http_script_engine_t *) );
 
 #if (NGX_DEBUG)
 val = e.pos;
diff --git a/src/http/modules/ngx_http_uwsgi_module.c 
b/src/http/modules/ngx_http_uwsgi_module.c
--- a/src/http/modules/ngx_http_uwsgi_module.c
+++ b/src/http/modules/ngx_http_uwsgi_module.c
@@ -865,7 +865,7 @@ ngx_http_uwsgi_create_request(ngx_http_r
 lcode = *(ngx_http_script_len_code_pt *) le.ip;
 skip_empty = lcode();
 
-for (val_len = 0; *(uintptr_t *) le.ip; val_len += lcode ()) {
+for (val_len = 0; *(uintptr_t *) le.ip; val_len += lcode()) {
 lcode = *(ngx_http_script_len_code_pt *) le.ip;
 }
 le.ip += sizeof(uintptr_t);
@@ -990,7 +990,7 @@ ngx_http_uwsgi_create_request(ngx_http_r
 while (*(uintptr_t *) le.ip) {
 
 lcode = *(ngx_http_script_len_code_pt *) le.ip;
-key_len = (u_char) lcode ();
+key_len = (u_char) lcode();
 
 lcode = *(ngx_http_script_len_code_pt *) le.ip;
 skip_empty = lcode();
@@ -1018,14 +1018,14 @@ ngx_http_uwsgi_create_request(ngx_http_r
 *e.pos++ = (u_char) ((key_len >> 8) & 0xff);
 
 code = *(ngx_http_script_code_pt *) e.ip;
-code((ngx_http_script_engine_t *) & e);
+code((ngx_http_script_engine_t *) );
 
 *e.pos++ = (u_char) (val_len & 0xff);
 *e.pos++ = (u_char) ((val_len >> 8) & 0xff);
 
 while (*(uintptr_t *) e.ip) {
 code = *(ngx_http_script_code_pt *) e.ip;
-code((ngx_http_script_engine_t *) & e);
+code((ngx_http_script_engine_t *) );
 }
 
 e.ip += sizeof(uintptr_t);
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style.

2017-08-09 Thread Sergey Kandaurov
details:   http://hg.nginx.org/nginx/rev/577628e6b6a6
branches:  
changeset: 7086:577628e6b6a6
user:  Sergey Kandaurov 
date:  Wed Aug 09 14:59:46 2017 +0300
description:
Style.

diffstat:

 src/core/ngx_conf_file.c   |  1 +
 src/event/ngx_event_openssl.c  |  2 ++
 src/http/modules/ngx_http_geo_module.c |  1 +
 src/os/unix/ngx_files.c|  1 +
 src/os/win32/ngx_files.c   |  1 +
 src/stream/ngx_stream_geo_module.c |  1 +
 6 files changed, 7 insertions(+), 0 deletions(-)

diffs (74 lines):

diff -r 2284008a2791 -r 577628e6b6a6 src/core/ngx_conf_file.c
--- a/src/core/ngx_conf_file.c  Wed Aug 09 14:59:44 2017 +0300
+++ b/src/core/ngx_conf_file.c  Wed Aug 09 14:59:46 2017 +0300
@@ -178,6 +178,7 @@ ngx_conf_parse(ngx_conf_t *cf, ngx_str_t
 /* open configuration file */
 
 fd = ngx_open_file(filename->data, NGX_FILE_RDONLY, NGX_FILE_OPEN, 0);
+
 if (fd == NGX_INVALID_FILE) {
 ngx_conf_log_error(NGX_LOG_EMERG, cf, ngx_errno,
ngx_open_file_n " \"%s\" failed",
diff -r 2284008a2791 -r 577628e6b6a6 src/event/ngx_event_openssl.c
--- a/src/event/ngx_event_openssl.c Wed Aug 09 14:59:44 2017 +0300
+++ b/src/event/ngx_event_openssl.c Wed Aug 09 14:59:46 2017 +0300
@@ -924,6 +924,7 @@ ngx_ssl_read_password_file(ngx_conf_t *c
 cln->data = passwords;
 
 fd = ngx_open_file(file->data, NGX_FILE_RDONLY, NGX_FILE_OPEN, 0);
+
 if (fd == NGX_INVALID_FILE) {
 ngx_conf_log_error(NGX_LOG_EMERG, cf, ngx_errno,
ngx_open_file_n " \"%s\" failed", file->data);
@@ -2906,6 +2907,7 @@ ngx_ssl_session_ticket_keys(ngx_conf_t *
 file.log = cf->log;
 
 file.fd = ngx_open_file(file.name.data, NGX_FILE_RDONLY, 0, 0);
+
 if (file.fd == NGX_INVALID_FILE) {
 ngx_conf_log_error(NGX_LOG_EMERG, cf, ngx_errno,
ngx_open_file_n " \"%V\" failed", );
diff -r 2284008a2791 -r 577628e6b6a6 src/http/modules/ngx_http_geo_module.c
--- a/src/http/modules/ngx_http_geo_module.cWed Aug 09 14:59:44 2017 +0300
+++ b/src/http/modules/ngx_http_geo_module.cWed Aug 09 14:59:46 2017 +0300
@@ -1401,6 +1401,7 @@ ngx_http_geo_include_binary_base(ngx_con
 file.log = cf->log;
 
 file.fd = ngx_open_file(name->data, NGX_FILE_RDONLY, 0, 0);
+
 if (file.fd == NGX_INVALID_FILE) {
 err = ngx_errno;
 if (err != NGX_ENOENT) {
diff -r 2284008a2791 -r 577628e6b6a6 src/os/unix/ngx_files.c
--- a/src/os/unix/ngx_files.c   Wed Aug 09 14:59:44 2017 +0300
+++ b/src/os/unix/ngx_files.c   Wed Aug 09 14:59:46 2017 +0300
@@ -620,6 +620,7 @@ ngx_create_file_mapping(ngx_file_mapping
 {
 fm->fd = ngx_open_file(fm->name, NGX_FILE_RDWR, NGX_FILE_TRUNCATE,
NGX_FILE_DEFAULT_ACCESS);
+
 if (fm->fd == NGX_INVALID_FILE) {
 ngx_log_error(NGX_LOG_CRIT, fm->log, ngx_errno,
   ngx_open_file_n " \"%s\" failed", fm->name);
diff -r 2284008a2791 -r 577628e6b6a6 src/os/win32/ngx_files.c
--- a/src/os/win32/ngx_files.c  Wed Aug 09 14:59:44 2017 +0300
+++ b/src/os/win32/ngx_files.c  Wed Aug 09 14:59:46 2017 +0300
@@ -330,6 +330,7 @@ ngx_create_file_mapping(ngx_file_mapping
 
 fm->fd = ngx_open_file(fm->name, NGX_FILE_RDWR, NGX_FILE_TRUNCATE,
NGX_FILE_DEFAULT_ACCESS);
+
 if (fm->fd == NGX_INVALID_FILE) {
 ngx_log_error(NGX_LOG_CRIT, fm->log, ngx_errno,
   ngx_open_file_n " \"%s\" failed", fm->name);
diff -r 2284008a2791 -r 577628e6b6a6 src/stream/ngx_stream_geo_module.c
--- a/src/stream/ngx_stream_geo_module.cWed Aug 09 14:59:44 2017 +0300
+++ b/src/stream/ngx_stream_geo_module.cWed Aug 09 14:59:46 2017 +0300
@@ -1327,6 +1327,7 @@ ngx_stream_geo_include_binary_base(ngx_c
 file.log = cf->log;
 
 file.fd = ngx_open_file(name->data, NGX_FILE_RDONLY, 0, 0);
+
 if (file.fd == NGX_INVALID_FILE) {
 err = ngx_errno;
 if (err != NGX_ENOENT) {
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style: aligned ngx_null_command.

2017-07-12 Thread Ruslan Ermilov
details:   http://hg.nginx.org/nginx/rev/a27e0c7e198c
branches:  
changeset: 7066:a27e0c7e198c
user:  Ruslan Ermilov 
date:  Wed Jul 12 11:34:04 2017 +0300
description:
Style: aligned ngx_null_command.

diffstat:

 src/misc/ngx_google_perftools_module.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r c0d89f602d08 -r a27e0c7e198c src/misc/ngx_google_perftools_module.c
--- a/src/misc/ngx_google_perftools_module.cTue Jul 11 20:06:52 2017 +0300
+++ b/src/misc/ngx_google_perftools_module.cWed Jul 12 11:34:04 2017 +0300
@@ -36,7 +36,7 @@ static ngx_command_t  ngx_google_perftoo
   offsetof(ngx_google_perftools_conf_t, profiles),
   NULL },
 
-ngx_null_command
+  ngx_null_command
 };
 
 
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style.

2017-06-01 Thread Maxim Dounin
details:   http://hg.nginx.org/nginx/rev/8ce1a34f160b
branches:  
changeset: 7019:8ce1a34f160b
user:  Maxim Dounin 
date:  Thu Jun 01 16:49:14 2017 +0300
description:
Style.

diffstat:

 src/os/unix/ngx_udp_sendmsg_chain.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (20 lines):

diff --git a/src/os/unix/ngx_udp_sendmsg_chain.c 
b/src/os/unix/ngx_udp_sendmsg_chain.c
--- a/src/os/unix/ngx_udp_sendmsg_chain.c
+++ b/src/os/unix/ngx_udp_sendmsg_chain.c
@@ -206,13 +206,13 @@ ngx_sendmsg(ngx_connection_t *c, ngx_iov
 #if (NGX_HAVE_MSGHDR_MSG_CONTROL)
 
 #if (NGX_HAVE_IP_SENDSRCADDR)
-u_char msg_control[CMSG_SPACE(sizeof(struct in_addr))];
+u_char msg_control[CMSG_SPACE(sizeof(struct in_addr))];
 #elif (NGX_HAVE_IP_PKTINFO)
-u_char msg_control[CMSG_SPACE(sizeof(struct in_pktinfo))];
+u_char msg_control[CMSG_SPACE(sizeof(struct in_pktinfo))];
 #endif
 
 #if (NGX_HAVE_INET6 && NGX_HAVE_IPV6_RECVPKTINFO)
-u_char msg_control6[CMSG_SPACE(sizeof(struct in6_pktinfo))];
+u_char msg_control6[CMSG_SPACE(sizeof(struct in6_pktinfo))];
 #endif
 
 #endif
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style: changed checks of ngx_ssl_create_connection() to != NGX_OK.

2017-05-29 Thread Maxim Dounin
details:   http://hg.nginx.org/nginx/rev/03444167a3bb
branches:  
changeset: 7009:03444167a3bb
user:  Maxim Dounin 
date:  Mon May 29 16:34:35 2017 +0300
description:
Style: changed checks of ngx_ssl_create_connection() to != NGX_OK.

In http these checks were changed in a6d6d762c554, though mail module
was missed at that time.  Since then, the stream module was introduced
based on mail, using "== NGX_ERROR" check.

diffstat:

 src/mail/ngx_mail_handler.c|  2 +-
 src/stream/ngx_stream_ssl_module.c |  2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diffs (24 lines):

diff --git a/src/mail/ngx_mail_handler.c b/src/mail/ngx_mail_handler.c
--- a/src/mail/ngx_mail_handler.c
+++ b/src/mail/ngx_mail_handler.c
@@ -222,7 +222,7 @@ ngx_mail_ssl_init_connection(ngx_ssl_t *
 ngx_mail_session_t*s;
 ngx_mail_core_srv_conf_t  *cscf;
 
-if (ngx_ssl_create_connection(ssl, c, 0) == NGX_ERROR) {
+if (ngx_ssl_create_connection(ssl, c, 0) != NGX_OK) {
 ngx_mail_close_connection(c);
 return;
 }
diff --git a/src/stream/ngx_stream_ssl_module.c 
b/src/stream/ngx_stream_ssl_module.c
--- a/src/stream/ngx_stream_ssl_module.c
+++ b/src/stream/ngx_stream_ssl_module.c
@@ -365,7 +365,7 @@ ngx_stream_ssl_init_connection(ngx_ssl_t
 return NGX_ERROR;
 }
 
-if (ngx_ssl_create_connection(ssl, c, 0) == NGX_ERROR) {
+if (ngx_ssl_create_connection(ssl, c, 0) != NGX_OK) {
 return NGX_ERROR;
 }
 
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


Re: [nginx] style

2017-03-16 Thread 洪志道
By the way, I'm confused by the problem I sent a few days ago.
And I think there are also other users face the same problem.

When we upgrade nginx, it produces the phenomenon that
the nginx.pid file is deleted but the master and worker processes are still
running.
Inside nginx source, it seems nginx dose guarantee that pid file and
master/worker processes
are always exist together.

What causes this phenomenon?

```
kill -USR2 pid;
sleep n;
kill -QUIT oldpid;
```

Thanks so much.
B.R.

2017-03-17 0:05 GMT+08:00 Ruslan Ermilov :

> On Thu, Mar 16, 2017 at 05:40:46PM +0800, 洪志道 wrote:
> > Hi!
> >
> > diff -r d45072375572 src/os/unix/ngx_process.c
> > --- a/src/os/unix/ngx_process.c Tue Mar 07 18:51:17 2017 +0300
> > +++ b/src/os/unix/ngx_process.c Thu Mar 16 06:44:25 2017 -0400
> > @@ -306,7 +306,7 @@
> >  }
> >
> >
> > -void
> > +static void
> >  ngx_signal_handler(int signo)
> >  {
> >  char*action;
> >
> >
> > Thanks.
> > B.R.
>
> Fixed, thanks!
>
> http://hg.nginx.org/nginx/rev/e54c336d95aa
> ___
> nginx-devel mailing list
> nginx-devel@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel

Re: [nginx] style

2017-03-16 Thread Ruslan Ermilov
On Thu, Mar 16, 2017 at 05:40:46PM +0800, 洪志道 wrote:
> Hi!
> 
> diff -r d45072375572 src/os/unix/ngx_process.c
> --- a/src/os/unix/ngx_process.c Tue Mar 07 18:51:17 2017 +0300
> +++ b/src/os/unix/ngx_process.c Thu Mar 16 06:44:25 2017 -0400
> @@ -306,7 +306,7 @@
>  }
> 
> 
> -void
> +static void
>  ngx_signal_handler(int signo)
>  {
>  char*action;
> 
> 
> Thanks.
> B.R.

Fixed, thanks!

http://hg.nginx.org/nginx/rev/e54c336d95aa
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel

[nginx] style

2017-03-16 Thread 洪志道
Hi!

diff -r d45072375572 src/os/unix/ngx_process.c
--- a/src/os/unix/ngx_process.c Tue Mar 07 18:51:17 2017 +0300
+++ b/src/os/unix/ngx_process.c Thu Mar 16 06:44:25 2017 -0400
@@ -306,7 +306,7 @@
 }


-void
+static void
 ngx_signal_handler(int signo)
 {
 char*action;


Thanks.
B.R.
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel

[nginx] Style.

2017-03-07 Thread Maxim Dounin
details:   http://hg.nginx.org/nginx/rev/d45072375572
branches:  
changeset: 6931:d45072375572
user:  Maxim Dounin 
date:  Tue Mar 07 18:51:17 2017 +0300
description:
Style.

diffstat:

 src/os/unix/ngx_process_cycle.c |  2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diffs (19 lines):

diff --git a/src/os/unix/ngx_process_cycle.c b/src/os/unix/ngx_process_cycle.c
--- a/src/os/unix/ngx_process_cycle.c
+++ b/src/os/unix/ngx_process_cycle.c
@@ -740,7 +740,6 @@ ngx_worker_process_cycle(ngx_cycle_t *cy
 if (ngx_exiting) {
 if (ngx_event_no_timers_left() == NGX_OK) {
 ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "exiting");
-
 ngx_worker_process_exit(cycle);
 }
 }
@@ -751,7 +750,6 @@ ngx_worker_process_cycle(ngx_cycle_t *cy
 
 if (ngx_terminate) {
 ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "exiting");
-
 ngx_worker_process_exit(cycle);
 }
 
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style: switch.

2016-11-04 Thread Ruslan Ermilov
details:   http://hg.nginx.org/nginx/rev/92ad1c92bcf9
branches:  
changeset: 6796:92ad1c92bcf9
user:  Ruslan Ermilov 
date:  Fri Nov 04 19:12:19 2016 +0300
description:
Style: switch.

diffstat:

 src/http/ngx_http_core_module.c  |  2 --
 src/http/ngx_http_special_response.c |  1 -
 2 files changed, 0 insertions(+), 3 deletions(-)

diffs (23 lines):

diff -r 1a917932db96 -r 92ad1c92bcf9 src/http/ngx_http_core_module.c
--- a/src/http/ngx_http_core_module.c   Thu Nov 03 17:10:29 2016 +0300
+++ b/src/http/ngx_http_core_module.c   Fri Nov 04 19:12:19 2016 +0300
@@ -4827,8 +4827,6 @@ ngx_http_core_error_page(ngx_conf_t *cf,
 case NGX_HTTPS_CERT_ERROR:
 case NGX_HTTPS_NO_CERT:
 err->overwrite = NGX_HTTP_BAD_REQUEST;
-default:
-break;
 }
 }
 
diff -r 1a917932db96 -r 92ad1c92bcf9 src/http/ngx_http_special_response.c
--- a/src/http/ngx_http_special_response.c  Thu Nov 03 17:10:29 2016 +0300
+++ b/src/http/ngx_http_special_response.c  Fri Nov 04 19:12:19 2016 +0300
@@ -473,7 +473,6 @@ ngx_http_special_response_handler(ngx_ht
 case NGX_HTTPS_NO_CERT:
 case NGX_HTTP_REQUEST_HEADER_TOO_LARGE:
 r->err_status = NGX_HTTP_BAD_REQUEST;
-break;
 }
 
 } else {

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style.

2016-10-14 Thread Maxim Dounin
details:   http://hg.nginx.org/nginx/rev/7fc16ff7ddc4
branches:  
changeset: 6743:7fc16ff7ddc4
user:  Maxim Dounin 
date:  Fri Oct 14 19:48:26 2016 +0300
description:
Style.

diffstat:

 src/core/ngx_hash.c |  1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diffs (11 lines):

diff --git a/src/core/ngx_hash.c b/src/core/ngx_hash.c
--- a/src/core/ngx_hash.c
+++ b/src/core/ngx_hash.c
@@ -390,7 +390,6 @@ found:
 
 buckets[i] = (ngx_hash_elt_t *) elts;
 elts += test[i];
-
 }
 
 for (i = 0; i < size; i++) {

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style: sorted epoll flags.

2016-07-15 Thread Valentin Bartenev
details:   http://hg.nginx.org/nginx/rev/18f6120e3b7a
branches:  
changeset: 6634:18f6120e3b7a
user:  Valentin Bartenev 
date:  Fri Jul 15 15:18:57 2016 +0300
description:
Style: sorted epoll flags.

diffstat:

 src/event/modules/ngx_epoll_module.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (25 lines):

diff -r d82b3c344e7e -r 18f6120e3b7a src/event/modules/ngx_epoll_module.c
--- a/src/event/modules/ngx_epoll_module.c  Fri Jul 15 15:18:57 2016 +0300
+++ b/src/event/modules/ngx_epoll_module.c  Fri Jul 15 15:18:57 2016 +0300
@@ -17,18 +17,18 @@
 #define EPOLLIN0x001
 #define EPOLLPRI   0x002
 #define EPOLLOUT   0x004
+#define EPOLLERR   0x008
+#define EPOLLHUP   0x010
 #define EPOLLRDNORM0x040
 #define EPOLLRDBAND0x080
 #define EPOLLWRNORM0x100
 #define EPOLLWRBAND0x200
 #define EPOLLMSG   0x400
-#define EPOLLERR   0x008
-#define EPOLLHUP   0x010
 
 #define EPOLLRDHUP 0x2000
 
+#define EPOLLONESHOT   0x4000
 #define EPOLLET0x8000
-#define EPOLLONESHOT   0x4000
 
 #define EPOLL_CTL_ADD  1
 #define EPOLL_CTL_DEL  2

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style.

2016-06-27 Thread Roman Arutyunyan
details:   http://hg.nginx.org/nginx/rev/d452cb27639f
branches:  
changeset: 6601:d452cb27639f
user:  Roman Arutyunyan 
date:  Mon Jun 27 18:42:29 2016 +0300
description:
Style.

diffstat:

 src/stream/ngx_stream_limit_conn_module.c |  20 ++--
 1 files changed, 10 insertions(+), 10 deletions(-)

diffs (30 lines):

diff -r 6f69e3c0f780 -r d452cb27639f src/stream/ngx_stream_limit_conn_module.c
--- a/src/stream/ngx_stream_limit_conn_module.c Wed Jun 22 13:47:54 2016 -0700
+++ b/src/stream/ngx_stream_limit_conn_module.c Mon Jun 27 18:42:29 2016 +0300
@@ -105,16 +105,16 @@ static ngx_stream_module_t  ngx_stream_l
 
 ngx_module_t  ngx_stream_limit_conn_module = {
 NGX_MODULE_V1,
-_stream_limit_conn_module_ctx,   /* module context */
-ngx_stream_limit_conn_commands,  /* module directives */
-NGX_STREAM_MODULE,   /* module type */
-NULL,/* init master */
-NULL,/* init module */
-NULL,/* init process */
-NULL,/* init thread */
-NULL,/* exit thread */
-NULL,/* exit process */
-NULL,/* exit master */
+_stream_limit_conn_module_ctx, /* module context */
+ngx_stream_limit_conn_commands,/* module directives */
+NGX_STREAM_MODULE, /* module type */
+NULL,  /* init master */
+NULL,  /* init module */
+NULL,  /* init process */
+NULL,  /* init thread */
+NULL,  /* exit thread */
+NULL,  /* exit process */
+NULL,  /* exit master */
 NGX_MODULE_V1_PADDING
 };
 

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style.

2016-06-22 Thread Roman Arutyunyan
details:   http://hg.nginx.org/nginx/rev/191e23214dfb
branches:  
changeset: 6599:191e23214dfb
user:  Roman Arutyunyan 
date:  Wed Jun 22 11:50:02 2016 +0300
description:
Style.

diffstat:

 src/stream/ngx_stream_proxy_module.c |  1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diffs (11 lines):

diff -r 4a724d6006ee -r 191e23214dfb src/stream/ngx_stream_proxy_module.c
--- a/src/stream/ngx_stream_proxy_module.c  Wed Jun 22 11:50:02 2016 +0300
+++ b/src/stream/ngx_stream_proxy_module.c  Wed Jun 22 11:50:02 2016 +0300
@@ -1753,7 +1753,6 @@ ngx_stream_proxy_bind(ngx_conf_t *cf, ng
 if (ngx_strcmp(value[2].data, "transparent") == 0) {
 #if (NGX_HAVE_TRANSPARENT_PROXY)
 local->transparent = 1;
-
 #else
 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"transparent proxying is not supported "

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style.

2016-03-30 Thread Ruslan Ermilov
details:   http://hg.nginx.org/nginx/rev/2cd019520210
branches:  
changeset: 6474:2cd019520210
user:  Ruslan Ermilov 
date:  Wed Mar 30 11:52:16 2016 +0300
description:
Style.

diffstat:

 src/core/ngx_conf_file.c   |   6 +-
 src/core/ngx_connection.c  |  36 
 src/core/ngx_connection.h  |  22 
 src/core/ngx_crypt.c   |   4 +-
 src/core/ngx_cycle.h   |  40 +-
 src/core/ngx_file.c|   2 +-
 src/core/ngx_inet.c|  20 
 src/core/ngx_log.c |  18 
 src/core/ngx_parse_time.c  |   2 +-
 src/core/ngx_slab.c|   8 +-
 src/core/ngx_syslog.c  |   6 +-
 src/event/modules/ngx_iocp_module.c|  38 
 src/event/ngx_event.h  |   2 +-
 src/event/ngx_event_openssl.c  |   6 +-
 src/event/ngx_event_pipe.c |  10 ++--
 src/http/modules/ngx_http_dav_module.c |  10 ++--
 src/http/modules/ngx_http_fastcgi_module.c |  10 ++--
 src/http/modules/ngx_http_image_filter_module.c|   2 +-
 src/http/modules/ngx_http_mp4_module.c |  16 +++---
 src/http/modules/ngx_http_range_filter_module.c|   2 +-
 src/http/modules/ngx_http_realip_module.c  |   4 +-
 src/http/modules/ngx_http_referer_module.c |   2 +-
 src/http/modules/ngx_http_rewrite_module.c |   2 +-
 src/http/modules/ngx_http_scgi_module.c|   2 +-
 src/http/modules/ngx_http_ssl_module.c |   4 +-
 src/http/modules/ngx_http_upstream_least_conn_module.c |   2 +-
 src/http/ngx_http_core_module.c|  36 
 src/http/ngx_http_core_module.h|   8 +-
 src/http/ngx_http_script.c |   4 +-
 src/http/ngx_http_upstream.c   |  30 ++--
 src/http/ngx_http_upstream_round_robin.c   |   2 +-
 src/http/v2/ngx_http_v2_module.c   |   2 +-
 src/mail/ngx_mail.h|   2 +-
 src/mail/ngx_mail_smtp_handler.c   |   2 +-
 src/mail/ngx_mail_ssl_module.c |   6 +-
 src/os/unix/ngx_atomic.h   |  20 
 src/os/unix/ngx_channel.h  |   8 +-
 src/os/unix/ngx_sunpro_amd64.il|   6 +-
 src/os/unix/ngx_sunpro_x86.il  |   6 +-
 src/os/win32/ngx_atomic.h  |   8 +-
 src/os/win32/ngx_wsasend_chain.c   |  10 ++--
 src/stream/ngx_stream_upstream_least_conn_module.c |   2 +-
 src/stream/ngx_stream_upstream_round_robin.c   |   2 +-
 43 files changed, 215 insertions(+), 215 deletions(-)

diffs (truncated from 1001 to 1000 lines):

diff -r 9d7326d3f474 -r 2cd019520210 src/core/ngx_conf_file.c
--- a/src/core/ngx_conf_file.c  Wed Mar 30 11:52:07 2016 +0300
+++ b/src/core/ngx_conf_file.c  Wed Mar 30 11:52:16 2016 +0300
@@ -613,9 +613,9 @@ ngx_conf_read_token(ngx_conf_t *cf)
 need_space = 0;
 
 } else {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
-"unexpected \"%c\"", ch);
- return NGX_ERROR;
+ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+   "unexpected \"%c\"", ch);
+return NGX_ERROR;
 }
 }
 
diff -r 9d7326d3f474 -r 2cd019520210 src/core/ngx_connection.c
--- a/src/core/ngx_connection.c Wed Mar 30 11:52:07 2016 +0300
+++ b/src/core/ngx_connection.c Wed Mar 30 11:52:16 2016 +0300
@@ -47,21 +47,21 @@ ngx_create_listening(ngx_conf_t *cf, voi
 switch (ls->sockaddr->sa_family) {
 #if (NGX_HAVE_INET6)
 case AF_INET6:
- ls->addr_text_max_len = NGX_INET6_ADDRSTRLEN;
- break;
+ls->addr_text_max_len = NGX_INET6_ADDRSTRLEN;
+break;
 #endif
 #if (NGX_HAVE_UNIX_DOMAIN)
 case AF_UNIX:
- ls->addr_text_max_len = NGX_UNIX_ADDRSTRLEN;
- len++;
- break;
+ls->addr_text_max_len = NGX_UNIX_ADDRSTRLEN;
+len++;
+break;
 #endif
 case AF_INET:
- ls->addr_text_max_len = NGX_INET_ADDRSTRLEN;
- break;
+ls->addr_text_max_len = NGX_INET_ADDRSTRLEN;
+break;
 default:
- ls->addr_text_max_len = NGX_SOCKADDR_STRLEN;
- break;
+ls->addr_text_max_len = NGX_SOCKADDR_STRLEN;
+break;
 }
 
 ls->addr_text.data = ngx_pnalloc(cf->pool, len);
@@ -168,22 +168,22 @@ 

[nginx] Style.

2016-03-19 Thread Ruslan Ermilov
details:   http://hg.nginx.org/nginx/rev/81329f6a4254
branches:  
changeset: 6439:81329f6a4254
user:  Ruslan Ermilov 
date:  Wed Mar 16 14:44:41 2016 +0300
description:
Style.

diffstat:

 src/http/ngx_http_upstream.c |  8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (18 lines):

diff -r 646985c55393 -r 81329f6a4254 src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c  Tue Mar 15 18:26:59 2016 +0300
+++ b/src/http/ngx_http_upstream.c  Wed Mar 16 14:44:41 2016 +0300
@@ -416,10 +416,10 @@ static ngx_http_upstream_next_t  ngx_htt
 
 
 ngx_conf_bitmask_t  ngx_http_upstream_cache_method_mask[] = {
-   { ngx_string("GET"),  NGX_HTTP_GET},
-   { ngx_string("HEAD"), NGX_HTTP_HEAD },
-   { ngx_string("POST"), NGX_HTTP_POST },
-   { ngx_null_string, 0 }
+{ ngx_string("GET"), NGX_HTTP_GET },
+{ ngx_string("HEAD"), NGX_HTTP_HEAD },
+{ ngx_string("POST"), NGX_HTTP_POST },
+{ ngx_null_string, 0 }
 };
 
 

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style.

2015-12-01 Thread Maxim Dounin
details:   http://hg.nginx.org/nginx/rev/be3aed17689c
branches:  
changeset: 6313:be3aed17689c
user:  Maxim Dounin 
date:  Wed Dec 02 01:06:54 2015 +0300
description:
Style.

diffstat:

 src/http/ngx_http_upstream.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -641,7 +641,7 @@ ngx_http_upstream_init_request(ngx_http_
 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
   "no port in upstream \"%V\"", host);
 ngx_http_upstream_finalize_request(r, u,
-   
NGX_HTTP_INTERNAL_SERVER_ERROR);
+   NGX_HTTP_INTERNAL_SERVER_ERROR);
 return;
 }
 

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


Re: [nginx] Style: unified request method checks.

2015-11-25 Thread Ruslan Ermilov
On Tue, Nov 24, 2015 at 11:31:16PM +0200, Sorin Manole wrote:
> 2015-11-24 22:41 GMT+02:00 Ruslan Ermilov :
> 
> > details:   http://hg.nginx.org/nginx/rev/b1858fc47e3b
> > branches:
> > changeset: 6306:b1858fc47e3b
> > user:  Ruslan Ermilov 
> > date:  Fri Nov 06 15:22:43 2015 +0300
> > description:
> > Style: unified request method checks.
> >
> > diffstat:
> >
> >  src/http/modules/ngx_http_chunked_filter_module.c |  2 +-
> >  src/http/modules/ngx_http_static_module.c |  2 +-
> >  src/http/modules/ngx_http_stub_status_module.c|  2 +-
> >  src/http/ngx_http_request.c   |  2 +-
> >  src/http/ngx_http_upstream.c  |  2 +-
> >  5 files changed, 5 insertions(+), 5 deletions(-)
> >
> > diffs (60 lines):
> >
> > diff -r 18428f775b2c -r b1858fc47e3b
> > src/http/modules/ngx_http_chunked_filter_module.c
> > --- a/src/http/modules/ngx_http_chunked_filter_module.c Mon Nov 23
> > 12:40:19 2015 +0300
> > +++ b/src/http/modules/ngx_http_chunked_filter_module.c Fri Nov 06
> > 15:22:43 2015 +0300
> > @@ -64,7 +64,7 @@ ngx_http_chunked_header_filter(ngx_http_
> >  || r->headers_out.status == NGX_HTTP_NO_CONTENT
> >  || r->headers_out.status < NGX_HTTP_OK
> >  || r != r->main
> > -|| (r->method & NGX_HTTP_HEAD))
> > +|| r->method == NGX_HTTP_HEAD)
> >  {
> >  return ngx_http_next_header_filter(r);
> >  }
> > diff -r 18428f775b2c -r b1858fc47e3b
> > src/http/modules/ngx_http_static_module.c
> > --- a/src/http/modules/ngx_http_static_module.c Mon Nov 23 12:40:19 2015
> > +0300
> > +++ b/src/http/modules/ngx_http_static_module.c Fri Nov 06 15:22:43 2015
> > +0300
> > @@ -204,7 +204,7 @@ ngx_http_static_handler(ngx_http_request
> >
> >  #endif
> >
> > -if (r->method & NGX_HTTP_POST) {
> > +if (r->method == NGX_HTTP_POST) {
> >  return NGX_HTTP_NOT_ALLOWED;
> >  }
> >
> > diff -r 18428f775b2c -r b1858fc47e3b
> > src/http/modules/ngx_http_stub_status_module.c
> > --- a/src/http/modules/ngx_http_stub_status_module.cMon Nov 23
> > 12:40:19 2015 +0300
> > +++ b/src/http/modules/ngx_http_stub_status_module.cFri Nov 06
> > 15:22:43 2015 +0300
> > @@ -89,7 +89,7 @@ ngx_http_stub_status_handler(ngx_http_re
> >  ngx_chain_tout;
> >  ngx_atomic_int_t   ap, hn, ac, rq, rd, wr, wa;
> >
> > -if (r->method != NGX_HTTP_GET && r->method != NGX_HTTP_HEAD) {
> > +if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD))) {
> >
> Since it's about the style, not really an unification I would say.

What did you mean to say, I don't quite follow?
This particular part of the change is about unification:

ngx_http_autoindex_module.c:if (!(r->method & 
(NGX_HTTP_GET|NGX_HTTP_HEAD))) {
ngx_http_empty_gif_module.c:if (!(r->method & 
(NGX_HTTP_GET|NGX_HTTP_HEAD))) {
ngx_http_flv_module.c:if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD))) {
ngx_http_gzip_static_module.c:if (!(r->method & 
(NGX_HTTP_GET|NGX_HTTP_HEAD))) {
ngx_http_index_module.c:if (!(r->method & 
(NGX_HTTP_GET|NGX_HTTP_HEAD|NGX_HTTP_POST))) {
ngx_http_memcached_module.c:if (!(r->method & 
(NGX_HTTP_GET|NGX_HTTP_HEAD))) {
ngx_http_mp4_module.c:if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD))) {
ngx_http_random_index_module.c:if (!(r->method & 
(NGX_HTTP_GET|NGX_HTTP_HEAD|NGX_HTTP_POST))) {
ngx_http_static_module.c:if (!(r->method & 
(NGX_HTTP_GET|NGX_HTTP_HEAD|NGX_HTTP_POST))) {
ngx_http_stub_status_module.c:if (!(r->method & 
(NGX_HTTP_GET|NGX_HTTP_HEAD))) {

> >  return NGX_HTTP_NOT_ALLOWED;
> >  }
> >
> > diff -r 18428f775b2c -r b1858fc47e3b src/http/ngx_http_request.c
> > --- a/src/http/ngx_http_request.c   Mon Nov 23 12:40:19 2015 +0300
> > +++ b/src/http/ngx_http_request.c   Fri Nov 06 15:22:43 2015 +0300
> > @@ -1788,7 +1788,7 @@ ngx_http_process_request_header(ngx_http
> >  }
> >  }
> >
> > -if (r->method & NGX_HTTP_TRACE) {
> > +if (r->method == NGX_HTTP_TRACE) {
> >  ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
> >"client sent TRACE method");
> >  ngx_http_finalize_request(r, NGX_HTTP_NOT_ALLOWED);
> > diff -r 18428f775b2c -r b1858fc47e3b src/http/ngx_http_upstream.c
> > --- a/src/http/ngx_http_upstream.c  Mon Nov 23 12:40:19 2015 +0300
> > +++ b/src/http/ngx_http_upstream.c  Fri Nov 06 15:22:43 2015 +0300
> > @@ -772,7 +772,7 @@ ngx_http_upstream_cache(ngx_http_request
> >  return rc;
> >  }
> >
> > -if ((r->method & NGX_HTTP_HEAD) && u->conf->cache_convert_head) {
> > +if (r->method == NGX_HTTP_HEAD && u->conf->cache_convert_head) {
> >  u->method = ngx_http_core_get_method;
> >  }
> >
> >
> > ___
> > nginx-devel mailing list
> > nginx-devel@nginx.org
> > http://mailman.nginx.org/mailman/listinfo/nginx-devel
> >


-- 
Ruslan Ermilov


Re: [nginx] Style: unified request method checks.

2015-11-25 Thread Sorin Manole
I meant, from the diff, it looked like all single HTTP method checks were
transitioned from & to ==, while that single one was changed from == to &.
I understand now, the checks were unified with the ones that were not in
the diff (duh, I should have though about that).

Still, as a result in some places "&" is used, and in another == is. So
IMHO I don't see the point in using == for single method checks and & for
multiple in terms of unifying usage throughout the code.

But, thanks a lot for clarifying. It makes sense.

2015-11-25 13:07 GMT+02:00 Ruslan Ermilov :

> On Tue, Nov 24, 2015 at 11:31:16PM +0200, Sorin Manole wrote:
> > 2015-11-24 22:41 GMT+02:00 Ruslan Ermilov :
> >
> > > details:   http://hg.nginx.org/nginx/rev/b1858fc47e3b
> > > branches:
> > > changeset: 6306:b1858fc47e3b
> > > user:  Ruslan Ermilov 
> > > date:  Fri Nov 06 15:22:43 2015 +0300
> > > description:
> > > Style: unified request method checks.
> > >
> > > diffstat:
> > >
> > >  src/http/modules/ngx_http_chunked_filter_module.c |  2 +-
> > >  src/http/modules/ngx_http_static_module.c |  2 +-
> > >  src/http/modules/ngx_http_stub_status_module.c|  2 +-
> > >  src/http/ngx_http_request.c   |  2 +-
> > >  src/http/ngx_http_upstream.c  |  2 +-
> > >  5 files changed, 5 insertions(+), 5 deletions(-)
> > >
> > > diffs (60 lines):
> > >
> > > diff -r 18428f775b2c -r b1858fc47e3b
> > > src/http/modules/ngx_http_chunked_filter_module.c
> > > --- a/src/http/modules/ngx_http_chunked_filter_module.c Mon Nov 23
> > > 12:40:19 2015 +0300
> > > +++ b/src/http/modules/ngx_http_chunked_filter_module.c Fri Nov 06
> > > 15:22:43 2015 +0300
> > > @@ -64,7 +64,7 @@ ngx_http_chunked_header_filter(ngx_http_
> > >  || r->headers_out.status == NGX_HTTP_NO_CONTENT
> > >  || r->headers_out.status < NGX_HTTP_OK
> > >  || r != r->main
> > > -|| (r->method & NGX_HTTP_HEAD))
> > > +|| r->method == NGX_HTTP_HEAD)
> > >  {
> > >  return ngx_http_next_header_filter(r);
> > >  }
> > > diff -r 18428f775b2c -r b1858fc47e3b
> > > src/http/modules/ngx_http_static_module.c
> > > --- a/src/http/modules/ngx_http_static_module.c Mon Nov 23 12:40:19
> 2015
> > > +0300
> > > +++ b/src/http/modules/ngx_http_static_module.c Fri Nov 06 15:22:43
> 2015
> > > +0300
> > > @@ -204,7 +204,7 @@ ngx_http_static_handler(ngx_http_request
> > >
> > >  #endif
> > >
> > > -if (r->method & NGX_HTTP_POST) {
> > > +if (r->method == NGX_HTTP_POST) {
> > >  return NGX_HTTP_NOT_ALLOWED;
> > >  }
> > >
> > > diff -r 18428f775b2c -r b1858fc47e3b
> > > src/http/modules/ngx_http_stub_status_module.c
> > > --- a/src/http/modules/ngx_http_stub_status_module.cMon Nov 23
> > > 12:40:19 2015 +0300
> > > +++ b/src/http/modules/ngx_http_stub_status_module.cFri Nov 06
> > > 15:22:43 2015 +0300
> > > @@ -89,7 +89,7 @@ ngx_http_stub_status_handler(ngx_http_re
> > >  ngx_chain_tout;
> > >  ngx_atomic_int_t   ap, hn, ac, rq, rd, wr, wa;
> > >
> > > -if (r->method != NGX_HTTP_GET && r->method != NGX_HTTP_HEAD) {
> > > +if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD))) {
> > >
> > Since it's about the style, not really an unification I would say.
>
> What did you mean to say, I don't quite follow?
> This particular part of the change is about unification:
>
> ngx_http_autoindex_module.c:if (!(r->method &
> (NGX_HTTP_GET|NGX_HTTP_HEAD))) {
> ngx_http_empty_gif_module.c:if (!(r->method &
> (NGX_HTTP_GET|NGX_HTTP_HEAD))) {
> ngx_http_flv_module.c:if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD)))
> {
> ngx_http_gzip_static_module.c:if (!(r->method &
> (NGX_HTTP_GET|NGX_HTTP_HEAD))) {
> ngx_http_index_module.c:if (!(r->method &
> (NGX_HTTP_GET|NGX_HTTP_HEAD|NGX_HTTP_POST))) {
> ngx_http_memcached_module.c:if (!(r->method &
> (NGX_HTTP_GET|NGX_HTTP_HEAD))) {
> ngx_http_mp4_module.c:if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD)))
> {
> ngx_http_random_index_module.c:if (!(r->method &
> (NGX_HTTP_GET|NGX_HTTP_HEAD|NGX_HTTP_POST))) {
> ngx_http_static_module.c:if (!(r->method &
> (NGX_HTTP_GET|NGX_HTTP_HEAD|NGX_HTTP_POST))) {
> ngx_http_stub_status_module.c:if (!(r->method &
> (NGX_HTTP_GET|NGX_HTTP_HEAD))) {
>
> > >  return NGX_HTTP_NOT_ALLOWED;
> > >  }
> > >
> > > diff -r 18428f775b2c -r b1858fc47e3b src/http/ngx_http_request.c
> > > --- a/src/http/ngx_http_request.c   Mon Nov 23 12:40:19 2015 +0300
> > > +++ b/src/http/ngx_http_request.c   Fri Nov 06 15:22:43 2015 +0300
> > > @@ -1788,7 +1788,7 @@ ngx_http_process_request_header(ngx_http
> > >  }
> > >  }
> > >
> > > -if (r->method & NGX_HTTP_TRACE) {
> > > +if (r->method == NGX_HTTP_TRACE) {
> > >  ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
> > >"client sent TRACE method");
> > >  ngx_http_finalize_request(r, 

[nginx] Style: unified request method checks.

2015-11-24 Thread Ruslan Ermilov
details:   http://hg.nginx.org/nginx/rev/b1858fc47e3b
branches:  
changeset: 6306:b1858fc47e3b
user:  Ruslan Ermilov 
date:  Fri Nov 06 15:22:43 2015 +0300
description:
Style: unified request method checks.

diffstat:

 src/http/modules/ngx_http_chunked_filter_module.c |  2 +-
 src/http/modules/ngx_http_static_module.c |  2 +-
 src/http/modules/ngx_http_stub_status_module.c|  2 +-
 src/http/ngx_http_request.c   |  2 +-
 src/http/ngx_http_upstream.c  |  2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diffs (60 lines):

diff -r 18428f775b2c -r b1858fc47e3b 
src/http/modules/ngx_http_chunked_filter_module.c
--- a/src/http/modules/ngx_http_chunked_filter_module.c Mon Nov 23 12:40:19 
2015 +0300
+++ b/src/http/modules/ngx_http_chunked_filter_module.c Fri Nov 06 15:22:43 
2015 +0300
@@ -64,7 +64,7 @@ ngx_http_chunked_header_filter(ngx_http_
 || r->headers_out.status == NGX_HTTP_NO_CONTENT
 || r->headers_out.status < NGX_HTTP_OK
 || r != r->main
-|| (r->method & NGX_HTTP_HEAD))
+|| r->method == NGX_HTTP_HEAD)
 {
 return ngx_http_next_header_filter(r);
 }
diff -r 18428f775b2c -r b1858fc47e3b src/http/modules/ngx_http_static_module.c
--- a/src/http/modules/ngx_http_static_module.c Mon Nov 23 12:40:19 2015 +0300
+++ b/src/http/modules/ngx_http_static_module.c Fri Nov 06 15:22:43 2015 +0300
@@ -204,7 +204,7 @@ ngx_http_static_handler(ngx_http_request
 
 #endif
 
-if (r->method & NGX_HTTP_POST) {
+if (r->method == NGX_HTTP_POST) {
 return NGX_HTTP_NOT_ALLOWED;
 }
 
diff -r 18428f775b2c -r b1858fc47e3b 
src/http/modules/ngx_http_stub_status_module.c
--- a/src/http/modules/ngx_http_stub_status_module.cMon Nov 23 12:40:19 
2015 +0300
+++ b/src/http/modules/ngx_http_stub_status_module.cFri Nov 06 15:22:43 
2015 +0300
@@ -89,7 +89,7 @@ ngx_http_stub_status_handler(ngx_http_re
 ngx_chain_tout;
 ngx_atomic_int_t   ap, hn, ac, rq, rd, wr, wa;
 
-if (r->method != NGX_HTTP_GET && r->method != NGX_HTTP_HEAD) {
+if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD))) {
 return NGX_HTTP_NOT_ALLOWED;
 }
 
diff -r 18428f775b2c -r b1858fc47e3b src/http/ngx_http_request.c
--- a/src/http/ngx_http_request.c   Mon Nov 23 12:40:19 2015 +0300
+++ b/src/http/ngx_http_request.c   Fri Nov 06 15:22:43 2015 +0300
@@ -1788,7 +1788,7 @@ ngx_http_process_request_header(ngx_http
 }
 }
 
-if (r->method & NGX_HTTP_TRACE) {
+if (r->method == NGX_HTTP_TRACE) {
 ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
   "client sent TRACE method");
 ngx_http_finalize_request(r, NGX_HTTP_NOT_ALLOWED);
diff -r 18428f775b2c -r b1858fc47e3b src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c  Mon Nov 23 12:40:19 2015 +0300
+++ b/src/http/ngx_http_upstream.c  Fri Nov 06 15:22:43 2015 +0300
@@ -772,7 +772,7 @@ ngx_http_upstream_cache(ngx_http_request
 return rc;
 }
 
-if ((r->method & NGX_HTTP_HEAD) && u->conf->cache_convert_head) {
+if (r->method == NGX_HTTP_HEAD && u->conf->cache_convert_head) {
 u->method = ngx_http_core_get_method;
 }
 

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


Re: [nginx] Style: unified request method checks.

2015-11-24 Thread Sorin Manole
2015-11-24 22:41 GMT+02:00 Ruslan Ermilov :

> details:   http://hg.nginx.org/nginx/rev/b1858fc47e3b
> branches:
> changeset: 6306:b1858fc47e3b
> user:  Ruslan Ermilov 
> date:  Fri Nov 06 15:22:43 2015 +0300
> description:
> Style: unified request method checks.
>
> diffstat:
>
>  src/http/modules/ngx_http_chunked_filter_module.c |  2 +-
>  src/http/modules/ngx_http_static_module.c |  2 +-
>  src/http/modules/ngx_http_stub_status_module.c|  2 +-
>  src/http/ngx_http_request.c   |  2 +-
>  src/http/ngx_http_upstream.c  |  2 +-
>  5 files changed, 5 insertions(+), 5 deletions(-)
>
> diffs (60 lines):
>
> diff -r 18428f775b2c -r b1858fc47e3b
> src/http/modules/ngx_http_chunked_filter_module.c
> --- a/src/http/modules/ngx_http_chunked_filter_module.c Mon Nov 23
> 12:40:19 2015 +0300
> +++ b/src/http/modules/ngx_http_chunked_filter_module.c Fri Nov 06
> 15:22:43 2015 +0300
> @@ -64,7 +64,7 @@ ngx_http_chunked_header_filter(ngx_http_
>  || r->headers_out.status == NGX_HTTP_NO_CONTENT
>  || r->headers_out.status < NGX_HTTP_OK
>  || r != r->main
> -|| (r->method & NGX_HTTP_HEAD))
> +|| r->method == NGX_HTTP_HEAD)
>  {
>  return ngx_http_next_header_filter(r);
>  }
> diff -r 18428f775b2c -r b1858fc47e3b
> src/http/modules/ngx_http_static_module.c
> --- a/src/http/modules/ngx_http_static_module.c Mon Nov 23 12:40:19 2015
> +0300
> +++ b/src/http/modules/ngx_http_static_module.c Fri Nov 06 15:22:43 2015
> +0300
> @@ -204,7 +204,7 @@ ngx_http_static_handler(ngx_http_request
>
>  #endif
>
> -if (r->method & NGX_HTTP_POST) {
> +if (r->method == NGX_HTTP_POST) {
>  return NGX_HTTP_NOT_ALLOWED;
>  }
>
> diff -r 18428f775b2c -r b1858fc47e3b
> src/http/modules/ngx_http_stub_status_module.c
> --- a/src/http/modules/ngx_http_stub_status_module.cMon Nov 23
> 12:40:19 2015 +0300
> +++ b/src/http/modules/ngx_http_stub_status_module.cFri Nov 06
> 15:22:43 2015 +0300
> @@ -89,7 +89,7 @@ ngx_http_stub_status_handler(ngx_http_re
>  ngx_chain_tout;
>  ngx_atomic_int_t   ap, hn, ac, rq, rd, wr, wa;
>
> -if (r->method != NGX_HTTP_GET && r->method != NGX_HTTP_HEAD) {
> +if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD))) {
>
Since it's about the style, not really an unification I would say.

>  return NGX_HTTP_NOT_ALLOWED;
>  }
>
> diff -r 18428f775b2c -r b1858fc47e3b src/http/ngx_http_request.c
> --- a/src/http/ngx_http_request.c   Mon Nov 23 12:40:19 2015 +0300
> +++ b/src/http/ngx_http_request.c   Fri Nov 06 15:22:43 2015 +0300
> @@ -1788,7 +1788,7 @@ ngx_http_process_request_header(ngx_http
>  }
>  }
>
> -if (r->method & NGX_HTTP_TRACE) {
> +if (r->method == NGX_HTTP_TRACE) {
>  ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
>"client sent TRACE method");
>  ngx_http_finalize_request(r, NGX_HTTP_NOT_ALLOWED);
> diff -r 18428f775b2c -r b1858fc47e3b src/http/ngx_http_upstream.c
> --- a/src/http/ngx_http_upstream.c  Mon Nov 23 12:40:19 2015 +0300
> +++ b/src/http/ngx_http_upstream.c  Fri Nov 06 15:22:43 2015 +0300
> @@ -772,7 +772,7 @@ ngx_http_upstream_cache(ngx_http_request
>  return rc;
>  }
>
> -if ((r->method & NGX_HTTP_HEAD) && u->conf->cache_convert_head) {
> +if (r->method == NGX_HTTP_HEAD && u->conf->cache_convert_head) {
>  u->method = ngx_http_core_get_method;
>  }
>
>
> ___
> nginx-devel mailing list
> nginx-devel@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
>
___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel

[nginx] Style.

2015-09-22 Thread Maxim Dounin
details:   http://hg.nginx.org/nginx/rev/cbb8c32f78b5
branches:  
changeset: 6251:cbb8c32f78b5
user:  Maxim Dounin 
date:  Tue Sep 22 17:09:50 2015 +0300
description:
Style.

diffstat:

 src/http/v2/ngx_http_v2_filter_module.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff --git a/src/http/v2/ngx_http_v2_filter_module.c 
b/src/http/v2/ngx_http_v2_filter_module.c
--- a/src/http/v2/ngx_http_v2_filter_module.c
+++ b/src/http/v2/ngx_http_v2_filter_module.c
@@ -945,7 +945,8 @@ ngx_http_v2_filter_get_data_frame(ngx_ht
 buf = cl->buf;
 
 if (!buf->start) {
-buf->start = ngx_palloc(stream->request->pool, 
NGX_HTTP_V2_FRAME_HEADER_SIZE);
+buf->start = ngx_palloc(stream->request->pool,
+NGX_HTTP_V2_FRAME_HEADER_SIZE);
 if (buf->start == NULL) {
 return NULL;
 }

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style.

2015-08-12 Thread Vladimir Homutov
details:   http://hg.nginx.org/nginx/rev/1bd5eb20bd7c
branches:  
changeset: 6222:1bd5eb20bd7c
user:  Vladimir Homutov v...@nginx.com
date:  Wed Aug 12 12:56:59 2015 +0300
description:
Style.

diffstat:

 src/stream/ngx_stream_proxy_module.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 7565e056fad6 -r 1bd5eb20bd7c src/stream/ngx_stream_proxy_module.c
--- a/src/stream/ngx_stream_proxy_module.c  Mon Aug 10 12:14:41 2015 +0300
+++ b/src/stream/ngx_stream_proxy_module.c  Wed Aug 12 12:56:59 2015 +0300
@@ -478,7 +478,7 @@ ngx_stream_proxy_connect(ngx_stream_sess
 static void
 ngx_stream_proxy_init_upstream(ngx_stream_session_t *s)
 {
-int  tcp_nodelay;
+int   tcp_nodelay;
 u_char   *p;
 ngx_connection_t *c, *pc;
 ngx_log_handler_pthandler;

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style.

2015-07-30 Thread Roman Arutyunyan
details:   http://hg.nginx.org/nginx/rev/543f10fe34d2
branches:  
changeset: 6216:543f10fe34d2
user:  Roman Arutyunyan a...@nginx.com
date:  Wed Jul 29 14:36:36 2015 -0700
description:
Style.

diffstat:

 src/stream/ngx_stream_proxy_module.c |  3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diffs (13 lines):

diff -r 8ee6a08ea3eb -r 543f10fe34d2 src/stream/ngx_stream_proxy_module.c
--- a/src/stream/ngx_stream_proxy_module.c  Wed Jul 29 13:46:26 2015 -0700
+++ b/src/stream/ngx_stream_proxy_module.c  Wed Jul 29 14:36:36 2015 -0700
@@ -368,8 +368,7 @@ ngx_stream_proxy_handler(ngx_stream_sess
 #if (NGX_STREAM_SSL)
  pscf-ssl == NULL
 #endif
- pscf-buffer_size = NGX_PROXY_PROTOCOL_MAX_HEADER
-   )
+ pscf-buffer_size = NGX_PROXY_PROTOCOL_MAX_HEADER)
 {
 /* optimization for a typical case */
 

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style.

2015-06-05 Thread Maxim Dounin
details:   http://hg.nginx.org/nginx/rev/ac52b46ebab5
branches:  
changeset: 6166:ac52b46ebab5
user:  Maxim Dounin mdou...@mdounin.ru
date:  Fri Jun 05 17:10:34 2015 +0300
description:
Style.

diffstat:

 src/event/ngx_event.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (14 lines):

diff --git a/src/event/ngx_event.c b/src/event/ngx_event.c
--- a/src/event/ngx_event.c
+++ b/src/event/ngx_event.c
@@ -927,8 +927,9 @@ ngx_events_block(ngx_conf_t *cf, ngx_com
 
 *cf = pcf;
 
-if (rv != NGX_CONF_OK)
+if (rv != NGX_CONF_OK) {
 return rv;
+}
 
 for (i = 0; ngx_modules[i]; i++) {
 if (ngx_modules[i]-type != NGX_EVENT_MODULE) {

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style: use %*s format, as in 68d21fd1dc64.

2015-03-04 Thread Ruslan Ermilov
details:   http://hg.nginx.org/nginx/rev/add12ee1d01c
branches:  
changeset: 6001:add12ee1d01c
user:  Ruslan Ermilov r...@nginx.com
date:  Wed Mar 04 08:05:38 2015 +0300
description:
Style: use %*s format, as in 68d21fd1dc64.

diffstat:

 src/mail/ngx_mail_auth_http_module.c |  11 +++
 1 files changed, 3 insertions(+), 8 deletions(-)

diffs (21 lines):

diff -r 93fee708f168 -r add12ee1d01c src/mail/ngx_mail_auth_http_module.c
--- a/src/mail/ngx_mail_auth_http_module.c  Wed Mar 04 19:20:30 2015 +0300
+++ b/src/mail/ngx_mail_auth_http_module.c  Wed Mar 04 08:05:38 2015 +0300
@@ -1394,14 +1394,9 @@ ngx_mail_auth_http_create_request(ngx_ma
 *b-last++ = CR; *b-last++ = LF;
 
 #if (NGX_DEBUG_MAIL_PASSWD)
-{
-ngx_str_t  l;
-
-l.len = b-last - b-pos;
-l.data = b-pos;
-ngx_log_debug1(NGX_LOG_DEBUG_MAIL, s-connection-log, 0,
-   mail auth http header:%N\%V\, l);
-}
+ngx_log_debug2(NGX_LOG_DEBUG_MAIL, s-connection-log, 0,
+   mail auth http header:%N\%*s\,
+   (size_t) (b-last - b-pos), b-pos);
 #endif
 
 return b;

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style.

2014-11-19 Thread Valentin Bartenev
details:   http://hg.nginx.org/nginx/rev/fddc6bed1e6e
branches:  
changeset: 5919:fddc6bed1e6e
user:  Valentin Bartenev vb...@nginx.com
date:  Wed Nov 19 21:46:01 2014 +0300
description:
Style.

diffstat:

 src/os/unix/ngx_darwin_sendfile_chain.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (14 lines):

diff -r c50b5ed3cd4b -r fddc6bed1e6e src/os/unix/ngx_darwin_sendfile_chain.c
--- a/src/os/unix/ngx_darwin_sendfile_chain.c   Wed Nov 19 21:18:13 2014 +0300
+++ b/src/os/unix/ngx_darwin_sendfile_chain.c   Wed Nov 19 21:46:01 2014 +0300
@@ -104,8 +104,8 @@ ngx_darwin_sendfile_chain(ngx_connection
  * create the trailer iovec and coalesce the neighbouring bufs
  */
 
-cl = ngx_output_chain_to_iovec(trailer, cl, limit - send, 
c-log);
-
+cl = ngx_output_chain_to_iovec(trailer, cl, limit - send,
+   c-log);
 if (cl == NGX_CHAIN_ERROR) {
 return NGX_CHAIN_ERROR;
 }

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style: use specified macro instead of magic-number.

2014-08-06 Thread Maxim Dounin
details:   http://hg.nginx.org/nginx/rev/ab48149b77a6
branches:  
changeset: 5801:ab48149b77a6
user:  Tatsuhiko Kubo cubicda...@gmail.com
date:  Wed Aug 06 23:58:44 2014 +0900
description:
Style: use specified macro instead of magic-number.

diffstat:

 src/http/modules/ngx_http_memcached_module.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff --git a/src/http/modules/ngx_http_memcached_module.c 
b/src/http/modules/ngx_http_memcached_module.c
--- a/src/http/modules/ngx_http_memcached_module.c
+++ b/src/http/modules/ngx_http_memcached_module.c
@@ -391,7 +391,7 @@ found:
 p = line.data + line.len;
 
 u-headers_in.content_length_n = ngx_atoof(start, p - start);
-if (u-headers_in.content_length_n == -1) {
+if (u-headers_in.content_length_n == NGX_ERROR) {
 ngx_log_error(NGX_LOG_ERR, r-connection-log, 0,
   memcached sent invalid length in response \%V\ 
   for key \%V\,

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style: use ngx_free() instead of free().

2014-08-03 Thread Maxim Dounin
details:   http://hg.nginx.org/nginx/rev/fbdab7f38fd6
branches:  
changeset: 5785:fbdab7f38fd6
user:  Tatsuhiko Kubo cubicda...@gmail.com
date:  Sun Aug 03 03:27:39 2014 +0900
description:
Style: use ngx_free() instead of free().

diffstat:

 src/os/win32/ngx_files.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff --git a/src/os/win32/ngx_files.c b/src/os/win32/ngx_files.c
--- a/src/os/win32/ngx_files.c
+++ b/src/os/win32/ngx_files.c
@@ -864,7 +864,7 @@ ngx_utf8_to_utf16(u_short *utf16, u_char
 n = ngx_utf8_decode(p, 4);
 
 if (n  0x10) {
-free(utf16);
+ngx_free(utf16);
 ngx_set_errno(NGX_EILSEQ);
 return NULL;
 }

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style: use ngx_str_set().

2014-07-09 Thread Maxim Dounin
details:   http://hg.nginx.org/nginx/rev/d80543940f9a
branches:  
changeset: 5765:d80543940f9a
user:  Tatsuhiko Kubo cubicda...@gmail.com
date:  Wed Jul 09 23:23:59 2014 +0900
description:
Style: use ngx_str_set().

diffstat:

 src/http/modules/ngx_http_memcached_module.c |  7 ++-
 1 files changed, 2 insertions(+), 5 deletions(-)

diffs (17 lines):

diff --git a/src/http/modules/ngx_http_memcached_module.c 
b/src/http/modules/ngx_http_memcached_module.c
--- a/src/http/modules/ngx_http_memcached_module.c
+++ b/src/http/modules/ngx_http_memcached_module.c
@@ -380,11 +380,8 @@ found:
 }
 
 h-hash = 1;
-h-key.len = sizeof(Content-Encoding) - 1;
-h-key.data = (u_char *) Content-Encoding;
-h-value.len = sizeof(gzip) - 1;
-h-value.data = (u_char *) gzip;
-
+ngx_str_set(h-key, Content-Encoding);
+ngx_str_set(h-value, gzip);
 r-headers_out.content_encoding = h;
 }
 

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style: use ngx_str_null().

2014-07-09 Thread Maxim Dounin
details:   http://hg.nginx.org/nginx/rev/f166c521b619
branches:  
changeset: 5764:f166c521b619
user:  Tatsuhiko Kubo cubicda...@gmail.com
date:  Wed Jul 09 23:22:14 2014 +0900
description:
Style: use ngx_str_null().

diffstat:

 src/core/ngx_resolver.c |  3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diffs (13 lines):

diff --git a/src/core/ngx_resolver.c b/src/core/ngx_resolver.c
--- a/src/core/ngx_resolver.c
+++ b/src/core/ngx_resolver.c
@@ -2722,8 +2722,7 @@ done:
 }
 
 if (len == -1) {
-name-len = 0;
-name-data = NULL;
+ngx_str_null(name);
 return NGX_OK;
 }
 

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style: use ngx_strlen() instead of strlen().

2014-07-09 Thread Maxim Dounin
details:   http://hg.nginx.org/nginx/rev/09e734739e46
branches:  
changeset: 5763:09e734739e46
user:  Tatsuhiko Kubo cubicda...@gmail.com
date:  Wed Jul 09 23:20:40 2014 +0900
description:
Style: use ngx_strlen() instead of strlen().

diffstat:

 src/core/ngx_log.h |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff --git a/src/core/ngx_log.h b/src/core/ngx_log.h
--- a/src/core/ngx_log.h
+++ b/src/core/ngx_log.h
@@ -248,7 +248,7 @@ char *ngx_log_set_log(ngx_conf_t *cf, ng
 static ngx_inline void
 ngx_write_stderr(char *text)
 {
-(void) ngx_write_fd(ngx_stderr, text, strlen(text));
+(void) ngx_write_fd(ngx_stderr, text, ngx_strlen(text));
 }
 
 

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style: remove whitespace between function name and paren...

2014-07-08 Thread Maxim Dounin
details:   http://hg.nginx.org/nginx/rev/f3df4e420ae7
branches:  
changeset: 5758:f3df4e420ae7
user:  Piotr Sikora pi...@cloudflare.com
date:  Tue Jul 08 03:03:14 2014 -0700
description:
Style: remove whitespace between function name and parentheses.

Signed-off-by: Piotr Sikora pi...@cloudflare.com

diffstat:

 src/http/modules/ngx_http_geoip_module.c |  6 +++---
 src/http/modules/ngx_http_scgi_module.c  |  2 +-
 src/http/modules/ngx_http_uwsgi_module.c |  2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diffs (54 lines):

diff --git a/src/http/modules/ngx_http_geoip_module.c 
b/src/http/modules/ngx_http_geoip_module.c
--- a/src/http/modules/ngx_http_geoip_module.c
+++ b/src/http/modules/ngx_http_geoip_module.c
@@ -691,7 +691,7 @@ ngx_http_geoip_country(ngx_conf_t *cf, n
 
 if (cf-args-nelts == 3) {
 if (ngx_strcmp(value[2].data, utf8) == 0) {
-GeoIP_set_charset (gcf-country, GEOIP_CHARSET_UTF8);
+GeoIP_set_charset(gcf-country, GEOIP_CHARSET_UTF8);
 
 } else {
 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
@@ -746,7 +746,7 @@ ngx_http_geoip_org(ngx_conf_t *cf, ngx_c
 
 if (cf-args-nelts == 3) {
 if (ngx_strcmp(value[2].data, utf8) == 0) {
-GeoIP_set_charset (gcf-org, GEOIP_CHARSET_UTF8);
+GeoIP_set_charset(gcf-org, GEOIP_CHARSET_UTF8);
 
 } else {
 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
@@ -807,7 +807,7 @@ ngx_http_geoip_city(ngx_conf_t *cf, ngx_
 
 if (cf-args-nelts == 3) {
 if (ngx_strcmp(value[2].data, utf8) == 0) {
-GeoIP_set_charset (gcf-city, GEOIP_CHARSET_UTF8);
+GeoIP_set_charset(gcf-city, GEOIP_CHARSET_UTF8);
 
 } else {
 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
diff --git a/src/http/modules/ngx_http_scgi_module.c 
b/src/http/modules/ngx_http_scgi_module.c
--- a/src/http/modules/ngx_http_scgi_module.c
+++ b/src/http/modules/ngx_http_scgi_module.c
@@ -1645,7 +1645,7 @@ ngx_http_scgi_pass(ngx_conf_t *cf, ngx_c
 return is duplicate;
 }
 
-clcf = ngx_http_conf_get_module_loc_conf (cf, ngx_http_core_module);
+clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
 clcf-handler = ngx_http_scgi_handler;
 
 value = cf-args-elts;
diff --git a/src/http/modules/ngx_http_uwsgi_module.c 
b/src/http/modules/ngx_http_uwsgi_module.c
--- a/src/http/modules/ngx_http_uwsgi_module.c
+++ b/src/http/modules/ngx_http_uwsgi_module.c
@@ -1868,7 +1868,7 @@ ngx_http_uwsgi_pass(ngx_conf_t *cf, ngx_
 return is duplicate;
 }
 
-clcf = ngx_http_conf_get_module_loc_conf (cf, ngx_http_core_module);
+clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
 clcf-handler = ngx_http_uwsgi_handler;
 
 value = cf-args-elts;

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style: add whitespace between control statement and pare...

2014-07-08 Thread Maxim Dounin
details:   http://hg.nginx.org/nginx/rev/c5ec6944de98
branches:  
changeset: 5757:c5ec6944de98
user:  Piotr Sikora pi...@cloudflare.com
date:  Tue Jul 08 03:03:13 2014 -0700
description:
Style: add whitespace between control statement and parentheses.

Signed-off-by: Piotr Sikora pi...@cloudflare.com

diffstat:

 src/http/modules/ngx_http_geo_module.c |  2 +-
 src/http/ngx_http_core_module.c|  4 ++--
 src/http/ngx_http_parse.c  |  8 
 src/http/ngx_http_upstream.c   |  2 +-
 src/os/win32/ngx_service.c |  2 +-
 5 files changed, 9 insertions(+), 9 deletions(-)

diffs (96 lines):

diff --git a/src/http/modules/ngx_http_geo_module.c 
b/src/http/modules/ngx_http_geo_module.c
--- a/src/http/modules/ngx_http_geo_module.c
+++ b/src/http/modules/ngx_http_geo_module.c
@@ -1470,7 +1470,7 @@ ngx_http_geo_include_binary_base(ngx_con
 
 vv = (ngx_http_variable_value_t *) (base + sizeof(ngx_http_geo_header_t));
 
-while(vv-data) {
+while (vv-data) {
 len = ngx_align(sizeof(ngx_http_variable_value_t) + vv-len,
 sizeof(void *));
 ngx_crc32_update(crc32, (u_char *) vv, len);
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -2355,7 +2355,7 @@ ngx_http_gzip_accept_encoding(ngx_str_t 
 p += 4;
 
 while (p  last) {
-switch(*p++) {
+switch (*p++) {
 case ',':
 return NGX_OK;
 case ';':
@@ -2372,7 +2372,7 @@ ngx_http_gzip_accept_encoding(ngx_str_t 
 quantity:
 
 while (p  last) {
-switch(*p++) {
+switch (*p++) {
 case 'q':
 case 'Q':
 goto equal;
diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c
--- a/src/http/ngx_http_parse.c
+++ b/src/http/ngx_http_parse.c
@@ -1287,7 +1287,7 @@ ngx_http_parse_complex_uri(ngx_http_requ
 break;
 }
 
-switch(ch) {
+switch (ch) {
 #if (NGX_WIN32)
 case '\\':
 if (u - 2 = r-uri.data
@@ -1357,7 +1357,7 @@ ngx_http_parse_complex_uri(ngx_http_requ
 break;
 }
 
-switch(ch) {
+switch (ch) {
 #if (NGX_WIN32)
 case '\\':
 break;
@@ -1400,7 +1400,7 @@ ngx_http_parse_complex_uri(ngx_http_requ
 break;
 }
 
-switch(ch) {
+switch (ch) {
 #if (NGX_WIN32)
 case '\\':
 #endif
@@ -1441,7 +1441,7 @@ ngx_http_parse_complex_uri(ngx_http_requ
 break;
 }
 
-switch(ch) {
+switch (ch) {
 #if (NGX_WIN32)
 case '\\':
 #endif
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -3441,7 +3441,7 @@ ngx_http_upstream_next(ngx_http_request_
 u-peer.tries++;
 
 } else {
-switch(ft_type) {
+switch (ft_type) {
 
 case NGX_HTTP_UPSTREAM_FT_TIMEOUT:
 status = NGX_HTTP_GATEWAY_TIME_OUT;
diff --git a/src/os/win32/ngx_service.c b/src/os/win32/ngx_service.c
--- a/src/os/win32/ngx_service.c
+++ b/src/os/win32/ngx_service.c
@@ -89,7 +89,7 @@ u_int service_handler(u_int control, u_i
 {
 /* primary thread */
 
-switch(control) {
+switch (control) {
 
 case SERVICE_CONTROL_INTERROGATE:
 status = NGX_IOCP_INTERROGATE;

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style: keep return type and function name on different l...

2014-07-08 Thread Maxim Dounin
details:   http://hg.nginx.org/nginx/rev/a1caf3989b49
branches:  
changeset: 5759:a1caf3989b49
user:  Piotr Sikora pi...@cloudflare.com
date:  Tue Jul 08 03:03:14 2014 -0700
description:
Style: keep return type and function name on different lines.

Signed-off-by: Piotr Sikora pi...@cloudflare.com

diffstat:

 src/os/win32/ngx_service.c |  9 ++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (33 lines):

diff --git a/src/os/win32/ngx_service.c b/src/os/win32/ngx_service.c
--- a/src/os/win32/ngx_service.c
+++ b/src/os/win32/ngx_service.c
@@ -16,7 +16,8 @@ SERVICE_TABLE_ENTRY st[] = {
 };
 
 
-ngx_int_t ngx_service(ngx_log_t *log)
+ngx_int_t
+ngx_service(ngx_log_t *log)
 {
 /* primary thread */
 
@@ -32,7 +33,8 @@ ngx_int_t ngx_service(ngx_log_t *log)
 }
 
 
-void service_main(u_int argc, char **argv)
+void
+service_main(u_int argc, char **argv)
 {
 SERVICE_STATUS status;
 SERVICE_STATUS_HANDLE  service;
@@ -85,7 +87,8 @@ void service_main(u_int argc, char **arg
 }
 
 
-u_int service_handler(u_int control, u_int type, void *data, void *ctx)
+u_int
+service_handler(u_int control, u_int type, void *data, void *ctx)
 {
 /* primary thread */
 

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style: fix typo.

2014-07-08 Thread Maxim Dounin
details:   http://hg.nginx.org/nginx/rev/1d693deab8ae
branches:  
changeset: 5761:1d693deab8ae
user:  Piotr Sikora pi...@cloudflare.com
date:  Tue Jul 08 03:03:14 2014 -0700
description:
Style: fix typo.

Signed-off-by: Piotr Sikora pi...@cloudflare.com

diffstat:

 src/misc/ngx_cpp_test_module.cpp |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (10 lines):

diff --git a/src/misc/ngx_cpp_test_module.cpp b/src/misc/ngx_cpp_test_module.cpp
--- a/src/misc/ngx_cpp_test_module.cpp
+++ b/src/misc/ngx_cpp_test_module.cpp
@@ -1,5 +1,5 @@
 
-// stub module to test header files' C++ compatibilty
+// stub module to test header files' C++ compatibility
 
 extern C {
   #include ngx_config.h

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style: use %N instead of '\n' where appropriate.

2014-05-14 Thread Ruslan Ermilov
details:   http://hg.nginx.org/nginx/rev/0cbefdcf82a6
branches:  
changeset: 5685:0cbefdcf82a6
user:  Ruslan Ermilov r...@nginx.com
date:  Wed May 14 22:26:30 2014 +0400
description:
Style: use %N instead of '\n' where appropriate.

diffstat:

 src/http/modules/ngx_http_proxy_module.c |  2 +-
 src/mail/ngx_mail_auth_http_module.c |  2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diffs (24 lines):

diff -r bc98b0f11bdd -r 0cbefdcf82a6 src/http/modules/ngx_http_proxy_module.c
--- a/src/http/modules/ngx_http_proxy_module.c  Wed May 14 22:26:05 2014 +0400
+++ b/src/http/modules/ngx_http_proxy_module.c  Wed May 14 22:26:30 2014 +0400
@@ -1294,7 +1294,7 @@ ngx_http_proxy_create_request(ngx_http_r
 }
 
 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r-connection-log, 0,
-   http proxy header:\n\%*s\,
+   http proxy header:%N\%*s\,
(size_t) (b-last - b-pos), b-pos);
 
 if (plcf-body_set == NULL  plcf-upstream.pass_request_body) {
diff -r bc98b0f11bdd -r 0cbefdcf82a6 src/mail/ngx_mail_auth_http_module.c
--- a/src/mail/ngx_mail_auth_http_module.c  Wed May 14 22:26:05 2014 +0400
+++ b/src/mail/ngx_mail_auth_http_module.c  Wed May 14 22:26:30 2014 +0400
@@ -1269,7 +1269,7 @@ ngx_mail_auth_http_create_request(ngx_ma
 l.len = b-last - b-pos;
 l.data = b-pos;
 ngx_log_debug1(NGX_LOG_DEBUG_MAIL, s-connection-log, 0,
-   mail auth http header:\n\%V\, l);
+   mail auth http header:%N\%V\, l);
 }
 #endif
 

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style: removed surplus semicolons.

2013-12-27 Thread Valentin Bartenev
details:   http://hg.nginx.org/nginx/rev/9d056f10fb99
branches:  
changeset: 5496:9d056f10fb99
user:  Valentin Bartenev vb...@nginx.com
date:  Fri Dec 27 18:47:42 2013 +0400
description:
Style: removed surplus semicolons.

diffstat:

 src/http/modules/ngx_http_mp4_module.c   |  2 +-
 src/http/modules/ngx_http_scgi_module.c  |  2 +-
 src/http/modules/ngx_http_uwsgi_module.c |  2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r 97f6cd787766 -r 9d056f10fb99 src/http/modules/ngx_http_mp4_module.c
--- a/src/http/modules/ngx_http_mp4_module.cThu Dec 26 17:03:16 2013 +0400
+++ b/src/http/modules/ngx_http_mp4_module.cFri Dec 27 18:47:42 2013 +0400
@@ -542,7 +542,7 @@ ngx_http_mp4_handler(ngx_http_request_t 
 
 mp4-file.fd = of.fd;
 mp4-file.name = path;
-mp4-file.log = r-connection-log;;
+mp4-file.log = r-connection-log;
 mp4-end = of.size;
 mp4-start = (ngx_uint_t) start;
 mp4-request = r;
diff -r 97f6cd787766 -r 9d056f10fb99 src/http/modules/ngx_http_scgi_module.c
--- a/src/http/modules/ngx_http_scgi_module.c   Thu Dec 26 17:03:16 2013 +0400
+++ b/src/http/modules/ngx_http_scgi_module.c   Fri Dec 27 18:47:42 2013 +0400
@@ -1734,7 +1734,7 @@ ngx_http_scgi_store(ngx_conf_t *cf, ngx_
 sc.source = value[1];
 sc.lengths = scf-upstream.store_lengths;
 sc.values = scf-upstream.store_values;
-sc.variables = ngx_http_script_variables_count(value[1]);;
+sc.variables = ngx_http_script_variables_count(value[1]);
 sc.complete_lengths = 1;
 sc.complete_values = 1;
 
diff -r 97f6cd787766 -r 9d056f10fb99 src/http/modules/ngx_http_uwsgi_module.c
--- a/src/http/modules/ngx_http_uwsgi_module.c  Thu Dec 26 17:03:16 2013 +0400
+++ b/src/http/modules/ngx_http_uwsgi_module.c  Fri Dec 27 18:47:42 2013 +0400
@@ -1916,7 +1916,7 @@ ngx_http_uwsgi_store(ngx_conf_t *cf, ngx
 sc.source = value[1];
 sc.lengths = uwcf-upstream.store_lengths;
 sc.values = uwcf-upstream.store_values;
-sc.variables = ngx_http_script_variables_count(value[1]);;
+sc.variables = ngx_http_script_variables_count(value[1]);
 sc.complete_lengths = 1;
 sc.complete_values = 1;
 

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style.

2013-10-18 Thread Maxim Dounin
details:   http://hg.nginx.org/nginx/rev/4bfa982dbf0e
branches:  
changeset: 5426:4bfa982dbf0e
user:  Maxim Dounin mdou...@mdounin.ru
date:  Fri Oct 18 18:13:35 2013 +0400
description:
Style.

diffstat:

 src/http/ngx_http_script.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff --git a/src/http/ngx_http_script.c b/src/http/ngx_http_script.c
--- a/src/http/ngx_http_script.c
+++ b/src/http/ngx_http_script.c
@@ -1394,7 +1394,7 @@ ngx_http_script_if_code(ngx_http_script_
 
 e-sp--;
 
-if (e-sp-len  (e-sp-len !=1 || e-sp-data[0] != '0')) {
+if (e-sp-len  (e-sp-len != 1 || e-sp-data[0] != '0')) {
 if (code-loc_conf) {
 e-request-loc_conf = code-loc_conf;
 ngx_http_update_location_config(e-request);

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style: reuse one int variable in ngx_configure_listening...

2013-07-25 Thread Ruslan Ermilov
details:   http://hg.nginx.org/nginx/rev/31690d934175
branches:  
changeset: 5282:31690d934175
user:  Ruslan Ermilov r...@nginx.com
date:  Thu Jul 25 12:46:02 2013 +0400
description:
Style: reuse one int variable in ngx_configure_listening_sockets().

No functional changes.

diffstat:

 src/core/ngx_connection.c |  19 ---
 1 files changed, 8 insertions(+), 11 deletions(-)

diffs (65 lines):

diff -r 7542b72fe4b1 -r 31690d934175 src/core/ngx_connection.c
--- a/src/core/ngx_connection.c Wed Jul 24 22:24:25 2013 +0400
+++ b/src/core/ngx_connection.c Thu Jul 25 12:46:02 2013 +0400
@@ -464,16 +464,13 @@ ngx_open_listening_sockets(ngx_cycle_t *
 void
 ngx_configure_listening_sockets(ngx_cycle_t *cycle)
 {
-intkeepalive;
+intvalue;
 ngx_uint_t i;
 ngx_listening_t   *ls;
 
 #if (NGX_HAVE_DEFERRED_ACCEPT  defined SO_ACCEPTFILTER)
 struct accept_filter_arg   af;
 #endif
-#if (NGX_HAVE_DEFERRED_ACCEPT  defined TCP_DEFER_ACCEPT)
-inttimeout;
-#endif
 
 ls = cycle-listening.elts;
 for (i = 0; i  cycle-listening.nelts; i++) {
@@ -503,15 +500,15 @@ ngx_configure_listening_sockets(ngx_cycl
 }
 
 if (ls[i].keepalive) {
-keepalive = (ls[i].keepalive == 1) ? 1 : 0;
+value = (ls[i].keepalive == 1) ? 1 : 0;
 
 if (setsockopt(ls[i].fd, SOL_SOCKET, SO_KEEPALIVE,
-   (const void *) keepalive, sizeof(int))
+   (const void *) value, sizeof(int))
 == -1)
 {
 ngx_log_error(NGX_LOG_ALERT, cycle-log, ngx_socket_errno,
   setsockopt(SO_KEEPALIVE, %d) %V failed, 
ignored,
-  keepalive, ls[i].addr_text);
+  value, ls[i].addr_text);
 }
 }
 
@@ -648,20 +645,20 @@ ngx_configure_listening_sockets(ngx_cycl
 if (ls[i].add_deferred || ls[i].delete_deferred) {
 
 if (ls[i].add_deferred) {
-timeout = (int) (ls[i].post_accept_timeout / 1000);
+value = (int) (ls[i].post_accept_timeout / 1000);
 
 } else {
-timeout = 0;
+value = 0;
 }
 
 if (setsockopt(ls[i].fd, IPPROTO_TCP, TCP_DEFER_ACCEPT,
-   timeout, sizeof(int))
+   value, sizeof(int))
 == -1)
 {
 ngx_log_error(NGX_LOG_ALERT, cycle-log, ngx_errno,
   setsockopt(TCP_DEFER_ACCEPT, %d) for %V failed, 

   ignored,
-  timeout, ls[i].addr_text);
+  value, ls[i].addr_text);
 
 continue;
 }

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style.

2013-07-12 Thread Maxim Dounin
details:   http://hg.nginx.org/nginx/rev/8e7db77e5d88
branches:  
changeset: 5266:8e7db77e5d88
user:  Maxim Dounin mdou...@mdounin.ru
date:  Thu Jul 11 20:38:27 2013 +0400
description:
Style.

diffstat:

 src/http/ngx_http_core_module.c |  2 +-
 src/mail/ngx_mail.c |  2 +-
 src/os/unix/ngx_process_cycle.c |  2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diffs (36 lines):

diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -4469,7 +4469,7 @@ static ngx_http_method_name_t  ngx_metho
{ (u_char *) COPY,  (uint32_t) ~NGX_HTTP_COPY },
{ (u_char *) MOVE,  (uint32_t) ~NGX_HTTP_MOVE },
{ (u_char *) OPTIONS,   (uint32_t) ~NGX_HTTP_OPTIONS },
-   { (u_char *) PROPFIND , (uint32_t) ~NGX_HTTP_PROPFIND },
+   { (u_char *) PROPFIND,  (uint32_t) ~NGX_HTTP_PROPFIND },
{ (u_char *) PROPPATCH, (uint32_t) ~NGX_HTTP_PROPPATCH },
{ (u_char *) LOCK,  (uint32_t) ~NGX_HTTP_LOCK },
{ (u_char *) UNLOCK,(uint32_t) ~NGX_HTTP_UNLOCK },
diff --git a/src/mail/ngx_mail.c b/src/mail/ngx_mail.c
--- a/src/mail/ngx_mail.c
+++ b/src/mail/ngx_mail.c
@@ -465,7 +465,7 @@ ngx_mail_add_addrs(ngx_conf_t *cf, ngx_m
 addrs[i].conf.ssl = addr[i].ssl;
 #endif
 
-len = ngx_sock_ntop(addr[i].sockaddr, addr[i].socklen , buf,
+len = ngx_sock_ntop(addr[i].sockaddr, addr[i].socklen, buf,
 NGX_SOCKADDR_STRLEN, 1);
 
 p = ngx_pnalloc(cf-pool, len);
diff --git a/src/os/unix/ngx_process_cycle.c b/src/os/unix/ngx_process_cycle.c
--- a/src/os/unix/ngx_process_cycle.c
+++ b/src/os/unix/ngx_process_cycle.c
@@ -536,7 +536,7 @@ ngx_signal_worker_processes(ngx_cycle_t 
 }
 
 ngx_log_debug2(NGX_LOG_DEBUG_CORE, cycle-log, 0,
-   kill (%P, %d) , ngx_processes[i].pid, signo);
+   kill (%P, %d), ngx_processes[i].pid, signo);
 
 if (kill(ngx_processes[i].pid, signo) == -1) {
 err = ngx_errno;

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style: remove unnecessary references to HTTP from non-HT...

2013-05-22 Thread Maxim Dounin
details:   http://hg.nginx.org/nginx/rev/23a186e8ca45
branches:  
changeset: 5222:23a186e8ca45
user:  Piotr Sikora pi...@cloudflare.com
date:  Tue May 21 18:43:43 2013 -0700
description:
Style: remove unnecessary references to HTTP from non-HTTP modules.

No functional changes.

Signed-off-by: Piotr Sikora pi...@cloudflare.com

diffstat:

 src/core/ngx_conf_file.h   |  6 +++---
 src/event/ngx_event_openssl.c  |  6 +++---
 src/mail/ngx_mail_ssl_module.c |  4 ++--
 src/os/unix/ngx_linux_sendfile_chain.c |  2 +-
 4 files changed, 9 insertions(+), 9 deletions(-)

diffs (83 lines):

diff --git a/src/core/ngx_conf_file.h b/src/core/ngx_conf_file.h
--- a/src/core/ngx_conf_file.h
+++ b/src/core/ngx_conf_file.h
@@ -5,8 +5,8 @@
  */
 
 
-#ifndef _NGX_HTTP_CONF_FILE_H_INCLUDED_
-#define _NGX_HTTP_CONF_FILE_H_INCLUDED_
+#ifndef _NGX_CONF_FILE_H_INCLUDED_
+#define _NGX_CONF_FILE_H_INCLUDED_
 
 
 #include ngx_config.h
@@ -337,4 +337,4 @@ extern ngx_uint_t ngx_max_module;
 extern ngx_module_t  *ngx_modules[];
 
 
-#endif /* _NGX_HTTP_CONF_FILE_H_INCLUDED_ */
+#endif /* _NGX_CONF_FILE_H_INCLUDED_ */
diff --git a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c
--- a/src/event/ngx_event_openssl.c
+++ b/src/event/ngx_event_openssl.c
@@ -15,7 +15,7 @@ typedef struct {
 } ngx_openssl_conf_t;
 
 
-static int ngx_http_ssl_verify_callback(int ok, X509_STORE_CTX *x509_store);
+static int ngx_ssl_verify_callback(int ok, X509_STORE_CTX *x509_store);
 static void ngx_ssl_info_callback(const ngx_ssl_conn_t *ssl_conn, int where,
 int ret);
 static void ngx_ssl_handshake_handler(ngx_event_t *ev);
@@ -342,7 +342,7 @@ ngx_ssl_client_certificate(ngx_conf_t *c
 {
 STACK_OF(X509_NAME)  *list;
 
-SSL_CTX_set_verify(ssl-ctx, SSL_VERIFY_PEER, 
ngx_http_ssl_verify_callback);
+SSL_CTX_set_verify(ssl-ctx, SSL_VERIFY_PEER, ngx_ssl_verify_callback);
 
 SSL_CTX_set_verify_depth(ssl-ctx, depth);
 
@@ -457,7 +457,7 @@ ngx_ssl_crl(ngx_conf_t *cf, ngx_ssl_t *s
 
 
 static int
-ngx_http_ssl_verify_callback(int ok, X509_STORE_CTX *x509_store)
+ngx_ssl_verify_callback(int ok, X509_STORE_CTX *x509_store)
 {
 #if (NGX_DEBUG)
 char  *subject, *issuer;
diff --git a/src/mail/ngx_mail_ssl_module.c b/src/mail/ngx_mail_ssl_module.c
--- a/src/mail/ngx_mail_ssl_module.c
+++ b/src/mail/ngx_mail_ssl_module.c
@@ -25,7 +25,7 @@ static char *ngx_mail_ssl_session_cache(
 void *conf);
 
 
-static ngx_conf_enum_t  ngx_http_starttls_state[] = {
+static ngx_conf_enum_t  ngx_mail_starttls_state[] = {
 { ngx_string(off), NGX_MAIL_STARTTLS_OFF },
 { ngx_string(on), NGX_MAIL_STARTTLS_ON },
 { ngx_string(only), NGX_MAIL_STARTTLS_ONLY },
@@ -58,7 +58,7 @@ static ngx_command_t  ngx_mail_ssl_comma
   ngx_mail_ssl_starttls,
   NGX_MAIL_SRV_CONF_OFFSET,
   offsetof(ngx_mail_ssl_conf_t, starttls),
-  ngx_http_starttls_state },
+  ngx_mail_starttls_state },
 
 { ngx_string(ssl_certificate),
   NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1,
diff --git a/src/os/unix/ngx_linux_sendfile_chain.c 
b/src/os/unix/ngx_linux_sendfile_chain.c
--- a/src/os/unix/ngx_linux_sendfile_chain.c
+++ b/src/os/unix/ngx_linux_sendfile_chain.c
@@ -181,7 +181,7 @@ ngx_linux_sendfile_chain(ngx_connection_
 } else {
 c-tcp_nodelay = NGX_TCP_NODELAY_UNSET;
 
-ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c-log, 0,
+ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c-log, 0,
no tcp_nodelay);
 }
 }

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel


[nginx] Style: replace SSL *ssl with ngx_ssl_conn_t *ssl_conn.

2013-05-22 Thread Maxim Dounin
details:   http://hg.nginx.org/nginx/rev/71d85de7b53b
branches:  
changeset: 5223:71d85de7b53b
user:  Piotr Sikora pi...@cloudflare.com
date:  Tue May 21 18:45:07 2013 -0700
description:
Style: replace SSL *ssl with ngx_ssl_conn_t *ssl_conn.

No functional changes.

Signed-off-by: Piotr Sikora pi...@cloudflare.com

diffstat:

 src/event/ngx_event_openssl.c |  3 ++-
 src/event/ngx_event_openssl.h |  3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diffs (26 lines):

diff --git a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c
--- a/src/event/ngx_event_openssl.c
+++ b/src/event/ngx_event_openssl.c
@@ -517,7 +517,8 @@ ngx_ssl_info_callback(const ngx_ssl_conn
 
 
 RSA *
-ngx_ssl_rsa512_key_callback(SSL *ssl, int is_export, int key_length)
+ngx_ssl_rsa512_key_callback(ngx_ssl_conn_t *ssl_conn, int is_export,
+int key_length)
 {
 static RSA  *key;
 
diff --git a/src/event/ngx_event_openssl.h b/src/event/ngx_event_openssl.h
--- a/src/event/ngx_event_openssl.h
+++ b/src/event/ngx_event_openssl.h
@@ -109,7 +109,8 @@ ngx_int_t ngx_ssl_stapling(ngx_conf_t *c
 ngx_str_t *file, ngx_str_t *responder, ngx_uint_t verify);
 ngx_int_t ngx_ssl_stapling_resolver(ngx_conf_t *cf, ngx_ssl_t *ssl,
 ngx_resolver_t *resolver, ngx_msec_t resolver_timeout);
-RSA *ngx_ssl_rsa512_key_callback(SSL *ssl, int is_export, int key_length);
+RSA *ngx_ssl_rsa512_key_callback(ngx_ssl_conn_t *ssl_conn, int is_export,
+int key_length);
 ngx_int_t ngx_ssl_dhparam(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_str_t *file);
 ngx_int_t ngx_ssl_ecdh_curve(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_str_t *name);
 ngx_int_t ngx_ssl_session_cache(ngx_ssl_t *ssl, ngx_str_t *sess_ctx,

___
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel