Welcome! Log In Create A New Profile

Advanced

[nginx] Perl: fixed syntax usage for C preprocessor directives.

Sergey Kandaurov
July 29, 2013 10:48AM
details: http://hg.nginx.org/nginx/rev/43900b822890
branches:
changeset: 5306:43900b822890
user: Sergey Kandaurov <pluknet@nginx.com>
date: Mon Jul 29 17:30:01 2013 +0400
description:
Perl: fixed syntax usage for C preprocessor directives.

As per perlxs, C preprocessor directives should be at the first
non-whitespace of a line to avoid interpreting them as comments.

#if and #endif are moved so that there are no blank lines before them
to retain them as part of the function body.

diffstat:

src/http/modules/perl/nginx.xs | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)

diffs (39 lines):

diff -r 12b750d35162 -r 43900b822890 src/http/modules/perl/nginx.xs
--- a/src/http/modules/perl/nginx.xs Mon Jul 29 13:23:16 2013 +0400
+++ b/src/http/modules/perl/nginx.xs Mon Jul 29 17:30:01 2013 +0400
@@ -261,13 +261,12 @@ header_in(r, key)
sep = ';';
goto multi;
}
-
- #if (NGX_HTTP_X_FORWARDED_FOR)
+#if (NGX_HTTP_X_FORWARDED_FOR)
if (hh->offset == offsetof(ngx_http_headers_in_t, x_forwarded_for)) {
sep = ',';
goto multi;
}
- #endif
+#endif

if (hh->offset) {

@@ -898,8 +897,7 @@ variable(r, name, value = NULL)

var.len = len;
var.data = lowcase;
-
- #if (NGX_DEBUG)
+#if (NGX_DEBUG)

if (value) {
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
@@ -908,8 +906,7 @@ variable(r, name, value = NULL)
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"perl variable: \"%V\"", &var);
}
-
- #endif
+#endif

vv = ngx_http_get_variable(r, &var, hash);
if (vv == NULL) {

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Perl: fixed syntax usage for C preprocessor directives.

Sergey Kandaurov 1125 July 29, 2013 10:48AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 72
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready