From defan at nginx.com Wed Aug 1 14:37:09 2012 From: defan at nginx.com (defan at nginx.com) Date: Wed, 1 Aug 2012 14:37:09 +0000 Subject: [nginx] svn commit: r4778 - trunk/src/core Message-ID: <20120801143709.207853F9ED0@mail.nginx.com> Author: defan Date: 2012-08-01 14:37:08 +0000 (Wed, 01 Aug 2012) New Revision: 4778 URL: http://trac.nginx.org/nginx/changeset/4778/nginx Log: Reorder checks in ngx_shared_memory_add() for more consistent error messages. Modified: trunk/src/core/ngx_cycle.c Modified: trunk/src/core/ngx_cycle.c =================================================================== --- trunk/src/core/ngx_cycle.c 2012-07-31 21:49:23 UTC (rev 4777) +++ trunk/src/core/ngx_cycle.c 2012-08-01 14:37:08 UTC (rev 4778) @@ -1285,6 +1285,14 @@ continue; } + if (tag != shm_zone[i].tag) { + ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, + "the shared memory zone \"%V\" is " + "already declared for a different use", + &shm_zone[i].shm.name); + return NULL; + } + if (size && size != shm_zone[i].shm.size) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "the size %uz of shared memory zone \"%V\" " @@ -1293,14 +1301,6 @@ return NULL; } - if (tag != shm_zone[i].tag) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "the shared memory zone \"%V\" is " - "already declared for a different use", - &shm_zone[i].shm.name); - return NULL; - } - return &shm_zone[i]; } From hayashi at clear-code.com Thu Aug 2 03:31:59 2012 From: hayashi at clear-code.com (HAYASHI Kentaro) Date: Thu, 2 Aug 2012 12:31:59 +0900 Subject: [PATCH] Fix to support old version of crtdefs.h Message-ID: <20120802123159.dff61e047d04417740d0f772@clear-code.com> Hi, I attached a patch for fixing build problem (_CRT_SECURE_NO_DEPRECATE) with Visual Studio 2005 Express. The problem is that old version of crtdefs.h uses _CRT_SECURE_NO_DEPRECATE (instead of _CRT_SECURE_NO_WARNINGS) for eliminating the warnings. see: http://social.msdn.microsoft.com/forums/en-US/vcgeneral/thread/3373dd77-ed73-44a6-a52c-53dfd95099ac/ The purpose of this patch is supporting old version of crtdefs.h by adding definition about _CRT_SECURE_NO_DEPRECATE. As a result, nmake build process succeeds with Visual Studio 2005 Express under Wine. NOTE: * I used Wine to setup old version of crtdefs.h. * I confirmed that VS2005 Express and VS2005 Express SP1 uses old version of crtdefs.h. (It seems that VS2005 Express SP1 with latest hotfix use newer version of crtdefs.h) * I confirmed that this patch does not affects build process even if newer version of crtdefs.h is used. I hope that this patch will be applied to nginx mainstream. Index: src/os/win32/ngx_win32_config.h =================================================================== --- src/os/win32/ngx_win32_config.h (revision 4778) +++ src/os/win32/ngx_win32_config.h (working copy) @@ -19,6 +19,11 @@ /* enable getenv() and gmtime() in msvc8 */ #define _CRT_SECURE_NO_WARNINGS +/* support old version of crtdefs.h in msvc8 */ +#if (_MSC_VER == 1400) +#define _CRT_SECURE_NO_DEPRECATE +#endif + /* * we need to include explicitly before because * the warning 4201 is enabled in I wrote how to reproduce the problem and details. Steps to reproduce the problem: 1) Install Wine 1.4 on Ubuntu 12.04 LTS. % sudo apt-get install wine winetricks 2) Setup WINE related environment variables. % export WINPREFIX=$HOME/.win32en % export WINEARCH=win32 3) Install MFC42 and .NET 2.0 under Wine. % winetricks --no-isolate -q mfc42 dotnet20 4) Install Visual Studio 2005 Express under Wine. % winetricks --no-isolate -q vc2005express 5) Install Windows SDK under Wine. % winetricks --no-isolate -q psdkwin7 6) Make symlink cl and rc to pass auto/configure compiler check (this is ad-hoc way, but just works). % cd $HOME/.wine32en/drive_c/Program Files/Microsoft Visual Studio 8/VC/bin % ln -sf cl.exe cl % ln -sf rc.exe rc 7) Generate Makefile by executing following command to build minimum nginx binary. % auto/configure --crossbuild=win32 --with-cc=cl \ --without-http_rewrite_module --without-http_gzip_module 8) Execute nmake.exe % nmake.exe What happened: Make process was failed. Warning is treated as error: ---Start Here--- cl -c -O2 -W4 -WX -nologo -MT -Yungx_config.h -Fpobjs/ngx_config.pch -I src/core -I src/event -I src/event/modules -I src/os/win32 -I objs -I src/http -I src/http/modules -I src/mail -Foobjs/src/core/nginx.obj src/core/nginx.c fixme:file:NeedCurrentDirectoryForExePathW (L"cl"): partial stub nginx.c src/core/nginx.c(424) : error C2220: warning treated as error - no 'object' file generated src/core/nginx.c(424) : warning C4996: 'getenv' was declared deprecated C:\Program Files\Microsoft Visual Studio 8\VC\include\stdlib.h(483) : see declaration of 'getenv' Message: 'This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.' NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\bin\cl.EXE"' : return code '0x2' Stop. NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\bin\nmake.exe"' : return code '0x2' Stop. ---End Here--- Thanks. -- HAYASHI Kentaro From raojm at mibuo.com Thu Aug 2 06:32:20 2012 From: raojm at mibuo.com (raojm) Date: Thu, 2 Aug 2012 14:32:20 +0800 Subject: =?UTF-8?B?562U5aSNOiBuZ2lueC1kZXZlbCBEaWdlc3QsIFZvbCAzNCwgSXNzdWUgMQ==?= In-Reply-To: References: Message-ID: <000d01cd7078$918f81a0$b4ae84e0$@com> Dear My nginx version isnginx-1.2.2?OS version is rhel 6.2 x_86 64bit; I would like to post requests for static files; but nginx outrightly request ; Log information: [02/Aug/2012:14:11:36 +0800] "POST /files/post/1343558979_148.jpg HTTP/1.1" 405 172 "-" "Dalvik/1.6.0 (Linux; U; Android 4.0.4; LT18i Build/4.1.B.0.431)" -----????----- ???: nginx-devel-bounces at nginx.org [mailto:nginx-devel-bounces at nginx.org] ?? nginx-devel-request at nginx.org ????: 2012?8?1? ??? 20:00 ???: nginx-devel at nginx.org ??: nginx-devel Digest, Vol 34, Issue 1 Send nginx-devel mailing list submissions to nginx-devel at nginx.org To subscribe or unsubscribe via the World Wide Web, visit http://mailman.nginx.org/mailman/listinfo/nginx-devel or, via email, send a message with subject or body 'help' to nginx-devel-request at nginx.org You can reach the person managing the list at nginx-devel-owner at nginx.org When replying, please edit your Subject line so it is more specific than "Re: Contents of nginx-devel digest..." Today's Topics: 1. [nginx] svn commit: r4773 - trunk/docs/xml/nginx (ru at nginx.com) 2. [nginx] svn commit: r4774 - tags (ru at nginx.com) 3. [nginx] svn commit: r4775 - trunk/misc (ru at nginx.com) 4. Re: Dependency of 3rd party module (Maxim Dounin) 5. [nginx] svn commit: r4776 - in trunk/src: core http/modules/perl (ru at nginx.com) 6. [nginx] svn commit: r4777 - trunk/docs (ru at nginx.com) ---------------------------------------------------------------------- Message: 1 Date: Tue, 31 Jul 2012 12:38:37 +0000 From: ru at nginx.com To: nginx-devel at nginx.org Subject: [nginx] svn commit: r4773 - trunk/docs/xml/nginx Message-ID: <20120731123837.D57B13F9E47 at mail.nginx.com> Content-Type: text/plain; charset=UTF-8 Author: ru Date: 2012-07-31 12:38:37 +0000 (Tue, 31 Jul 2012) New Revision: 4773 URL: http://trac.nginx.org/nginx/changeset/4773/nginx Log: nginx-1.3.4-RELEASE Modified: trunk/docs/xml/nginx/changes.xml Modified: trunk/docs/xml/nginx/changes.xml =================================================================== --- trunk/docs/xml/nginx/changes.xml 2012-07-30 12:27:06 UTC (rev 4772) +++ trunk/docs/xml/nginx/changes.xml 2012-07-31 12:38:37 UTC (rev 4773) @@ -9,6 +9,69 @@ nginx changelog + + + + +?????? ?? ????????? IPv6-??????? ???????? ipv6only +??????? ?? ?????????. + + +the "ipv6only" parameter is now turned on by default for +listening IPv6 sockets. + + + + + +????????? ??????????? Clang. + + +the Clang compiler support. + + + + + +????? ??????????? ?????? ????????? ??????.
+??????? ?????? ?????????. +
+ +extra listening sockets might be created.
+Thanks to Roman Odaisky. +
+
+ + + +nginx/Windows ??? ????????? ?????????, ???? ??? ??????? ???????? ???????? +??????????? ??????.
+??????? Ricardo Villalobos Guevara. +
+ +nginx/Windows might hog CPU if a worker process failed to start.
+Thanks to Ricardo Villalobos Guevara. +
+
+ + + +????????? proxy_pass_header, fastcgi_pass_header, scgi_pass_header, +uwsgi_pass_header, proxy_hide_header, fastcgi_hide_header, +scgi_hide_header ? uwsgi_hide_header +????? ????????????? ???????????. + + +the "proxy_pass_header", "fastcgi_pass_header", "scgi_pass_header", +"uwsgi_pass_header", "proxy_hide_header", "fastcgi_hide_header", +"scgi_hide_header", and "uwsgi_hide_header" directives +might be inherited incorrectly. + + + +
+ + ------------------------------ Message: 2 Date: Tue, 31 Jul 2012 12:38:57 +0000 From: ru at nginx.com To: nginx-devel at nginx.org Subject: [nginx] svn commit: r4774 - tags Message-ID: <20120731123857.5CCB73FA20B at mail.nginx.com> Content-Type: text/plain; charset=UTF-8 Author: ru Date: 2012-07-31 12:38:57 +0000 (Tue, 31 Jul 2012) New Revision: 4774 URL: http://trac.nginx.org/nginx/changeset/4774/nginx Log: release-1.3.4 tag Added: tags/release-1.3.4/ ------------------------------ Message: 3 Date: Tue, 31 Jul 2012 13:13:52 +0000 From: ru at nginx.com To: nginx-devel at nginx.org Subject: [nginx] svn commit: r4775 - trunk/misc Message-ID: <20120731131352.F04CD3F9F9F at mail.nginx.com> Content-Type: text/plain; charset=UTF-8 Author: ru Date: 2012-07-31 13:13:52 +0000 (Tue, 31 Jul 2012) New Revision: 4775 URL: http://trac.nginx.org/nginx/changeset/4775/nginx Log: Updated PCRE used for win32 builds. Modified: trunk/misc/GNUmakefile Modified: trunk/misc/GNUmakefile =================================================================== --- trunk/misc/GNUmakefile 2012-07-31 12:38:57 UTC (rev 4774) +++ trunk/misc/GNUmakefile 2012-07-31 13:13:52 UTC (rev 4775) @@ -8,7 +8,7 @@ OBJS = objs.msvc8 OPENSSL = openssl-1.0.1c ZLIB = zlib-1.2.5 -PCRE = pcre-8.30 +PCRE = pcre-8.31 release: ------------------------------ Message: 4 Date: Tue, 31 Jul 2012 17:26:54 +0400 From: Maxim Dounin To: nginx-devel at nginx.org, danfiala at centrum.cz Subject: Re: Dependency of 3rd party module Message-ID: <20120731132654.GQ40452 at mdounin.ru> Content-Type: text/plain; charset=us-ascii Hello! On Tue, Jul 31, 2012 at 08:56:19AM +0200, Daniel Fiala wrote: > Hi all. > I am developing some 3rd party module for Nginx. I would like to enable > configuration/compilation of my module only if http_ssl_module is enabled. > Moreover, if http_ssl_module is not set, then configure should write an > error message and failed. Is there any way how to do this? You may check HTTP_SSL variable in your module's config script (and trigger failure if it isn't set to "YES"). See auto/options for details. Maxim Dounin ------------------------------ Message: 5 Date: Tue, 31 Jul 2012 21:47:56 +0000 From: ru at nginx.com To: nginx-devel at nginx.org Subject: [nginx] svn commit: r4776 - in trunk/src: core http/modules/perl Message-ID: <20120731214757.03E2E3FA211 at mail.nginx.com> Content-Type: text/plain; charset=UTF-8 Author: ru Date: 2012-07-31 21:47:56 +0000 (Tue, 31 Jul 2012) New Revision: 4776 URL: http://trac.nginx.org/nginx/changeset/4776/nginx Log: Version bump. Modified: trunk/src/core/nginx.h trunk/src/http/modules/perl/nginx.pm Modified: trunk/src/core/nginx.h =================================================================== --- trunk/src/core/nginx.h 2012-07-31 13:13:52 UTC (rev 4775) +++ trunk/src/core/nginx.h 2012-07-31 21:47:56 UTC (rev 4776) @@ -9,8 +9,8 @@ #define _NGINX_H_INCLUDED_ -#define nginx_version 1003004 -#define NGINX_VERSION "1.3.4" +#define nginx_version 1003005 +#define NGINX_VERSION "1.3.5" #define NGINX_VER "nginx/" NGINX_VERSION #define NGINX_VAR "NGINX" Modified: trunk/src/http/modules/perl/nginx.pm =================================================================== --- trunk/src/http/modules/perl/nginx.pm 2012-07-31 13:13:52 UTC (rev 4775) +++ trunk/src/http/modules/perl/nginx.pm 2012-07-31 21:47:56 UTC (rev 4776) @@ -50,7 +50,7 @@ HTTP_INSUFFICIENT_STORAGE ); -our $VERSION = '1.3.4'; +our $VERSION = '1.3.5'; require XSLoader; XSLoader::load('nginx', $VERSION); ------------------------------ Message: 6 Date: Tue, 31 Jul 2012 21:49:23 +0000 From: ru at nginx.com To: nginx-devel at nginx.org Subject: [nginx] svn commit: r4777 - trunk/docs Message-ID: <20120731214923.8D7C73F9F85 at mail.nginx.com> Content-Type: text/plain; charset=UTF-8 Author: ru Date: 2012-07-31 21:49:23 +0000 (Tue, 31 Jul 2012) New Revision: 4777 URL: http://trac.nginx.org/nginx/changeset/4777/nginx Log: Simplified makefile that builds CHANGES. Modified: trunk/docs/GNUmakefile Modified: trunk/docs/GNUmakefile =================================================================== --- trunk/docs/GNUmakefile 2012-07-31 21:47:56 UTC (rev 4776) +++ trunk/docs/GNUmakefile 2012-07-31 21:49:23 UTC (rev 4777) @@ -5,25 +5,7 @@ TEMP= tmp CP= $(HOME)/java -define XSLScript - java -cp $(CP)/xsls/saxon.jar:$(CP)/xsls/xsls.jar \ - com.pault.StyleSheet \ - -x com.pault.XX -y com.pault.XX \ - $(1) docs/xsls/dump.xsls \ - | sed 's/ *$$//;/^ *$$/N;/\n *$$/D' > $(2) - if [ ! -s $(2) ]; then rm $(2); fi; test -s $(2) -endef - -define XSLT - xmllint --noout --valid $2 - xsltproc -o $3 \ - $(shell echo $4 \\ - | sed -e "s/\([^= ]*\)=\([^= ]*\)/--param \1 \"'\2'\"/g") \ - $1 $2 -endef - - all: changes changes: $(TEMP)/$(NGINX)/CHANGES.ru \ @@ -34,24 +16,28 @@ docs/xml/change_log_conf.xml \ docs/xslt/changes.xslt - test -d $(TEMP)/$(NGINX) || mkdir -p $(TEMP)/$(NGINX) + mkdir -p $(TEMP)/$(NGINX) xsltproc --stringparam lang ru \ - -o $(TEMP)/$(NGINX)/CHANGES.ru \ - docs/xslt/changes.xslt docs/xml/nginx/changes.xml + -o $@ docs/xslt/changes.xslt docs/xml/nginx/changes.xml $(TEMP)/$(NGINX)/CHANGES: docs/xml/nginx/changes.xml \ docs/xml/change_log_conf.xml \ docs/xslt/changes.xslt - test -d $(TEMP)/$(NGINX) || mkdir -p $(TEMP)/$(NGINX) + mkdir -p $(TEMP)/$(NGINX) xsltproc --stringparam lang en \ - -o $(TEMP)/$(NGINX)/CHANGES \ - docs/xslt/changes.xslt docs/xml/nginx/changes.xml + -o $@ docs/xslt/changes.xslt docs/xml/nginx/changes.xml -docs/xslt/changes.xslt: docs/xsls/changes.xsls +docs/xslt/changes.xslt: docs/xsls/changes.xsls docs/xsls/dump.xsls - $(call XSLScript, docs/xsls/changes.xsls, $@) + java -cp $(CP)/xsls/saxon.jar:$(CP)/xsls/xsls.jar \ + com.pault.StyleSheet \ + -x com.pault.XX -y com.pault.XX \ + $< docs/xsls/dump.xsls \ + | sed 's/ *$$//;/^ *$$/N;/\n *$$/D' > $@ + + if [ ! -s $@ ]; then rm $@; fi; test -s $@ ------------------------------ _______________________________________________ nginx-devel mailing list nginx-devel at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx-devel End of nginx-devel Digest, Vol 34, Issue 1 ****************************************** From mdounin at mdounin.ru Thu Aug 2 08:52:20 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 2 Aug 2012 12:52:20 +0400 Subject: [PATCH] Fix to support old version of crtdefs.h In-Reply-To: <20120802123159.dff61e047d04417740d0f772@clear-code.com> References: <20120802123159.dff61e047d04417740d0f772@clear-code.com> Message-ID: <20120802085220.GR40452@mdounin.ru> Hello! On Thu, Aug 02, 2012 at 12:31:59PM +0900, HAYASHI Kentaro wrote: > > Hi, > > I attached a patch for fixing build problem (_CRT_SECURE_NO_DEPRECATE) > with Visual Studio 2005 Express. > > The problem is that old version of crtdefs.h uses _CRT_SECURE_NO_DEPRECATE > (instead of _CRT_SECURE_NO_WARNINGS) for eliminating the warnings. > > see: http://social.msdn.microsoft.com/forums/en-US/vcgeneral/thread/3373dd77-ed73-44a6-a52c-53dfd95099ac/ > > The purpose of this patch is supporting old version of crtdefs.h > by adding definition about _CRT_SECURE_NO_DEPRECATE. > > As a result, nmake build process succeeds with Visual Studio 2005 Express under Wine. > > NOTE: > * I used Wine to setup old version of crtdefs.h. > * I confirmed that VS2005 Express and VS2005 Express SP1 uses old version of crtdefs.h. > (It seems that VS2005 Express SP1 with latest hotfix use newer version of crtdefs.h) > * I confirmed that this patch does not affects build process > even if newer version of crtdefs.h is used. > > I hope that this patch will be applied to nginx mainstream. > > > Index: src/os/win32/ngx_win32_config.h > =================================================================== > --- src/os/win32/ngx_win32_config.h (revision 4778) > +++ src/os/win32/ngx_win32_config.h (working copy) > @@ -19,6 +19,11 @@ > /* enable getenv() and gmtime() in msvc8 */ > #define _CRT_SECURE_NO_WARNINGS > > +/* support old version of crtdefs.h in msvc8 */ > +#if (_MSC_VER == 1400) > +#define _CRT_SECURE_NO_DEPRECATE > +#endif > + Thanks for your report. Any specific reason to explicitly check msvc version? I tend to think that just --- a/src/os/win32/ngx_win32_config.h +++ b/src/os/win32/ngx_win32_config.h @@ -18,6 +18,7 @@ /* enable getenv() and gmtime() in msvc8 */ #define _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_DEPRECATE /* * we need to include explicitly before because should be enough. Maxim Dounin From hayashi at clear-code.com Thu Aug 2 09:41:09 2012 From: hayashi at clear-code.com (HAYASHI Kentaro) Date: Thu, 2 Aug 2012 18:41:09 +0900 Subject: [PATCH] Fix to support old version of crtdefs.h In-Reply-To: <20120802085220.GR40452@mdounin.ru> References: <20120802123159.dff61e047d04417740d0f772@clear-code.com> <20120802085220.GR40452@mdounin.ru> Message-ID: <20120802184109.d7efca42258eead119f2340f@clear-code.com> Hi, On Thu, 2 Aug 2012 12:52:20 +0400 Maxim Dounin wrote: > Hello! > > On Thu, Aug 02, 2012 at 12:31:59PM +0900, HAYASHI Kentaro wrote: > > > > > Hi, > > > > I attached a patch for fixing build problem (_CRT_SECURE_NO_DEPRECATE) > > with Visual Studio 2005 Express. > > > > The problem is that old version of crtdefs.h uses _CRT_SECURE_NO_DEPRECATE > > (instead of _CRT_SECURE_NO_WARNINGS) for eliminating the warnings. > > > > see: http://social.msdn.microsoft.com/forums/en-US/vcgeneral/thread/3373dd77-ed73-44a6-a52c-53dfd95099ac/ > > > > The purpose of this patch is supporting old version of crtdefs.h > > by adding definition about _CRT_SECURE_NO_DEPRECATE. > > > > As a result, nmake build process succeeds with Visual Studio 2005 Express under Wine. > > > > NOTE: > > * I used Wine to setup old version of crtdefs.h. > > * I confirmed that VS2005 Express and VS2005 Express SP1 uses old version of crtdefs.h. > > (It seems that VS2005 Express SP1 with latest hotfix use newer version of crtdefs.h) > > * I confirmed that this patch does not affects build process > > even if newer version of crtdefs.h is used. > > > > I hope that this patch will be applied to nginx mainstream. > > > > > > Index: src/os/win32/ngx_win32_config.h > > =================================================================== > > --- src/os/win32/ngx_win32_config.h (revision 4778) > > +++ src/os/win32/ngx_win32_config.h (working copy) > > @@ -19,6 +19,11 @@ > > /* enable getenv() and gmtime() in msvc8 */ > > #define _CRT_SECURE_NO_WARNINGS > > > > +/* support old version of crtdefs.h in msvc8 */ > > +#if (_MSC_VER == 1400) > > +#define _CRT_SECURE_NO_DEPRECATE > > +#endif > > + > > Thanks for your report. > > Any specific reason to explicitly check msvc version? I tend to > think that just > > --- a/src/os/win32/ngx_win32_config.h > +++ b/src/os/win32/ngx_win32_config.h > @@ -18,6 +18,7 @@ > > /* enable getenv() and gmtime() in msvc8 */ > #define _CRT_SECURE_NO_WARNINGS > +#define _CRT_SECURE_NO_DEPRECATE > > /* > * we need to include explicitly before because > > should be enough. > > Maxim Dounin > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel The patch checks explicitly msvc version because I just confirmed VS2005 Express series only. So I checked VS2010 Express crtdefs.h additionally, it seems that there is no problem without checking explicitly msvc version. As you mentioned above, just adding "#define _CRT_SECURE_NO_DEPRECATE" is enough. Thanks. -- HAYASHI Kentaro From mdounin at mdounin.ru Thu Aug 2 12:53:08 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Thu, 2 Aug 2012 12:53:08 +0000 Subject: [nginx] svn commit: r4779 - trunk/src/os/win32 Message-ID: <20120802125308.227AB3F9F56@mail.nginx.com> Author: mdounin Date: 2012-08-02 12:53:07 +0000 (Thu, 02 Aug 2012) New Revision: 4779 URL: http://trac.nginx.org/nginx/changeset/4779/nginx Log: Win32: fixed build with Visual Studio 2005 Express. It is available via winetricks which makes it still usable, and has an old crtdefs.h which uses _CRT_SECURE_NO_DEPRECATE instead of _CRT_SECURE_NO_WARNINGS to suppress warnings. Reported by HAYASHI Kentaro, http://mailman.nginx.org/pipermail/nginx-devel/2012-August/002542.html Modified: trunk/src/os/win32/ngx_win32_config.h Modified: trunk/src/os/win32/ngx_win32_config.h =================================================================== --- trunk/src/os/win32/ngx_win32_config.h 2012-08-01 14:37:08 UTC (rev 4778) +++ trunk/src/os/win32/ngx_win32_config.h 2012-08-02 12:53:07 UTC (rev 4779) @@ -18,6 +18,7 @@ /* enable getenv() and gmtime() in msvc8 */ #define _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_DEPRECATE /* * we need to include explicitly before because From mdounin at mdounin.ru Thu Aug 2 12:54:09 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 2 Aug 2012 16:54:09 +0400 Subject: [PATCH] Fix to support old version of crtdefs.h In-Reply-To: <20120802184109.d7efca42258eead119f2340f@clear-code.com> References: <20120802123159.dff61e047d04417740d0f772@clear-code.com> <20120802085220.GR40452@mdounin.ru> <20120802184109.d7efca42258eead119f2340f@clear-code.com> Message-ID: <20120802125408.GY40452@mdounin.ru> Hello! On Thu, Aug 02, 2012 at 06:41:09PM +0900, HAYASHI Kentaro wrote: [...] > The patch checks explicitly msvc version because I just > confirmed VS2005 Express series only. > So I checked VS2010 Express crtdefs.h additionally, it seems > that there is no problem without checking explicitly msvc > version. > As you mentioned above, just adding "#define > _CRT_SECURE_NO_DEPRECATE" is enough. Thanks, committed. Maxim Dounin From ru at nginx.com Thu Aug 2 14:58:37 2012 From: ru at nginx.com (ru at nginx.com) Date: Thu, 2 Aug 2012 14:58:37 +0000 Subject: [nginx] svn commit: r4780 - trunk/misc Message-ID: <20120802145837.3EC243F9F35@mail.nginx.com> Author: ru Date: 2012-08-02 14:58:36 +0000 (Thu, 02 Aug 2012) New Revision: 4780 URL: http://trac.nginx.org/nginx/changeset/4780/nginx Log: Removed the need in Perl to generate ZIP archive of nginx/Windows. Modified: trunk/misc/GNUmakefile Modified: trunk/misc/GNUmakefile =================================================================== --- trunk/misc/GNUmakefile 2012-08-02 12:53:07 UTC (rev 4779) +++ trunk/misc/GNUmakefile 2012-08-02 14:58:36 UTC (rev 4780) @@ -92,7 +92,7 @@ mkdir -p $(TEMP)/$(NGINX)/temp svn export -rHEAD conf $(TEMP)/$(NGINX)/conf/ - perl -pi -e 's/$$/\r/' $(TEMP)/$(NGINX)/conf/* + sed -i '' -e "s/$$/`printf '\r'`/" $(TEMP)/$(NGINX)/conf/* svn export -rHEAD contrib $(TEMP)/$(NGINX)/contrib/ svn export -rHEAD docs/html $(TEMP)/$(NGINX)/html/ @@ -111,7 +111,7 @@ cp -p $(OBJS)/lib/$(PCRE)/LICENCE \ $(TEMP)/$(NGINX)/docs/PCRE.LICENCE - perl -ne 'print if /^ \(C\) 1995-20/ .. /^ jloup\@gzip.org/' \ + sed -ne '/^ (C) 1995-20/,/^ jloup at gzip\.org/p' \ $(OBJS)/lib/$(ZLIB)/README \ > $(TEMP)/$(NGINX)/docs/zlib.LICENSE From leok.trash at gmail.com Thu Aug 2 18:15:35 2012 From: leok.trash at gmail.com (=?utf-8?B?bGVvay50cmFzaEBnbWFpbC5jb20=?=) Date: Thu, 02 Aug 2012 22:15:35 +0400 Subject: =?UTF-8?B?0J3QkDogW25naW54XSBzdm4gY29tbWl0OiAgcjQ3ODAgLSB0cnVuay9taXNj?= Message-ID: <501ac3ca.4292980a.5695.6edd@mx.google.com> ?????????? ? ????? HTC ----- Reply message ----- ??: ru at nginx.com ????: ????: [nginx] svn commit: r4780 - trunk/misc ????: ??, ??? 2, 2012 18:58 Author: ru Date: 2012-08-02 14:58:36 +0000 (Thu, 02 Aug 2012) New Revision: 4780 URL: http://trac.nginx.org/nginx/changeset/4780/nginx Log: Removed the need in Perl to generate ZIP archive of nginx/Windows. Modified: trunk/misc/GNUmakefile Modified: trunk/misc/GNUmakefile =================================================================== --- trunk/misc/GNUmakefile 2012-08-02 12:53:07 UTC (rev 4779) +++ trunk/misc/GNUmakefile 2012-08-02 14:58:36 UTC (rev 4780) @@ -92,7 +92,7 @@ mkdir -p $(TEMP)/$(NGINX)/temp svn export -rHEAD conf $(TEMP)/$(NGINX)/conf/ - perl -pi -e 's/$$/\r/' $(TEMP)/$(NGINX)/conf/* + sed -i '' -e "s/$$/`printf '\r'`/" $(TEMP)/$(NGINX)/conf/* svn export -rHEAD contrib $(TEMP)/$(NGINX)/contrib/ svn export -rHEAD docs/html $(TEMP)/$(NGINX)/html/ @@ -111,7 +111,7 @@ cp -p $(OBJS)/lib/$(PCRE)/LICENCE \ $(TEMP)/$(NGINX)/docs/PCRE.LICENCE - perl -ne 'print if /^ \(C\) 1995-20/ .. /^ jloup\@gzip.org/' \ + sed -ne '/^ (C) 1995-20/,/^ jloup at gzip\.org/p' \ $(OBJS)/lib/$(ZLIB)/README \ > $(TEMP)/$(NGINX)/docs/zlib.LICENSE _______________________________________________ nginx-devel mailing list nginx-devel at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx-devel -------------- next part -------------- An HTML attachment was scrubbed... URL: From piotr.sikora at frickle.com Thu Aug 2 19:36:48 2012 From: piotr.sikora at frickle.com (Piotr Sikora) Date: Thu, 2 Aug 2012 21:36:48 +0200 Subject: [nginx] svn commit: r4780 - trunk/misc In-Reply-To: <20120802145837.3EC243F9F35@mail.nginx.com> References: <20120802145837.3EC243F9F35@mail.nginx.com> Message-ID: <6DF5DA0E600D4FF7A5CD42301E921A1C@Desktop> Hey Ruslan, > - perl -pi -e 's/$$/\r/' $(TEMP)/$(NGINX)/conf/* > + sed -i '' -e "s/$$/`printf '\r'`/" $(TEMP)/$(NGINX)/conf/* Neither OpenBSD's nor NetBSD's sed have "-i" option. Best regards, Piotr Sikora < piotr.sikora at frickle.com > From ru at nginx.com Thu Aug 2 20:57:54 2012 From: ru at nginx.com (Ruslan Ermilov) Date: Fri, 3 Aug 2012 00:57:54 +0400 Subject: [nginx] svn commit: r4780 - trunk/misc In-Reply-To: <6DF5DA0E600D4FF7A5CD42301E921A1C@Desktop> References: <20120802145837.3EC243F9F35@mail.nginx.com> <6DF5DA0E600D4FF7A5CD42301E921A1C@Desktop> Message-ID: <20120802205754.GA74659@lo0.su> On Thu, Aug 02, 2012 at 09:36:48PM +0200, Piotr Sikora wrote: > Hey Ruslan, > > > - perl -pi -e 's/$$/\r/' $(TEMP)/$(NGINX)/conf/* > > + sed -i '' -e "s/$$/`printf '\r'`/" $(TEMP)/$(NGINX)/conf/* > > Neither OpenBSD's nor NetBSD's sed have "-i" option. It's an internal makefile used during a release process. This particular commit touched the "zip" target that is used to generate ZIP archives of nginx/Windows that are made available on the download page. Do you also use this makefile and would like to have it working on said BSDs? From piotr.sikora at frickle.com Fri Aug 3 00:01:56 2012 From: piotr.sikora at frickle.com (Piotr Sikora) Date: Fri, 3 Aug 2012 02:01:56 +0200 Subject: [nginx] svn commit: r4780 - trunk/misc In-Reply-To: <20120802205754.GA74659@lo0.su> References: <20120802145837.3EC243F9F35@mail.nginx.com> <6DF5DA0E600D4FF7A5CD42301E921A1C@Desktop> <20120802205754.GA74659@lo0.su> Message-ID: <8C948A3F331A4FC4AE5C67301BE32D0E@Desktop> Hey Ruslan, > It's an internal makefile used during a release process. > This particular commit touched the "zip" target that is > used to generate ZIP archives of nginx/Windows that are > made available on the download page. > > Do you also use this makefile and would like to have it > working on said BSDs? No, I don't, but it doesn't mean that others don't use it. Anyway, it was more of a general remark in case that you didn't know, because I saw this particular change introduced and then reverted in subsequent release more than once in other projects. Best regards, Piotr Sikora < piotr.sikora at frickle.com > From mdounin at mdounin.ru Fri Aug 3 09:00:26 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Fri, 3 Aug 2012 09:00:26 +0000 Subject: [nginx] svn commit: r4781 - trunk/src/http Message-ID: <20120803090026.268203FA013@mail.nginx.com> Author: mdounin Date: 2012-08-03 09:00:25 +0000 (Fri, 03 Aug 2012) New Revision: 4781 URL: http://trac.nginx.org/nginx/changeset/4781/nginx Log: Whitespace fix. Modified: trunk/src/http/ngx_http_core_module.c Modified: trunk/src/http/ngx_http_core_module.c =================================================================== --- trunk/src/http/ngx_http_core_module.c 2012-08-02 14:58:36 UTC (rev 4780) +++ trunk/src/http/ngx_http_core_module.c 2012-08-03 09:00:25 UTC (rev 4781) @@ -1820,9 +1820,9 @@ { ngx_table_elt_t *etag; ngx_http_core_loc_conf_t *clcf; - + clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); - + if (!clcf->etag) { return NGX_OK; } From mdounin at mdounin.ru Fri Aug 3 09:07:30 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Fri, 3 Aug 2012 09:07:30 +0000 Subject: [nginx] svn commit: r4782 - trunk/src/core Message-ID: <20120803090731.8D88B3F9EA7@mail.nginx.com> Author: mdounin Date: 2012-08-03 09:07:30 +0000 (Fri, 03 Aug 2012) New Revision: 4782 URL: http://trac.nginx.org/nginx/changeset/4782/nginx Log: Added "const" to ngx_memcpy() with NGX_MEMCPY_LIMIT defined. This fixes warning produced during compilation of the ngx_http_geoip_module due to const qualifier being discarded. Modified: trunk/src/core/ngx_string.c trunk/src/core/ngx_string.h Modified: trunk/src/core/ngx_string.c =================================================================== --- trunk/src/core/ngx_string.c 2012-08-03 09:00:25 UTC (rev 4781) +++ trunk/src/core/ngx_string.c 2012-08-03 09:07:30 UTC (rev 4782) @@ -1827,7 +1827,7 @@ #if (NGX_MEMCPY_LIMIT) void * -ngx_memcpy(void *dst, void *src, size_t n) +ngx_memcpy(void *dst, const void *src, size_t n) { if (n > NGX_MEMCPY_LIMIT) { ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0, "memcpy %uz bytes", n); Modified: trunk/src/core/ngx_string.h =================================================================== --- trunk/src/core/ngx_string.h 2012-08-03 09:00:25 UTC (rev 4781) +++ trunk/src/core/ngx_string.h 2012-08-03 09:07:30 UTC (rev 4782) @@ -89,7 +89,7 @@ #if (NGX_MEMCPY_LIMIT) -void *ngx_memcpy(void *dst, void *src, size_t n); +void *ngx_memcpy(void *dst, const void *src, size_t n); #define ngx_cpymem(dst, src, n) (((u_char *) ngx_memcpy(dst, src, n)) + (n)) #else From mdounin at mdounin.ru Fri Aug 3 09:10:39 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Fri, 3 Aug 2012 09:10:39 +0000 Subject: [nginx] svn commit: r4783 - trunk/src/core Message-ID: <20120803091040.070183F9F22@mail.nginx.com> Author: mdounin Date: 2012-08-03 09:10:39 +0000 (Fri, 03 Aug 2012) New Revision: 4783 URL: http://trac.nginx.org/nginx/changeset/4783/nginx Log: Fixed possible use of old cached times if runtime went backwards. If ngx_time_sigsafe_update() updated only ngx_cached_err_log_time, and then clock was adjusted backwards, the cached_time[slot].sec might accidentally match current seconds on next ngx_time_update() call, resulting in various cached times not being updated. Fix is to clear the cached_time[slot].sec to explicitly mark cached times are stale and need updating. Modified: trunk/src/core/ngx_times.c Modified: trunk/src/core/ngx_times.c =================================================================== --- trunk/src/core/ngx_times.c 2012-08-03 09:07:30 UTC (rev 4782) +++ trunk/src/core/ngx_times.c 2012-08-03 09:10:39 UTC (rev 4783) @@ -211,6 +211,10 @@ slot++; } + tp = &cached_time[slot]; + + tp->sec = 0; + ngx_gmtime(sec + cached_gmtoff * 60, &tm); p = &cached_err_log_time[slot][0]; From ru at nginx.com Fri Aug 3 12:52:32 2012 From: ru at nginx.com (ru at nginx.com) Date: Fri, 3 Aug 2012 12:52:32 +0000 Subject: [nginx] svn commit: r4784 - trunk/src/core Message-ID: <20120803125232.9B2753F9F06@mail.nginx.com> Author: ru Date: 2012-08-03 12:52:32 +0000 (Fri, 03 Aug 2012) New Revision: 4784 URL: http://trac.nginx.org/nginx/changeset/4784/nginx Log: Fixed the -p parameter handling. Ensure that the path supplied always ends with a `/' except when empty. An empty value now corresponds to the current directory instead of `/'. Modified: trunk/src/core/nginx.c Modified: trunk/src/core/nginx.c =================================================================== --- trunk/src/core/nginx.c 2012-08-03 09:10:39 UTC (rev 4783) +++ trunk/src/core/nginx.c 2012-08-03 12:52:32 UTC (rev 4784) @@ -836,7 +836,7 @@ len = ngx_strlen(ngx_prefix); p = ngx_prefix; - if (!ngx_path_separator(*p)) { + if (len && !ngx_path_separator(p[len - 1])) { p = ngx_pnalloc(cycle->pool, len + 1); if (p == NULL) { return NGX_ERROR; From mdounin at mdounin.ru Mon Aug 6 10:48:09 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 6 Aug 2012 10:48:09 +0000 Subject: [nginx] svn commit: r4785 - trunk/src/core Message-ID: <20120806104810.0E1C53F9E70@mail.nginx.com> Author: mdounin Date: 2012-08-06 10:48:09 +0000 (Mon, 06 Aug 2012) New Revision: 4785 URL: http://trac.nginx.org/nginx/changeset/4785/nginx Log: Resolver: fixed possible memory leak in ngx_resolver_create(). Found by Coverity. Modified: trunk/src/core/ngx_resolver.c Modified: trunk/src/core/ngx_resolver.c =================================================================== --- trunk/src/core/ngx_resolver.c 2012-08-03 12:52:32 UTC (rev 4784) +++ trunk/src/core/ngx_resolver.c 2012-08-06 10:48:09 UTC (rev 4785) @@ -113,15 +113,6 @@ return NULL; } - if (n) { - if (ngx_array_init(&r->udp_connections, cf->pool, n, - sizeof(ngx_udp_connection_t)) - != NGX_OK) - { - return NULL; - } - } - cln->data = r; r->event = ngx_calloc(sizeof(ngx_event_t), cf->log); @@ -153,6 +144,15 @@ r->log = &cf->cycle->new_log; r->log_level = NGX_LOG_ERR; + if (n) { + if (ngx_array_init(&r->udp_connections, cf->pool, n, + sizeof(ngx_udp_connection_t)) + != NGX_OK) + { + return NULL; + } + } + for (i = 0; i < n; i++) { if (ngx_strncmp(names[i].data, "valid=", 6) == 0) { s.len = names[i].len - 6; From mdounin at mdounin.ru Mon Aug 6 14:04:06 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 6 Aug 2012 14:04:06 +0000 Subject: [nginx] svn commit: r4786 - in branches/stable-1.2: . src/http/modules Message-ID: <20120806140406.E4B083F9C5F@mail.nginx.com> Author: mdounin Date: 2012-08-06 14:04:06 +0000 (Mon, 06 Aug 2012) New Revision: 4786 URL: http://trac.nginx.org/nginx/changeset/4786/nginx Log: Merge of r4713: map hostnames fix (ticket #182). The final dot wasn't stripped before looking up in a map of hostnames. Modified: branches/stable-1.2/ branches/stable-1.2/src/http/modules/ngx_http_map_module.c Index: branches/stable-1.2 =================================================================== --- branches/stable-1.2 2012-08-06 10:48:09 UTC (rev 4785) +++ branches/stable-1.2 2012-08-06 14:04:06 UTC (rev 4786) Property changes on: branches/stable-1.2 ___________________________________________________________________ Modified: svn:mergeinfo ## -1 +1 ## -/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706 +/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713 \ No newline at end of property Modified: branches/stable-1.2/src/http/modules/ngx_http_map_module.c =================================================================== --- branches/stable-1.2/src/http/modules/ngx_http_map_module.c 2012-08-06 10:48:09 UTC (rev 4785) +++ branches/stable-1.2/src/http/modules/ngx_http_map_module.c 2012-08-06 14:04:06 UTC (rev 4786) @@ -110,7 +110,6 @@ { ngx_http_map_ctx_t *map = (ngx_http_map_ctx_t *) data; - size_t len; ngx_str_t val; ngx_http_variable_value_t *value; @@ -121,10 +120,8 @@ return NGX_ERROR; } - len = val.len; - - if (len && map->hostnames && val.data[len - 1] == '.') { - len--; + if (map->hostnames && val.len > 0 && val.data[val.len - 1] == '.') { + val.len--; } value = ngx_http_map_find(r, &map->map, &val); @@ -281,6 +278,8 @@ map->default_value = ctx.default_value ? ctx.default_value: &ngx_http_variable_null_value; + map->hostnames = ctx.hostnames; + hash.key = ngx_hash_key_lc; hash.max_size = mcf->hash_max_size; hash.bucket_size = mcf->hash_bucket_size; From mdounin at mdounin.ru Mon Aug 6 14:58:36 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 6 Aug 2012 14:58:36 +0000 Subject: [nginx] svn commit: r4787 - in branches/stable-1.2: . docs/xml/nginx Message-ID: <20120806145836.B96593F9EB7@mail.nginx.com> Author: mdounin Date: 2012-08-06 14:58:36 +0000 (Mon, 06 Aug 2012) New Revision: 4787 URL: http://trac.nginx.org/nginx/changeset/4787/nginx Log: Merge of r4736: typo fixed. Modified: branches/stable-1.2/ branches/stable-1.2/docs/xml/nginx/changes.xml Index: branches/stable-1.2 =================================================================== --- branches/stable-1.2 2012-08-06 14:04:06 UTC (rev 4786) +++ branches/stable-1.2 2012-08-06 14:58:36 UTC (rev 4787) Property changes on: branches/stable-1.2 ___________________________________________________________________ Modified: svn:mergeinfo ## -1 +1 ## -/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713 +/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736 \ No newline at end of property Modified: branches/stable-1.2/docs/xml/nginx/changes.xml =================================================================== --- branches/stable-1.2/docs/xml/nginx/changes.xml 2012-08-06 14:04:06 UTC (rev 4786) +++ branches/stable-1.2/docs/xml/nginx/changes.xml 2012-08-06 14:58:36 UTC (rev 4787) @@ -50,7 +50,7 @@ ???????? IPv6-?????? DNS-????????. -the "resolver" directive now support IPv6 addresses and +the "resolver" directive now supports IPv6 addresses and an optional port specification. From mdounin at mdounin.ru Mon Aug 6 15:20:04 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 6 Aug 2012 15:20:04 +0000 Subject: [nginx] svn commit: r4788 - in branches/stable-1.2: . src/http Message-ID: <20120806152004.2E4843F9F7A@mail.nginx.com> Author: mdounin Date: 2012-08-06 15:20:03 +0000 (Mon, 06 Aug 2012) New Revision: 4788 URL: http://trac.nginx.org/nginx/changeset/4788/nginx Log: Merge of r4737: r->uri_changed in a named location fix. Reset r->uri_changed in a named location (ticket #184). Modified: branches/stable-1.2/ branches/stable-1.2/src/http/ngx_http_core_module.c Index: branches/stable-1.2 =================================================================== --- branches/stable-1.2 2012-08-06 14:58:36 UTC (rev 4787) +++ branches/stable-1.2 2012-08-06 15:20:03 UTC (rev 4788) Property changes on: branches/stable-1.2 ___________________________________________________________________ Modified: svn:mergeinfo ## -1 +1 ## -/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736 +/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4737 \ No newline at end of property Modified: branches/stable-1.2/src/http/ngx_http_core_module.c =================================================================== --- branches/stable-1.2/src/http/ngx_http_core_module.c 2012-08-06 14:58:36 UTC (rev 4787) +++ branches/stable-1.2/src/http/ngx_http_core_module.c 2012-08-06 15:20:03 UTC (rev 4788) @@ -2588,6 +2588,7 @@ r->internal = 1; r->content_handler = NULL; + r->uri_changed = 0; r->loc_conf = (*clcfp)->loc_conf; /* clear the modules contexts */ From mdounin at mdounin.ru Mon Aug 6 15:31:49 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 6 Aug 2012 15:31:49 +0000 Subject: [nginx] svn commit: r4789 - in branches/stable-1.2: . src/os/unix Message-ID: <20120806153149.F1FDD3F9F56@mail.nginx.com> Author: mdounin Date: 2012-08-06 15:31:49 +0000 (Mon, 06 Aug 2012) New Revision: 4789 URL: http://trac.nginx.org/nginx/changeset/4789/nginx Log: Merge of r4738: struct flock initialization. Made sure to initialize the entire "struct flock" allocated on stack. Modified: branches/stable-1.2/ branches/stable-1.2/src/os/unix/ngx_files.c Index: branches/stable-1.2 =================================================================== --- branches/stable-1.2 2012-08-06 15:20:03 UTC (rev 4788) +++ branches/stable-1.2 2012-08-06 15:31:49 UTC (rev 4789) Property changes on: branches/stable-1.2 ___________________________________________________________________ Modified: svn:mergeinfo ## -1 +1 ## -/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4737 +/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738 \ No newline at end of property Modified: branches/stable-1.2/src/os/unix/ngx_files.c =================================================================== --- branches/stable-1.2/src/os/unix/ngx_files.c 2012-08-06 15:20:03 UTC (rev 4788) +++ branches/stable-1.2/src/os/unix/ngx_files.c 2012-08-06 15:31:49 UTC (rev 4789) @@ -413,9 +413,7 @@ { struct flock fl; - fl.l_start = 0; - fl.l_len = 0; - fl.l_pid = 0; + ngx_memzero(&fl, sizeof(struct flock)); fl.l_type = F_WRLCK; fl.l_whence = SEEK_SET; @@ -432,9 +430,7 @@ { struct flock fl; - fl.l_start = 0; - fl.l_len = 0; - fl.l_pid = 0; + ngx_memzero(&fl, sizeof(struct flock)); fl.l_type = F_WRLCK; fl.l_whence = SEEK_SET; @@ -451,9 +447,7 @@ { struct flock fl; - fl.l_start = 0; - fl.l_len = 0; - fl.l_pid = 0; + ngx_memzero(&fl, sizeof(struct flock)); fl.l_type = F_UNLCK; fl.l_whence = SEEK_SET; From ywu at about.com Mon Aug 6 15:45:35 2012 From: ywu at about.com (YongFeng Wu) Date: Mon, 6 Aug 2012 11:45:35 -0400 Subject: hanging on ngx_free(file->name) in function ngx_close_cached_file() Message-ID: <000901cd73ea$8541b5b0$8fc52110$@com> Hi All, It's not often, but sometimes an worker process can hang on the "ngx_free(file->name)" in function ngx_close_cached_file(). Following is part of GDB backtrace: (gdb) bt #0 0x0000000800f5e7b9 in _pthread_mutex_init_calloc_cb () from /lib/libc.so.7 #1 0x0000000800f62f4d in free () from /lib/libc.so.7 #2 0x0000000000423537 in ngx_close_cached_file (cache=0x8012495f8, file=0x8090f1700, min_uses=0, log=0x8031bc160) at src/core/ngx_open_file_cache.c:1021 #3 0x000000000042383e in ngx_expire_old_cached_files (cache=0x8012495f8, n=2, log=0x8031bc160) at src/core/ngx_open_file_cache.c:1090 #4 0x000000000042392b in ngx_open_file_cleanup (data=0x80527eee8) at src/core/ngx_open_file_cache.c:973 #5 0x00000000004082ad in ngx_destroy_pool (pool=0x8032b9000) at src/core/ngx_palloc.c:54 #6 0x00000000004512eb in ngx_http_free_request (r=0x801206000, rc=0) at src/http/ngx_http_request.c:3196 .. The memory for file->name is perfect and not corrupted. We are running on FreeBSD 7.4. Anybody had the same problem or know anything about it? Thank you very much Yong -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Mon Aug 6 15:45:44 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 6 Aug 2012 15:45:44 +0000 Subject: [nginx] svn commit: r4790 - in branches/stable-1.2: . src/http Message-ID: <20120806154544.F2CEB3F9F9F@mail.nginx.com> Author: mdounin Date: 2012-08-06 15:45:44 +0000 (Mon, 06 Aug 2012) New Revision: 4790 URL: http://trac.nginx.org/nginx/changeset/4790/nginx Log: Merge of r4740: fixed $request_length for pipelined requests. Modified: branches/stable-1.2/ branches/stable-1.2/src/http/ngx_http_request.c Index: branches/stable-1.2 =================================================================== --- branches/stable-1.2 2012-08-06 15:31:49 UTC (rev 4789) +++ branches/stable-1.2 2012-08-06 15:45:44 UTC (rev 4790) Property changes on: branches/stable-1.2 ___________________________________________________________________ Modified: svn:mergeinfo ## -1 +1 ## -/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738 +/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740 \ No newline at end of property Modified: branches/stable-1.2/src/http/ngx_http_request.c =================================================================== --- branches/stable-1.2/src/http/ngx_http_request.c 2012-08-06 15:31:49 UTC (rev 4789) +++ branches/stable-1.2/src/http/ngx_http_request.c 2012-08-06 15:45:44 UTC (rev 4790) @@ -747,6 +747,7 @@ r->request_line.len = r->request_end - r->request_start; r->request_line.data = r->request_start; + r->request_length = r->header_in->pos - r->request_start; if (r->args_start) { @@ -1056,6 +1057,8 @@ if (rc == NGX_OK) { + r->request_length += r->header_in->pos - r->header_name_start; + if (r->invalid_header && cscf->ignore_invalid_headers) { /* there was error while a header line parsing */ @@ -1119,7 +1122,7 @@ ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "http header done"); - r->request_length += r->header_in->pos - r->header_in->start; + r->request_length += r->header_in->pos - r->header_name_start; r->http_state = NGX_HTTP_PROCESS_REQUEST_STATE; @@ -1226,8 +1229,6 @@ /* the client fills up the buffer with "\r\n" */ - r->request_length += r->header_in->end - r->header_in->start; - r->header_in->pos = r->header_in->start; r->header_in->last = r->header_in->start; @@ -1287,8 +1288,6 @@ * to relocate the parser header pointers */ - r->request_length += r->header_in->end - r->header_in->start; - r->header_in = b; return NGX_OK; @@ -1297,8 +1296,6 @@ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "http large header copy: %d", r->header_in->pos - old); - r->request_length += old - r->header_in->start; - new = b->start; ngx_memcpy(new, old, r->header_in->pos - old); From mdounin at mdounin.ru Mon Aug 6 15:47:16 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 6 Aug 2012 15:47:16 +0000 Subject: [nginx] svn commit: r4791 - in branches/stable-1.2: . auto auto/lib/libatomic auto/lib/perl Message-ID: <20120806154716.BF4B93F9E2A@mail.nginx.com> Author: mdounin Date: 2012-08-06 15:47:15 +0000 (Mon, 06 Aug 2012) New Revision: 4791 URL: http://trac.nginx.org/nginx/changeset/4791/nginx Log: Merge of r4741: fixed "make" used instead of "${MAKE}". Modified: branches/stable-1.2/ branches/stable-1.2/auto/install branches/stable-1.2/auto/lib/libatomic/make branches/stable-1.2/auto/lib/perl/make Index: branches/stable-1.2 =================================================================== --- branches/stable-1.2 2012-08-06 15:45:44 UTC (rev 4790) +++ branches/stable-1.2 2012-08-06 15:47:15 UTC (rev 4791) Property changes on: branches/stable-1.2 ___________________________________________________________________ Modified: svn:mergeinfo ## -1 +1 ## -/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740 +/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741 \ No newline at end of property Modified: branches/stable-1.2/auto/install =================================================================== --- branches/stable-1.2/auto/install 2012-08-06 15:45:44 UTC (rev 4790) +++ branches/stable-1.2/auto/install 2012-08-06 15:47:15 UTC (rev 4791) @@ -8,7 +8,7 @@ cat << END >> $NGX_MAKEFILE install_perl_modules: - cd $NGX_OBJS/src/http/modules/perl && make install + cd $NGX_OBJS/src/http/modules/perl && \${MAKE} install END NGX_INSTALL_PERL_MODULES=install_perl_modules Modified: branches/stable-1.2/auto/lib/libatomic/make =================================================================== --- branches/stable-1.2/auto/lib/libatomic/make 2012-08-06 15:45:44 UTC (rev 4790) +++ branches/stable-1.2/auto/lib/libatomic/make 2012-08-06 15:47:15 UTC (rev 4791) @@ -6,7 +6,7 @@ cat << END >> $NGX_MAKEFILE $NGX_LIBATOMIC/src/libatomic_ops.a: $NGX_LIBATOMIC/Makefile - cd $NGX_LIBATOMIC && make + cd $NGX_LIBATOMIC && \${MAKE} $NGX_LIBATOMIC/Makefile: $NGX_MAKEFILE cd $NGX_LIBATOMIC && ./configure Modified: branches/stable-1.2/auto/lib/perl/make =================================================================== --- branches/stable-1.2/auto/lib/perl/make 2012-08-06 15:45:44 UTC (rev 4790) +++ branches/stable-1.2/auto/lib/perl/make 2012-08-06 15:47:15 UTC (rev 4791) @@ -12,7 +12,7 @@ $NGX_OBJS/src/http/modules/perl/Makefile cp -p src/http/modules/perl/nginx.* $NGX_OBJS/src/http/modules/perl/ - cd $NGX_OBJS/src/http/modules/perl && make + cd $NGX_OBJS/src/http/modules/perl && \${MAKE} rm -rf $NGX_OBJS/install_perl From mdounin at mdounin.ru Mon Aug 6 15:52:02 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 6 Aug 2012 15:52:02 +0000 Subject: [nginx] svn commit: r4792 - in branches/stable-1.2: . docs/text Message-ID: <20120806155202.CE2E23F9EB7@mail.nginx.com> Author: mdounin Date: 2012-08-06 15:52:02 +0000 (Mon, 06 Aug 2012) New Revision: 4792 URL: http://trac.nginx.org/nginx/changeset/4792/nginx Log: Merge of r4754: synchronized the license text. Synchronized the license text with the FreeBSD's bsd-style-copyright. Modified: branches/stable-1.2/ branches/stable-1.2/docs/text/LICENSE Index: branches/stable-1.2 =================================================================== --- branches/stable-1.2 2012-08-06 15:47:15 UTC (rev 4791) +++ branches/stable-1.2 2012-08-06 15:52:02 UTC (rev 4792) Property changes on: branches/stable-1.2 ___________________________________________________________________ Modified: svn:mergeinfo ## -1 +1 ## -/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741 +/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754 \ No newline at end of property Modified: branches/stable-1.2/docs/text/LICENSE =================================================================== --- branches/stable-1.2/docs/text/LICENSE 2012-08-06 15:47:15 UTC (rev 4791) +++ branches/stable-1.2/docs/text/LICENSE 2012-08-06 15:52:02 UTC (rev 4792) @@ -1,6 +1,7 @@ /* * Copyright (C) 2002-2012 Igor Sysoev * Copyright (C) 2011,2012 Nginx, Inc. + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -11,10 +12,10 @@ * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) From mdounin at mdounin.ru Mon Aug 6 16:03:57 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 6 Aug 2012 16:03:57 +0000 Subject: [nginx] svn commit: r4793 - in branches/stable-1.2: . src/http Message-ID: <20120806160357.9BF7C3F9F75@mail.nginx.com> Author: mdounin Date: 2012-08-06 16:03:56 +0000 (Mon, 06 Aug 2012) New Revision: 4793 URL: http://trac.nginx.org/nginx/changeset/4793/nginx Log: Merge of r4756: fixed listen addresses sorting (ticket #187) Fixed sorting of listen addresses so that wildcard address is always at the end. Failure to do so could result in several listen sockets to be created instead of only one listening on wildcard address. Reported by Roman Odaisky. Modified: branches/stable-1.2/ branches/stable-1.2/src/http/ngx_http.c Index: branches/stable-1.2 =================================================================== --- branches/stable-1.2 2012-08-06 15:52:02 UTC (rev 4792) +++ branches/stable-1.2 2012-08-06 16:03:56 UTC (rev 4793) Property changes on: branches/stable-1.2 ___________________________________________________________________ Modified: svn:mergeinfo ## -1 +1 ## -/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754 +/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754,4756 \ No newline at end of property Modified: branches/stable-1.2/src/http/ngx_http.c =================================================================== --- branches/stable-1.2/src/http/ngx_http.c 2012-08-06 15:52:02 UTC (rev 4792) +++ branches/stable-1.2/src/http/ngx_http.c 2012-08-06 16:03:56 UTC (rev 4793) @@ -1613,6 +1613,11 @@ return 1; } + if (second->opt.wildcard) { + /* a wildcard address must be the last resort, shift it to the end */ + return -1; + } + if (first->opt.bind && !second->opt.bind) { /* shift explicit bind()ed addresses to the start */ return -1; From mdounin at mdounin.ru Mon Aug 6 16:06:36 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 6 Aug 2012 16:06:36 +0000 Subject: [nginx] svn commit: r4794 - in branches/stable-1.2/src: core http/modules/perl Message-ID: <20120806160636.B01E83F9C5F@mail.nginx.com> Author: mdounin Date: 2012-08-06 16:06:36 +0000 (Mon, 06 Aug 2012) New Revision: 4794 URL: http://trac.nginx.org/nginx/changeset/4794/nginx Log: Version bump. Modified: branches/stable-1.2/src/core/nginx.h branches/stable-1.2/src/http/modules/perl/nginx.pm Modified: branches/stable-1.2/src/core/nginx.h =================================================================== --- branches/stable-1.2/src/core/nginx.h 2012-08-06 16:03:56 UTC (rev 4793) +++ branches/stable-1.2/src/core/nginx.h 2012-08-06 16:06:36 UTC (rev 4794) @@ -9,8 +9,8 @@ #define _NGINX_H_INCLUDED_ -#define nginx_version 1002002 -#define NGINX_VERSION "1.2.2" +#define nginx_version 1002003 +#define NGINX_VERSION "1.2.3" #define NGINX_VER "nginx/" NGINX_VERSION #define NGINX_VAR "NGINX" Modified: branches/stable-1.2/src/http/modules/perl/nginx.pm =================================================================== --- branches/stable-1.2/src/http/modules/perl/nginx.pm 2012-08-06 16:03:56 UTC (rev 4793) +++ branches/stable-1.2/src/http/modules/perl/nginx.pm 2012-08-06 16:06:36 UTC (rev 4794) @@ -50,7 +50,7 @@ HTTP_INSUFFICIENT_STORAGE ); -our $VERSION = '1.2.2'; +our $VERSION = '1.2.3'; require XSLoader; XSLoader::load('nginx', $VERSION); From defan at nginx.com Mon Aug 6 16:07:00 2012 From: defan at nginx.com (defan at nginx.com) Date: Mon, 6 Aug 2012 16:07:00 +0000 Subject: [nginx] svn commit: r4795 - trunk/src/os/unix Message-ID: <20120806160700.A3B9B3F9F9F@mail.nginx.com> Author: defan Date: 2012-08-06 16:06:59 +0000 (Mon, 06 Aug 2012) New Revision: 4795 URL: http://trac.nginx.org/nginx/changeset/4795/nginx Log: Explicitly ignore returned value from unlink() in ngx_open_tempfile(). The only thing we could potentially do here in case of error returned is to complain to error log, but we don't have log structure available here due to interface limitations. Prodded by Coverity. Modified: trunk/src/os/unix/ngx_files.c Modified: trunk/src/os/unix/ngx_files.c =================================================================== --- trunk/src/os/unix/ngx_files.c 2012-08-06 16:06:36 UTC (rev 4794) +++ trunk/src/os/unix/ngx_files.c 2012-08-06 16:06:59 UTC (rev 4795) @@ -139,7 +139,7 @@ access ? access : 0600); if (fd != -1 && !persistent) { - unlink((const char *) name); + (void) unlink((const char *) name); } return fd; From mdounin at mdounin.ru Mon Aug 6 16:19:36 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 6 Aug 2012 16:19:36 +0000 Subject: [nginx] svn commit: r4796 - in branches/stable-1.2: . src/http/modules Message-ID: <20120806161936.666073F9F3A@mail.nginx.com> Author: mdounin Date: 2012-08-06 16:19:35 +0000 (Mon, 06 Aug 2012) New Revision: 4796 URL: http://trac.nginx.org/nginx/changeset/4796/nginx Log: Merge of r4757: debugging messages in limit_conn. Fixed debugging messages to account that limit_zone was renamed to limit_conn. Modified: branches/stable-1.2/ branches/stable-1.2/src/http/modules/ngx_http_limit_conn_module.c Index: branches/stable-1.2 =================================================================== --- branches/stable-1.2 2012-08-06 16:06:59 UTC (rev 4795) +++ branches/stable-1.2 2012-08-06 16:19:35 UTC (rev 4796) Property changes on: branches/stable-1.2 ___________________________________________________________________ Modified: svn:mergeinfo ## -1 +1 ## -/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754,4756 +/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754,4756-4757 \ No newline at end of property Modified: branches/stable-1.2/src/http/modules/ngx_http_limit_conn_module.c =================================================================== --- branches/stable-1.2/src/http/modules/ngx_http_limit_conn_module.c 2012-08-06 16:06:59 UTC (rev 4795) +++ branches/stable-1.2/src/http/modules/ngx_http_limit_conn_module.c 2012-08-06 16:19:35 UTC (rev 4796) @@ -238,7 +238,7 @@ } ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "limit zone: %08XD %d", node->key, lc->conn); + "limit conn: %08XD %d", node->key, lc->conn); ngx_shmtx_unlock(&shpool->mutex); @@ -358,7 +358,7 @@ ngx_shmtx_lock(&shpool->mutex); ngx_log_debug2(NGX_LOG_DEBUG_HTTP, lccln->shm_zone->shm.log, 0, - "limit zone cleanup: %08XD %d", node->key, lc->conn); + "limit conn cleanup: %08XD %d", node->key, lc->conn); lc->conn--; From mdounin at mdounin.ru Mon Aug 6 16:24:23 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 6 Aug 2012 16:24:23 +0000 Subject: [nginx] svn commit: r4797 - in branches/stable-1.2: . src/os/win32 Message-ID: <20120806162423.1B20B3F9F22@mail.nginx.com> Author: mdounin Date: 2012-08-06 16:24:22 +0000 (Mon, 06 Aug 2012) New Revision: 4797 URL: http://trac.nginx.org/nginx/changeset/4797/nginx Log: Merge of r4758: win32: fixed cpu hog after process startup failure. If ngx_spawn_process() failed while starting a process, the handle of a handle of a processes was closed but left non-NULL in the ngx_processes[] array. The handle later was used in WaitForMultipleObjects() (if there were multiple worker processes configured and at least one worker process was started successfully), resulting in infinite loop. Reported by Ricardo Villalobos Guevara: http://mailman.nginx.org/pipermail/nginx-devel/2012-July/002494.html Modified: branches/stable-1.2/ branches/stable-1.2/src/os/win32/ngx_process.c Index: branches/stable-1.2 =================================================================== --- branches/stable-1.2 2012-08-06 16:19:35 UTC (rev 4796) +++ branches/stable-1.2 2012-08-06 16:24:22 UTC (rev 4797) Property changes on: branches/stable-1.2 ___________________________________________________________________ Modified: svn:mergeinfo ## -1 +1 ## -/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754,4756-4757 +/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754,4756-4758 \ No newline at end of property Modified: branches/stable-1.2/src/os/win32/ngx_process.c =================================================================== --- branches/stable-1.2/src/os/win32/ngx_process.c 2012-08-06 16:19:35 UTC (rev 4796) +++ branches/stable-1.2/src/os/win32/ngx_process.c 2012-08-06 16:24:22 UTC (rev 4797) @@ -196,6 +196,7 @@ if (ngx_processes[s].handle) { ngx_close_handle(ngx_processes[s].handle); + ngx_processes[s].handle = NULL; } return NGX_INVALID_PID; From mdounin at mdounin.ru Mon Aug 6 17:03:01 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 6 Aug 2012 17:03:01 +0000 Subject: [nginx] svn commit: r4798 - in branches/stable-1.2: . auto auto/cc Message-ID: <20120806170301.7D3883F9F75@mail.nginx.com> Author: mdounin Date: 2012-08-06 17:03:01 +0000 (Mon, 06 Aug 2012) New Revision: 4798 URL: http://trac.nginx.org/nginx/changeset/4798/nginx Log: Merge of r4759, r4762, r4768: configure minor fixes. *) Replaced a number of "else if" with "elif". *) Made sure to run configure in a "C" locale. Otherwise, we may fail to properly detect a version of compiler. *) Removed extraneous GCC warning flags. Modified: branches/stable-1.2/ branches/stable-1.2/auto/cc/gcc branches/stable-1.2/auto/cc/name branches/stable-1.2/auto/configure Index: branches/stable-1.2 =================================================================== --- branches/stable-1.2 2012-08-06 16:24:22 UTC (rev 4797) +++ branches/stable-1.2 2012-08-06 17:03:01 UTC (rev 4798) Property changes on: branches/stable-1.2 ___________________________________________________________________ Modified: svn:mergeinfo ## -1 +1 ## -/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754,4756-4758 +/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754,4756-4759,4762,4768 \ No newline at end of property Modified: branches/stable-1.2/auto/cc/gcc =================================================================== --- branches/stable-1.2/auto/cc/gcc 2012-08-06 16:24:22 UTC (rev 4797) +++ branches/stable-1.2/auto/cc/gcc 2012-08-06 17:03:01 UTC (rev 4798) @@ -155,9 +155,6 @@ 3.* | 4.* ) # we have a lot of the unused function arguments CFLAGS="$CFLAGS -Wno-unused-parameter" - CFLAGS="$CFLAGS -Wunused-function" - CFLAGS="$CFLAGS -Wunused-variable" - CFLAGS="$CFLAGS -Wunused-value" # 4.2.1 shows the warning in wrong places #CFLAGS="$CFLAGS -Wunreachable-code" ;; Modified: branches/stable-1.2/auto/cc/name =================================================================== --- branches/stable-1.2/auto/cc/name 2012-08-06 16:24:22 UTC (rev 4797) +++ branches/stable-1.2/auto/cc/name 2012-08-06 17:03:01 UTC (rev 4798) @@ -32,14 +32,14 @@ NGX_CC_NAME=msvc10 echo " + using Microsoft Visual C++ 10 compiler" - else if `$NGX_WINE $CC -v 2>&1 \ + elif `$NGX_WINE $CC -v 2>&1 \ | grep '^Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14' \ >/dev/null 2>&1`; then NGX_CC_NAME=msvc8 echo " + using Microsoft Visual C++ 8 compiler" - else if `$NGX_WINE $CC -v 2>&1 \ + elif `$NGX_WINE $CC -v 2>&1 \ | grep '^Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13' \ >/dev/null 2>&1`; then @@ -50,52 +50,36 @@ NGX_CC_NAME=msvc echo " + using Microsoft Visual C++ compiler" fi - fi - fi -else -if [ "$CC" = wcl386 ]; then +elif [ "$CC" = wcl386 ]; then NGX_CC_NAME=owc echo " + using Open Watcom C compiler" -else -if [ "$CC" = bcc32 ]; then +elif [ "$CC" = bcc32 ]; then NGX_CC_NAME=bcc echo " + using Borland C++ compiler" -else -if `$CC -V 2>&1 | grep '^Intel(R) C' >/dev/null 2>&1`; then +elif `$CC -V 2>&1 | grep '^Intel(R) C' >/dev/null 2>&1`; then NGX_CC_NAME=icc echo " + using Intel C++ compiler" -else -if `$CC -v 2>&1 | grep 'gcc version' >/dev/null 2>&1`; then +elif `$CC -v 2>&1 | grep 'gcc version' >/dev/null 2>&1`; then NGX_CC_NAME=gcc echo " + using GNU C compiler" -else -if `$CC -V 2>&1 | grep 'Sun C' >/dev/null 2>&1`; then +elif `$CC -V 2>&1 | grep 'Sun C' >/dev/null 2>&1`; then NGX_CC_NAME=sunc echo " + using Sun C compiler" -else -if `$CC -V 2>&1 | grep '^Compaq C' >/dev/null 2>&1`; then +elif `$CC -V 2>&1 | grep '^Compaq C' >/dev/null 2>&1`; then NGX_CC_NAME=ccc echo " + using Compaq C compiler" -else -if `$CC -V 2>&1 | grep '^aCC: ' >/dev/null 2>&1`; then +elif `$CC -V 2>&1 | grep '^aCC: ' >/dev/null 2>&1`; then NGX_CC_NAME=acc echo " + using HP aC++ compiler" else NGX_CC_NAME=unknown -fi # acc -fi # ccc -fi # sunc -fi # icc -fi # gcc -fi # bcc -fi # owc -fi # msvc +fi Modified: branches/stable-1.2/auto/configure =================================================================== --- branches/stable-1.2/auto/configure 2012-08-06 16:24:22 UTC (rev 4797) +++ branches/stable-1.2/auto/configure 2012-08-06 17:03:01 UTC (rev 4798) @@ -4,6 +4,9 @@ # Copyright (C) Nginx, Inc. +LC_ALL=C +export LC_ALL + . auto/options . auto/init . auto/sources From mdounin at mdounin.ru Mon Aug 6 17:07:28 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 6 Aug 2012 17:07:28 +0000 Subject: [nginx] svn commit: r4799 - in branches/stable-1.2: . auto/cc src/core src/event src/event/modules src/http src/http/modules src/mail src/misc src/os/unix Message-ID: <20120806170728.C6ACC3F9EB7@mail.nginx.com> Author: mdounin Date: 2012-08-06 17:07:28 +0000 (Mon, 06 Aug 2012) New Revision: 4799 URL: http://trac.nginx.org/nginx/changeset/4799/nginx Log: Merge of r4760, r4761: -Wmissing-prototypes. Fixed compilation with -Wmissing-prototypes. Added a commented out -Wmissing-prototypes to CFLAGS. It is commented out to not break builds with 3rd party modules. Modified: branches/stable-1.2/ branches/stable-1.2/auto/cc/gcc branches/stable-1.2/src/core/ngx_conf_file.c branches/stable-1.2/src/core/ngx_crypt.c branches/stable-1.2/src/event/modules/ngx_epoll_module.c branches/stable-1.2/src/event/modules/ngx_eventport_module.c branches/stable-1.2/src/event/modules/ngx_rtsig_module.c branches/stable-1.2/src/event/ngx_event.c branches/stable-1.2/src/http/modules/ngx_http_log_module.c branches/stable-1.2/src/http/modules/ngx_http_upstream_least_conn_module.c branches/stable-1.2/src/http/ngx_http_parse_time.c branches/stable-1.2/src/mail/ngx_mail_parse.c branches/stable-1.2/src/misc/ngx_cpp_test_module.cpp branches/stable-1.2/src/os/unix/ngx_atomic.h branches/stable-1.2/src/os/unix/ngx_posix_init.c branches/stable-1.2/src/os/unix/ngx_solaris_sendfilev_chain.c Index: branches/stable-1.2 =================================================================== --- branches/stable-1.2 2012-08-06 17:03:01 UTC (rev 4798) +++ branches/stable-1.2 2012-08-06 17:07:28 UTC (rev 4799) Property changes on: branches/stable-1.2 ___________________________________________________________________ Modified: svn:mergeinfo ## -1 +1 ## -/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754,4756-4759,4762,4768 +/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754,4756-4762,4768 \ No newline at end of property Modified: branches/stable-1.2/auto/cc/gcc =================================================================== --- branches/stable-1.2/auto/cc/gcc 2012-08-06 17:03:01 UTC (rev 4798) +++ branches/stable-1.2/auto/cc/gcc 2012-08-06 17:07:28 UTC (rev 4799) @@ -149,6 +149,7 @@ CFLAGS="$CFLAGS -Wall -Wpointer-arith" #CFLAGS="$CFLAGS -Wconversion" #CFLAGS="$CFLAGS -Winline" +#CFLAGS="$CFLAGS -Wmissing-prototypes" case "$NGX_GCC_VER" in Modified: branches/stable-1.2/src/core/ngx_conf_file.c =================================================================== --- branches/stable-1.2/src/core/ngx_conf_file.c 2012-08-06 17:03:01 UTC (rev 4798) +++ branches/stable-1.2/src/core/ngx_conf_file.c 2012-08-06 17:07:28 UTC (rev 4799) @@ -1448,13 +1448,17 @@ } +#if 0 + char * ngx_conf_unsupported(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) { return "unsupported on this platform"; } +#endif + char * ngx_conf_deprecated(ngx_conf_t *cf, void *post, void *data) { Modified: branches/stable-1.2/src/core/ngx_crypt.c =================================================================== --- branches/stable-1.2/src/core/ngx_crypt.c 2012-08-06 17:03:01 UTC (rev 4798) +++ branches/stable-1.2/src/core/ngx_crypt.c 2012-08-06 17:07:28 UTC (rev 4799) @@ -6,6 +6,7 @@ #include #include +#include #include #if (NGX_HAVE_SHA1) #include Modified: branches/stable-1.2/src/event/modules/ngx_epoll_module.c =================================================================== --- branches/stable-1.2/src/event/modules/ngx_epoll_module.c 2012-08-06 17:03:01 UTC (rev 4798) +++ branches/stable-1.2/src/event/modules/ngx_epoll_module.c 2012-08-06 17:07:28 UTC (rev 4799) @@ -44,16 +44,25 @@ epoll_data_t data; }; + +int epoll_create(int size); + int epoll_create(int size) { return -1; } + +int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event); + int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event) { return -1; } + +int epoll_wait(int epfd, struct epoll_event *events, int nevents, int timeout); + int epoll_wait(int epfd, struct epoll_event *events, int nevents, int timeout) { return -1; @@ -76,11 +85,6 @@ }; -int eventfd(u_int initval) -{ - return -1; -} - #endif #endif Modified: branches/stable-1.2/src/event/modules/ngx_eventport_module.c =================================================================== --- branches/stable-1.2/src/event/modules/ngx_eventport_module.c 2012-08-06 17:03:01 UTC (rev 4798) +++ branches/stable-1.2/src/event/modules/ngx_eventport_module.c 2012-08-06 17:07:28 UTC (rev 4799) @@ -15,6 +15,12 @@ #define ushort_t u_short #define uint_t u_int +#ifndef CLOCK_REALTIME +#define CLOCK_REALTIME 0 +typedef int clockid_t; +typedef void * timer_t; +#endif + /* Solaris declarations */ #define PORT_SOURCE_AIO 1 @@ -24,7 +30,9 @@ #define PORT_SOURCE_ALERT 5 #define PORT_SOURCE_MQ 6 +#ifndef ETIME #define ETIME 64 +#endif #define SIGEV_PORT 4 @@ -50,39 +58,62 @@ #endif +int port_create(void); + int port_create(void) { return -1; } + int port_associate(int port, int source, uintptr_t object, int events, + void *user); + +int port_associate(int port, int source, uintptr_t object, int events, void *user) { return -1; } + +int port_dissociate(int port, int source, uintptr_t object); + int port_dissociate(int port, int source, uintptr_t object) { return -1; } + int port_getn(int port, port_event_t list[], uint_t max, uint_t *nget, + struct timespec *timeout); + +int port_getn(int port, port_event_t list[], uint_t max, uint_t *nget, struct timespec *timeout) { return -1; } + +int timer_create(clockid_t clock_id, struct sigevent *evp, timer_t *timerid); + int timer_create(clockid_t clock_id, struct sigevent *evp, timer_t *timerid) { return -1; } + int timer_settime(timer_t timerid, int flags, const struct itimerspec *value, + struct itimerspec *ovalue); + +int timer_settime(timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue) { return -1; } + +int timer_delete(timer_t timerid); + int timer_delete(timer_t timerid) { return -1; Modified: branches/stable-1.2/src/event/modules/ngx_rtsig_module.c =================================================================== --- branches/stable-1.2/src/event/modules/ngx_rtsig_module.c 2012-08-06 17:03:01 UTC (rev 4798) +++ branches/stable-1.2/src/event/modules/ngx_rtsig_module.c 2012-08-06 17:07:28 UTC (rev 4799) @@ -12,6 +12,13 @@ #if (NGX_TEST_BUILD_RTSIG) +#if (NGX_DARWIN) + +#define SIGRTMIN 33 +#define si_fd __pad[0] + +#else + #ifdef SIGRTMIN #define si_fd _reason.__spare__.__spare2__[0] #else @@ -19,11 +26,16 @@ #define si_fd __spare__[0] #endif +#endif + #define F_SETSIG 10 #define KERN_RTSIGNR 30 #define KERN_RTSIGMAX 31 int sigtimedwait(const sigset_t *set, siginfo_t *info, + const struct timespec *timeout); + +int sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *timeout) { return -1; Modified: branches/stable-1.2/src/event/ngx_event.c =================================================================== --- branches/stable-1.2/src/event/ngx_event.c 2012-08-06 17:03:01 UTC (rev 4798) +++ branches/stable-1.2/src/event/ngx_event.c 2012-08-06 17:07:28 UTC (rev 4799) @@ -567,7 +567,7 @@ #if !(NGX_WIN32) -void +static void ngx_timer_signal_handler(int signo) { ngx_event_timer_alarm = 1; Modified: branches/stable-1.2/src/http/modules/ngx_http_log_module.c =================================================================== --- branches/stable-1.2/src/http/modules/ngx_http_log_module.c 2012-08-06 17:03:01 UTC (rev 4798) +++ branches/stable-1.2/src/http/modules/ngx_http_log_module.c 2012-08-06 17:07:28 UTC (rev 4799) @@ -218,7 +218,7 @@ }; -ngx_int_t +static ngx_int_t ngx_http_log_handler(ngx_http_request_t *r) { u_char *line, *p; Modified: branches/stable-1.2/src/http/modules/ngx_http_upstream_least_conn_module.c =================================================================== --- branches/stable-1.2/src/http/modules/ngx_http_upstream_least_conn_module.c 2012-08-06 17:03:01 UTC (rev 4798) +++ branches/stable-1.2/src/http/modules/ngx_http_upstream_least_conn_module.c 2012-08-06 17:07:28 UTC (rev 4799) @@ -81,7 +81,7 @@ }; -ngx_int_t +static ngx_int_t ngx_http_upstream_init_least_conn(ngx_conf_t *cf, ngx_http_upstream_srv_conf_t *us) { Modified: branches/stable-1.2/src/http/ngx_http_parse_time.c =================================================================== --- branches/stable-1.2/src/http/ngx_http_parse_time.c 2012-08-06 17:03:01 UTC (rev 4798) +++ branches/stable-1.2/src/http/ngx_http_parse_time.c 2012-08-06 17:07:28 UTC (rev 4799) @@ -7,6 +7,7 @@ #include #include +#include static ngx_uint_t mday[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; Modified: branches/stable-1.2/src/mail/ngx_mail_parse.c =================================================================== --- branches/stable-1.2/src/mail/ngx_mail_parse.c 2012-08-06 17:03:01 UTC (rev 4798) +++ branches/stable-1.2/src/mail/ngx_mail_parse.c 2012-08-06 17:07:28 UTC (rev 4799) @@ -9,6 +9,9 @@ #include #include #include +#include +#include +#include ngx_int_t Modified: branches/stable-1.2/src/misc/ngx_cpp_test_module.cpp =================================================================== --- branches/stable-1.2/src/misc/ngx_cpp_test_module.cpp 2012-08-06 17:03:01 UTC (rev 4798) +++ branches/stable-1.2/src/misc/ngx_cpp_test_module.cpp 2012-08-06 17:07:28 UTC (rev 4799) @@ -20,6 +20,8 @@ // #include +void ngx_cpp_test_handler(void *data); + void ngx_cpp_test_handler(void *data) { Modified: branches/stable-1.2/src/os/unix/ngx_atomic.h =================================================================== --- branches/stable-1.2/src/os/unix/ngx_atomic.h 2012-08-06 17:03:01 UTC (rev 4798) +++ branches/stable-1.2/src/os/unix/ngx_atomic.h 2012-08-06 17:07:28 UTC (rev 4799) @@ -48,7 +48,9 @@ #include /* "bool" conflicts with perl's CORE/handy.h */ +#if 0 #undef bool +#endif #define NGX_HAVE_ATOMIC_OPS 1 Modified: branches/stable-1.2/src/os/unix/ngx_posix_init.c =================================================================== --- branches/stable-1.2/src/os/unix/ngx_posix_init.c 2012-08-06 17:03:01 UTC (rev 4798) +++ branches/stable-1.2/src/os/unix/ngx_posix_init.c 2012-08-06 17:07:28 UTC (rev 4799) @@ -98,6 +98,8 @@ } +#if 0 + ngx_int_t ngx_posix_post_conf_init(ngx_log_t *log) { @@ -122,3 +124,5 @@ return NGX_OK; } + +#endif Modified: branches/stable-1.2/src/os/unix/ngx_solaris_sendfilev_chain.c =================================================================== --- branches/stable-1.2/src/os/unix/ngx_solaris_sendfilev_chain.c 2012-08-06 17:03:01 UTC (rev 4798) +++ branches/stable-1.2/src/os/unix/ngx_solaris_sendfilev_chain.c 2012-08-06 17:07:28 UTC (rev 4799) @@ -29,6 +29,9 @@ return -1; } +ngx_chain_t *ngx_solaris_sendfilev_chain(ngx_connection_t *c, ngx_chain_t *in, + off_t limit); + #endif From mdounin at mdounin.ru Mon Aug 6 17:10:35 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 6 Aug 2012 17:10:35 +0000 Subject: [nginx] svn commit: r4800 - in branches/stable-1.2: . auto/cc Message-ID: <20120806171035.E1DA03F9F22@mail.nginx.com> Author: mdounin Date: 2012-08-06 17:10:35 +0000 (Mon, 06 Aug 2012) New Revision: 4800 URL: http://trac.nginx.org/nginx/changeset/4800/nginx Log: Merge of r4763: added the Clang compiler support. The -Werror is commented out to not break builds on Linux. Added: branches/stable-1.2/auto/cc/clang Modified: branches/stable-1.2/ branches/stable-1.2/auto/cc/conf branches/stable-1.2/auto/cc/name Index: branches/stable-1.2 =================================================================== --- branches/stable-1.2 2012-08-06 17:07:28 UTC (rev 4799) +++ branches/stable-1.2 2012-08-06 17:10:35 UTC (rev 4800) Property changes on: branches/stable-1.2 ___________________________________________________________________ Modified: svn:mergeinfo ## -1 +1 ## -/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754,4756-4762,4768 +/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754,4756-4763,4768 \ No newline at end of property Copied: branches/stable-1.2/auto/cc/clang (from rev 4763, trunk/auto/cc/clang) =================================================================== --- branches/stable-1.2/auto/cc/clang (rev 0) +++ branches/stable-1.2/auto/cc/clang 2012-08-06 17:10:35 UTC (rev 4800) @@ -0,0 +1,98 @@ + +# Copyright (C) Nginx, Inc. + + +# clang + + +NGX_CLANG_VER=`$CC -v 2>&1 | grep 'clang version' 2>&1 \ + | sed -e 's/^.*clang version \(.*\)/\1/'` + +echo " + clang version: $NGX_CLANG_VER" + +have=NGX_COMPILER value="\"clang $NGX_CLANG_VER\"" . auto/define + + +CC_TEST_FLAGS="-pipe" + + +# optimizations + +#NGX_CLANG_OPT="-O2" +#NGX_CLANG_OPT="-Oz" +NGX_CLANG_OPT="-O" + +case $CPU in + pentium) + # optimize for Pentium + CPU_OPT="-march=pentium" + NGX_CPU_CACHE_LINE=32 + ;; + + pentiumpro | pentium3) + # optimize for Pentium Pro, Pentium II and Pentium III + CPU_OPT="-march=pentiumpro" + NGX_CPU_CACHE_LINE=32 + ;; + + pentium4) + # optimize for Pentium 4 + CPU_OPT="-march=pentium4" + NGX_CPU_CACHE_LINE=128 + ;; + + athlon) + # optimize for Athlon + CPU_OPT="-march=athlon" + NGX_CPU_CACHE_LINE=64 + ;; + + opteron) + # optimize for Opteron + CPU_OPT="-march=opteron" + NGX_CPU_CACHE_LINE=64 + ;; + +esac + +CC_AUX_FLAGS="$CC_AUX_FLAGS $CPU_OPT" + + +CFLAGS="$CFLAGS -pipe $CPU_OPT" + +if [ ".$PCRE_OPT" = "." ]; then + PCRE_OPT="-O2 -pipe $CPU_OPT" +else + PCRE_OPT="$PCRE_OPT -pipe" +fi + +if [ ".$MD5_OPT" = "." ]; then + MD5_OPT="-O2 -pipe $CPU_OPT" +else + MD5_OPT="$MD5_OPT -pipe" +fi + +if [ ".$ZLIB_OPT" = "." ]; then + ZLIB_OPT="-O2 -pipe $CPU_OPT" +else + ZLIB_OPT="$ZLIB_OPT -pipe" +fi + + +# warnings + +CFLAGS="$CFLAGS $NGX_CLANG_OPT -Wall -Wextra -Wpointer-arith" +#CFLAGS="$CFLAGS -Wmissing-prototypes" + +# we have a lot of unused function arguments +CFLAGS="$CFLAGS -Wno-unused-parameter" + +# stop on warning +#CFLAGS="$CFLAGS -Werror" + +# debug +CFLAGS="$CFLAGS -g" + +if [ ".$CPP" = "." ]; then + CPP="$CC -E" +fi Modified: branches/stable-1.2/auto/cc/conf =================================================================== --- branches/stable-1.2/auto/cc/conf 2012-08-06 17:07:28 UTC (rev 4799) +++ branches/stable-1.2/auto/cc/conf 2012-08-06 17:10:35 UTC (rev 4800) @@ -56,6 +56,12 @@ . auto/cc/gcc ;; + clang) + # Clang C compiler + + . auto/cc/clang + ;; + icc) # Intel C++ compiler 7.1, 8.0, 8.1 Modified: branches/stable-1.2/auto/cc/name =================================================================== --- branches/stable-1.2/auto/cc/name 2012-08-06 17:07:28 UTC (rev 4799) +++ branches/stable-1.2/auto/cc/name 2012-08-06 17:10:35 UTC (rev 4800) @@ -67,6 +67,10 @@ NGX_CC_NAME=gcc echo " + using GNU C compiler" +elif `$CC -v 2>&1 | grep 'clang version' >/dev/null 2>&1`; then + NGX_CC_NAME=clang + echo " + using Clang C compiler" + elif `$CC -V 2>&1 | grep 'Sun C' >/dev/null 2>&1`; then NGX_CC_NAME=sunc echo " + using Sun C compiler" From mdounin at mdounin.ru Mon Aug 6 17:13:20 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 6 Aug 2012 17:13:20 +0000 Subject: [nginx] svn commit: r4801 - in branches/stable-1.2: . src/event Message-ID: <20120806171320.9AAAF3F9F22@mail.nginx.com> Author: mdounin Date: 2012-08-06 17:13:20 +0000 (Mon, 06 Aug 2012) New Revision: 4801 URL: http://trac.nginx.org/nginx/changeset/4801/nginx Log: Merge of r4764: debug_connection with a domain name change. When "debug_connection" is configured with a domain name, only the first resolved address was used. Now all addresses will be used. Modified: branches/stable-1.2/ branches/stable-1.2/src/event/ngx_event.c Index: branches/stable-1.2 =================================================================== --- branches/stable-1.2 2012-08-06 17:10:35 UTC (rev 4800) +++ branches/stable-1.2 2012-08-06 17:13:20 UTC (rev 4801) Property changes on: branches/stable-1.2 ___________________________________________________________________ Modified: svn:mergeinfo ## -1 +1 ## -/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754,4756-4763,4768 +/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754,4756-4764,4768 \ No newline at end of property Modified: branches/stable-1.2/src/event/ngx_event.c =================================================================== --- branches/stable-1.2/src/event/ngx_event.c 2012-08-06 17:10:35 UTC (rev 4800) +++ branches/stable-1.2/src/event/ngx_event.c 2012-08-06 17:13:20 UTC (rev 4801) @@ -1062,51 +1062,92 @@ #if (NGX_DEBUG) ngx_event_conf_t *ecf = conf; - ngx_int_t rc; - ngx_str_t *value; - struct hostent *h; - ngx_cidr_t *cidr; + ngx_int_t rc; + ngx_str_t *value; + ngx_url_t u; + ngx_cidr_t c, *cidr; + ngx_uint_t i; + struct sockaddr_in *sin; +#if (NGX_HAVE_INET6) + struct sockaddr_in6 *sin6; +#endif value = cf->args->elts; - cidr = ngx_array_push(&ecf->debug_connection); - if (cidr == NULL) { - return NGX_CONF_ERROR; - } - #if (NGX_HAVE_UNIX_DOMAIN) if (ngx_strcmp(value[1].data, "unix:") == 0) { - cidr->family = AF_UNIX; - return NGX_CONF_OK; + cidr = ngx_array_push(&ecf->debug_connection); + if (cidr == NULL) { + return NGX_CONF_ERROR; + } + + cidr->family = AF_UNIX; + return NGX_CONF_OK; } #endif - rc = ngx_ptocidr(&value[1], cidr); + rc = ngx_ptocidr(&value[1], &c); - if (rc == NGX_DONE) { - ngx_conf_log_error(NGX_LOG_WARN, cf, 0, - "low address bits of %V are meaningless", &value[1]); - return NGX_CONF_OK; - } + if (rc != NGX_ERROR) { + if (rc == NGX_DONE) { + ngx_conf_log_error(NGX_LOG_WARN, cf, 0, + "low address bits of %V are meaningless", + &value[1]); + } - if (rc == NGX_OK) { + cidr = ngx_array_push(&ecf->debug_connection); + if (cidr == NULL) { + return NGX_CONF_ERROR; + } + + *cidr = c; + return NGX_CONF_OK; } - h = gethostbyname((char *) value[1].data); + ngx_memzero(&u, sizeof(ngx_url_t)); + u.host = value[1]; - if (h == NULL || h->h_addr_list[0] == NULL) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "host \"%s\" not found", value[1].data); + if (ngx_inet_resolve_host(cf->pool, &u) != NGX_OK) { + if (u.err) { + ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, + "%s in debug_connection \"%V\"", + u.err, &u.host); + } + return NGX_CONF_ERROR; } - cidr->family = AF_INET; - cidr->u.in.mask = 0xffffffff; - cidr->u.in.addr = *(in_addr_t *)(h->h_addr_list[0]); + cidr = ngx_array_push_n(&ecf->debug_connection, u.naddrs); + if (cidr == NULL) { + return NGX_CONF_ERROR; + } + ngx_memzero(cidr, u.naddrs * sizeof(ngx_cidr_t)); + + for (i = 0; i < u.naddrs; i++) { + cidr[i].family = u.addrs[i].sockaddr->sa_family; + + switch (cidr[i].family) { + +#if (NGX_HAVE_INET6) + case AF_INET6: + sin6 = (struct sockaddr_in6 *) u.addrs[i].sockaddr; + cidr[i].u.in6.addr = sin6->sin6_addr; + ngx_memset(cidr[i].u.in6.mask.s6_addr, 0xff, 16); + break; +#endif + + default: /* AF_INET */ + sin = (struct sockaddr_in *) u.addrs[i].sockaddr; + cidr[i].u.in.addr = sin->sin_addr.s_addr; + cidr[i].u.in.mask = 0xffffffff; + break; + } + } + #else ngx_conf_log_error(NGX_LOG_WARN, cf, 0, From mdounin at mdounin.ru Mon Aug 6 17:15:23 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 6 Aug 2012 17:15:23 +0000 Subject: [nginx] svn commit: r4802 - in branches/stable-1.2: . src/core Message-ID: <20120806171524.061423F9F46@mail.nginx.com> Author: mdounin Date: 2012-08-06 17:15:23 +0000 (Mon, 06 Aug 2012) New Revision: 4802 URL: http://trac.nginx.org/nginx/changeset/4802/nginx Log: Merge of r4765: reduced the number of preprocessor directives. Modified: branches/stable-1.2/ branches/stable-1.2/src/core/ngx_slab.c Index: branches/stable-1.2 =================================================================== --- branches/stable-1.2 2012-08-06 17:13:20 UTC (rev 4801) +++ branches/stable-1.2 2012-08-06 17:15:23 UTC (rev 4802) Property changes on: branches/stable-1.2 ___________________________________________________________________ Modified: svn:mergeinfo ## -1 +1 ## -/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754,4756-4764,4768 +/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754,4756-4765,4768 \ No newline at end of property Modified: branches/stable-1.2/src/core/ngx_slab.c =================================================================== --- branches/stable-1.2/src/core/ngx_slab.c 2012-08-06 17:13:20 UTC (rev 4801) +++ branches/stable-1.2/src/core/ngx_slab.c 2012-08-06 17:15:23 UTC (rev 4802) @@ -45,10 +45,8 @@ #define ngx_slab_junk(p, size) ngx_memset(p, 0xA5, size) -#else +#elif (NGX_HAVE_DEBUG_MALLOC) -#if (NGX_HAVE_DEBUG_MALLOC) - #define ngx_slab_junk(p, size) \ if (ngx_debug_malloc) ngx_memset(p, 0xA5, size) @@ -58,8 +56,6 @@ #endif -#endif - static ngx_slab_page_t *ngx_slab_alloc_pages(ngx_slab_pool_t *pool, ngx_uint_t pages); static void ngx_slab_free_pages(ngx_slab_pool_t *pool, ngx_slab_page_t *page, From mdounin at mdounin.ru Mon Aug 6 17:20:01 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 6 Aug 2012 17:20:01 +0000 Subject: [nginx] svn commit: r4803 - in branches/stable-1.2: . src/http Message-ID: <20120806172001.D24243F9E7F@mail.nginx.com> Author: mdounin Date: 2012-08-06 17:20:01 +0000 (Mon, 06 Aug 2012) New Revision: 4803 URL: http://trac.nginx.org/nginx/changeset/4803/nginx Log: Merge of r4766, r4767: ngx_http_upstream_add() changes. *) Fixed to return NULL if an error occurs. *) Microoptimization: replaced an expression known to be constant with the constant value. Modified: branches/stable-1.2/ branches/stable-1.2/src/http/ngx_http_upstream.c Index: branches/stable-1.2 =================================================================== --- branches/stable-1.2 2012-08-06 17:15:23 UTC (rev 4802) +++ branches/stable-1.2 2012-08-06 17:20:01 UTC (rev 4803) Property changes on: branches/stable-1.2 ___________________________________________________________________ Modified: svn:mergeinfo ## -1 +1 ## -/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754,4756-4765,4768 +/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754,4756-4768 \ No newline at end of property Modified: branches/stable-1.2/src/http/ngx_http_upstream.c =================================================================== --- branches/stable-1.2/src/http/ngx_http_upstream.c 2012-08-06 17:15:23 UTC (rev 4802) +++ branches/stable-1.2/src/http/ngx_http_upstream.c 2012-08-06 17:20:01 UTC (rev 4803) @@ -4422,18 +4422,18 @@ uscf->servers = ngx_array_create(cf->pool, 1, sizeof(ngx_http_upstream_server_t)); if (uscf->servers == NULL) { - return NGX_CONF_ERROR; + return NULL; } us = ngx_array_push(uscf->servers); if (us == NULL) { - return NGX_CONF_ERROR; + return NULL; } ngx_memzero(us, sizeof(ngx_http_upstream_server_t)); us->addrs = u->addrs; - us->naddrs = u->naddrs; + us->naddrs = 1; } uscfp = ngx_array_push(&umcf->upstreams); From mdounin at mdounin.ru Mon Aug 6 17:31:33 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 6 Aug 2012 17:31:33 +0000 Subject: [nginx] svn commit: r4804 - in branches/stable-1.2: . src/core src/http Message-ID: <20120806173133.276043F9ED0@mail.nginx.com> Author: mdounin Date: 2012-08-06 17:31:32 +0000 (Mon, 06 Aug 2012) New Revision: 4804 URL: http://trac.nginx.org/nginx/changeset/4804/nginx Log: Merge of r4769: better diagnostics for directives in wrong context. Modified: branches/stable-1.2/ branches/stable-1.2/src/core/ngx_conf_file.c branches/stable-1.2/src/core/ngx_conf_file.h branches/stable-1.2/src/http/ngx_http_core_module.c Index: branches/stable-1.2 =================================================================== --- branches/stable-1.2 2012-08-06 17:20:01 UTC (rev 4803) +++ branches/stable-1.2 2012-08-06 17:31:32 UTC (rev 4804) Property changes on: branches/stable-1.2 ___________________________________________________________________ Modified: svn:mergeinfo ## -1 +1 ## -/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754,4756-4768 +/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754,4756-4769 \ No newline at end of property Modified: branches/stable-1.2/src/core/ngx_conf_file.c =================================================================== --- branches/stable-1.2/src/core/ngx_conf_file.c 2012-08-06 17:20:01 UTC (rev 4803) +++ branches/stable-1.2/src/core/ngx_conf_file.c 2012-08-06 17:31:32 UTC (rev 4804) @@ -282,24 +282,16 @@ { char *rv; void *conf, **confp; - ngx_uint_t i, multi; + ngx_uint_t i, found; ngx_str_t *name; ngx_command_t *cmd; name = cf->args->elts; - multi = 0; + found = 0; for (i = 0; ngx_modules[i]; i++) { - /* look up the directive in the appropriate modules */ - - if (ngx_modules[i]->type != NGX_CONF_MODULE - && ngx_modules[i]->type != cf->module_type) - { - continue; - } - cmd = ngx_modules[i]->commands; if (cmd == NULL) { continue; @@ -315,16 +307,18 @@ continue; } + found = 1; + if (ngx_modules[i]->type != NGX_CONF_MODULE + && ngx_modules[i]->type != cf->module_type) + { + continue; + } + /* is the directive's location right ? */ if (!(cmd->type & cf->cmd_type)) { - if (cmd->type & NGX_CONF_MULTI) { - multi = 1; - continue; - } - - goto not_allowed; + continue; } if (!(cmd->type & NGX_CONF_BLOCK) && last != NGX_OK) { @@ -408,17 +402,16 @@ } } - if (multi == 0) { + if (found) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "unknown directive \"%s\"", name->data); + "\"%s\" directive is not allowed here", name->data); return NGX_ERROR; } -not_allowed: + ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, + "unknown directive \"%s\"", name->data); - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "\"%s\" directive is not allowed here", name->data); return NGX_ERROR; invalid: Modified: branches/stable-1.2/src/core/ngx_conf_file.h =================================================================== --- branches/stable-1.2/src/core/ngx_conf_file.h 2012-08-06 17:20:01 UTC (rev 4803) +++ branches/stable-1.2/src/core/ngx_conf_file.h 2012-08-06 17:31:32 UTC (rev 4804) @@ -45,7 +45,7 @@ #define NGX_CONF_ANY 0x00000400 #define NGX_CONF_1MORE 0x00000800 #define NGX_CONF_2MORE 0x00001000 -#define NGX_CONF_MULTI 0x00002000 +#define NGX_CONF_MULTI 0x00000000 /* compatibility */ #define NGX_DIRECT_CONF 0x00010000 Modified: branches/stable-1.2/src/http/ngx_http_core_module.c =================================================================== --- branches/stable-1.2/src/http/ngx_http_core_module.c 2012-08-06 17:20:01 UTC (rev 4803) +++ branches/stable-1.2/src/http/ngx_http_core_module.c 2012-08-06 17:31:32 UTC (rev 4804) @@ -222,7 +222,7 @@ NULL }, { ngx_string("server"), - NGX_HTTP_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_MULTI|NGX_CONF_NOARGS, + NGX_HTTP_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS, ngx_http_core_server, 0, 0, From mdounin at mdounin.ru Mon Aug 6 17:34:09 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 6 Aug 2012 17:34:09 +0000 Subject: [nginx] svn commit: r4805 - in branches/stable-1.2: . src/http Message-ID: <20120806173409.28FAD3F9C5F@mail.nginx.com> Author: mdounin Date: 2012-08-06 17:34:08 +0000 (Mon, 06 Aug 2012) New Revision: 4805 URL: http://trac.nginx.org/nginx/changeset/4805/nginx Log: Merge of r4770: hide_headers/pass_headers inheritance fix. Hide headers and pass headers arrays might not be inherited correctly into a nested location, e.g. in configuration like server { proxy_hide_header X-Foo; location / { location /nested/ { proxy_pass_header X-Pad; } } } the X-Foo header wasn't hidden in the location /nested/. Reported by Konstantin Svist, http://mailman.nginx.org/pipermail/nginx-ru/2012-July/047555.html Modified: branches/stable-1.2/ branches/stable-1.2/src/http/ngx_http_upstream.c Index: branches/stable-1.2 =================================================================== --- branches/stable-1.2 2012-08-06 17:31:32 UTC (rev 4804) +++ branches/stable-1.2 2012-08-06 17:34:08 UTC (rev 4805) Property changes on: branches/stable-1.2 ___________________________________________________________________ Modified: svn:mergeinfo ## -1 +1 ## -/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754,4756-4769 +/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754,4756-4770 \ No newline at end of property Modified: branches/stable-1.2/src/http/ngx_http_upstream.c =================================================================== --- branches/stable-1.2/src/http/ngx_http_upstream.c 2012-08-06 17:31:32 UTC (rev 4804) +++ branches/stable-1.2/src/http/ngx_http_upstream.c 2012-08-06 17:34:08 UTC (rev 4805) @@ -4541,6 +4541,9 @@ if (conf->hide_headers == NGX_CONF_UNSET_PTR && conf->pass_headers == NGX_CONF_UNSET_PTR) { + conf->hide_headers = prev->hide_headers; + conf->pass_headers = prev->pass_headers; + conf->hide_headers_hash = prev->hide_headers_hash; if (conf->hide_headers_hash.buckets @@ -4552,9 +4555,6 @@ return NGX_OK; } - conf->hide_headers = prev->hide_headers; - conf->pass_headers = prev->pass_headers; - } else { if (conf->hide_headers == NGX_CONF_UNSET_PTR) { conf->hide_headers = prev->hide_headers; From mdounin at mdounin.ru Mon Aug 6 17:36:31 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 6 Aug 2012 17:36:31 +0000 Subject: [nginx] svn commit: r4806 - in branches/stable-1.2: . src/http Message-ID: <20120806173631.5F8273F9E47@mail.nginx.com> Author: mdounin Date: 2012-08-06 17:36:30 +0000 (Mon, 06 Aug 2012) New Revision: 4806 URL: http://trac.nginx.org/nginx/changeset/4806/nginx Log: Merge of r4771: ngx_http_find_virtual_server() fix. The ngx_http_find_virtual_server() function should return NGX_DECLINED if virtual server not found. Modified: branches/stable-1.2/ branches/stable-1.2/src/http/ngx_http_request.c Index: branches/stable-1.2 =================================================================== --- branches/stable-1.2 2012-08-06 17:34:08 UTC (rev 4805) +++ branches/stable-1.2 2012-08-06 17:36:30 UTC (rev 4806) Property changes on: branches/stable-1.2 ___________________________________________________________________ Modified: svn:mergeinfo ## -1 +1 ## -/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754,4756-4770 +/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754,4756-4771 \ No newline at end of property Modified: branches/stable-1.2/src/http/ngx_http_request.c =================================================================== --- branches/stable-1.2/src/http/ngx_http_request.c 2012-08-06 17:34:08 UTC (rev 4805) +++ branches/stable-1.2/src/http/ngx_http_request.c 2012-08-06 17:36:30 UTC (rev 4806) @@ -1823,7 +1823,7 @@ #endif - return NGX_OK; + return NGX_DECLINED; found: From mdounin at mdounin.ru Mon Aug 6 17:38:12 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 6 Aug 2012 17:38:12 +0000 Subject: [nginx] svn commit: r4807 - in branches/stable-1.2: . misc Message-ID: <20120806173812.5E2893F9E47@mail.nginx.com> Author: mdounin Date: 2012-08-06 17:38:12 +0000 (Mon, 06 Aug 2012) New Revision: 4807 URL: http://trac.nginx.org/nginx/changeset/4807/nginx Log: Merge of r4775: updated PCRE used for win32 builds. Modified: branches/stable-1.2/ branches/stable-1.2/misc/GNUmakefile Index: branches/stable-1.2 =================================================================== --- branches/stable-1.2 2012-08-06 17:36:30 UTC (rev 4806) +++ branches/stable-1.2 2012-08-06 17:38:12 UTC (rev 4807) Property changes on: branches/stable-1.2 ___________________________________________________________________ Modified: svn:mergeinfo ## -1 +1 ## -/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754,4756-4771 +/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754,4756-4771,4775 \ No newline at end of property Modified: branches/stable-1.2/misc/GNUmakefile =================================================================== --- branches/stable-1.2/misc/GNUmakefile 2012-08-06 17:36:30 UTC (rev 4806) +++ branches/stable-1.2/misc/GNUmakefile 2012-08-06 17:38:12 UTC (rev 4807) @@ -8,7 +8,7 @@ OBJS = objs.msvc8 OPENSSL = openssl-1.0.1c ZLIB = zlib-1.2.5 -PCRE = pcre-8.30 +PCRE = pcre-8.31 release: From eiji-gravion at hotmail.com Mon Aug 6 17:43:32 2012 From: eiji-gravion at hotmail.com (steve willing) Date: Tue, 7 Aug 2012 03:13:32 +0930 Subject: SPDY increasing size of pages Message-ID: Hello, After enabling SPDY, I noticed that every element that loads on my site is larger (in bytes) than without SPDY. This includes all elements, images, css, js and html. Some log snippets below. spdy disabled: TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:01:53:27 -0400] "GET / HTTP/1.1" 200 1836 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:01:53:27 -0400] "GET /style.css HTTP/1.1" 200 761 "https://127.0.0.1/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:01:53:27 -0400] "GET /images/banner.jpg HTTP/1.1" 200 66445 "https://127.0.0.1/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:01:53:27 -0400] "GET /images/background.png HTTP/1.1" 200 235 "https://127.0.0.1/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:01:53:27 -0400] "GET /images/menu.gif HTTP/1.1" 200 262 "https://127.0.0.1/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" spdy disabled (cached): TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:02:14:31 -0400] "GET / HTTP/1.1" 200 1836 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:02:14:31 -0400] "GET /style.css HTTP/1.1" 304 0 "https://127.0.0.1/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:02:14:31 -0400] "GET /images/banner.jpg HTTP/1.1" 304 0 "https://127.0.0.1/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" spdy enabled: TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:02:06:28 -0400] "GET / HTTP/1.1" 200 3142 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:02:06:28 -0400] "GET /style.css HTTP/1.1" 200 2699 "https://127.0.0.1/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:02:06:29 -0400] "GET /images/background.png HTTP/1.1" 200 251 "https://127.0.0.1/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:02:06:29 -0400] "GET /images/menu.gif HTTP/1.1" 200 278 "https://127.0.0.1/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:02:06:29 -0400] "GET /images/banner.jpg HTTP/1.1" 200 67288 "https://127.0.0.1/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" spdy enabled (cached): TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:02:08:48 -0400] "GET / HTTP/1.1" 200 3742 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:02:08:48 -0400] "GET /style.css HTTP/1.1" 304 4295 "https://127.0.0.1/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:02:08:48 -0400] "GET /images/banner.jpg HTTP/1.1" 304 68333 "https://127.0.0.1/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" Notice how even when cached (304 not modified) it shows the bytes being even *larger* than the non-cached version.I should also note that I have tested this in the latest version of Chrome and Firefox, both have the same results. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at tvdw.eu Mon Aug 6 17:55:15 2012 From: info at tvdw.eu (Tom van der Woerdt) Date: Mon, 06 Aug 2012 19:55:15 +0200 Subject: SPDY increasing size of pages In-Reply-To: References: Message-ID: <50200503.8050801@tvdw.eu> Hi Steve, I just did some tests: the logs reported 33KB on a .html file that's 805 bytes. After refreshing it said 2.4KB, and after another refresh it claimed 1.1KB. For the record: gzip was disabled and with spdy disabled it reported 805 bytes like it should. Then I looked at the response headers on the requests, which always mentioned 805 bytes on all responses, even with SPDY enabled. Conclusion: there's no massive network overhead, the counter is simply broken. Tom Op 8/6/12 7:43 PM, steve willing schreef: > Hello, > > After enabling SPDY, I noticed that every element that loads on my site is larger (in bytes) than without SPDY. > > This includes all elements, images, css, js and html. > > Some log snippets below. > > spdy disabled: > TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:01:53:27 -0400] "GET / HTTP/1.1" 200 1836 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" > TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:01:53:27 -0400] "GET /style.css HTTP/1.1" 200 761 "https://127.0.0.1/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" > TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:01:53:27 -0400] "GET /images/banner.jpg HTTP/1.1" 200 66445 "https://127.0.0.1/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" > TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:01:53:27 -0400] "GET /images/background.png HTTP/1.1" 200 235 "https://127.0.0.1/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" > TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:01:53:27 -0400] "GET /images/menu.gif HTTP/1.1" 200 262 "https://127.0.0.1/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" > > spdy disabled (cached): > TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:02:14:31 -0400] "GET / HTTP/1.1" 200 1836 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" > TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:02:14:31 -0400] "GET /style.css HTTP/1.1" 304 0 "https://127.0.0.1/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" > TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:02:14:31 -0400] "GET /images/banner.jpg HTTP/1.1" 304 0 "https://127.0.0.1/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" > > spdy enabled: > TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:02:06:28 -0400] "GET / HTTP/1.1" 200 3142 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" > TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:02:06:28 -0400] "GET /style.css HTTP/1.1" 200 2699 "https://127.0.0.1/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" > TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:02:06:29 -0400] "GET /images/background.png HTTP/1.1" 200 251 "https://127.0.0.1/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" > TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:02:06:29 -0400] "GET /images/menu.gif HTTP/1.1" 200 278 "https://127.0.0.1/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" > TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:02:06:29 -0400] "GET /images/banner.jpg HTTP/1.1" 200 67288 "https://127.0.0.1/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" > > spdy enabled (cached): > TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:02:08:48 -0400] "GET / HTTP/1.1" 200 3742 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" > TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:02:08:48 -0400] "GET /style.css HTTP/1.1" 304 4295 "https://127.0.0.1/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" > TLSv1.1 ECDHE-RSA-RC4-SHA 10.0.0.1 - - [05/Aug/2012:02:08:48 -0400] "GET /images/banner.jpg HTTP/1.1" 304 68333 "https://127.0.0.1/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1" > Notice how even when cached (304 not modified) it shows the bytes being even *larger* than the non-cached version. > I should also note that I have tested this in the latest version of Chrome and Firefox, both have the same results. > Thanks > > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel -------------- next part -------------- An HTML attachment was scrubbed... URL: From eiji-gravion at hotmail.com Mon Aug 6 18:03:38 2012 From: eiji-gravion at hotmail.com (steve willing) Date: Tue, 7 Aug 2012 03:33:38 +0930 Subject: SPDY loading small pages slower than larger pages Message-ID: Hello, As the subject says, when I test on my own local SPDY setup and others on the internet, I've noticed that while larger pages do indeed load faster if there are a lot of elements, small pages load slower than without SPDY and even slower than those larger pages. Here are a few examples of SPDY capable sites that I have been able to reproduce this on. larger page:https://test.wowmetacheck.com/ smaller page:https://test.wowmetacheck.com/a larger page:https://bugsnag.com/ smaller page:https://bugsnag.com/x I would think any nginx based SPDY setup could reproduce this. To see the best results, try loading the larger and smaller pages and compare how long it takes, cached and non-cached. You can also disable SPDY and see how much faster the smaller pages are than with SPDY. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Mon Aug 6 18:09:24 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Mon, 6 Aug 2012 18:09:24 +0000 Subject: [nginx] svn commit: r4808 - in branches/stable-1.2: . src/core Message-ID: <20120806180924.7CEB23F9E2A@mail.nginx.com> Author: mdounin Date: 2012-08-06 18:09:23 +0000 (Mon, 06 Aug 2012) New Revision: 4808 URL: http://trac.nginx.org/nginx/changeset/4808/nginx Log: Merge of r4739: s/ngx_shmtx_destory/ngx_shmtx_destroy/. Modified: branches/stable-1.2/ branches/stable-1.2/src/core/ngx_shmtx.c branches/stable-1.2/src/core/ngx_shmtx.h Index: branches/stable-1.2 =================================================================== --- branches/stable-1.2 2012-08-06 17:38:12 UTC (rev 4807) +++ branches/stable-1.2 2012-08-06 18:09:23 UTC (rev 4808) Property changes on: branches/stable-1.2 ___________________________________________________________________ Modified: svn:mergeinfo ## -1 +1 ## -/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754,4756-4771,4775 +/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4741,4754,4756-4771,4775 \ No newline at end of property Modified: branches/stable-1.2/src/core/ngx_shmtx.c =================================================================== --- branches/stable-1.2/src/core/ngx_shmtx.c 2012-08-06 17:38:12 UTC (rev 4807) +++ branches/stable-1.2/src/core/ngx_shmtx.c 2012-08-06 18:09:23 UTC (rev 4808) @@ -44,7 +44,7 @@ void -ngx_shmtx_destory(ngx_shmtx_t *mtx) +ngx_shmtx_destroy(ngx_shmtx_t *mtx) { #if (NGX_HAVE_POSIX_SEM) @@ -208,7 +208,7 @@ return NGX_OK; } - ngx_shmtx_destory(mtx); + ngx_shmtx_destroy(mtx); } mtx->fd = ngx_open_file(name, NGX_FILE_RDWR, NGX_FILE_CREATE_OR_OPEN, @@ -232,7 +232,7 @@ void -ngx_shmtx_destory(ngx_shmtx_t *mtx) +ngx_shmtx_destroy(ngx_shmtx_t *mtx) { if (ngx_close_file(mtx->fd) == NGX_FILE_ERROR) { ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, ngx_errno, Modified: branches/stable-1.2/src/core/ngx_shmtx.h =================================================================== --- branches/stable-1.2/src/core/ngx_shmtx.h 2012-08-06 17:38:12 UTC (rev 4807) +++ branches/stable-1.2/src/core/ngx_shmtx.h 2012-08-06 18:09:23 UTC (rev 4808) @@ -39,7 +39,7 @@ ngx_int_t ngx_shmtx_create(ngx_shmtx_t *mtx, ngx_shmtx_sh_t *addr, u_char *name); -void ngx_shmtx_destory(ngx_shmtx_t *mtx); +void ngx_shmtx_destroy(ngx_shmtx_t *mtx); ngx_uint_t ngx_shmtx_trylock(ngx_shmtx_t *mtx); void ngx_shmtx_lock(ngx_shmtx_t *mtx); void ngx_shmtx_unlock(ngx_shmtx_t *mtx); From ne at vbart.ru Mon Aug 6 22:54:08 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Tue, 7 Aug 2012 02:54:08 +0400 Subject: SPDY increasing size of pages In-Reply-To: References: Message-ID: <201208070254.08440.ne@vbart.ru> On Monday 06 August 2012 21:43:32 steve willing wrote: > Hello, > > After enabling SPDY, I noticed that every element that loads on my site is > larger (in bytes) than without SPDY. > > This includes all elements, images, css, js and html. > > Some log snippets below. [...] Actually it's just wrong values in the logs. Thanks for pointing this out. It has been fixed in the new patch: http://nginx.org/patches/spdy/patch.spdy-50.txt wbr, Valentin V. Bartenev From mdounin at mdounin.ru Tue Aug 7 12:35:56 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Tue, 7 Aug 2012 12:35:56 +0000 Subject: [nginx] svn commit: r4809 - branches/stable-1.2/docs/xml/nginx Message-ID: <20120807123557.0BE933F9E70@mail.nginx.com> Author: mdounin Date: 2012-08-07 12:35:56 +0000 (Tue, 07 Aug 2012) New Revision: 4809 URL: http://trac.nginx.org/nginx/changeset/4809/nginx Log: nginx-1.2.3-RELEASE Modified: branches/stable-1.2/docs/xml/nginx/changes.xml Modified: branches/stable-1.2/docs/xml/nginx/changes.xml =================================================================== --- branches/stable-1.2/docs/xml/nginx/changes.xml 2012-08-06 18:09:23 UTC (rev 4808) +++ branches/stable-1.2/docs/xml/nginx/changes.xml 2012-08-07 12:35:56 UTC (rev 4809) @@ -9,6 +9,82 @@ nginx changelog + + + + +????????? ??????????? Clang. + + +the Clang compiler support. + + + + + +????? ??????????? ?????? ????????? ??????.
+??????? ?????? ?????????. +
+ +extra listening sockets might be created.
+Thanks to Roman Odaisky. +
+
+ + + +nginx/Windows ??? ????????? ?????????, ???? ??? ??????? ???????? ???????? +??????????? ??????.
+??????? Ricardo Villalobos Guevara. +
+ +nginx/Windows might hog CPU if a worker process failed to start.
+Thanks to Ricardo Villalobos Guevara. +
+
+ + + +????????? proxy_pass_header, fastcgi_pass_header, scgi_pass_header, +uwsgi_pass_header, proxy_hide_header, fastcgi_hide_header, +scgi_hide_header ? uwsgi_hide_header +????? ????????????? ???????????. + + +the "proxy_pass_header", "fastcgi_pass_header", "scgi_pass_header", +"uwsgi_pass_header", "proxy_hide_header", "fastcgi_hide_header", +"scgi_hide_header", and "uwsgi_hide_header" directives +might be inherited incorrectly. + + + + + +??? ????????????? ????????? map ? ?????????? hostnames +?? ?????????????? ???????? ????? ? ???????? ????????. + + +trailing dot in a source value was not ignored +if the "map" directive was used with the "hostnames" parameter. + + + + + +??? ????????? ??????? ??? ?????????????? ???????? location, +???? ??????? ? ??????????? location ?????????? +????? ????????? URI ? ??????? ????????? rewrite. + + +incorrect location might be used to process a request +if a URI was changed via a "rewrite" directive +before an internal redirect to a named location. + + + +
+ + From mdounin at mdounin.ru Tue Aug 7 12:36:19 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Tue, 7 Aug 2012 12:36:19 +0000 Subject: [nginx] svn commit: r4810 - in tags: . release-1.2.3 Message-ID: <20120807123619.B71333F9F87@mail.nginx.com> Author: mdounin Date: 2012-08-07 12:36:19 +0000 (Tue, 07 Aug 2012) New Revision: 4810 URL: http://trac.nginx.org/nginx/changeset/4810/nginx Log: release-1.2.3 tag Added: tags/release-1.2.3/ Index: tags/release-1.2.3 =================================================================== --- branches/stable-1.2 2012-08-07 12:35:56 UTC (rev 4809) +++ tags/release-1.2.3 2012-08-07 12:36:19 UTC (rev 4810) Property changes on: tags/release-1.2.3 ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,14 ## +access.log +client_body_temp +fastcgi_temp +proxy_temp +scgi_temp +uwsgi_temp +GNUmakefile +Makefile +makefile +nginx +nginx.conf +nginx-*.tar.gz +objs* +tmp Added: svn:mergeinfo ## -0,0 +1 ## +/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4741,4754,4756-4771,4775 \ No newline at end of property From defan at nginx.com Tue Aug 7 13:57:04 2012 From: defan at nginx.com (defan at nginx.com) Date: Tue, 7 Aug 2012 13:57:04 +0000 Subject: [nginx] svn commit: r4811 - trunk/src/event Message-ID: <20120807135704.E30113F9E47@mail.nginx.com> Author: defan Date: 2012-08-07 13:57:04 +0000 (Tue, 07 Aug 2012) New Revision: 4811 URL: http://trac.nginx.org/nginx/changeset/4811/nginx Log: Explicitly ignore returned value from close() in ngx_event_core_init_conf(). We don't have strong reason to inform about any errors reported by close() call here, and there are no other things to do with its return value. Prodded by Coverity. Modified: trunk/src/event/ngx_event.c Modified: trunk/src/event/ngx_event.c =================================================================== --- trunk/src/event/ngx_event.c 2012-08-07 12:36:19 UTC (rev 4810) +++ trunk/src/event/ngx_event.c 2012-08-07 13:57:04 UTC (rev 4811) @@ -1214,7 +1214,7 @@ fd = epoll_create(100); if (fd != -1) { - close(fd); + (void) close(fd); module = &ngx_epoll_module; } else if (ngx_errno != NGX_ENOSYS) { From eiji-gravion at hotmail.com Wed Aug 8 08:08:15 2012 From: eiji-gravion at hotmail.com (steve willing) Date: Wed, 8 Aug 2012 17:38:15 +0930 Subject: SPDY increasing size of pages In-Reply-To: <201208070254.08440.ne@vbart.ru> References: , <201208070254.08440.ne@vbart.ru> Message-ID: I applied the new patch and while the values are not quite as inaccurate, they are still wrong. > From: ne at vbart.ru > To: nginx-devel at nginx.org > Subject: Re: SPDY increasing size of pages > Date: Tue, 7 Aug 2012 02:54:08 +0400 > > On Monday 06 August 2012 21:43:32 steve willing wrote: > > Hello, > > > > After enabling SPDY, I noticed that every element that loads on my site is > > larger (in bytes) than without SPDY. > > > > This includes all elements, images, css, js and html. > > > > Some log snippets below. > [...] > > Actually it's just wrong values in the logs. > Thanks for pointing this out. It has been fixed in the new patch: > http://nginx.org/patches/spdy/patch.spdy-50.txt > > wbr, Valentin V. Bartenev > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel -------------- next part -------------- An HTML attachment was scrubbed... URL: From ne at vbart.ru Wed Aug 8 09:54:33 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Wed, 8 Aug 2012 13:54:33 +0400 Subject: SPDY increasing size of pages In-Reply-To: References: <201208070254.08440.ne@vbart.ru> Message-ID: <201208081354.33973.ne@vbart.ru> On Wednesday 08 August 2012 12:08:15 steve willing wrote: > I applied the new patch and while the values are not quite as inaccurate, > they are still wrong. > What do you mean by "wrong"? Could you clarify it a bit? Please note that the SPDY protocol adds overhead on data transfer, and values such as $body_bytes_sent and $bytes_sent will always be slightly larger with SPDY then the actual size of your files. TLS also adds even more overhead but there's no way to count it. wbr, Valentin V. Bartenev From info at tvdw.eu Wed Aug 8 10:14:07 2012 From: info at tvdw.eu (Tom van der Woerdt) Date: Wed, 08 Aug 2012 12:14:07 +0200 Subject: SPDY increasing size of pages In-Reply-To: <201208081354.33973.ne@vbart.ru> References: <201208070254.08440.ne@vbart.ru> <201208081354.33973.ne@vbart.ru> Message-ID: <50223BEF.2090407@tvdw.eu> Quick tests show that my 805 byte file became a 813 byte response, which seems consistent with the 8 byte header of a DATA frame. Question: do we really need to include that into the size? Just like the response headers aren't counted, why should the protocol overhead be counted? Note: after refreshing the server responded with a 304 Not Modified but it did log it as 813 bytes. Once I disabled SPDY, it logged a 0-byte response. Both responses came without a content-length header so I am assuming that the server didn't actually send a response body and this too is a counting issue. Tom Op 8/8/12 11:54 AM, Valentin V. Bartenev schreef: > On Wednesday 08 August 2012 12:08:15 steve willing wrote: >> I applied the new patch and while the values are not quite as inaccurate, >> they are still wrong. >> > What do you mean by "wrong"? Could you clarify it a bit? > > Please note that the SPDY protocol adds overhead on data transfer, and values > such as $body_bytes_sent and $bytes_sent will always be slightly larger with > SPDY then the actual size of your files. TLS also adds even more overhead but > there's no way to count it. > > wbr, Valentin V. Bartenev > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel From ne at vbart.ru Wed Aug 8 10:40:14 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Wed, 8 Aug 2012 14:40:14 +0400 Subject: SPDY increasing size of pages In-Reply-To: <50223BEF.2090407@tvdw.eu> References: <201208081354.33973.ne@vbart.ru> <50223BEF.2090407@tvdw.eu> Message-ID: <201208081440.14167.ne@vbart.ru> On Wednesday 08 August 2012 14:14:07 Tom van der Woerdt wrote: > Quick tests show that my 805 byte file became a 813 byte response, which > seems consistent with the 8 byte header of a DATA frame. > > Question: do we really need to include that into the size? Just like the > response headers aren't counted, why should the protocol overhead be > counted This is how it is in nginx now. For example, if a response has been sent over HTTP with chunked transfer encoding, the $body_bytes_sent also will not equal to payload size. Personally I do not really agree with that, but it should be discussed and changed globally. > Note: after refreshing the server responded with a 304 Not Modified but > it did log it as 813 bytes. Once I disabled SPDY, it logged a 0-byte > response. Both responses came without a content-length header so I am > assuming that the server didn't actually send a response body and this > too is a counting issue. > Strange. How do you found out that it responded with 304 Not Modified? wbr, Valentin V. Bartenev From info at tvdw.eu Wed Aug 8 10:45:57 2012 From: info at tvdw.eu (Tom van der Woerdt) Date: Wed, 08 Aug 2012 12:45:57 +0200 Subject: SPDY increasing size of pages In-Reply-To: <201208081440.14167.ne@vbart.ru> References: <201208081354.33973.ne@vbart.ru> <50223BEF.2090407@tvdw.eu> <201208081440.14167.ne@vbart.ru> Message-ID: <50224365.7090104@tvdw.eu> Op 8/8/12 12:40 PM, Valentin V. Bartenev schreef: > On Wednesday 08 August 2012 14:14:07 Tom van der Woerdt wrote: >> Quick tests show that my 805 byte file became a 813 byte response, which >> seems consistent with the 8 byte header of a DATA frame. >> >> Question: do we really need to include that into the size? Just like the >> response headers aren't counted, why should the protocol overhead be >> counted > This is how it is in nginx now. For example, if a response has been sent over > HTTP with chunked transfer encoding, the $body_bytes_sent also will not equal > to payload size. > > Personally I do not really agree with that, but it should be discussed and > changed globally. Ah, didn't know that. >> Note: after refreshing the server responded with a 304 Not Modified but >> it did log it as 813 bytes. Once I disabled SPDY, it logged a 0-byte >> response. Both responses came without a content-length header so I am >> assuming that the server didn't actually send a response body and this >> too is a counting issue. >> > Strange. How do you found out that it responded with 304 Not Modified? That's what the logs say, and Firebug confirms it. SPDY disabled: - tom [08/Aug/2012:12:42:38 +0200] "GET /home HTTP/1.1" 304 0 "-" "" "-" SPDY enabled: - tom [08/Aug/2012:12:44:03 +0200] "GET /home HTTP/1.1" 304 813 "-" "" "-" Both resulted in a 304 Not Modified. Tom From piotr.sikora at frickle.com Wed Aug 8 10:50:48 2012 From: piotr.sikora at frickle.com (Piotr Sikora) Date: Wed, 8 Aug 2012 12:50:48 +0200 Subject: SPDY increasing size of pages In-Reply-To: <201208081440.14167.ne@vbart.ru> References: <201208081354.33973.ne@vbart.ru> <50223BEF.2090407@tvdw.eu> <201208081440.14167.ne@vbart.ru> Message-ID: <65FC75A3AAFB4D6398782B4683E7A6C1@Desktop> Hey, > This is how it is in nginx now. For example, if a response has been sent > over > HTTP with chunked transfer encoding, the $body_bytes_sent also will not > equal > to payload size. > > Personally I do not really agree with that, but it should be discussed and > changed globally. Yes, it should be changed to report only sent payload size (IMHO). Best regards, Piotr Sikora < piotr.sikora at frickle.com > From vbart at nginx.com Wed Aug 8 12:03:47 2012 From: vbart at nginx.com (vbart at nginx.com) Date: Wed, 8 Aug 2012 12:03:47 +0000 Subject: [nginx] svn commit: r4812 - trunk/src/http/modules Message-ID: <20120808120347.C1C223FA0EF@mail.nginx.com> Author: vbart Date: 2012-08-08 12:03:46 +0000 (Wed, 08 Aug 2012) New Revision: 4812 URL: http://trac.nginx.org/nginx/changeset/4812/nginx Log: Added three missing checks for NULL after ngx_array_push() calls. Found by Coverity. Modified: trunk/src/http/modules/ngx_http_fastcgi_module.c trunk/src/http/modules/ngx_http_limit_conn_module.c trunk/src/http/modules/ngx_http_limit_req_module.c Modified: trunk/src/http/modules/ngx_http_fastcgi_module.c =================================================================== --- trunk/src/http/modules/ngx_http_fastcgi_module.c 2012-08-07 13:57:04 UTC (rev 4811) +++ trunk/src/http/modules/ngx_http_fastcgi_module.c 2012-08-08 12:03:46 UTC (rev 4812) @@ -1626,6 +1626,9 @@ } part = ngx_array_push(f->split_parts); + if (part == NULL) { + return NGX_ERROR; + } part->start = part_start; part->end = part_end; Modified: trunk/src/http/modules/ngx_http_limit_conn_module.c =================================================================== --- trunk/src/http/modules/ngx_http_limit_conn_module.c 2012-08-07 13:57:04 UTC (rev 4811) +++ trunk/src/http/modules/ngx_http_limit_conn_module.c 2012-08-08 12:03:46 UTC (rev 4812) @@ -721,6 +721,10 @@ } limit = ngx_array_push(&lccf->limits); + if (limit == NULL) { + return NGX_CONF_ERROR; + } + limit->conn = n; limit->shm_zone = shm_zone; Modified: trunk/src/http/modules/ngx_http_limit_req_module.c =================================================================== --- trunk/src/http/modules/ngx_http_limit_req_module.c 2012-08-07 13:57:04 UTC (rev 4811) +++ trunk/src/http/modules/ngx_http_limit_req_module.c 2012-08-08 12:03:46 UTC (rev 4812) @@ -937,6 +937,9 @@ } limit = ngx_array_push(&lrcf->limits); + if (limit == NULL) { + return NGX_CONF_ERROR; + } limit->shm_zone = shm_zone; limit->burst = burst * 1000; From mdounin at mdounin.ru Wed Aug 8 13:31:33 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 8 Aug 2012 17:31:33 +0400 Subject: SPDY increasing size of pages In-Reply-To: <65FC75A3AAFB4D6398782B4683E7A6C1@Desktop> References: <201208081354.33973.ne@vbart.ru> <50223BEF.2090407@tvdw.eu> <201208081440.14167.ne@vbart.ru> <65FC75A3AAFB4D6398782B4683E7A6C1@Desktop> Message-ID: <20120808133133.GR40452@mdounin.ru> Hello! On Wed, Aug 08, 2012 at 12:50:48PM +0200, Piotr Sikora wrote: > Hey, > > >This is how it is in nginx now. For example, if a response has > >been sent over > >HTTP with chunked transfer encoding, the $body_bytes_sent also > >will not equal > >to payload size. > > > >Personally I do not really agree with that, but it should be discussed and > >changed globally. > > Yes, it should be changed to report only sent payload size (IMHO). In case of http the $body_bytes_sent represents message-body[1] size (aka response body size) as sent to client. Changing it to represent entity-body[2] size instead in general won't be trivial: e.g. with gzip transfer encoding it won't be possible to track size of payload sent without introducing either additional stream of "sizes" or some granularity. With currently supported chunked encoding it would be a bit easier, but I don't really think we want this just to be able to see better(?) numbers in logs. Especially keeping in mind it's just some numbers, and I don't think entity-body size is really better than message-body size. In case of spdy we might want to actually keep spdy as a separate layer and don't count it's overhead (or size reduction) at all, much like it's currently done for SSL. [1] http://tools.ietf.org/html/rfc2616#section-6 [2] http://tools.ietf.org/html/rfc2616#section-4.3 Maxim Dounin From ne at vbart.ru Wed Aug 8 22:16:58 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Thu, 9 Aug 2012 02:16:58 +0400 Subject: SPDY increasing size of pages In-Reply-To: <50224365.7090104@tvdw.eu> References: <201208081440.14167.ne@vbart.ru> <50224365.7090104@tvdw.eu> Message-ID: <201208090216.58742.ne@vbart.ru> On Wednesday 08 August 2012 14:45:57 Tom van der Woerdt wrote: [...] > That's what the logs say, and Firebug confirms it. > > SPDY disabled: - tom [08/Aug/2012:12:42:38 +0200] "GET /home > HTTP/1.1" 304 0 "-" "" "-" > SPDY enabled: - tom [08/Aug/2012:12:44:03 +0200] "GET /home > HTTP/1.1" 304 813 "-" "" "-" > > Both resulted in a 304 Not Modified. > Thank you for the report. Indeed there was a problem with 304 responses. Please, try the new patch: http://nginx.org/patches/spdy/patch.spdy-51.txt wbr, Valentin V. Bartenev From info at tvdw.eu Thu Aug 9 08:47:20 2012 From: info at tvdw.eu (Tom van der Woerdt) Date: Thu, 09 Aug 2012 10:47:20 +0200 Subject: SPDY increasing size of pages In-Reply-To: <201208090216.58742.ne@vbart.ru> References: <201208081440.14167.ne@vbart.ru> <50224365.7090104@tvdw.eu> <201208090216.58742.ne@vbart.ru> Message-ID: <50237918.60503@tvdw.eu> Op 8/9/12 12:16 AM, Valentin V. Bartenev schreef: > On Wednesday 08 August 2012 14:45:57 Tom van der Woerdt wrote: > [...] >> That's what the logs say, and Firebug confirms it. >> >> SPDY disabled: - tom [08/Aug/2012:12:42:38 +0200] "GET /home >> HTTP/1.1" 304 0 "-" "" "-" >> SPDY enabled: - tom [08/Aug/2012:12:44:03 +0200] "GET /home >> HTTP/1.1" 304 813 "-" "" "-" >> >> Both resulted in a 304 Not Modified. >> > Thank you for the report. Indeed there was a problem with 304 responses. > Please, try the new patch: http://nginx.org/patches/spdy/patch.spdy-51.txt > > wbr, Valentin V. Bartenev > Yes, it looks fixed now. Thanks! Tom From piotr.sikora at frickle.com Fri Aug 10 10:38:18 2012 From: piotr.sikora at frickle.com (Piotr Sikora) Date: Fri, 10 Aug 2012 12:38:18 +0200 Subject: SPDY increasing size of pages In-Reply-To: <20120808133133.GR40452@mdounin.ru> References: <201208081354.33973.ne@vbart.ru> <50223BEF.2090407@tvdw.eu> <201208081440.14167.ne@vbart.ru> <65FC75A3AAFB4D6398782B4683E7A6C1@Desktop> <20120808133133.GR40452@mdounin.ru> Message-ID: Hey, > (...) but I don't really think we > want this just to be able to see better(?) numbers in logs. > Especially keeping in mind it's just some numbers, and I don't > think entity-body size is really better than message-body size. But that's exactly the reason - right now $body_bytes_sent is just some meaningless number that may or may not represent something measurable, because part of the time it's neither the payload size (i.e. entity-body size) nor the amount of data written to the wire and it would be nice if this variable could be actually useful one day :) > In case of spdy we might want to actually keep spdy as a separate > layer and don't count it's overhead (or size reduction) at all, > much like it's currently done for SSL. Definitely. Best regards, Piotr Sikora < piotr.sikora at frickle.com > From ne at vbart.ru Fri Aug 10 13:03:14 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Fri, 10 Aug 2012 17:03:14 +0400 Subject: SPDY increasing size of pages In-Reply-To: References: <20120808133133.GR40452@mdounin.ru> Message-ID: <201208101703.14499.ne@vbart.ru> On Friday 10 August 2012 14:38:18 Piotr Sikora wrote: [...] > > > In case of spdy we might want to actually keep spdy as a separate > > layer and don't count it's overhead (or size reduction) at all, > > much like it's currently done for SSL. > > Definitely. $body_bytes_sent is currently r->connection->sent - r->header_size where r->header_size in case of SPDY is the size of SYN_REPLY frame. If we pretend that SPDY is a separate level, and we are unaware about it and its framing, then what should r->header_size represent? There's no traditional HTTP header and we can't deny this. wbr, Valentin V. Bartenev From piotr.sikora at frickle.com Sat Aug 11 03:07:01 2012 From: piotr.sikora at frickle.com (Piotr Sikora) Date: Sat, 11 Aug 2012 05:07:01 +0200 Subject: SPDY increasing size of pages In-Reply-To: <201208101703.14499.ne@vbart.ru> References: <20120808133133.GR40452@mdounin.ru> <201208101703.14499.ne@vbart.ru> Message-ID: Hello Valentin, > $body_bytes_sent is currently r->connection->sent - r->header_size > where r->header_size in case of SPDY is the size of SYN_REPLY frame. This formula cannot work with SPDY because of the multiplexing (unless it's not implemented?). > If we pretend that SPDY is a separate level, and we are unaware about > it and its framing, then what should r->header_size represent? There's > no traditional HTTP header and we can't deny this. Well, there are HEADERS frames and the pairs sent with SYN_REPLY header, which are kind of like the traditional HTTP header, but if we're interested only in the entity body size then it doesn't really matter. Best regards, Piotr Sikora < piotr.sikora at frickle.com > From thinke365 at gmail.com Sun Aug 12 05:29:01 2012 From: thinke365 at gmail.com (thinkee365) Date: Sun, 12 Aug 2012 13:29:01 +0800 Subject: [nginx] svn commit: r4812 - trunk/src/http/modules In-Reply-To: <20120808120347.C1C223FA0EF@mail.nginx.com> References: <20120808120347.C1C223FA0EF@mail.nginx.com> Message-ID: <20120812052900.GA5851@home> why svn commit is send to maillist? it that necessary? if there are 10 commit to svn per day, then the subscriber of nginx maybe receive 10 mails:( On Wed, Aug 08, 2012 at 12:03:47PM +0000, vbart at nginx.com wrote: > Author: vbart > Date: 2012-08-08 12:03:46 +0000 (Wed, 08 Aug 2012) > New Revision: 4812 > URL: http://trac.nginx.org/nginx/changeset/4812/nginx > > Log: > Added three missing checks for NULL after ngx_array_push() calls. > > Found by Coverity. > > > Modified: > trunk/src/http/modules/ngx_http_fastcgi_module.c > trunk/src/http/modules/ngx_http_limit_conn_module.c > trunk/src/http/modules/ngx_http_limit_req_module.c > > Modified: trunk/src/http/modules/ngx_http_fastcgi_module.c > =================================================================== > --- trunk/src/http/modules/ngx_http_fastcgi_module.c 2012-08-07 13:57:04 UTC (rev 4811) > +++ trunk/src/http/modules/ngx_http_fastcgi_module.c 2012-08-08 12:03:46 UTC (rev 4812) > @@ -1626,6 +1626,9 @@ > } > > part = ngx_array_push(f->split_parts); > + if (part == NULL) { > + return NGX_ERROR; > + } > > part->start = part_start; > part->end = part_end; > > Modified: trunk/src/http/modules/ngx_http_limit_conn_module.c > =================================================================== > --- trunk/src/http/modules/ngx_http_limit_conn_module.c 2012-08-07 13:57:04 UTC (rev 4811) > +++ trunk/src/http/modules/ngx_http_limit_conn_module.c 2012-08-08 12:03:46 UTC (rev 4812) > @@ -721,6 +721,10 @@ > } > > limit = ngx_array_push(&lccf->limits); > + if (limit == NULL) { > + return NGX_CONF_ERROR; > + } > + > limit->conn = n; > limit->shm_zone = shm_zone; > > > Modified: trunk/src/http/modules/ngx_http_limit_req_module.c > =================================================================== > --- trunk/src/http/modules/ngx_http_limit_req_module.c 2012-08-07 13:57:04 UTC (rev 4811) > +++ trunk/src/http/modules/ngx_http_limit_req_module.c 2012-08-08 12:03:46 UTC (rev 4812) > @@ -937,6 +937,9 @@ > } > > limit = ngx_array_push(&lrcf->limits); > + if (limit == NULL) { > + return NGX_CONF_ERROR; > + } > > limit->shm_zone = shm_zone; > limit->burst = burst * 1000; > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel From magic.drums at gmail.com Sun Aug 12 05:34:57 2012 From: magic.drums at gmail.com (magic.drums at gmail.com) Date: Sun, 12 Aug 2012 01:34:57 -0400 Subject: [nginx] svn commit: r4812 - trunk/src/http/modules In-Reply-To: <20120812052900.GA5851@home> References: <20120808120347.C1C223FA0EF@mail.nginx.com> <20120812052900.GA5851@home> Message-ID: If they were 10 commits not worry is not so much for the entire amount already received but when there are more prefer to make a compiled and sent on to the end of the day. regards On Sun, Aug 12, 2012 at 1:29 AM, thinkee365 wrote: > > > why svn commit is send to maillist? > it that necessary? > if there are 10 commit to svn per day, then the subscriber of nginx maybe > receive 10 mails:( > > > On Wed, Aug 08, 2012 at 12:03:47PM +0000, vbart at nginx.com wrote: > > Author: vbart > > Date: 2012-08-08 12:03:46 +0000 (Wed, 08 Aug 2012) > > New Revision: 4812 > > URL: http://trac.nginx.org/nginx/changeset/4812/nginx > > > > Log: > > Added three missing checks for NULL after ngx_array_push() calls. > > > > Found by Coverity. > > > > > > Modified: > > trunk/src/http/modules/ngx_http_fastcgi_module.c > > trunk/src/http/modules/ngx_http_limit_conn_module.c > > trunk/src/http/modules/ngx_http_limit_req_module.c > > > > Modified: trunk/src/http/modules/ngx_http_fastcgi_module.c > > =================================================================== > > --- trunk/src/http/modules/ngx_http_fastcgi_module.c 2012-08-07 > 13:57:04 UTC (rev 4811) > > +++ trunk/src/http/modules/ngx_http_fastcgi_module.c 2012-08-08 > 12:03:46 UTC (rev 4812) > > @@ -1626,6 +1626,9 @@ > > } > > > > part = ngx_array_push(f->split_parts); > > + if (part == NULL) { > > + return NGX_ERROR; > > + } > > > > part->start = part_start; > > part->end = part_end; > > > > Modified: trunk/src/http/modules/ngx_http_limit_conn_module.c > > =================================================================== > > --- trunk/src/http/modules/ngx_http_limit_conn_module.c 2012-08-07 > 13:57:04 UTC (rev 4811) > > +++ trunk/src/http/modules/ngx_http_limit_conn_module.c 2012-08-08 > 12:03:46 UTC (rev 4812) > > @@ -721,6 +721,10 @@ > > } > > > > limit = ngx_array_push(&lccf->limits); > > + if (limit == NULL) { > > + return NGX_CONF_ERROR; > > + } > > + > > limit->conn = n; > > limit->shm_zone = shm_zone; > > > > > > Modified: trunk/src/http/modules/ngx_http_limit_req_module.c > > =================================================================== > > --- trunk/src/http/modules/ngx_http_limit_req_module.c 2012-08-07 > 13:57:04 UTC (rev 4811) > > +++ trunk/src/http/modules/ngx_http_limit_req_module.c 2012-08-08 > 12:03:46 UTC (rev 4812) > > @@ -937,6 +937,9 @@ > > } > > > > limit = ngx_array_push(&lrcf->limits); > > + if (limit == NULL) { > > + return NGX_CONF_ERROR; > > + } > > > > limit->shm_zone = shm_zone; > > limit->burst = burst * 1000; > > > > _______________________________________________ > > nginx-devel mailing list > > nginx-devel at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx-devel > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel > -- Victor Pereira -------------- next part -------------- An HTML attachment was scrubbed... URL: From thinke365 at gmail.com Sun Aug 12 05:41:42 2012 From: thinke365 at gmail.com (thinkee365) Date: Sun, 12 Aug 2012 13:41:42 +0800 Subject: [nginx] svn commit: r4812 - trunk/src/http/modules In-Reply-To: References: <20120808120347.C1C223FA0EF@mail.nginx.com> <20120812052900.GA5851@home> Message-ID: <20120812054141.GB5851@home> so are these mails which are telling there are commits to svn repo generated by version control system automatically? or is it some kind of svn hooks? anybody here know the details? On Sun, Aug 12, 2012 at 01:34:57AM -0400, magic.drums at gmail.com wrote: > If they were 10 commits not worry is not so much for the entire amount > already received but when there are more prefer to make a compiled and sent > on to the end of the day. > > regards > > On Sun, Aug 12, 2012 at 1:29 AM, thinkee365 wrote: > > > > > > > why svn commit is send to maillist? > > it that necessary? > > if there are 10 commit to svn per day, then the subscriber of nginx maybe > > receive 10 mails:( > > > > > > On Wed, Aug 08, 2012 at 12:03:47PM +0000, vbart at nginx.com wrote: > > > Author: vbart > > > Date: 2012-08-08 12:03:46 +0000 (Wed, 08 Aug 2012) > > > New Revision: 4812 > > > URL: http://trac.nginx.org/nginx/changeset/4812/nginx > > > > > > Log: > > > Added three missing checks for NULL after ngx_array_push() calls. > > > > > > Found by Coverity. > > > > > > > > > Modified: > > > trunk/src/http/modules/ngx_http_fastcgi_module.c > > > trunk/src/http/modules/ngx_http_limit_conn_module.c > > > trunk/src/http/modules/ngx_http_limit_req_module.c > > > > > > Modified: trunk/src/http/modules/ngx_http_fastcgi_module.c > > > =================================================================== > > > --- trunk/src/http/modules/ngx_http_fastcgi_module.c 2012-08-07 > > 13:57:04 UTC (rev 4811) > > > +++ trunk/src/http/modules/ngx_http_fastcgi_module.c 2012-08-08 > > 12:03:46 UTC (rev 4812) > > > @@ -1626,6 +1626,9 @@ > > > } > > > > > > part = ngx_array_push(f->split_parts); > > > + if (part == NULL) { > > > + return NGX_ERROR; > > > + } > > > > > > part->start = part_start; > > > part->end = part_end; > > > > > > Modified: trunk/src/http/modules/ngx_http_limit_conn_module.c > > > =================================================================== > > > --- trunk/src/http/modules/ngx_http_limit_conn_module.c 2012-08-07 > > 13:57:04 UTC (rev 4811) > > > +++ trunk/src/http/modules/ngx_http_limit_conn_module.c 2012-08-08 > > 12:03:46 UTC (rev 4812) > > > @@ -721,6 +721,10 @@ > > > } > > > > > > limit = ngx_array_push(&lccf->limits); > > > + if (limit == NULL) { > > > + return NGX_CONF_ERROR; > > > + } > > > + > > > limit->conn = n; > > > limit->shm_zone = shm_zone; > > > > > > > > > Modified: trunk/src/http/modules/ngx_http_limit_req_module.c > > > =================================================================== > > > --- trunk/src/http/modules/ngx_http_limit_req_module.c 2012-08-07 > > 13:57:04 UTC (rev 4811) > > > +++ trunk/src/http/modules/ngx_http_limit_req_module.c 2012-08-08 > > 12:03:46 UTC (rev 4812) > > > @@ -937,6 +937,9 @@ > > > } > > > > > > limit = ngx_array_push(&lrcf->limits); > > > + if (limit == NULL) { > > > + return NGX_CONF_ERROR; > > > + } > > > > > > limit->shm_zone = shm_zone; > > > limit->burst = burst * 1000; > > > > > > _______________________________________________ > > > nginx-devel mailing list > > > nginx-devel at nginx.org > > > http://mailman.nginx.org/mailman/listinfo/nginx-devel > > > > _______________________________________________ > > nginx-devel mailing list > > nginx-devel at nginx.org > > http://mailman.nginx.org/mailman/listinfo/nginx-devel > > > > > > -- > Victor Pereira > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel From sb at waeme.net Sun Aug 12 08:21:41 2012 From: sb at waeme.net (Sergey Budnevitch) Date: Sun, 12 Aug 2012 12:21:41 +0400 Subject: [nginx] svn commit: r4812 - trunk/src/http/modules In-Reply-To: <20120812054141.GB5851@home> References: <20120808120347.C1C223FA0EF@mail.nginx.com> <20120812052900.GA5851@home> <20120812054141.GB5851@home> Message-ID: <1FADBBE5-FDDF-41F7-8944-39864B3967CC@waeme.net> On 12.08.2012, at 9:41, thinkee365 wrote: > so are these mails which are telling there are commits to svn repo generated by version control system automatically? > or is it some kind of svn hooks? Sure, it is svn post-commit hook. FYI: http://mailman.nginx.org/pipermail/nginx-devel/2011-October/001346.html From sunyxing at gmail.com Mon Aug 13 06:25:24 2012 From: sunyxing at gmail.com (Thomas) Date: Mon, 13 Aug 2012 14:25:24 +0800 Subject: Can hide_headers_hash in ngx_http_upstream_conf_t be empty? Message-ID: Hi, all I'm writing a proxy module which sends http requests to local cache server through upstream. It seems that the worker will crush if the upstream->conf->hide_headers_hash is empty, following is my gdb stack(nginx 1.2.2, Apple Mountain Lion): Program received signal EXC_ARITHMETIC, Arithmetic exception. 0x00000001094a0343 in ngx_hash_find (hash=0x7febb282a970, key=3389140803, name=0x7febb2815df4 "serverDate", len=6) at ngx_hash.c:22 22 elt = hash->buckets[key % hash->size]; (gdb) bt #0 0x00000001094a0343 in ngx_hash_find (hash=0x7febb282a970, key=3389140803, name=0x7febb2815df4 "serverDate", len=6) at ngx_hash.c:22 #1 0x0000000109513da4 in ngx_http_upstream_process_headers (r=0x7febb2814600, u=0x7febb2815608) at ngx_http_upstream.c:1924 #2 0x000000010951322f in ngx_http_upstream_process_header (r=0x7febb2814600, u=0x7febb2815608) at ngx_http_upstream.c:1639 #3 0x0000000109511618 in ngx_http_upstream_handler (ev=0x7febb283c0a0) at ngx_http_upstream.c:935 #4 0x00000001094d8617 in ngx_kqueue_process_events (cycle=0x7febb280b850, timer=60000, flags=1) at ngx_kqueue_module.c:684 #5 0x00000001094c706a in ngx_process_events_and_timers (cycle=0x7febb280b850) at ngx_event.c:247 #6 0x00000001094d5844 in ngx_worker_process_cycle (cycle=0x7febb280b850, data=0x0) at ngx_process_cycle.c:808 #7 0x00000001094d1a36 in ngx_spawn_process (cycle=0x7febb280b850, proc=0x1094d5670 , data=0x0, name=0x10958b920 "worker process", respawn=-3) at ngx_process.c:198 #8 0x00000001094d4669 in ngx_start_worker_processes (cycle=0x7febb280b850, n=1, type=-3) at ngx_process_cycle.c:365 #9 0x00000001094d3b21 in ngx_master_process_cycle (cycle=0x7febb280b850) at ngx_process_cycle.c:137 #10 0x000000010949b511 in main (argc=1, argv=0x7fff56765cd0) at nginx.c:410 (gdb) f 1 #1 0x0000000109513da4 in ngx_http_upstream_process_headers (r=0x7febb2814600, u=0x7febb2815608) at ngx_http_upstream.c:1924 1924 if (ngx_hash_find(&u->conf->hide_headers_hash, h[i].hash, (gdb) f 0 #0 0x00000001094a0343 in ngx_hash_find (hash=0x7febb282a970, key=3389140803, name=0x7febb2815df4 "serverDate", len=6) at ngx_hash.c:22 22 elt = hash->buckets[key % hash->size]; (gdb) p *hash $6 = { buckets = 0x0, size = 0 } I checked ngx_http_proxy_module and it fills the hash with some default values, but what should I do if i'm not hiding any response header? -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at tvdw.eu Mon Aug 13 09:12:18 2012 From: info at tvdw.eu (Tom van der Woerdt) Date: Mon, 13 Aug 2012 11:12:18 +0200 Subject: SPDY/1.3.4: strange connection buildup Message-ID: <5028C4F2.3060809@tvdw.eu> Hi, I've attached two Munin screenshots that show a strange issue I've been having with nginx. I'm running the 1.3.4 version with the SPDY patch (latest, 51) and it really looks like nginx sometimes forgets to close connections. I've been running the SPDY patch since version 38, which is just under 2 months ago. The attached screenshots really show the issue well. A few things: * Before the SPDY patch, the connection count would go to nearly 0 in the night. * After the patch, even at night the connection count would stick to 20 or 30. This is not entirely unexpected as the SPDY protocol suggests not letting the connection time out unless necessary. * I've always used the exact same build arguments (see below) and I haven't changed the configuration recently. * Before patch 50/51 the connection count would hardly ever go above 100. * After patch 50/51 the connection count managed to go over 300 and never below 80. * Note in the month screenshot how between week 29 and week 30 there was a pretty low connection count. This is because that week I restarted the server. It seems to take a while for nginx to start making mistakes. * The drop in connections tonight was because I restarted nginx. * The server only serves 1 SPDY/SSL site which has approximately 40 or 50 unique visitors a day. All other sites are HTTP-only and hardly popular. There's no reason for the server to have 300 active connections. I'm hoping that someone else can reproduce this issue as well. Tom Right, here go the build arguments: > ./configure \ > --prefix=/etc/nginx/ \ > --sbin-path=/usr/sbin/nginx \ > --conf-path=/etc/nginx/nginx.conf \ > --error-log-path=/var/log/nginx/error.log \ > --http-log-path=/var/log/nginx/access.log \ > --pid-path=/var/run/nginx.pid \ > --lock-path=/var/run/nginx.lock \ > --http-client-body-temp-path=/var/cache/nginx/client_temp \ > --http-proxy-temp-path=/var/cache/nginx/proxy_temp \ > --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \ > --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \ > --http-scgi-temp-path=/var/cache/nginx/scgi_temp \ > --user=nginx \ > --group=nginx \ > --with-http_ssl_module \ > --with-http_realip_module \ > --with-http_addition_module \ > --with-http_sub_module \ > --with-http_dav_module \ > --with-http_flv_module \ > --with-http_mp4_module \ > --with-http_gzip_static_module \ > --with-http_random_index_module \ > --with-http_secure_link_module \ > --with-http_stub_status_module \ > --with-mail \ > --with-mail_ssl_module \ > --with-file-aio \ > --with-ipv6 \ > --with-cc-opt='-O2 -g -m32 -march=i386 -mtune=generic > -fasynchronous-unwind-tables' \ > --with-openssl='/root/libraries/openssl-1.0.1c/' -------------- next part -------------- A non-text attachment was scrubbed... Name: nginx_status-month.png Type: image/png Size: 41567 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: nginx_status-week.png Type: image/png Size: 32292 bytes Desc: not available URL: From ne at vbart.ru Mon Aug 13 10:07:52 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Mon, 13 Aug 2012 14:07:52 +0400 Subject: SPDY/1.3.4: strange connection buildup In-Reply-To: <5028C4F2.3060809@tvdw.eu> References: <5028C4F2.3060809@tvdw.eu> Message-ID: <201208131407.52651.ne@vbart.ru> On Monday 13 August 2012 13:12:18 Tom van der Woerdt wrote: > Hi, > > I've attached two Munin screenshots that show a strange issue I've been > having with nginx. I'm running the 1.3.4 version with the SPDY patch > (latest, 51) and it really looks like nginx sometimes forgets to close > connections. [...] In case of SPDY these numbers are not real connections. It also counts SPDY-streams. And it's pretty common when a browser opens about 10-20 streams per page. But it is not ruled out, that there's may be a problem with the counting. wbr, Valentin V. Bartenev From info at tvdw.eu Mon Aug 13 10:11:41 2012 From: info at tvdw.eu (Tom van der Woerdt) Date: Mon, 13 Aug 2012 12:11:41 +0200 Subject: SPDY/1.3.4: strange connection buildup In-Reply-To: <201208131407.52651.ne@vbart.ru> References: <5028C4F2.3060809@tvdw.eu> <201208131407.52651.ne@vbart.ru> Message-ID: <5028D2DD.3000605@tvdw.eu> Op 8/13/12 12:07 PM, Valentin V. Bartenev schreef: > On Monday 13 August 2012 13:12:18 Tom van der Woerdt wrote: >> Hi, >> >> I've attached two Munin screenshots that show a strange issue I've been >> having with nginx. I'm running the 1.3.4 version with the SPDY patch >> (latest, 51) and it really looks like nginx sometimes forgets to close >> connections. > [...] > > In case of SPDY these numbers are not real connections. It also counts > SPDY-streams. And it's pretty common when a browser opens about 10-20 > streams per page. > > But it is not ruled out, that there's may be a problem with the counting. > If streams are counted instead of connections then the number is even more wrong. A stream gets closed immediately after the response has been sent. My server has no "slow" streams so there should be maybe 1 or 2 streams visible on the graph, not 250. Tom From ne at vbart.ru Mon Aug 13 10:26:47 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Mon, 13 Aug 2012 14:26:47 +0400 Subject: SPDY/1.3.4: strange connection buildup In-Reply-To: <5028D2DD.3000605@tvdw.eu> References: <5028C4F2.3060809@tvdw.eu> <201208131407.52651.ne@vbart.ru> <5028D2DD.3000605@tvdw.eu> Message-ID: <201208131426.47509.ne@vbart.ru> On Monday 13 August 2012 14:11:41 Tom van der Woerdt wrote: > Op 8/13/12 12:07 PM, Valentin V. Bartenev schreef: > > On Monday 13 August 2012 13:12:18 Tom van der Woerdt wrote: > >> Hi, > >> > >> I've attached two Munin screenshots that show a strange issue I've been > >> having with nginx. I'm running the 1.3.4 version with the SPDY patch > >> (latest, 51) and it really looks like nginx sometimes forgets to close > >> connections. > > > > [...] > > > > In case of SPDY these numbers are not real connections. It also counts > > SPDY-streams. And it's pretty common when a browser opens about 10-20 > > streams per page. > > > > But it is not ruled out, that there's may be a problem with the counting. > > If streams are counted instead of connections then the number is even > more wrong. Streams + connections. > A stream gets closed immediately after the response has been > sent. My server has no "slow" streams so there should be maybe 1 or 2 > streams visible on the graph, not 250. > Could you check the error log for segfault alerts? If worker process dies then counters will stay in a wrong state. wbr, Valentin V. Bartenev From info at tvdw.eu Mon Aug 13 10:40:07 2012 From: info at tvdw.eu (Tom van der Woerdt) Date: Mon, 13 Aug 2012 12:40:07 +0200 Subject: SPDY/1.3.4: strange connection buildup In-Reply-To: <201208131426.47509.ne@vbart.ru> References: <5028C4F2.3060809@tvdw.eu> <201208131407.52651.ne@vbart.ru> <5028D2DD.3000605@tvdw.eu> <201208131426.47509.ne@vbart.ru> Message-ID: <5028D987.3050708@tvdw.eu> Op 8/13/12 12:26 PM, Valentin V. Bartenev schreef: > On Monday 13 August 2012 14:11:41 Tom van der Woerdt wrote: >> Op 8/13/12 12:07 PM, Valentin V. Bartenev schreef: >>> On Monday 13 August 2012 13:12:18 Tom van der Woerdt wrote: >>>> Hi, >>>> >>>> I've attached two Munin screenshots that show a strange issue I've been >>>> having with nginx. I'm running the 1.3.4 version with the SPDY patch >>>> (latest, 51) and it really looks like nginx sometimes forgets to close >>>> connections. >>> [...] >>> >>> In case of SPDY these numbers are not real connections. It also counts >>> SPDY-streams. And it's pretty common when a browser opens about 10-20 >>> streams per page. >>> >>> But it is not ruled out, that there's may be a problem with the counting. >> If streams are counted instead of connections then the number is even >> more wrong. > Streams + connections. > >> A stream gets closed immediately after the response has been >> sent. My server has no "slow" streams so there should be maybe 1 or 2 >> streams visible on the graph, not 250. >> > Could you check the error log for segfault alerts? If worker process dies then > counters will stay in a wrong state. > [root at server nginx]# cat error.log* | grep alert 2012/08/12 18:52:18 [alert] 25293#0: worker process 32049 exited on signal 11 2012/08/10 23:02:13 [alert] 25293#0: worker process 16308 exited on signal 11 2012/08/09 17:55:50 [alert] 25293#0: worker process 25294 exited on signal 11 [root at server nginx]# cat error.log* | grep emerg 2012/08/12 18:52:18 [emerg] 12943#0: eventfd() failed (38: Function not implemented) 2012/08/12 21:58:39 [emerg] 6416#0: eventfd() failed (38: Function not implemented) 2012/08/12 23:46:04 [emerg] 7651#0: eventfd() failed (38: Function not implemented) 2012/08/13 00:43:46 [emerg] 880#0: eventfd() failed (38: Function not implemented) 2012/08/10 17:14:45 [emerg] 16308#0: eventfd() failed (38: Function not implemented) 2012/08/10 23:02:13 [emerg] 32049#0: eventfd() failed (38: Function not implemented) 2012/08/09 10:43:42 [emerg] 25294#0: eventfd() failed (38: Function not implemented) 2012/08/09 17:55:50 [emerg] 5345#0: eventfd() failed (38: Function not implemented) [root at server nginx]# cat error.log* | grep error | grep -v "redirection cycle" | grep -v "timed out" | grep -v "upstream" | grep -v "No such file" | grep -v "basic authentication" | grep -v "password mismatch" -- nothing -- Tom From ne at vbart.ru Mon Aug 13 12:16:12 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Mon, 13 Aug 2012 16:16:12 +0400 Subject: SPDY/1.3.4: strange connection buildup In-Reply-To: <5028D987.3050708@tvdw.eu> References: <5028C4F2.3060809@tvdw.eu> <201208131426.47509.ne@vbart.ru> <5028D987.3050708@tvdw.eu> Message-ID: <201208131616.12172.ne@vbart.ru> On Monday 13 August 2012 14:40:07 Tom van der Woerdt wrote: > Op 8/13/12 12:26 PM, Valentin V. Bartenev schreef: > > On Monday 13 August 2012 14:11:41 Tom van der Woerdt wrote: > >> Op 8/13/12 12:07 PM, Valentin V. Bartenev schreef: > >>> On Monday 13 August 2012 13:12:18 Tom van der Woerdt wrote: > >>>> Hi, > >>>> > >>>> I've attached two Munin screenshots that show a strange issue I've > >>>> been having with nginx. I'm running the 1.3.4 version with the SPDY > >>>> patch (latest, 51) and it really looks like nginx sometimes forgets > >>>> to close connections. > >>> > >>> [...] > >>> > >>> In case of SPDY these numbers are not real connections. It also counts > >>> SPDY-streams. And it's pretty common when a browser opens about 10-20 > >>> streams per page. > >>> > >>> But it is not ruled out, that there's may be a problem with the > >>> counting. > >> > >> If streams are counted instead of connections then the number is even > >> more wrong. > > > > Streams + connections. > > > >> A stream gets closed immediately after the response has been > >> sent. My server has no "slow" streams so there should be maybe 1 or 2 > >> streams visible on the graph, not 250. > > > > Could you check the error log for segfault alerts? If worker process dies > > then counters will stay in a wrong state. > > [root at server nginx]# cat error.log* | grep alert > 2012/08/12 18:52:18 [alert] 25293#0: worker process 32049 exited on > signal 11 > 2012/08/10 23:02:13 [alert] 25293#0: worker process 16308 exited on > signal 11 > 2012/08/09 17:55:50 [alert] 25293#0: worker process 25294 exited on > signal 11 > [...] Well, I was right, it's segfaulting. Please, try a patch with the latest changes: http://nginx.org/patches/spdy/patch.spdy-52.txt If this doesn't help, I will ask you to provide a core dump: http://wiki.nginx.org/Debugging#Core_dump wbr, Valentin V. Bartenev From mdounin at mdounin.ru Mon Aug 13 15:04:42 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 13 Aug 2012 19:04:42 +0400 Subject: Can hide_headers_hash in ngx_http_upstream_conf_t be empty? In-Reply-To: References: Message-ID: <20120813150442.GT40452@mdounin.ru> Hello! On Mon, Aug 13, 2012 at 02:25:24PM +0800, Thomas wrote: > Hi, all > > I'm writing a proxy module which sends http requests to local cache > server through upstream. It seems that the worker will crush if the > upstream->conf->hide_headers_hash is empty, following is my gdb stack(nginx > 1.2.2, Apple Mountain Lion): [...] > (gdb) p *hash > $6 = { > buckets = 0x0, > size = 0 > } > > I checked ngx_http_proxy_module and it fills the hash with some default > values, but what should I do if i'm not hiding any response header? It can be empty, but it must be initialized. In your case it's not initialized and this is what causes crash. Maxim Dounin From takashi at sendmail.com Mon Aug 13 16:33:20 2012 From: takashi at sendmail.com (Takashi Komatsubara) Date: Mon, 13 Aug 2012 09:33:20 -0700 Subject: Ticket number for a fix with 1.1.1 Message-ID: Hi team, With 1.1.1 nginx, the below fix is included. ----- *) Bugfix: a segmentation fault might occur in a worker process if many backup servers were used in an upstream. ---- I want to see what changes have been done. So, I would like to know the ticket number. Does anybody know it ? Thank you very much, Takashi. From maxim at nginx.com Mon Aug 13 18:33:00 2012 From: maxim at nginx.com (Maxim Konovalov) Date: Mon, 13 Aug 2012 22:33:00 +0400 Subject: Ticket number for a fix with 1.1.1 In-Reply-To: References: Message-ID: <5029485C.9050207@nginx.com> Hello, On 8/13/12 8:33 PM, Takashi Komatsubara wrote: > Hi team, > > With 1.1.1 nginx, the below fix is included. > > ----- > *) Bugfix: a segmentation fault might occur in a worker process if many > backup servers were used in an upstream. > ---- > > I want to see what changes have been done. So, I would like to know the ticket number. > Does anybody know it ? > Please check this one http://trac.nginx.org/nginx/changeset/4012/nginx -- Maxim Konovalov +7 (910) 4293178 http://nginx.com/ From takashi at sendmail.com Wed Aug 15 07:10:27 2012 From: takashi at sendmail.com (Takashi Komatsubara) Date: Wed, 15 Aug 2012 00:10:27 -0700 Subject: Ticket number for a fix with 1.1.1 In-Reply-To: <5029485C.9050207@nginx.com> References: <5029485C.9050207@nginx.com> Message-ID: <181BECF2-2ADE-4311-9D0F-0BB6436681DE@sendmail.com> Hello Maxim, Thank you very much!! Takashi. On 2012/08/14, at 3:33, Maxim Konovalov wrote: > Hello, > > On 8/13/12 8:33 PM, Takashi Komatsubara wrote: >> Hi team, >> >> With 1.1.1 nginx, the below fix is included. >> >> ----- >> *) Bugfix: a segmentation fault might occur in a worker process if many >> backup servers were used in an upstream. >> ---- >> >> I want to see what changes have been done. So, I would like to know the ticket number. >> Does anybody know it ? >> > Please check this one > > http://trac.nginx.org/nginx/changeset/4012/nginx > > -- > Maxim Konovalov > +7 (910) 4293178 > http://nginx.com/ > > From ru at nginx.com Wed Aug 15 11:17:56 2012 From: ru at nginx.com (ru at nginx.com) Date: Wed, 15 Aug 2012 11:17:56 +0000 Subject: [nginx] svn commit: r4813 - trunk/src/mail Message-ID: <20120815111756.3ADAA3FA1F0@mail.nginx.com> Author: ru Date: 2012-08-15 11:17:55 +0000 (Wed, 15 Aug 2012) New Revision: 4813 URL: http://trac.nginx.org/nginx/changeset/4813/nginx Log: Corrected the directive name in the ngx_mail_auth_http_module error message. Modified: trunk/src/mail/ngx_mail_auth_http_module.c Modified: trunk/src/mail/ngx_mail_auth_http_module.c =================================================================== --- trunk/src/mail/ngx_mail_auth_http_module.c 2012-08-08 12:03:46 UTC (rev 4812) +++ trunk/src/mail/ngx_mail_auth_http_module.c 2012-08-15 11:17:55 UTC (rev 4813) @@ -1332,7 +1332,7 @@ if (conf->peer == NULL) { ngx_log_error(NGX_LOG_EMERG, cf->log, 0, - "no \"http_auth\" is defined for server in %s:%ui", + "no \"auth_http\" is defined for server in %s:%ui", conf->file, conf->line); return NGX_CONF_ERROR; From ru at nginx.com Wed Aug 15 11:30:25 2012 From: ru at nginx.com (ru at nginx.com) Date: Wed, 15 Aug 2012 11:30:25 +0000 Subject: [nginx] svn commit: r4814 - trunk/src/mail Message-ID: <20120815113025.D3AC13F9C6B@mail.nginx.com> Author: ru Date: 2012-08-15 11:30:24 +0000 (Wed, 15 Aug 2012) New Revision: 4814 URL: http://trac.nginx.org/nginx/changeset/4814/nginx Log: mail_core: don't let the well-known port in the "listen" directive to override the already set "protocol". Modified: trunk/src/mail/ngx_mail_core_module.c Modified: trunk/src/mail/ngx_mail_core_module.c =================================================================== --- trunk/src/mail/ngx_mail_core_module.c 2012-08-15 11:17:55 UTC (rev 4813) +++ trunk/src/mail/ngx_mail_core_module.c 2012-08-15 11:30:24 UTC (rev 4814) @@ -378,22 +378,24 @@ ls->ipv6only = 1; #endif - for (m = 0; ngx_modules[m]; m++) { - if (ngx_modules[m]->type != NGX_MAIL_MODULE) { - continue; - } - - module = ngx_modules[m]->ctx; - - if (module->protocol == NULL) { - continue; - } - - for (i = 0; module->protocol->port[i]; i++) { - if (module->protocol->port[i] == u.port) { - cscf->protocol = module->protocol; - break; + if (cscf->protocol == NULL) { + for (m = 0; ngx_modules[m]; m++) { + if (ngx_modules[m]->type != NGX_MAIL_MODULE) { + continue; } + + module = ngx_modules[m]->ctx; + + if (module->protocol == NULL) { + continue; + } + + for (i = 0; module->protocol->port[i]; i++) { + if (module->protocol->port[i] == u.port) { + cscf->protocol = module->protocol; + break; + } + } } } From me at prudhvi.net Wed Aug 15 23:05:22 2012 From: me at prudhvi.net (Prudhvi Krishna Surapaneni) Date: Wed, 15 Aug 2012 16:05:22 -0700 Subject: Enable module on two locations Message-ID: <20120815230522.GA24270@prudhvi.net> Hi List, I have a module, that i am using to serve files from two different application specific locations. location ~ /download/([a-z0-9])/f/([a-z0-9]) { my_module; my_module_source_file file1; my_module_id $1; my_module_file_size $2; } location ~/download/([a-z0-9])/q/([a-z0-9]) { my_module; my_module_source_file file2; my_module_id $1; my_module_file_size $2; } My loc_conf_t is as follows typedef struct { ngx_http_complex_value_t *my_id; ngx_str_t source_file; ngx_http_complex_value_t *my_size; } I run into problems when accessing files from the second location. The module always trys to get file1 as the source instead of file2. My question is why does it always pick up the file1. But, interestingly the complex values are captured correctly. How can i fix this scenario so that it picks up the proper value for my_module_source_file basing on the location it was called. Thanks, Prudhvi Surapaneni. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 490 bytes Desc: Digital signature URL: From lide at nhn.com Thu Aug 16 01:42:04 2012 From: lide at nhn.com (=?gb2312?B?wO61wltSZWVkXQ==?=) Date: Thu, 16 Aug 2012 09:42:04 +0800 Subject: Migrate from Apache to nginx Message-ID: <54C5E46EC92AEF4F930AB3738AA0B9DC7D7F7E@mexcnb01.cn.all.nhncorp.com> Hi, We have developed a tool, which can migrate apache conf file to Nginx conf file. This tool is able to converting the most frequently used and the less frequently used Apache directives. https://github.com/nhnc-nginx/apache2nginx/wiki/Welcome-to-Apache2Nginx If you like to try, give us some advise. Thank you. Reed -------------- next part -------------- An HTML attachment was scrubbed... URL: From nbubingo at gmail.com Thu Aug 16 02:12:01 2012 From: nbubingo at gmail.com (=?GB2312?B?0qbOsLHz?=) Date: Thu, 16 Aug 2012 10:12:01 +0800 Subject: Migrate from Apache to nginx In-Reply-To: <54C5E46EC92AEF4F930AB3738AA0B9DC7D7F7E@mexcnb01.cn.all.nhncorp.com> References: <54C5E46EC92AEF4F930AB3738AA0B9DC7D7F7E@mexcnb01.cn.all.nhncorp.com> Message-ID: Awsome, It's a cool tool. 2012/8/16 ??[Reed] : > Hi, > > > > We have developed a tool, which can migrate apache conf file to Nginx conf > file. > > This tool is able to converting the most frequently used and the less > frequently used Apache > > directives. > > > > https://github.com/nhnc-nginx/apache2nginx/wiki/Welcome-to-Apache2Nginx > > > > If you like to try, give us some advise. Thank you. > > > > Reed > > > > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel From nbubingo at gmail.com Thu Aug 16 08:46:05 2012 From: nbubingo at gmail.com (=?GB2312?B?0qbOsLHz?=) Date: Thu, 16 Aug 2012 16:46:05 +0800 Subject: A bug with geo module which may cause Nginx segment fault. Message-ID: Hi, We found a bug with geo module. If you use geo module with range directive, but you don't add the default directive, it'll cause a segment fault. The test configure is like this: http { geo $geo { ranges; 10.0.0.1-10.0.0.1 1; } server { listen 80; location / { set $test $geo; root html; index index.html index.htm; } } } The reason is that configure structure value is assigned to the geo structure before the default value initialized. You can see the code in the geo module: geo->u.high = ctx.high; var->get_handler = ngx_http_geo_range_variable; var->data = (uintptr_t) geo; if (ctx.high.default_value == NULL) { ctx.high.default_value = &ngx_http_variable_null_value; } The variable of ctx is allocated by stack. And the member variable ctx.high is structure, not a pointer. The attachment is our patch for this bug. The man who first found this bug is Zhen Chen ( gongyuan.cz at taobao.com ) in our team. Thanks. -------------- next part -------------- A non-text attachment was scrubbed... Name: geo.patch Type: application/octet-stream Size: 797 bytes Desc: not available URL: From info at tvdw.eu Thu Aug 16 10:17:48 2012 From: info at tvdw.eu (Tom van der Woerdt) Date: Thu, 16 Aug 2012 12:17:48 +0200 Subject: SPDY/1.3.4: strange connection buildup In-Reply-To: <201208131616.12172.ne@vbart.ru> References: <5028C4F2.3060809@tvdw.eu> <201208131426.47509.ne@vbart.ru> <5028D987.3050708@tvdw.eu> <201208131616.12172.ne@vbart.ru> Message-ID: <502CC8CC.6070904@tvdw.eu> I've had the new patch running for a few days and I don't see any strange connection spikes yet, and no crash dumps either. So yeah, I think it's fixed. Tom Op 8/13/12 2:16 PM, Valentin V. Bartenev schreef: > On Monday 13 August 2012 14:40:07 Tom van der Woerdt wrote: >> Op 8/13/12 12:26 PM, Valentin V. Bartenev schreef: >>> On Monday 13 August 2012 14:11:41 Tom van der Woerdt wrote: >>>> Op 8/13/12 12:07 PM, Valentin V. Bartenev schreef: >>>>> On Monday 13 August 2012 13:12:18 Tom van der Woerdt wrote: >>>>>> Hi, >>>>>> >>>>>> I've attached two Munin screenshots that show a strange issue I've >>>>>> been having with nginx. I'm running the 1.3.4 version with the SPDY >>>>>> patch (latest, 51) and it really looks like nginx sometimes forgets >>>>>> to close connections. >>>>> [...] >>>>> >>>>> In case of SPDY these numbers are not real connections. It also counts >>>>> SPDY-streams. And it's pretty common when a browser opens about 10-20 >>>>> streams per page. >>>>> >>>>> But it is not ruled out, that there's may be a problem with the >>>>> counting. >>>> If streams are counted instead of connections then the number is even >>>> more wrong. >>> Streams + connections. >>> >>>> A stream gets closed immediately after the response has been >>>> sent. My server has no "slow" streams so there should be maybe 1 or 2 >>>> streams visible on the graph, not 250. >>> Could you check the error log for segfault alerts? If worker process dies >>> then counters will stay in a wrong state. >> [root at server nginx]# cat error.log* | grep alert >> 2012/08/12 18:52:18 [alert] 25293#0: worker process 32049 exited on >> signal 11 >> 2012/08/10 23:02:13 [alert] 25293#0: worker process 16308 exited on >> signal 11 >> 2012/08/09 17:55:50 [alert] 25293#0: worker process 25294 exited on >> signal 11 >> > [...] > > Well, I was right, it's segfaulting. > > Please, try a patch with the latest changes: > http://nginx.org/patches/spdy/patch.spdy-52.txt > > If this doesn't help, I will ask you to provide a core dump: > http://wiki.nginx.org/Debugging#Core_dump > > wbr, Valentin V. Bartenev > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel From mdounin at mdounin.ru Thu Aug 16 10:58:19 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Thu, 16 Aug 2012 10:58:19 +0000 Subject: [nginx] svn commit: r4815 - trunk/src/http/modules Message-ID: <20120816105820.6E0323FA201@mail.nginx.com> Author: mdounin Date: 2012-08-16 10:58:18 +0000 (Thu, 16 Aug 2012) New Revision: 4815 URL: http://trac.nginx.org/nginx/changeset/4815/nginx Log: Map: fixed optimization of variables as values. Previous code incorrectly used ctx->var_values as an array of pointers to ngx_http_variable_value_t, but the array contains structures, not pointers. Additionally, ctx->var_values inspection failed to properly set var on match. Modified: trunk/src/http/modules/ngx_http_map_module.c Modified: trunk/src/http/modules/ngx_http_map_module.c =================================================================== --- trunk/src/http/modules/ngx_http_map_module.c 2012-08-15 11:30:24 UTC (rev 4814) +++ trunk/src/http/modules/ngx_http_map_module.c 2012-08-16 10:58:18 UTC (rev 4815) @@ -416,11 +416,12 @@ for (i = 0; i < ctx->var_values.nelts; i++) { if (index == (ngx_int_t) var[i].data) { + var = &var[i]; goto found; } } - var = ngx_palloc(ctx->keys.pool, sizeof(ngx_http_variable_value_t)); + var = ngx_array_push(&ctx->var_values); if (var == NULL) { return NGX_CONF_ERROR; } @@ -431,13 +432,6 @@ var->len = 0; var->data = (u_char *) index; - vp = ngx_array_push(&ctx->var_values); - if (vp == NULL) { - return NGX_CONF_ERROR; - } - - *vp = var; - goto found; } From mdounin at mdounin.ru Thu Aug 16 12:05:58 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Thu, 16 Aug 2012 12:05:58 +0000 Subject: [nginx] svn commit: r4816 - trunk/src/core Message-ID: <20120816120558.E5FAF3F9F56@mail.nginx.com> Author: mdounin Date: 2012-08-16 12:05:58 +0000 (Thu, 16 Aug 2012) New Revision: 4816 URL: http://trac.nginx.org/nginx/changeset/4816/nginx Log: Crypt: fixed handling of corrupted SSHA entries in password file. Found by Coverity. Modified: trunk/src/core/ngx_crypt.c Modified: trunk/src/core/ngx_crypt.c =================================================================== --- trunk/src/core/ngx_crypt.c 2012-08-16 10:58:18 UTC (rev 4815) +++ trunk/src/core/ngx_crypt.c 2012-08-16 12:05:58 UTC (rev 4816) @@ -194,6 +194,7 @@ ngx_crypt_ssha(ngx_pool_t *pool, u_char *key, u_char *salt, u_char **encrypted) { size_t len; + ngx_int_t rc; ngx_str_t encoded, decoded; ngx_sha1_t sha1; @@ -204,13 +205,19 @@ encoded.data = salt + sizeof("{SSHA}") - 1; encoded.len = ngx_strlen(encoded.data); - decoded.data = ngx_pnalloc(pool, ngx_base64_decoded_length(encoded.len)); + len = ngx_max(ngx_base64_decoded_length(encoded.len), 20); + + decoded.data = ngx_pnalloc(pool, len); if (decoded.data == NULL) { return NGX_ERROR; } - ngx_decode_base64(&decoded, &encoded); + rc = ngx_decode_base64(&decoded, &encoded); + if (rc != NGX_OK || decoded.len < 20) { + decoded.len = 20; + } + /* update SHA1 from key and salt */ ngx_sha1_init(&sha1); From mdounin at mdounin.ru Thu Aug 16 12:23:41 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 16 Aug 2012 16:23:41 +0400 Subject: Enable module on two locations In-Reply-To: <20120815230522.GA24270@prudhvi.net> References: <20120815230522.GA24270@prudhvi.net> Message-ID: <20120816122341.GU40452@mdounin.ru> Hello! On Wed, Aug 15, 2012 at 04:05:22PM -0700, Prudhvi Krishna Surapaneni wrote: > Hi List, > > I have a module, that i am using to serve files from two different > application specific locations. > > location ~ /download/([a-z0-9])/f/([a-z0-9]) { > my_module; > my_module_source_file file1; > my_module_id $1; > my_module_file_size $2; > } > > location ~/download/([a-z0-9])/q/([a-z0-9]) { > my_module; > my_module_source_file file2; > my_module_id $1; > my_module_file_size $2; > } > > My loc_conf_t is as follows > > typedef struct { > ngx_http_complex_value_t *my_id; > ngx_str_t source_file; > ngx_http_complex_value_t *my_size; > } > > I run into problems when accessing files from the second location. The > module always trys to get file1 as the source instead of file2. > > My question is why does it always pick up the file1. But, interestingly > the complex values are captured correctly. How can i fix this scenario > so that it picks up the proper value for my_module_source_file basing > on the location it was called. Most likely you did something wrong during configuration parsing and/or configuration merge in your module. It's hard to say anything more without the code. Maxim Dounin From mdounin at mdounin.ru Thu Aug 16 13:01:42 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Thu, 16 Aug 2012 13:01:42 +0000 Subject: [nginx] svn commit: r4817 - trunk/src/http/modules Message-ID: <20120816130142.47F453FA780@mail.nginx.com> Author: mdounin Date: 2012-08-16 13:01:41 +0000 (Thu, 16 Aug 2012) New Revision: 4817 URL: http://trac.nginx.org/nginx/changeset/4817/nginx Log: Geo: fixed handling of ranges without default set. The bug had appeared in 0.8.43 (r3653). Patch by Weibin Yao. Modified: trunk/src/http/modules/ngx_http_geo_module.c Modified: trunk/src/http/modules/ngx_http_geo_module.c =================================================================== --- trunk/src/http/modules/ngx_http_geo_module.c 2012-08-16 12:05:58 UTC (rev 4816) +++ trunk/src/http/modules/ngx_http_geo_module.c 2012-08-16 13:01:41 UTC (rev 4817) @@ -400,15 +400,15 @@ } } + if (ctx.high.default_value == NULL) { + ctx.high.default_value = &ngx_http_variable_null_value; + } + geo->u.high = ctx.high; var->get_handler = ngx_http_geo_range_variable; var->data = (uintptr_t) geo; - if (ctx.high.default_value == NULL) { - ctx.high.default_value = &ngx_http_variable_null_value; - } - ngx_destroy_pool(ctx.temp_pool); ngx_destroy_pool(pool); From mdounin at mdounin.ru Thu Aug 16 13:02:52 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 16 Aug 2012 17:02:52 +0400 Subject: A bug with geo module which may cause Nginx segment fault. In-Reply-To: References: Message-ID: <20120816130252.GX40452@mdounin.ru> Hello! On Thu, Aug 16, 2012 at 04:46:05PM +0800, ??? wrote: > Hi, > > We found a bug with geo module. If you use geo module with range > directive, but you don't add the default directive, it'll cause a > segment fault. [...] Patch committed, thanks. Maxim Dounin From nbubingo at gmail.com Thu Aug 16 14:49:37 2012 From: nbubingo at gmail.com (=?GB2312?B?0qbOsLHz?=) Date: Thu, 16 Aug 2012 22:49:37 +0800 Subject: A bug with geo module which may cause Nginx segment fault. In-Reply-To: <20120816130252.GX40452@mdounin.ru> References: <20120816130252.GX40452@mdounin.ru> Message-ID: Thanks. This bug was not found by me. Can you just added the name "Zhen Chen" to your releasing changlog. Thanks again for your hard work. 2012/8/16 Maxim Dounin : > Hello! > > On Thu, Aug 16, 2012 at 04:46:05PM +0800, ??? wrote: > >> Hi, >> >> We found a bug with geo module. If you use geo module with range >> directive, but you don't add the default directive, it'll cause a >> segment fault. > > [...] > > Patch committed, thanks. > > Maxim Dounin > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel From ru at nginx.com Fri Aug 17 05:08:43 2012 From: ru at nginx.com (ru at nginx.com) Date: Fri, 17 Aug 2012 05:08:43 +0000 Subject: [nginx] svn commit: r4818 - trunk/src/mail Message-ID: <20120817050843.28B2A3F9C1B@mail.nginx.com> Author: ru Date: 2012-08-17 05:08:42 +0000 (Fri, 17 Aug 2012) New Revision: 4818 URL: http://trac.nginx.org/nginx/changeset/4818/nginx Log: Mail: fixed sorting of listen addresses (ticket #187). For http module this problem was already fixed in r4756. Modified: trunk/src/mail/ngx_mail.c Modified: trunk/src/mail/ngx_mail.c =================================================================== --- trunk/src/mail/ngx_mail.c 2012-08-16 13:01:41 UTC (rev 4817) +++ trunk/src/mail/ngx_mail.c 2012-08-17 05:08:42 UTC (rev 4818) @@ -539,6 +539,11 @@ return 1; } + if (second->wildcard) { + /* a wildcard must be the last resort, shift it to the end */ + return -1; + } + if (first->bind && !second->bind) { /* shift explicit bind()ed addresses to the start */ return -1; From ru at nginx.com Fri Aug 17 05:14:20 2012 From: ru at nginx.com (ru at nginx.com) Date: Fri, 17 Aug 2012 05:14:20 +0000 Subject: [nginx] svn commit: r4819 - trunk/src/mail Message-ID: <20120817051420.16E023F9C5F@mail.nginx.com> Author: ru Date: 2012-08-17 05:14:19 +0000 (Fri, 17 Aug 2012) New Revision: 4819 URL: http://trac.nginx.org/nginx/changeset/4819/nginx Log: Removed a stale "AF_INET only" comment. IPv6 client connections in mail modules have been supported since r2856. Modified: trunk/src/mail/ngx_mail_handler.c Modified: trunk/src/mail/ngx_mail_handler.c =================================================================== --- trunk/src/mail/ngx_mail_handler.c 2012-08-17 05:08:42 UTC (rev 4818) +++ trunk/src/mail/ngx_mail_handler.c 2012-08-17 05:14:19 UTC (rev 4819) @@ -38,8 +38,6 @@ /* find the server configuration for the address:port */ - /* AF_INET only */ - port = c->listening->servers; if (port->naddrs > 1) { From ru at nginx.com Fri Aug 17 05:21:28 2012 From: ru at nginx.com (ru at nginx.com) Date: Fri, 17 Aug 2012 05:21:28 +0000 Subject: [nginx] svn commit: r4820 - trunk/src/mail Message-ID: <20120817052128.B51033FA785@mail.nginx.com> Author: ru Date: 2012-08-17 05:21:28 +0000 (Fri, 17 Aug 2012) New Revision: 4820 URL: http://trac.nginx.org/nginx/changeset/4820/nginx Log: Mail: fixed handling of AF_UNIX addresses in "listen". This makes AF_UNIX addresses in mail officially supported. Modified: trunk/src/mail/ngx_mail.c trunk/src/mail/ngx_mail_core_module.c Modified: trunk/src/mail/ngx_mail.c =================================================================== --- trunk/src/mail/ngx_mail.c 2012-08-17 05:14:19 UTC (rev 4819) +++ trunk/src/mail/ngx_mail.c 2012-08-17 05:21:28 UTC (rev 4820) @@ -263,6 +263,12 @@ break; #endif +#if (NGX_HAVE_UNIX_DOMAIN) + case AF_UNIX: + p = 0; + break; +#endif + default: /* AF_INET */ sin = (struct sockaddr_in *) sa; p = sin->sin_port; Modified: trunk/src/mail/ngx_mail_core_module.c =================================================================== --- trunk/src/mail/ngx_mail_core_module.c 2012-08-17 05:14:19 UTC (rev 4819) +++ trunk/src/mail/ngx_mail_core_module.c 2012-08-17 05:21:28 UTC (rev 4820) @@ -340,6 +340,14 @@ break; #endif +#if (NGX_HAVE_UNIX_DOMAIN) + case AF_UNIX: + off = offsetof(struct sockaddr_un, sun_path); + len = sizeof(((struct sockaddr_un *) sa)->sun_path); + port = 0; + break; +#endif + default: /* AF_INET */ off = offsetof(struct sockaddr_in, sin_addr); len = 4; From thierry.magnien at sfr.com Fri Aug 17 09:58:26 2012 From: thierry.magnien at sfr.com (MAGNIEN, Thierry) Date: Fri, 17 Aug 2012 09:58:26 +0000 Subject: Pb with module initialization Message-ID: <5D103CE839D50E4CBC62C9FD7B83287C10D82D@EXCN015.encara.local.ads> Hi, I am currently writing a module for my own needs and am facing a problem : at startup, I need to load into shared memory some content from a MySQL database. Shared memory size and mysql parameters (hostname, user, password) are in the main config section. My problem is I don't know where to insert the code so that it works : - I initialize shared memory in postconfiguration, but I can't load MySQl data here because the shm is not ready yet, - I tried to load MySQL data in init module function but then I can't access my module configuration directives (ngx_get_conf returns NULL). Does anybody have an idea how I could achieve this ? Thanks, Thierry From mdounin at mdounin.ru Fri Aug 17 11:02:37 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Fri, 17 Aug 2012 11:02:37 +0000 Subject: [nginx] svn commit: r4821 - trunk/src/http/modules Message-ID: <20120817110238.084683F9F5E@mail.nginx.com> Author: mdounin Date: 2012-08-17 11:02:35 +0000 (Fri, 17 Aug 2012) New Revision: 4821 URL: http://trac.nginx.org/nginx/changeset/4821/nginx Log: Mp4: removed restriction to avc1/mp4a formats (ticket #194). Modified: trunk/src/http/modules/ngx_http_mp4_module.c Modified: trunk/src/http/modules/ngx_http_mp4_module.c =================================================================== --- trunk/src/http/modules/ngx_http_mp4_module.c 2012-08-17 05:21:28 UTC (rev 4820) +++ trunk/src/http/modules/ngx_http_mp4_module.c 2012-08-17 11:02:35 UTC (rev 4821) @@ -1842,14 +1842,6 @@ ngx_mp4_get_32value(stsd_atom->entries), 4, stsd_atom->media_name); - /* supported media format: "avc1" (H.264) and "mp4a" (MPEG-4/AAC) */ - - if (ngx_strncmp(stsd_atom->media_name, "avc1", 4) != 0 - && ngx_strncmp(stsd_atom->media_name, "mp4a", 4) != 0) - { - return NGX_DECLINED; - } - trak = ngx_mp4_last_trak(mp4); atom = &trak->stsd_atom_buf; From vshebordaev at mail.ru Fri Aug 17 11:32:56 2012 From: vshebordaev at mail.ru (Vladimir Shebordaev) Date: Fri, 17 Aug 2012 15:32:56 +0400 Subject: Pb with module initialization In-Reply-To: <5D103CE839D50E4CBC62C9FD7B83287C10D82D@EXCN015.encara.local.ads> References: <5D103CE839D50E4CBC62C9FD7B83287C10D82D@EXCN015.encara.local.ads> Message-ID: Hi, 2012/8/17 MAGNIEN, Thierry : > > I am currently writing a module for my own needs and am facing a problem : at startup, I need to load into shared memory some content from a MySQL database. > > Shared memory size and mysql parameters (hostname, user, password) are in the main config section. > > My problem is I don't know where to insert the code so that it works : > - I initialize shared memory in postconfiguration, but I can't load MySQl data here because the shm is not ready yet, > - I tried to load MySQL data in init module function but then I can't access my module configuration directives (ngx_get_conf returns NULL). > > Does anybody have an idea how I could achieve this ? > A shared memory zone has a constructor, namely, init() method in ngx_shm_zone_t. This method is invoked by ngx_init_cycle() when the configuration is already processed and the shared memory zones are about to be (re)initialized, so I guess you can accees both your directives and the actual shm zone data from there. See file cache initialization routine ngx_http_file_cache_init() in src/http/ngx_http_file_cache.c for an example. Hope it helps. > Thanks, > Thierry > -- Regards, Vladimir From thierry.magnien at sfr.com Fri Aug 17 11:44:58 2012 From: thierry.magnien at sfr.com (MAGNIEN, Thierry) Date: Fri, 17 Aug 2012 11:44:58 +0000 Subject: Pb with module initialization In-Reply-To: References: <5D103CE839D50E4CBC62C9FD7B83287C10D82D@EXCN015.encara.local.ads> Message-ID: <5D103CE839D50E4CBC62C9FD7B83287C10D9D2@EXCN015.encara.local.ads> Hi and thanks for your answer. > A shared memory zone has a constructor, namely, init() method in > ngx_shm_zone_t. This method is invoked by ngx_init_cycle() when the > configuration is already processed and the shared memory zones are > about to be (re)initialized, so I guess you can accees both your > directives and the actual shm zone data from there. See file cache > initialization routine ngx_http_file_cache_init() in > src/http/ngx_http_file_cache.c for an example. Well, I have such an init method but its arguments are only (ngx_shm_zone_t *shm_zone, void *data). I suppose I must use ngx_get_conf but what arguments should I give to it ? Thanks, Thierry From thierry.magnien at sfr.com Fri Aug 17 12:52:55 2012 From: thierry.magnien at sfr.com (MAGNIEN, Thierry) Date: Fri, 17 Aug 2012 12:52:55 +0000 Subject: Pb with module initialization In-Reply-To: <5D103CE839D50E4CBC62C9FD7B83287C10D9D2@EXCN015.encara.local.ads> References: <5D103CE839D50E4CBC62C9FD7B83287C10D82D@EXCN015.encara.local.ads> <5D103CE839D50E4CBC62C9FD7B83287C10D9D2@EXCN015.encara.local.ads> Message-ID: <5D103CE839D50E4CBC62C9FD7B83287C10DA8C@EXCN015.encara.local.ads> > My problem is I don't know where to insert the code so that it works : > - I initialize shared memory in postconfiguration, but I can't load MySQl data here because the shm is not ready yet, > - I tried to load MySQL data in init module function but then I can't access my module configuration directives (ngx_get_conf returns NULL). OK, I've found the solution : in the init module function, I have to call ngx_http_cycle_get_module_main_conf(cycle, my_module) to retrieve the configuration directives for my module. Regards, Thierry From vshebordaev at mail.ru Fri Aug 17 12:55:30 2012 From: vshebordaev at mail.ru (Vladimir Shebordaev) Date: Fri, 17 Aug 2012 16:55:30 +0400 Subject: Pb with module initialization In-Reply-To: <5D103CE839D50E4CBC62C9FD7B83287C10D9D2@EXCN015.encara.local.ads> References: <5D103CE839D50E4CBC62C9FD7B83287C10D82D@EXCN015.encara.local.ads> <5D103CE839D50E4CBC62C9FD7B83287C10D9D2@EXCN015.encara.local.ads> Message-ID: 2012/8/17 MAGNIEN, Thierry : > Hi and thanks for your answer. > >> A shared memory zone has a constructor, namely, init() method in >> ngx_shm_zone_t. This method is invoked by ngx_init_cycle() when the >> configuration is already processed and the shared memory zones are >> about to be (re)initialized, so I guess you can accees both your >> directives and the actual shm zone data from there. See file cache >> initialization routine ngx_http_file_cache_init() in >> src/http/ngx_http_file_cache.c for an example. > > Well, I have such an init method but its arguments are only (ngx_shm_zone_t *shm_zone, void *data). I suppose I must use ngx_get_conf but what arguments should I give to it ? You can access your module main configuration with ngx_http_cycle_get_module_main_conf() through the global ngx_cycle that has the module contexts already set up by the shm initialization time. You can also access the configuration from the module init_process() method that is explicitly given the cycle. Either way, you can pass any parameters you need to the shm zone constructor through the zone data field that is to be installed right after the shm zone is added at the module configuration time. -- Regards, Vladimir From thierry.magnien at sfr.com Fri Aug 17 12:58:38 2012 From: thierry.magnien at sfr.com (MAGNIEN, Thierry) Date: Fri, 17 Aug 2012 12:58:38 +0000 Subject: Pb with module initialization In-Reply-To: References: <5D103CE839D50E4CBC62C9FD7B83287C10D82D@EXCN015.encara.local.ads> <5D103CE839D50E4CBC62C9FD7B83287C10D9D2@EXCN015.encara.local.ads> Message-ID: <5D103CE839D50E4CBC62C9FD7B83287C10DAD6@EXCN015.encara.local.ads> >>> A shared memory zone has a constructor, namely, init() method in >>> ngx_shm_zone_t. This method is invoked by ngx_init_cycle() when the >>> configuration is already processed and the shared memory zones are >>> about to be (re)initialized, so I guess you can accees both your >>> directives and the actual shm zone data from there. See file cache >>> initialization routine ngx_http_file_cache_init() in >>> src/http/ngx_http_file_cache.c for an example. >> >> Well, I have such an init method but its arguments are only (ngx_shm_zone_t *shm_zone, void *data). I suppose I must use ngx_get_conf but what arguments should I give to it ? > >You can access your module main configuration with >ngx_http_cycle_get_module_main_conf() through the global ngx_cycle >that has the module contexts already set up by the shm initialization >time. You can also access the configuration from the module >init_process() method that is explicitly given the cycle. Either way, >you can pass any parameters you need to the shm zone constructor >through the zone data field that is to be installed right after the >shm zone is added at the module configuration time. Just found out this, our messages crossed each other ;-) Thanks for your help, however. Regards, Thierry From vshebordaev at mail.ru Fri Aug 17 13:36:51 2012 From: vshebordaev at mail.ru (Vladimir Shebordaev) Date: Fri, 17 Aug 2012 17:36:51 +0400 Subject: Pb with module initialization In-Reply-To: <5D103CE839D50E4CBC62C9FD7B83287C10DAD6@EXCN015.encara.local.ads> References: <5D103CE839D50E4CBC62C9FD7B83287C10D82D@EXCN015.encara.local.ads> <5D103CE839D50E4CBC62C9FD7B83287C10D9D2@EXCN015.encara.local.ads> <5D103CE839D50E4CBC62C9FD7B83287C10DAD6@EXCN015.encara.local.ads> Message-ID: 2012/8/17 MAGNIEN, Thierry : >>>> A shared memory zone has a constructor, namely, init() method in >>>> ngx_shm_zone_t. This method is invoked by ngx_init_cycle() when the >>>> configuration is already processed and the shared memory zones are >>>> about to be (re)initialized, so I guess you can accees both your >>>> directives and the actual shm zone data from there. See file cache >>>> initialization routine ngx_http_file_cache_init() in >>>> src/http/ngx_http_file_cache.c for an example. >>> >>> Well, I have such an init method but its arguments are only (ngx_shm_zone_t *shm_zone, void *data). I suppose I must use ngx_get_conf but what arguments should I give to it ? >> By the way, when the shm zone constructor is invoked by ngx_init_cycle() it gets the value of the data field of the shm zone descriptor from the old cycle as the second argument. NULL is passed there when the zone is initialized for the first time right after it is created anew. >>You can access your module main configuration with >>ngx_http_cycle_get_module_main_conf() through the global ngx_cycle >>that has the module contexts already set up by the shm initialization >>time. You can also access the configuration from the module >>init_process() method that is explicitly given the cycle. Either way, >>you can pass any parameters you need to the shm zone constructor >>through the zone data field that is to be installed right after the >>shm zone is added at the module configuration time. > > Just found out this, our messages crossed each other ;-) > > Thanks for your help, however. > > Regards, > Thierry > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel > From vshebordaev at mail.ru Fri Aug 17 14:00:04 2012 From: vshebordaev at mail.ru (Vladimir Shebordaev) Date: Fri, 17 Aug 2012 18:00:04 +0400 Subject: Pb with module initialization In-Reply-To: References: <5D103CE839D50E4CBC62C9FD7B83287C10D82D@EXCN015.encara.local.ads> <5D103CE839D50E4CBC62C9FD7B83287C10D9D2@EXCN015.encara.local.ads> <5D103CE839D50E4CBC62C9FD7B83287C10DAD6@EXCN015.encara.local.ads> Message-ID: 2012/8/17 Vladimir Shebordaev : > 2012/8/17 MAGNIEN, Thierry : >>>>> A shared memory zone has a constructor, namely, init() method in >>>>> ngx_shm_zone_t. This method is invoked by ngx_init_cycle() when the >>>>> configuration is already processed and the shared memory zones are >>>>> about to be (re)initialized, so I guess you can accees both your >>>>> directives and the actual shm zone data from there. See file cache >>>>> initialization routine ngx_http_file_cache_init() in >>>>> src/http/ngx_http_file_cache.c for an example. >>>> >>>> Well, I have such an init method but its arguments are only (ngx_shm_zone_t *shm_zone, void *data). I suppose I must use ngx_get_conf but what arguments should I give to it ? >>> > > By the way, when the shm zone constructor is invoked by > ngx_init_cycle() it gets the value of the data field of the shm zone > descriptor from the old cycle as the second argument. NULL is passed > there when the zone is initialized for the first time right after it > is created anew. > Well, I rather mean that the shm zone is a global object which live cicle is controlled by the server core, so the zone contructor is the only proper place to manage the initialization. The module init_process() and init_thread() methods are to solve other tasks when the new worker process or thread is (re)spawned, those events should not normally affect shared memory state, it is inherited from the parent master process and is already mapped to the process address space. >>>You can access your module main configuration with >>>ngx_http_cycle_get_module_main_conf() through the global ngx_cycle >>>that has the module contexts already set up by the shm initialization >>>time. You can also access the configuration from the module >>>init_process() method that is explicitly given the cycle. Either way, >>>you can pass any parameters you need to the shm zone constructor >>>through the zone data field that is to be installed right after the >>>shm zone is added at the module configuration time. >> >> Just found out this, our messages crossed each other ;-) >> >> Thanks for your help, however. >> Thanks for your question :) >> Regards, >> Thierry >> From defan at nginx.com Fri Aug 17 15:35:51 2012 From: defan at nginx.com (defan at nginx.com) Date: Fri, 17 Aug 2012 15:35:51 +0000 Subject: [nginx] svn commit: r4822 - trunk/src/http/modules Message-ID: <20120817153551.124703F9C18@mail.nginx.com> Author: defan Date: 2012-08-17 15:35:50 +0000 (Fri, 17 Aug 2012) New Revision: 4822 URL: http://trac.nginx.org/nginx/changeset/4822/nginx Log: Mark logically dead code with corresponding comment. Found by Coverity. Modified: trunk/src/http/modules/ngx_http_ssi_filter_module.c Modified: trunk/src/http/modules/ngx_http_ssi_filter_module.c =================================================================== --- trunk/src/http/modules/ngx_http_ssi_filter_module.c 2012-08-17 11:02:35 UTC (rev 4821) +++ trunk/src/http/modules/ngx_http_ssi_filter_module.c 2012-08-17 15:35:50 UTC (rev 4822) @@ -1025,6 +1025,7 @@ switch (state) { case ssi_start_state: + /* not reached */ break; case ssi_tag_state: From eoconnor at coincident.com Sat Aug 18 15:48:09 2012 From: eoconnor at coincident.com (Eric O'Connor) Date: Sat, 18 Aug 2012 11:48:09 -0400 Subject: [PATCH] Add a no_verify option for SSL client authentication In-Reply-To: References: Message-ID: <502FB939.5020602@coincident.com> Hello Nginx, This patch adds a "ssl_verify_client no_verify;" option that triggers a client to upload a certificate, but does not throw an exception when that certificate does not validate. It also allows "ssl_client_certificate" to not exist when this option is specified. This is useful for our company's application where we would like to do SSL client authentication on an application server. Any feedback is welcome. ~ Eric O'Connor --- src/http/modules/ngx_http_ssl_module.c | 3 ++- src/http/ngx_http_request.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/http/modules/ngx_http_ssl_module.c b/src/http/modules/ngx_http_ssl_module.c index d759489..fede8e0 100644 --- a/src/http/modules/ngx_http_ssl_module.c +++ b/src/http/modules/ngx_http_ssl_module.c @@ -48,6 +48,7 @@ static ngx_conf_enum_t ngx_http_ssl_verify[] = { { ngx_string("off"), 0 }, { ngx_string("on"), 1 }, { ngx_string("optional"), 2 }, + { ngx_string("no_verify"), 3 }, { ngx_null_string, 0 } }; @@ -466,7 +467,7 @@ ngx_http_ssl_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child) if (conf->verify) { - if (conf->client_certificate.len == 0) { + if (conf->client_certificate.len == 0 && conf->verify != 3) { ngx_log_error(NGX_LOG_EMERG, cf->log, 0, "no ssl_client_certificate for ssl_client_verify"); return NGX_CONF_ERROR; diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index c104db1..5d02683 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -1634,7 +1634,7 @@ ngx_http_process_request(ngx_http_request_t *r) if (sscf->verify) { rc = SSL_get_verify_result(c->ssl->connection); - if (rc != X509_V_OK) { + if (sscf->verify != 3 && rc != X509_V_OK) { ngx_log_error(NGX_LOG_INFO, c->log, 0, "client SSL certificate verify error: (%l:%s)", rc, X509_verify_cert_error_string(rc)); -- From mdounin at mdounin.ru Sat Aug 18 23:04:40 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Sat, 18 Aug 2012 23:04:40 +0000 Subject: [nginx] svn commit: r4823 - trunk/src/mail Message-ID: <20120818230445.165783FA05C@mail.nginx.com> Author: mdounin Date: 2012-08-18 23:04:39 +0000 (Sat, 18 Aug 2012) New Revision: 4823 URL: http://trac.nginx.org/nginx/changeset/4823/nginx Log: Whitespace fix. Modified: trunk/src/mail/ngx_mail_core_module.c Modified: trunk/src/mail/ngx_mail_core_module.c =================================================================== --- trunk/src/mail/ngx_mail_core_module.c 2012-08-17 15:35:50 UTC (rev 4822) +++ trunk/src/mail/ngx_mail_core_module.c 2012-08-18 23:04:39 UTC (rev 4823) @@ -391,13 +391,13 @@ if (ngx_modules[m]->type != NGX_MAIL_MODULE) { continue; } - + module = ngx_modules[m]->ctx; - + if (module->protocol == NULL) { continue; } - + for (i = 0; module->protocol->port[i]; i++) { if (module->protocol->port[i] == u.port) { cscf->protocol = module->protocol; From mdounin at mdounin.ru Sat Aug 18 23:17:58 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Sat, 18 Aug 2012 23:17:58 +0000 Subject: [nginx] svn commit: r4824 - trunk/src/core Message-ID: <20120818231758.F039D3F9EB7@mail.nginx.com> Author: mdounin Date: 2012-08-18 23:17:58 +0000 (Sat, 18 Aug 2012) New Revision: 4824 URL: http://trac.nginx.org/nginx/changeset/4824/nginx Log: Radix tree preallocation fix. The preallocation size was calculated incorrectly and was always 8 due to sizeof(ngx_radix_tree_t) accidentally used instead of sizeof(ngx_radix_node_t). Modified: trunk/src/core/ngx_radix_tree.c Modified: trunk/src/core/ngx_radix_tree.c =================================================================== --- trunk/src/core/ngx_radix_tree.c 2012-08-18 23:04:39 UTC (rev 4823) +++ trunk/src/core/ngx_radix_tree.c 2012-08-18 23:17:58 UTC (rev 4824) @@ -60,7 +60,7 @@ */ if (preallocate == -1) { - switch (ngx_pagesize / sizeof(ngx_radix_tree_t)) { + switch (ngx_pagesize / sizeof(ngx_radix_node_t)) { /* amd64 */ case 128: From info at tvdw.eu Mon Aug 20 07:46:22 2012 From: info at tvdw.eu (Tom van der Woerdt) Date: Mon, 20 Aug 2012 09:46:22 +0200 Subject: [PATCH] Add a no_verify option for SSL client authentication In-Reply-To: <502FB939.5020602@coincident.com> References: <502FB939.5020602@coincident.com> Message-ID: Feedback: this is a bad idea and super bad practice. If you want to use client cert auth but don't verify them, you might just as well only have an input field with 'What's your name?' as the login page, no password field. You drop any security that client auth offers. Recommendation: don't include this patch in nginx. The only thing it does is create a massive security hole. Tom Verstuurd vanaf mijn iPhone Op 18 aug. 2012 om 17:48 heeft Eric O'Connor het volgende geschreven: > Hello Nginx, > > This patch adds a "ssl_verify_client no_verify;" option that triggers > a client to upload a certificate, but does not throw an exception when > that certificate does not validate. It also allows > "ssl_client_certificate" to not exist when this option is specified. > > This is useful for our company's application where we would like to do > SSL client authentication on an application server. > > Any feedback is welcome. > > ~ Eric O'Connor > > --- > src/http/modules/ngx_http_ssl_module.c | 3 ++- > src/http/ngx_http_request.c | 2 +- > 2 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/src/http/modules/ngx_http_ssl_module.c > b/src/http/modules/ngx_http_ssl_module.c > index d759489..fede8e0 100644 > --- a/src/http/modules/ngx_http_ssl_module.c > +++ b/src/http/modules/ngx_http_ssl_module.c > @@ -48,6 +48,7 @@ static ngx_conf_enum_t ngx_http_ssl_verify[] = { > { ngx_string("off"), 0 }, > { ngx_string("on"), 1 }, > { ngx_string("optional"), 2 }, > + { ngx_string("no_verify"), 3 }, > { ngx_null_string, 0 } > }; > > @@ -466,7 +467,7 @@ ngx_http_ssl_merge_srv_conf(ngx_conf_t *cf, void > *parent, void *child) > > if (conf->verify) { > > - if (conf->client_certificate.len == 0) { > + if (conf->client_certificate.len == 0 && conf->verify != 3) { > ngx_log_error(NGX_LOG_EMERG, cf->log, 0, > "no ssl_client_certificate for > ssl_client_verify"); > return NGX_CONF_ERROR; > diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c > index c104db1..5d02683 100644 > --- a/src/http/ngx_http_request.c > +++ b/src/http/ngx_http_request.c > @@ -1634,7 +1634,7 @@ ngx_http_process_request(ngx_http_request_t *r) > if (sscf->verify) { > rc = SSL_get_verify_result(c->ssl->connection); > > - if (rc != X509_V_OK) { > + if (sscf->verify != 3 && rc != X509_V_OK) { > ngx_log_error(NGX_LOG_INFO, c->log, 0, > "client SSL certificate verify error: > (%l:%s)", > rc, X509_verify_cert_error_string(rc)); > -- > > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel From eoconnor at coincident.com Mon Aug 20 12:12:44 2012 From: eoconnor at coincident.com (Eric O'Connor) Date: Mon, 20 Aug 2012 08:12:44 -0400 Subject: [PATCH] Add a no_verify option for SSL client authentication Message-ID: Tom, Your feedback is correct in the sense that if we were not performing certificate verification, it would be bad news. It is not applicable here, though. In my original email I noted that we are in fact performing certificate verification, it is simply not done in nginx code. Your security concerns are irrelevant for our application, since in both cases the certificate is cryptographically verified long before the request is passed to the application (this is exactly what happens if you do the verification in nginx code, so there is no security-relevant difference between the two approaches). They are also irrelevant for nginx in general, because "no_verify" is a fairly self explanatory option that will be very unlikely to be used accidentally. In light of your misunderstanding, I would ask that you please reconsider your recommendation. Eric O'Connor -- Feedback: this is a bad idea and super bad practice. If you want to use client cert auth but don't verify them, you might just as well only have an input field with 'What's your name?' as the login page, no password field. You drop any security that client auth offers. Recommendation: don't include this patch in nginx. The only thing it does is create a massive security hole. Tom From info at tvdw.eu Mon Aug 20 12:37:44 2012 From: info at tvdw.eu (Tom van der Woerdt) Date: Mon, 20 Aug 2012 14:37:44 +0200 Subject: [PATCH] Add a no_verify option for SSL client authentication In-Reply-To: References: Message-ID: <50322F98.9090203@tvdw.eu> Hi Eric, For the record, I'm not affiliated with nginx. If I understand your message correctly, you've got a load balancer (or something similar) in front of nginx that already verifies the certificates. You simply don't want nginx to do all the double checking, or maybe you just don't want to store the keys on an application server. A patch such as the one you supplied would be a major security hole (for those who don't know what they're doing, which nowadays is most people) while not offering much in return. What you describe can already be achieved by (for example) passing the cert's DN to the application server (and making sure the application server only accepts requests from your load balancer): proxy_set_header X-SSL-DN $ssl_client_s_dn; This would also take care of the required SSL connection between your load balancer and your application server, which could now simply be a http connection that is kept alive if it's on a private subnet. Significant performance boost that probably only requires minimal changes in your application. I'm going to stick with my original recommendation: don't include it in nginx by default. While the patch might be very helpful in your specific case, it's going to be used by people who have no idea what they're doing as well, and that can be very dangerous. It has only one very specific use case (that's covered by other options in nginx) but many dangerous use cases. Maybe write it as a 3rd party module that does this, or publish it as a patch on your own site? Tom Op 8/20/12 2:12 PM, Eric O'Connor schreef: > Tom, > > Your feedback is correct in the sense that if we were not performing > certificate verification, it would be bad news. It is not applicable > here, though. > > In my original email I noted that we are in fact performing > certificate verification, it is simply not done in nginx code. Your > security concerns are irrelevant for our application, since in both > cases the certificate is cryptographically verified long before the > request is passed to the application (this is exactly what happens if > you do the verification in nginx code, so there is no > security-relevant difference between the two approaches). They are > also irrelevant for nginx in general, because "no_verify" is a fairly > self explanatory option that will be very unlikely to be used > accidentally. > > In light of your misunderstanding, I would ask that you please > reconsider your recommendation. > > Eric O'Connor > > > -- > > Feedback: this is a bad idea and super bad practice. If you want to > use client cert auth but don't verify them, you might just as well > only have an input field with 'What's your name?' as the login page, > no password field. You drop any security that client auth offers. > > Recommendation: don't include this patch in nginx. The only thing it > does is create a massive security hole. > > Tom From eoconnor at coincident.com Mon Aug 20 14:48:02 2012 From: eoconnor at coincident.com (Eric O'Connor) Date: Mon, 20 Aug 2012 10:48:02 -0400 Subject: [PATCH] Add a no_verify option for SSL client authentication In-Reply-To: <50322F73.6030309@tvdw.eu> References: <50322F73.6030309@tvdw.eu> Message-ID: > If I understand your message correctly, you've got a load balancer (or > something similar) in front of nginx that already verifies the certificates. > You simply don't want nginx to do all the double checking, or maybe you just > don't want to store the keys on an application server. We are performing certificate verification behind nginx (based on the encoded certificate passed in an HTTP header over localhost). > A patch such as the one you supplied would be a major security hole (for > those who don't know what they're doing, which nowadays is most people) But anyone that is implementing ssl client authentication understands the value of verifying the certificates. Eric From mdounin at mdounin.ru Tue Aug 21 11:03:48 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 21 Aug 2012 15:03:48 +0400 Subject: [PATCH] Add a no_verify option for SSL client authentication In-Reply-To: <50322F98.9090203@tvdw.eu> References: <50322F98.9090203@tvdw.eu> Message-ID: <20120821110348.GJ40452@mdounin.ru> Hello! On Mon, Aug 20, 2012 at 02:37:44PM +0200, Tom van der Woerdt wrote: > Hi Eric, > > For the record, I'm not affiliated with nginx. > > If I understand your message correctly, you've got a load balancer > (or something similar) in front of nginx that already verifies the > certificates. You simply don't want nginx to do all the double > checking, or maybe you just don't want to store the keys on an > application server. > > A patch such as the one you supplied would be a major security hole > (for those who don't know what they're doing, which nowadays is most > people) while not offering much in return. What you describe can > already be achieved by (for example) passing the cert's DN to the > application server (and making sure the application server only > accepts requests from your load balancer): The problem with the discussed use case is that issuer certificate isn't known in advance. Hence nginx won't be able to verify the supplied cert (unless we are willing to bring all the logic to fetch issuer cert into nginx, which doesn't looks like a good option) and will return error. I believe the use case may be handled with error_page 495, but it's not yet clear - if it's actually true; - whether it introduce unwanted side effects; - how the case is common (i.e. wether it deserves special option even if the above allows to handle it). Maxim Dounin From mdounin at mdounin.ru Tue Aug 21 13:05:03 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Tue, 21 Aug 2012 13:05:03 +0000 Subject: [nginx] svn commit: r4825 - trunk/docs/xml/nginx Message-ID: <20120821130503.6BF583F9FD0@mail.nginx.com> Author: mdounin Date: 2012-08-21 13:05:02 +0000 (Tue, 21 Aug 2012) New Revision: 4825 URL: http://trac.nginx.org/nginx/changeset/4825/nginx Log: nginx-1.3.5-RELEASE Modified: trunk/docs/xml/nginx/changes.xml Modified: trunk/docs/xml/nginx/changes.xml =================================================================== --- trunk/docs/xml/nginx/changes.xml 2012-08-18 23:17:58 UTC (rev 4824) +++ trunk/docs/xml/nginx/changes.xml 2012-08-21 13:05:02 UTC (rev 4825) @@ -9,6 +9,88 @@ nginx changelog + + + + +?????? ngx_http_mp4_module ?????? ?? ??????????????? ??????? +? ????????, ???????? ?? H.264 ? AAC. + + +the ngx_http_mp4_module module no longer skips +tracks in formats other than H.264 and AAC. + + + + + +? ??????? ???????? ??? ????????? segmentation fault, +???? ? ????????? map ? ???????? ???????? ?????????????? ??????????. + + +a segmentation fault might occur in a worker process +if the "map" directive was used with variables as values. + + + + + +? ??????? ???????? ??? ????????? segmentation fault +??? ????????????? ????????? geo ? ?????????? ranges, +?? ??? ????????? default; ?????? ????????? ? 0.8.43.
+??????? Zhen Chen ? Weibin Yao. +
+ +a segmentation fault might occur in a worker process +if the "geo" directive was used with the "ranges" parameter +but without the "default" parameter; the bug had appeared in 0.8.43.
+Thanks to Zhen Chen and Weibin Yao. +
+
+ + + +? ????????? ????????? ????????? ?????? -p. + + +in the -p command-line parameter handling. + + + + + +? ???????? ??????-???????. + + +in the mail proxy server. + + + + + +?????????????? ????????????? ??????.
+??????? Coverity. +
+ +of minor potential bugs.
+Thanks to Coverity. +
+
+ + + +nginx/Windows ?? ????????? ? Visual Studio 2005 Express.
+??????? HAYASHI Kentaro. +
+ +nginx/Windows could not be built with Visual Studio 2005 Express.
+Thanks to HAYASHI Kentaro. +
+
+ +
+ + From mdounin at mdounin.ru Tue Aug 21 13:05:26 2012 From: mdounin at mdounin.ru (mdounin at mdounin.ru) Date: Tue, 21 Aug 2012 13:05:26 +0000 Subject: [nginx] svn commit: r4826 - tags Message-ID: <20120821130526.F06883F9FD7@mail.nginx.com> Author: mdounin Date: 2012-08-21 13:05:26 +0000 (Tue, 21 Aug 2012) New Revision: 4826 URL: http://trac.nginx.org/nginx/changeset/4826/nginx Log: release-1.3.5 tag Added: tags/release-1.3.5/ From juce66 at gmail.com Tue Aug 21 18:36:49 2012 From: juce66 at gmail.com (Anton Jouline) Date: Tue, 21 Aug 2012 11:36:49 -0700 Subject: [PATCH] Random peer selection for implicit upstream defined by proxy_pass Message-ID: hello, Nginx developers, submitting this patch for your review. It changes the behaviour of peer selection for the case, when the upstream is defined implicitly by proxy_pass directive like this: resolver 172.16.0.23; set $backend backend.servers.example.com; proxy_pass http://$backend; It's important to note that this is the case when "backend.servers.example.com" name is getting resolved by nginx resolver at request time, instead of being resolved by OS resolver when server configuration is read at startup. My change only affects this very specific scenario. (When "backend.servers.example.com" is resolved at startup, the original round-robin algorithm is still used.) Why the change? Let me explain our use case first. We are using nginx as a load balancer in from of an array of backend servers. The array is dynamic - it changes over time: new servers can be launched and join the array, old ones may get terminated. The current state of the array is defined by a DNS A-record which maps "backend.servers.example.com" to a list of IP addresses. This A-record also changes dynamically as the array itself changes. The fact that the A-record is dynamic means that we cannot resolve the name at startup. Therefore, we use nginx resolver to do DNS at request time. This works great, but the problem is with selection of which backend server (peer) to proxy the request to. It turns out that the round-robin algorithm actually does not work in this case, because of the way things are implemented in src/http/ngx_http_upstream.c. The peer array is created and initialized on each request, even if a cached result of DNS query is returned by resolver. The upstream code has no knowledge of whether the list of IP addresses changed or not. So what ends up happening is this: Let's say "backend.servers.example.com" resolves to 6 IP addresses. Then the first good one will be always used, and the rest will never be even looked at. It is easy to verify that, if you use nginx.debug executable, enable "debug" logging in your error_log directive, and just tail the error log like this: $tail /var/log/nginx/error.log | grep current 2012/08/21 12:07:09 [debug] 25252#0: *1 get rr peer, current: 0 -5 2012/08/21 12:07:10 [debug] 25252#0: *1 get rr peer, current: 0 -5 2012/08/21 12:07:11 [debug] 25252#0: *1 get rr peer, current: 0 -5 2012/08/21 12:07:12 [debug] 25252#0: *1 get rr peer, current: 0 -5 2012/08/21 12:07:12 [debug] 25252#0: *1 get rr peer, current: 0 -5 2012/08/21 12:07:13 [debug] 25252#0: *1 get rr peer, current: 0 -5 With my random selection change, the peer is basically chosen at random each time. Of course, the random selection does not guarantee ideal distribution of the load, but it turns out to work quite well statistically. Here are some numbers from a load-testing run. 6 servers used were in the backend: Total # of requests: 2,374,398 ====================== server 2: 399,342 16.819% server 3: 397,854 16.756% server 1: 396,807 16.712% server 4: 396,660 16.706% server 5: 393,735 16.582% server 0: 390,000 16.425% In our case, we don't really care if all backend servers receive the exact amount of requests, as long as the load is approximately the same. The bad situation that we were aiming to avoid, is when one server is overloaded and others are running idle. The patch was originally made for 1.2.2, but i verified that it also applies without problems to 1.2.3 and 1.3.5, and works the same way with those newer versions of nginx. Sorry about such a long message. Thanks for reading! Anton. -------------- next part -------------- A non-text attachment was scrubbed... Name: nginx-upstream-random.patch Type: application/octet-stream Size: 18738 bytes Desc: not available URL: From crk_world at yahoo.com.cn Wed Aug 22 13:49:52 2012 From: crk_world at yahoo.com.cn (chen cw) Date: Wed, 22 Aug 2012 21:49:52 +0800 Subject: a bug in limit_request module Message-ID: Hi, The red-black tree used in limit_request module has two level of keys, the top is hash, and the next is the value string itself. However, when inserting a new node into the tree, only hash is set, the value string is left empty, as such code shows the whole thing: 445: node->key = hash; 446: 447: ngx_rbtree_insert(&ctx->sh->rbtree, node); 448: 449: lr = (ngx_http_limit_req_node_t *) &node->color; 450: 451: ngx_queue_insert_head(&ctx->sh->queue, &lr->queue); 452: 453: lr->len = (u_char) len; 454: lr->excess = 0; 455: 456: ngx_memcpy(lr->data, data, len); So there are chances nginx inserts a node which the value string is large, into the left sub tree. The bugfix is to move line 447 to under line 456. -- Charles Chen Software Engineer Server Platforms Team at Taobao.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From ne at vbart.ru Wed Aug 22 14:55:04 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Wed, 22 Aug 2012 18:55:04 +0400 Subject: a bug in limit_request module In-Reply-To: References: Message-ID: <201208221855.04686.ne@vbart.ru> On Wednesday 22 August 2012 17:49:52 chen cw wrote: > Hi, > The red-black tree used in limit_request module has two level of > keys, the top is hash, and the next is the value string itself. However, > when inserting a new node into the tree, only hash is set, the value string > is left empty, [...] > Nice catch. Thank you. wbr, Valentin V. Bartenev Index: src/http/modules/ngx_http_limit_req_module.c =================================================================== --- src/http/modules/ngx_http_limit_req_module.c (revision 4826) +++ src/http/modules/ngx_http_limit_req_module.c (working copy) @@ -444,17 +444,17 @@ ngx_http_limit_req_lookup(ngx_http_limit_req_limit node->key = hash; - ngx_rbtree_insert(&ctx->sh->rbtree, node); - lr = (ngx_http_limit_req_node_t *) &node->color; - ngx_queue_insert_head(&ctx->sh->queue, &lr->queue); - lr->len = (u_char) len; lr->excess = 0; ngx_memcpy(lr->data, data, len); + ngx_rbtree_insert(&ctx->sh->rbtree, node); + + ngx_queue_insert_head(&ctx->sh->queue, &lr->queue); + if (account) { lr->last = now; lr->count = 0; From kajtzu at a51.org Fri Aug 24 09:46:42 2012 From: kajtzu at a51.org (Kaj Niemi) Date: Fri, 24 Aug 2012 09:46:42 +0000 Subject: Build time patches to nginx spdy patch #52 Message-ID: <1EB442F5-C295-4FBB-9112-1CC383EF89B1@a51.org> Hi, SPDY patch #52 is missing a few conditionals that are required when the patch has been applied but nginx is built using --without-ssl_spdy_module (on RHEL6 I need to build one version of nginx against an openssl that has it (ours) and another without (vendor's)). Thanks. --- src/http/ngx_http_request.c.old 2012-08-24 12:21:14.377350628 +0300 +++ src/http/ngx_http_request.c 2012-08-24 12:21:17.774312838 +0300 @@ -1981,10 +1981,12 @@ ngx_http_request_t *pr; ngx_http_core_loc_conf_t *clcf; +#if (NGX_HTTP_SPDY) if (r->spdy_stream) { ngx_http_spdy_finalize_request(r, rc); return; } +#endif c = r->connection; --- src/http/ngx_http_request_body.c.old 2012-08-24 12:27:26.553322219 +0300 +++ src/http/ngx_http_request_body.c 2012-08-24 12:28:58.491538266 +0300 @@ -471,10 +471,12 @@ return NGX_OK; } +#if (NGX_HTTP_SPDY) if (r->spdy_stream) { r->discard_body = 1; return NGX_OK; } +#endif if (ngx_http_test_expect(r) != NGX_OK) { return NGX_HTTP_INTERNAL_SERVER_ERROR; --- auto/modules.old 2012-08-24 12:33:19.266063093 +0300 +++ auto/modules 2012-08-24 12:35:23.397878682 +0300 @@ -117,9 +117,13 @@ HTTP_FILTER_MODULES="$HTTP_WRITE_FILTER_MODULE \ $HTTP_HEADER_FILTER_MODULE \ - $HTTP_CHUNKED_FILTER_MODULE \ - $HTTP_SPDY_FILTER_MODULE \ - $HTTP_RANGE_HEADER_FILTER_MODULE" + $HTTP_CHUNKED_FILTER_MODULE" + +if [ $HTTP_SPDY = YES ]; then + HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_SPDY_FILTER_MODULE" +fi + +HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_RANGE_HEADER_FILTER_MODULE" if [ $HTTP_GZIP = YES ]; then have=NGX_HTTP_GZIP . auto/have Kaj -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4383 bytes Desc: not available URL: From ne at vbart.ru Fri Aug 24 13:57:21 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Fri, 24 Aug 2012 17:57:21 +0400 Subject: Build time patches to nginx spdy patch #52 In-Reply-To: <1EB442F5-C295-4FBB-9112-1CC383EF89B1@a51.org> References: <1EB442F5-C295-4FBB-9112-1CC383EF89B1@a51.org> Message-ID: <201208241757.21933.ne@vbart.ru> On Friday 24 August 2012 13:46:42 Kaj Niemi wrote: > Hi, > > > SPDY patch #52 is missing a few conditionals that are required when the > patch has been applied but nginx is built using --without-ssl_spdy_module > (on RHEL6 I need to build one version of nginx against an openssl that has > it (ours) and another without (vendor's)). > > Thanks. Actually, current patch has only two options: applied or not applied. =) "--without-ssl_spdy_module" is just stub. SPDY should be optional module by default, and should not be built without "--with-http_spdy_module". wbr, Valentin V. Bartenev From goelvivek2011 at gmail.com Sun Aug 26 11:33:07 2012 From: goelvivek2011 at gmail.com (Vivek Goel) Date: Sun, 26 Aug 2012 17:03:07 +0530 Subject: How to do url-encode/ decode inside nginx module ? Message-ID: Is there already available function to do url encode/decode of data in nginx module development kit ? regards Vivek Goel -------------- next part -------------- An HTML attachment was scrubbed... URL: From vshebordaev at mail.ru Sun Aug 26 15:25:09 2012 From: vshebordaev at mail.ru (Vladimir Shebordaev) Date: Sun, 26 Aug 2012 19:25:09 +0400 Subject: How to do url-encode/ decode inside nginx module ? In-Reply-To: References: Message-ID: Hi! There are ngx_escape_uri() /ngx_unescape_uri() functions in src/core/ngx_string.c. They can transform strings in different ways according to the last argument. If you need NGX_ESCAPE_URI/NGX_UNESCAPE_URI ecoding types, please refer to SSI or XSLT module for a usage pattern. Hope it helps. Regards, Vladimir 2012/8/26 Vivek Goel : > Is there already available function to do url encode/decode of data in nginx > module development kit ? > > > regards > Vivek Goel > > > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel From ru at nginx.com Mon Aug 27 14:21:42 2012 From: ru at nginx.com (ru at nginx.com) Date: Mon, 27 Aug 2012 14:21:42 +0000 Subject: [nginx] svn commit: r4827 - in trunk/src: core http/modules/perl Message-ID: <20120827142142.4DEF73F9F00@mail.nginx.com> Author: ru Date: 2012-08-27 14:21:41 +0000 (Mon, 27 Aug 2012) New Revision: 4827 URL: http://trac.nginx.org/nginx/changeset/4827/nginx Log: Version bump. Modified: trunk/src/core/nginx.h trunk/src/http/modules/perl/nginx.pm Modified: trunk/src/core/nginx.h =================================================================== --- trunk/src/core/nginx.h 2012-08-21 13:05:26 UTC (rev 4826) +++ trunk/src/core/nginx.h 2012-08-27 14:21:41 UTC (rev 4827) @@ -9,8 +9,8 @@ #define _NGINX_H_INCLUDED_ -#define nginx_version 1003005 -#define NGINX_VERSION "1.3.5" +#define nginx_version 1003006 +#define NGINX_VERSION "1.3.6" #define NGINX_VER "nginx/" NGINX_VERSION #define NGINX_VAR "NGINX" Modified: trunk/src/http/modules/perl/nginx.pm =================================================================== --- trunk/src/http/modules/perl/nginx.pm 2012-08-21 13:05:26 UTC (rev 4826) +++ trunk/src/http/modules/perl/nginx.pm 2012-08-27 14:21:41 UTC (rev 4827) @@ -50,7 +50,7 @@ HTTP_INSUFFICIENT_STORAGE ); -our $VERSION = '1.3.5'; +our $VERSION = '1.3.6'; require XSLoader; XSLoader::load('nginx', $VERSION); From juce66 at gmail.com Mon Aug 27 15:45:24 2012 From: juce66 at gmail.com (Anton Jouline) Date: Mon, 27 Aug 2012 08:45:24 -0700 Subject: [PATCH] Random peer selection for implicit upstream defined by proxy_pass Message-ID: Just realized the patch in the previous message was not in the most-readable form... Here is the shorter version of the diff with new files omitted. (If anyone's interested, you can see the new files in the full diff, attached to the original message. These files - ngx_http_upstream_random.h and ngx_http_upstream_random.c - are, for the most part, pretty much copies of ngx_http_upstream_round_robin.*, with some slight changes). ==== diff -u -r nginx-1.2.2-org/auto/sources nginx-1.2.2/auto/sources --- nginx-1.2.2-org/auto/sources 2012-07-02 09:41:13.000000000 -0700 +++ nginx-1.2.2/auto/sources 2012-08-27 08:31:45.000000000 -0700 @@ -291,6 +291,7 @@ src/http/ngx_http_script.h \ src/http/ngx_http_upstream.h \ src/http/ngx_http_upstream_round_robin.h \ + src/http/ngx_http_upstream_random.h \ src/http/ngx_http_busy_lock.h" HTTP_SRCS="src/http/ngx_http.c \ @@ -307,6 +308,7 @@ src/http/ngx_http_script.c \ src/http/ngx_http_upstream.c \ src/http/ngx_http_upstream_round_robin.c \ + src/http/ngx_http_upstream_random.c \ src/http/ngx_http_parse_time.c \ src/http/modules/ngx_http_static_module.c \ src/http/modules/ngx_http_index_module.c \ diff -u -r nginx-1.2.2-org/src/http/ngx_http.h nginx-1.2.2/src/http/ngx_http.h --- nginx-1.2.2-org/src/http/ngx_http.h 2012-01-18 07:07:43.000000000 -0800 +++ nginx-1.2.2/src/http/ngx_http.h 2012-08-27 08:31:45.000000000 -0700 @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include diff -u -r nginx-1.2.2-org/src/http/ngx_http_upstream.c nginx-1.2.2/src/http/ngx_http_upstream.c --- nginx-1.2.2-org/src/http/ngx_http_upstream.c 2012-07-02 08:43:50.000000000 -0700 +++ nginx-1.2.2/src/http/ngx_http_upstream.c 2012-08-27 08:31:45.000000000 -0700 @@ -895,7 +895,7 @@ } #endif - if (ngx_http_upstream_create_round_robin_peer(r, ur) != NGX_OK) { + if (ngx_http_upstream_create_random_peer(r, ur) != NGX_OK) { ngx_http_upstream_finalize_request(r, u, NGX_HTTP_INTERNAL_SERVER_ERROR); return; Only in nginx-1.2.2/src/http: ngx_http_upstream_random.c Only in nginx-1.2.2/src/http: ngx_http_upstream_random.h From ru at nginx.com Tue Aug 28 13:31:02 2012 From: ru at nginx.com (ru at nginx.com) Date: Tue, 28 Aug 2012 13:31:02 +0000 Subject: [nginx] svn commit: r4828 - in trunk/src: core http http/modules Message-ID: <20120828133102.26EE13FA09B@mail.nginx.com> Author: ru Date: 2012-08-28 13:31:01 +0000 (Tue, 28 Aug 2012) New Revision: 4828 URL: http://trac.nginx.org/nginx/changeset/4828/nginx Log: Fixed the "include" directive. The "include" directive should be able to include multiple files if given a filename mask. Fixed this to work for "include" directives inside the "map" or "types" blocks. The "include" directive inside the "geo" block is still not fixed. Modified: trunk/src/core/ngx_conf_file.c trunk/src/core/ngx_conf_file.h trunk/src/http/modules/ngx_http_map_module.c trunk/src/http/ngx_http_core_module.c Modified: trunk/src/core/ngx_conf_file.c =================================================================== --- trunk/src/core/ngx_conf_file.c 2012-08-27 14:21:41 UTC (rev 4827) +++ trunk/src/core/ngx_conf_file.c 2012-08-28 13:31:01 UTC (rev 4828) @@ -12,7 +12,6 @@ static ngx_int_t ngx_conf_handler(ngx_conf_t *cf, ngx_int_t last); static ngx_int_t ngx_conf_read_token(ngx_conf_t *cf); -static char *ngx_conf_include(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); static ngx_int_t ngx_conf_test_full_name(ngx_str_t *name); static void ngx_conf_flush_files(ngx_cycle_t *cycle); @@ -731,7 +730,7 @@ } -static char * +char * ngx_conf_include(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) { char *rv; Modified: trunk/src/core/ngx_conf_file.h =================================================================== --- trunk/src/core/ngx_conf_file.h 2012-08-27 14:21:41 UTC (rev 4827) +++ trunk/src/core/ngx_conf_file.h 2012-08-28 13:31:01 UTC (rev 4828) @@ -317,6 +317,7 @@ char *ngx_conf_param(ngx_conf_t *cf); char *ngx_conf_parse(ngx_conf_t *cf, ngx_str_t *filename); +char *ngx_conf_include(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); ngx_int_t ngx_conf_full_name(ngx_cycle_t *cycle, ngx_str_t *name, Modified: trunk/src/http/modules/ngx_http_map_module.c =================================================================== --- trunk/src/http/modules/ngx_http_map_module.c 2012-08-27 14:21:41 UTC (rev 4827) +++ trunk/src/http/modules/ngx_http_map_module.c 2012-08-28 13:31:01 UTC (rev 4828) @@ -369,7 +369,7 @@ ngx_http_map(ngx_conf_t *cf, ngx_command_t *dummy, void *conf) { ngx_int_t rc, index; - ngx_str_t *value, file, name; + ngx_str_t *value, name; ngx_uint_t i, key; ngx_http_map_conf_ctx_t *ctx; ngx_http_variable_value_t *var, **vp; @@ -391,15 +391,7 @@ } if (ngx_strcmp(value[0].data, "include") == 0) { - file = value[1]; - - if (ngx_conf_full_name(cf->cycle, &file, 1) != NGX_OK) { - return NGX_CONF_ERROR; - } - - ngx_log_debug1(NGX_LOG_DEBUG_CORE, cf->log, 0, "include %s", file.data); - - return ngx_conf_parse(cf, &file); + return ngx_conf_include(cf, dummy, conf); } if (value[1].data[0] == '$') { Modified: trunk/src/http/ngx_http_core_module.c =================================================================== --- trunk/src/http/ngx_http_core_module.c 2012-08-27 14:21:41 UTC (rev 4827) +++ trunk/src/http/ngx_http_core_module.c 2012-08-28 13:31:01 UTC (rev 4828) @@ -3236,7 +3236,7 @@ { ngx_http_core_loc_conf_t *clcf = conf; - ngx_str_t *value, *content_type, *old, file; + ngx_str_t *value, *content_type, *old; ngx_uint_t i, n, hash; ngx_hash_key_t *type; @@ -3249,15 +3249,8 @@ " in \"include\" directive"); return NGX_CONF_ERROR; } - file = value[1]; - if (ngx_conf_full_name(cf->cycle, &file, 1) != NGX_OK) { - return NGX_CONF_ERROR; - } - - ngx_log_debug1(NGX_LOG_DEBUG_CORE, cf->log, 0, "include %s", file.data); - - return ngx_conf_parse(cf, &file); + return ngx_conf_include(cf, dummy, conf); } content_type = ngx_palloc(cf->pool, sizeof(ngx_str_t)); From toli at webforge.bg Wed Aug 29 11:43:04 2012 From: toli at webforge.bg (Anatoli Marinov) Date: Wed, 29 Aug 2012 14:43:04 +0300 Subject: question about ngx_http_named_location Message-ID: <503E0048.2030706@webforge.bg> Hello Mates, I am wondering why in ngx_http_named_location is used a segment of code that resets all modules contexts. I mean the line ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module);. My opinion is that the module context should not be touched outside of the certain module. Is there a special reason for this patch? Is there a case which requires it? Thanks in advance Anatoli Marinov -------------- next part -------------- An HTML attachment was scrubbed... URL: From vshebordaev at mail.ru Wed Aug 29 12:47:22 2012 From: vshebordaev at mail.ru (Vladimir Shebordaev) Date: Wed, 29 Aug 2012 16:47:22 +0400 Subject: question about ngx_http_named_location In-Reply-To: <503E0048.2030706@webforge.bg> References: <503E0048.2030706@webforge.bg> Message-ID: Hi! 2012/8/29 Anatoli Marinov : > Hello Mates, > I am wondering why in ngx_http_named_location is used a segment of code that > resets all modules contexts. I mean the line ngx_memzero(r->ctx, sizeof(void > *) * ngx_http_max_module);. > > My opinion is that the module context should not be touched outside of the > certain module. Is there a special reason for this patch? Is there a case > which requires it? > I guess, this is due to that the named location is an internal redirect, so the module contexts must be reset. > > Thanks in advance > Anatoli Marinov > > From toli at webforge.bg Wed Aug 29 13:02:25 2012 From: toli at webforge.bg (Anatoli Marinov) Date: Wed, 29 Aug 2012 16:02:25 +0300 Subject: question about ngx_http_named_location In-Reply-To: References: <503E0048.2030706@webforge.bg> Message-ID: <503E12E1.1060107@webforge.bg> "Must" is not a good reason. Is there a case that requires this behavior. In my use case I use internal redirects from location A to location @B. In location @B I try to read an exported variable which is actually located in module context and the module set this variable in location A but in @B all previous contexts are missing and I lost all previously set states and variables. Why internal redirects should erase module contexts? I think module context should be managed only from its module and should be attached to request while the request exists. Module context is the only one storage functionality per request and external modules depends from it. They expect to read exactly what was written there before. On 08/29/2012 03:47 PM, Vladimir Shebordaev wrote: > Hi! > > 2012/8/29 Anatoli Marinov: > >> Hello Mates, >> I am wondering why in ngx_http_named_location is used a segment of code that >> resets all modules contexts. I mean the line ngx_memzero(r->ctx, sizeof(void >> *) * ngx_http_max_module);. >> >> My opinion is that the module context should not be touched outside of the >> certain module. Is there a special reason for this patch? Is there a case >> which requires it? >> >> > I guess, this is due to that the named location is an internal > redirect, so the module contexts must be reset. > > >> Thanks in advance >> Anatoli Marinov >> >> >> > _______________________________________________ > nginx-devel mailing list > nginx-devel at nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-devel > From vshebordaev at mail.ru Wed Aug 29 18:42:47 2012 From: vshebordaev at mail.ru (Vladimir Shebordaev) Date: Wed, 29 Aug 2012 22:42:47 +0400 Subject: question about ngx_http_named_location In-Reply-To: <503E12E1.1060107@webforge.bg> References: <503E0048.2030706@webforge.bg> <503E12E1.1060107@webforge.bg> Message-ID: 2012/8/29 Anatoli Marinov : > "Must" is not a good reason. > Is there a case that requires this behavior. > In my use case I use internal redirects from location A to location @B. In > location @B I try to read an exported variable which is actually located in Well, module contexts are dynamic, they are created by appropriate handlers and are destoryed when the request is terminated. An internal redirect handled as a different request of special kind, that is why the module contexts are (re)initialized, i.e. zeroed out as if they were just allocated in ngx_http_init_request(). > module context and the module set this variable in location A but in @B all > previous contexts are missing and I lost all previously set states and > variables. Basically, it looks like bad design, the redirect is a request on its own. > > Why internal redirects should erase module contexts? I think module context > should be managed only from its module and should be attached to request > while the request exists. Module context is the only one storage > functionality per request and external modules depends from it. They expect > to read exactly what was written there before. > > On 08/29/2012 03:47 PM, Vladimir Shebordaev wrote: >> >> Hi! >> >> 2012/8/29 Anatoli Marinov: >> >>> >>> Hello Mates, >>> I am wondering why in ngx_http_named_location is used a segment of code >>> that >>> resets all modules contexts. I mean the line ngx_memzero(r->ctx, >>> sizeof(void >>> *) * ngx_http_max_module);. >>> >>> My opinion is that the module context should not be touched outside of >>> the >>> certain module. Is there a special reason for this patch? Is there a case >>> which requires it? >>> >>> >> >> I guess, this is due to that the named location is an internal >> redirect, so the module contexts must be reset. >> >> >>> >>> Thanks in advance >>> Anatoli Marinov >>> >>> >>> >> From ne at vbart.ru Wed Aug 29 18:54:45 2012 From: ne at vbart.ru (Valentin V. Bartenev) Date: Wed, 29 Aug 2012 22:54:45 +0400 Subject: question about ngx_http_named_location In-Reply-To: <503E12E1.1060107@webforge.bg> References: <503E0048.2030706@webforge.bg> <503E12E1.1060107@webforge.bg> Message-ID: <201208292254.45964.ne@vbart.ru> On Wednesday 29 August 2012 17:02:25 Anatoli Marinov wrote: [...] > Why internal redirects should erase module contexts? I think, it's because nginx trying to be declarative as much as possible. Erasing module contexts leads to less side effects. wbr, Valentin V. Bartenev From tsahia at gmail.com Thu Aug 30 07:19:11 2012 From: tsahia at gmail.com (Tsahi Asher) Date: Thu, 30 Aug 2012 10:19:11 +0300 Subject: problem with nginx round robin upstream Message-ID: Hi I have a problem with the upstream round robin mechanism. in ngx_http_upstream.c ngx_http_upstream_server function the hostname that is added in the configuration file under upstream directive is added to the upstream server list. the function uses ngx_parse_url which in turn uses ngx_parse_inet_url that calls ngx_inet_resolve_host. ngx_inet_resolve_host tries to resolve the host name from the configuration file by calling gethostbyname. for each url gethostbyname return the list of ip's that are associated with this url and these ip's are added to the list of upstream servers. This results in a situation that if there are three servers defined in an upstream directive, each with an equal weight, but one of those server is associated with two ip's (for example internal and an external ip) then the round robin weight will not be equal for each server. The server which has two ip's will get a double weight. i can add a log if required or if my explanation is not good enough. i saw that a url has a flag called one_addr that if is set to true will get resolved to a single ip only, but this flag is not used. adding the host ip address is one way to solve this, is there another way? -------------- next part -------------- An HTML attachment was scrubbed... URL: From ru at nginx.com Thu Aug 30 09:29:34 2012 From: ru at nginx.com (Ruslan Ermilov) Date: Thu, 30 Aug 2012 13:29:34 +0400 Subject: problem with nginx round robin upstream In-Reply-To: References: Message-ID: <20120830092934.GA75395@lo0.su> On Thu, Aug 30, 2012 at 10:19:11AM +0300, Tsahi Asher wrote: > Hi > > I have a problem with the upstream round robin mechanism. > in ngx_http_upstream.c ngx_http_upstream_server function the hostname that > is added in the configuration file under upstream directive is added to > the upstream server list. > the function uses ngx_parse_url which in turn uses ngx_parse_inet_url that > calls ngx_inet_resolve_host. > ngx_inet_resolve_host tries to resolve the host name from the > configuration file by calling gethostbyname. for each url gethostbyname > return the list of ip's that are associated with this url and these ip's > are added to the list of upstream servers. > This results in a situation that if there are three servers defined in an > upstream directive, each with an equal weight, but one of those server is > associated with two ip's (for example internal and an external ip) then > the round robin weight will not be equal for each server. The server which > has two ip's will get a double weight. > i can add a log if required or if my explanation is not good enough. > i saw that a url has a flag called one_addr that if is set to true will > get resolved to a single ip only, but this flag is not used. > > adding the host ip address is one way to solve this, is there another way? This is expected. Here's the relevant quote from documentation [1]: : A domain name that resolves to several IP addresses essentially defines : multiple servers. [1] http://nginx.org/en/docs/http/ngx_http_upstream_module.html#server From ru at nginx.com Thu Aug 30 14:58:12 2012 From: ru at nginx.com (ru at nginx.com) Date: Thu, 30 Aug 2012 14:58:12 +0000 Subject: [nginx] svn commit: r4829 - in trunk/src/http: . modules Message-ID: <20120830145812.54C4D3F9E7F@mail.nginx.com> Author: ru Date: 2012-08-30 14:58:11 +0000 (Thu, 30 Aug 2012) New Revision: 4829 URL: http://trac.nginx.org/nginx/changeset/4829/nginx Log: Fixed strict aliasing bugs when dealing with IPv4-mapped IPv6 addresses (closes #201). Modified: trunk/src/http/modules/ngx_http_geo_module.c trunk/src/http/modules/ngx_http_geoip_module.c trunk/src/http/ngx_http_core_module.c Modified: trunk/src/http/modules/ngx_http_geo_module.c =================================================================== --- trunk/src/http/modules/ngx_http_geo_module.c 2012-08-28 13:31:01 UTC (rev 4828) +++ trunk/src/http/modules/ngx_http_geo_module.c 2012-08-30 14:58:11 UTC (rev 4829) @@ -233,12 +233,21 @@ #if (NGX_HAVE_INET6) if (addr.sockaddr->sa_family == AF_INET6) { + u_char *p; + in_addr_t inaddr; struct in6_addr *inaddr6; inaddr6 = &((struct sockaddr_in6 *) addr.sockaddr)->sin6_addr; if (IN6_IS_ADDR_V4MAPPED(inaddr6)) { - return ntohl(*(in_addr_t *) &inaddr6->s6_addr[12]); + p = inaddr6->s6_addr; + + inaddr = p[12] << 24; + inaddr += p[13] << 16; + inaddr += p[14] << 8; + inaddr += p[15]; + + return inaddr; } } Modified: trunk/src/http/modules/ngx_http_geoip_module.c =================================================================== --- trunk/src/http/modules/ngx_http_geoip_module.c 2012-08-28 13:31:01 UTC (rev 4828) +++ trunk/src/http/modules/ngx_http_geoip_module.c 2012-08-30 14:58:11 UTC (rev 4829) @@ -226,12 +226,21 @@ #if (NGX_HAVE_INET6) if (addr.sockaddr->sa_family == AF_INET6) { + u_char *p; + in_addr_t inaddr; struct in6_addr *inaddr6; inaddr6 = &((struct sockaddr_in6 *) addr.sockaddr)->sin6_addr; if (IN6_IS_ADDR_V4MAPPED(inaddr6)) { - return ntohl(*(in_addr_t *) &inaddr6->s6_addr[12]); + p = inaddr6->s6_addr; + + inaddr = p[12] << 24; + inaddr += p[13] << 16; + inaddr += p[14] << 8; + inaddr += p[15]; + + return inaddr; } } Modified: trunk/src/http/ngx_http_core_module.c =================================================================== --- trunk/src/http/ngx_http_core_module.c 2012-08-28 13:31:01 UTC (rev 4828) +++ trunk/src/http/ngx_http_core_module.c 2012-08-30 14:58:11 UTC (rev 4829) @@ -2776,7 +2776,15 @@ if (IN6_IS_ADDR_V4MAPPED(inaddr6)) { family = AF_INET; - inaddr = *(in_addr_t *) &inaddr6->s6_addr[12]; + + p = inaddr6->s6_addr; + + inaddr = p[12] << 24; + inaddr += p[13] << 16; + inaddr += p[14] << 8; + inaddr += p[15]; + + inaddr = htonl(inaddr); } } #endif From ru at nginx.com Thu Aug 30 15:09:21 2012 From: ru at nginx.com (ru at nginx.com) Date: Thu, 30 Aug 2012 15:09:21 +0000 Subject: [nginx] svn commit: r4830 - trunk/src/core Message-ID: <20120830150921.B25D73F9C5F@mail.nginx.com> Author: ru Date: 2012-08-30 15:09:21 +0000 (Thu, 30 Aug 2012) New Revision: 4830 URL: http://trac.nginx.org/nginx/changeset/4830/nginx Log: Fixed overflow if ngx_slab_alloc() is called with very big "size" argument. Modified: trunk/src/core/ngx_slab.c Modified: trunk/src/core/ngx_slab.c =================================================================== --- trunk/src/core/ngx_slab.c 2012-08-30 14:58:11 UTC (rev 4829) +++ trunk/src/core/ngx_slab.c 2012-08-30 15:09:21 UTC (rev 4830) @@ -162,8 +162,8 @@ ngx_log_debug1(NGX_LOG_DEBUG_ALLOC, ngx_cycle->log, 0, "slab alloc: %uz", size); - page = ngx_slab_alloc_pages(pool, (size + ngx_pagesize - 1) - >> ngx_pagesize_shift); + page = ngx_slab_alloc_pages(pool, (size >> ngx_pagesize_shift) + + ((size % ngx_pagesize) ? 1 : 0)); if (page) { p = (page - pool->pages) << ngx_pagesize_shift; p += (uintptr_t) pool->start; From ru at nginx.com Thu Aug 30 16:05:43 2012 From: ru at nginx.com (ru at nginx.com) Date: Thu, 30 Aug 2012 16:05:43 +0000 Subject: [nginx] svn commit: r4831 - trunk/docs/xsls Message-ID: <20120830160543.6A46A3FA0C6@mail.nginx.com> Author: ru Date: 2012-08-30 16:05:43 +0000 (Thu, 30 Aug 2012) New Revision: 4831 URL: http://trac.nginx.org/nginx/changeset/4831/nginx Log: Converted DOS-style newlines. Modified: trunk/docs/xsls/dump.xsls Modified: trunk/docs/xsls/dump.xsls =================================================================== --- trunk/docs/xsls/dump.xsls 2012-08-30 15:09:21 UTC (rev 4830) +++ trunk/docs/xsls/dump.xsls 2012-08-30 16:05:43 UTC (rev 4831) @@ -1,29 +1,29 @@ -X:stylesheet { - -X:output method="xml" -X:param indent-increment="' '"; - -X:template noname(indent="' '") = "*" { - !{$indent} - - X:if "name()='xsl:template'" { - !{$indent} - } - - X:copy { - X:copy-of "@*" - !!( indent = "concat($indent, $indent-increment)" ); - X:if "./* " { !{$indent} } - } -} - - -X:template = "comment()|processing-instruction()" { - X:copy; -} - - - -} +X:stylesheet { + +X:output method="xml" +X:param indent-increment="' '"; + +X:template noname(indent="' '") = "*" { + !{$indent} + + X:if "name()='xsl:template'" { + !{$indent} + } + + X:copy { + X:copy-of "@*" + !!( indent = "concat($indent, $indent-increment)" ); + X:if "./* " { !{$indent} } + } +} + + +X:template = "comment()|processing-instruction()" { + X:copy; +} + + + +} From ru at nginx.com Thu Aug 30 16:08:13 2012 From: ru at nginx.com (ru at nginx.com) Date: Thu, 30 Aug 2012 16:08:13 +0000 Subject: [nginx] svn commit: r4832 - in trunk/docs: . dtd xml/nginx Message-ID: <20120830160814.1920A3FA0C6@mail.nginx.com> Author: ru Date: 2012-08-30 16:08:13 +0000 (Thu, 30 Aug 2012) New Revision: 4832 URL: http://trac.nginx.org/nginx/changeset/4832/nginx Log: Pass changes.xml thru xmllint when generating CHANGES and CHANGES.ru. Modified: trunk/docs/GNUmakefile trunk/docs/dtd/changes.dtd trunk/docs/xml/nginx/changes.xml Modified: trunk/docs/GNUmakefile =================================================================== --- trunk/docs/GNUmakefile 2012-08-30 16:05:43 UTC (rev 4831) +++ trunk/docs/GNUmakefile 2012-08-30 16:08:13 UTC (rev 4832) @@ -12,22 +12,26 @@ $(TEMP)/$(NGINX)/CHANGES -$(TEMP)/$(NGINX)/CHANGES.ru: docs/xml/nginx/changes.xml \ +$(TEMP)/$(NGINX)/CHANGES.ru: docs/dtd/changes.dtd \ + docs/xml/nginx/changes.xml \ docs/xml/change_log_conf.xml \ docs/xslt/changes.xslt mkdir -p $(TEMP)/$(NGINX) + xmllint --noout --valid docs/xml/nginx/changes.xml xsltproc --stringparam lang ru \ -o $@ docs/xslt/changes.xslt docs/xml/nginx/changes.xml -$(TEMP)/$(NGINX)/CHANGES: docs/xml/nginx/changes.xml \ +$(TEMP)/$(NGINX)/CHANGES: docs/dtd/changes.dtd \ + docs/xml/nginx/changes.xml \ docs/xml/change_log_conf.xml \ docs/xslt/changes.xslt mkdir -p $(TEMP)/$(NGINX) + xmllint --noout --valid docs/xml/nginx/changes.xml xsltproc --stringparam lang en \ -o $@ docs/xslt/changes.xslt docs/xml/nginx/changes.xml Modified: trunk/docs/dtd/changes.dtd =================================================================== --- trunk/docs/dtd/changes.dtd 2012-08-30 16:05:43 UTC (rev 4831) +++ trunk/docs/dtd/changes.dtd 2012-08-30 16:08:13 UTC (rev 4832) @@ -12,10 +12,10 @@ > - + - + Modified: trunk/docs/xml/nginx/changes.xml =================================================================== --- trunk/docs/xml/nginx/changes.xml 2012-08-30 16:05:43 UTC (rev 4831) +++ trunk/docs/xml/nginx/changes.xml 2012-08-30 16:08:13 UTC (rev 4832) @@ -2,13 +2,9 @@ - + -????????? ? nginx -nginx changelog - From mdounin at mdounin.ru Fri Aug 31 18:52:26 2012 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 31 Aug 2012 22:52:26 +0400 Subject: question about ngx_http_named_location In-Reply-To: <503E0048.2030706@webforge.bg> References: <503E0048.2030706@webforge.bg> Message-ID: <20120831185226.GZ40452@mdounin.ru> Hello! On Wed, Aug 29, 2012 at 02:43:04PM +0300, Anatoli Marinov wrote: > Hello Mates, > I am wondering why in ngx_http_named_location is used a segment of > code that resets all modules contexts. I mean the line > ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module);. > My opinion is that the module context should not be touched outside > of the certain module. Is there a special reason for this patch? Is > there a case which requires it? There was more than one case where not clearing of module contexts in ngx_http_named_location() was causing problems, see here for more details: http://mailman.nginx.org/pipermail/nginx-devel/2011-October/001329.html As this behaviour wasn't something designed (rather a bug, even if not affecting official modules), nor something consistent with other similar code (i.e. clearing module contexts on internal redirects), hence it was decided that it's better to clear context than to don't. As for clearing module contexts on internal redirects (in contrast to named locations - where behaviour was changed recently, and the change is explained above), it allows to simplify module development as modules don't need to keep track of request processing history. And actually it semantically does what internal redirect is expected to do: start another request with another uri. There is at least one way to preserve data between both internal redirects and named location changes (as well as subrequests, actually), via variables. (It's somewhat a hack, but it works and it's expected to work. You may try searching mailing list archives for more details, I believe I explained this at least once.) Maxim Dounin From agentzh at gmail.com Fri Aug 31 22:33:39 2012 From: agentzh at gmail.com (agentzh) Date: Fri, 31 Aug 2012 15:33:39 -0700 Subject: question about ngx_http_named_location In-Reply-To: <503E0048.2030706@webforge.bg> References: <503E0048.2030706@webforge.bg> Message-ID: Hello! On Wed, Aug 29, 2012 at 4:43 AM, Anatoli Marinov wrote: > I am wondering why in ngx_http_named_location is used a segment of code that > resets all modules contexts. I mean the line ngx_memzero(r->ctx, sizeof(void > *) * ngx_http_max_module);. > My opinion is that the module context should not be touched outside of the > certain module. Is there a special reason for this patch? Is there a case > which requires it? > If you're tracking contexts for subrequests that may initiate internal redirects via ngx_http_named_location, then you can restore your ctx pointer from something like the post_subrequest in places like your own output header filters. I'm doing this in both the ngx_srcache and ngx_lua modules (at least) :) Best regards, -agentzh