[PATCH] Style: cleanup.

Piotr Sikora piotr at cloudflare.com
Wed May 22 01:51:14 UTC 2013


Actually, after thinking about it, it makes much more sense to do this
as a two separate patches with better descriptions.

While there, I've also renamed "ssl" to "ssl_conn", to stay consistent
with the rest of the code.

Best regards,
Piotr Sikora


# HG changeset patch
# User Piotr Sikora <piotr at cloudflare.com>
# Date 1369187023 25200
# Node ID 5511739dc78991a6cdcc98053d533c773d829fda
# Parent  1d68b502088c9d6e6603e9699354e36d03d77f9c
Style: remove unnecessary references to HTTP from non-HTTP modules.

No functional changes.

Signed-off-by: Piotr Sikora <piotr at cloudflare.com>

diff -r 1d68b502088c -r 5511739dc789 src/core/ngx_conf_file.h
--- a/src/core/ngx_conf_file.h  Tue May 21 21:47:50 2013 +0400
+++ b/src/core/ngx_conf_file.h  Tue May 21 18:43:43 2013 -0700
@@ -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_module_t  *ngx_modules[];


-#endif /* _NGX_HTTP_CONF_FILE_H_INCLUDED_ */
+#endif /* _NGX_CONF_FILE_H_INCLUDED_ */
diff -r 1d68b502088c -r 5511739dc789 src/event/ngx_event_openssl.c
--- a/src/event/ngx_event_openssl.c     Tue May 21 21:47:50 2013 +0400
+++ b/src/event/ngx_event_openssl.c     Tue May 21 18:43:43 2013 -0700
@@ -15,7 +15,7 @@
 } 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 @@
 {
     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 @@


 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 -r 1d68b502088c -r 5511739dc789 src/mail/ngx_mail_ssl_module.c
--- a/src/mail/ngx_mail_ssl_module.c    Tue May 21 21:47:50 2013 +0400
+++ b/src/mail/ngx_mail_ssl_module.c    Tue May 21 18:43:43 2013 -0700
@@ -25,7 +25,7 @@
     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 @@
       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 -r 1d68b502088c -r 5511739dc789 src/os/unix/ngx_linux_sendfile_chain.c
--- a/src/os/unix/ngx_linux_sendfile_chain.c    Tue May 21 21:47:50 2013 +0400
+++ b/src/os/unix/ngx_linux_sendfile_chain.c    Tue May 21 18:43:43 2013 -0700
@@ -181,7 +181,7 @@
                 } 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");
                 }
             }


# HG changeset patch
# User Piotr Sikora <piotr at cloudflare.com>
# Date 1369187107 25200
# Node ID a485b47aae9c3d1781360ea2f9a8a2b04458045a
# Parent  5511739dc78991a6cdcc98053d533c773d829fda
Style: replace SSL *ssl with ngx_ssl_conn_t *ssl_conn.

No functional changes.

Signed-off-by: Piotr Sikora <piotr at cloudflare.com>

diff -r 5511739dc789 -r a485b47aae9c src/event/ngx_event_openssl.c
--- a/src/event/ngx_event_openssl.c     Tue May 21 18:43:43 2013 -0700
+++ b/src/event/ngx_event_openssl.c     Tue May 21 18:45:07 2013 -0700
@@ -517,7 +517,8 @@


 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 -r 5511739dc789 -r a485b47aae9c src/event/ngx_event_openssl.h
--- a/src/event/ngx_event_openssl.h     Tue May 21 18:43:43 2013 -0700
+++ b/src/event/ngx_event_openssl.h     Tue May 21 18:45:07 2013 -0700
@@ -109,7 +109,8 @@
     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,



More information about the nginx-devel mailing list