diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 7665f8e..0000000 --- a/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -objs/* -!objs/ndk_* -.pc/ -.vscode/ -modules/media-framework/ -modules/nginx-srt-module/ -modules/nginx-vod-module/ -Makefile -*.orig -*.txt \ No newline at end of file diff --git a/.hgtags b/.hgtags deleted file mode 100644 index 0dc64a5..0000000 --- a/.hgtags +++ /dev/null @@ -1,483 +0,0 @@ -551102312e19b704cd22bd7254a9444b9ea14e96 release-0.1.0 -23fb87bddda14ce9faec90f774085634106aded4 release-0.1.1 -295d97d70c698585705345f1a8f92b02e63d6d0d release-0.1.2 -ded1284520cc939ad5ae6ddab39925375e64237d release-0.1.3 -0491b909ef7612d8411f1f59054186c1f3471b52 release-0.1.4 -a88a3e4e158fade0aaa6f3eb25597d5ced2c1075 release-0.1.5 -1f31dc6d33a3a4e65240b08066bf186df9e33b79 release-0.1.6 -5aecc125bc33d81d6214c91d73eb44230a903dde release-0.1.7 -bbd6b0b4a2b15ef8c8f1aaf7b027b6da47303524 release-0.1.8 -2ff194b74f1e60cd04670986973e3b1a6aa3bece release-0.1.9 -31ee1b50354fb829564b81a6f34e8d6ceb2d3f48 release-0.1.10 -8e8f3af115b5b903b2b8f3335de971f18891246f release-0.1.11 -c3c2848fc081e19aec5ffa97e468ad20ddb81df0 release-0.1.12 -ad1e9ebf93bb5ae4c748d471fad2de8a0afc4d2a release-0.1.13 -c5240858380136a67bec261c59b1532560b57885 release-0.1.14 -fd661d14a7fad212e326a7dad6234ea0de992fbf release-0.1.15 -621229427cba1b0af417ff2a101fc4f17a7d93c8 release-0.1.16 -4ebe09b07e3021f1a63b459903ec58f162183b26 release-0.1.17 -31ff3e943e1675a2caf745ba7a981244445d4c98 release-0.1.18 -45a460f82aec80b0f61136aa09f412436d42203a release-0.1.19 -0f836f0288eee4980f57736d50a7a60fa082d8e9 release-0.1.20 -975f62e77f0244f1b631f740be77c72c8f2da1de release-0.1.21 -fc9909c369b2b4716304ac8e38da57b8fb781211 release-0.1.22 -d7c90bb5ce83dab08715e98f9c7b81c7df4b37be release-0.1.23 -64d9afb209da0cd4a917202b7b77e51cc23e2229 release-0.1.24 -d4ea69372b946dc4ec37fc3f5ddd93ff7c3da675 release-0.1.25 -b1648294f6935e993e436fd8a68bca75c74c826d release-0.1.26 -ee66921ecd47a7fa459f70f4a9d660f91f6a1b94 release-0.1.27 -cd3117ad9aab9c58c6f7e677e551e1adbdeaba54 release-0.1.28 -9b8c906f6e63ec2c71cecebfff35819a7d32227d release-0.1.29 -c12967aadd8726daf2d85e3f3e622d89c42db176 release-0.1.30 -fbbf16224844e7d560c00043e8ade8a560415bba release-0.1.31 -417a087c9c4d9abb9b0b9b3f787aff515c43c035 release-0.1.32 -dadfa78d227027348d7f9d1e7b7093d06ba545a0 release-0.1.33 -12234c998d83bfbbaa305273b3dd1b855ca325dc release-0.1.34 -6f00349b98e5f706b82115c6e4dc84456fc0d770 release-0.1.35 -2019117e6b38cc3e89fe4f56a23b271479c627a6 release-0.1.36 -09b42134ac0c42625340f16628e29690a04f8db5 release-0.1.37 -7fa11e5c6e9612ecff5eb58274cc846ae742d1d2 release-0.1.38 -e5d7d0334fdb946133c17523c198800142ac9fe9 release-0.1.39 -c3bd8cdabb8f73e5600a91f198eb7df6fac65e92 release-0.1.40 -d6e48c08d718bf5a9e58c20a37e8ae172bff1139 release-0.1.41 -563ad09abf5042eb41e8ecaf5b4e6c9deaa42731 release-0.1.42 -c9ad0d9c7d59b2fa2a5fe669f1e88debd03e6c04 release-0.1.43 -371c1cee100d7a1b0e6cad4d188e05c98a641ee7 release-0.1.44 -b09ee85d0ac823e36861491eedfc4dfafe282997 release-0.1.45 -511a89da35ada16ae806667d699f9610b4f8499a release-0.2.0 -0148586012ab3dde69b394ec5a389d44bb11c869 release-0.2.1 -818fbd4750b99d14d2736212c939855a11b1f1ef release-0.2.2 -e16a8d574da511622b97d6237d005f40f2cddb30 release-0.2.3 -483cca23060331f2078b1c2984870d80f288ad41 release-0.2.4 -45033d85b30e3f12c407b7cfc518d76e0eda0263 release-0.2.5 -7bd37aef1e7e87858c12b124e253e98558889b50 release-0.2.6 -ecd9c160f25b7a7075dd93383d98a0fc8d8c0a41 release-0.3.0 -c1f965ef97188fd7ef81342dcf8719da18c554d2 release-0.3.1 -e48ebafc69393fc94fecfdf9997c4179fd1ce473 release-0.3.2 -9c2f3ed7a24711d3b42b124d5f831155c8beff95 release-0.3.3 -7c1369d37c7eb0017c28ebcaa0778046f5aafdcc release-0.3.4 -1af2fcb3be8a63796b6b23a488049c92a6bc12f4 release-0.3.5 -174f1e853e1e831b01000aeccfd06a9c8d4d95a2 release-0.3.6 -458b6c3fea65a894c99dd429334a77bb164c7e83 release-0.3.7 -58475592100cb792c125101b6d2d898f5adada30 release-0.3.8 -fcd6fc7ff7f9b132c35193d834e6e7d05026c716 release-0.3.9 -4d9ea73a627a914d364e83e20c58eb1283f4031d release-0.3.10 -4c5c2c55975c1152b5ca5d5d55b32d4dd7945f7a release-0.3.11 -326634fb9d47912ad94221dc2f8fa4bec424d40c release-0.3.12 -4e296b7d25bf62390ca2afb599e395426b94f785 release-0.3.13 -401de5a43ba5a8acdb9c52465193c0ea7354afe7 release-0.3.14 -284cc140593bb16ac71094acd509ab415ff4837d release-0.3.15 -d4e858a5751a7fd08e64586795ed7d336011fbc0 release-0.3.16 -8c0cdd81580eb76d774cfc5724de68e7e5cbbdc2 release-0.3.17 -425af804d968f30eeff01e33b808bc2e8c467f2c release-0.3.18 -ebc68d8ca4962fe3531b7e13444f7ac4395d9c6e release-0.3.19 -9262f520ce214d3d5fd7c842891519336ef85ca6 release-0.3.20 -869b6444d2341a587183859d4df736c7f3381169 release-0.3.21 -77f77f53214a0e3a68fef8226c15532b54f2c365 release-0.3.22 -858700ae46b453ea111b966b6d03f2c21ddcb94e release-0.3.23 -5dac8c7fb71b86aafed8ea352305e7f85759f72e release-0.3.24 -77cdfe394a94a625955e7585e09983b3af9b889b release-0.3.25 -608cf78b24ef7baaf9705e4715a361f26bb16ba9 release-0.3.26 -3f8a2132b93d66ac19bec006205a304a68524a0b release-0.3.27 -c73c5c58c619c22dd3a5a26c91bb0567a62c6930 release-0.3.28 -5ef026a2ac7481f04154f29ab49377bf99aaf96f release-0.3.29 -51b27717f140b71a2e9158807d79da17c888ce4c release-0.3.30 -7a16e281c01f1c7ab3b79c64b43ddb754ea7935e release-0.3.31 -93e85a79757c49d502e42a1cb8264a0f133b0b00 release-0.3.32 -0216fd1471f386168545f772836156761eddec08 release-0.3.33 -fbed40ce7cb4fd7203fecc22a617b9ce5b950fb3 release-0.3.34 -387450de0b4d21652f0b6242a5e26a31e3be8d8c release-0.3.35 -65bf042c0b4f39f18a235464c52f980e9fa24f6b release-0.3.36 -5d2b8078c1c2593b95ec50acfeeafbefa65be344 release-0.3.37 -f971949ffb585d400e0f15508a56232a0f897c80 release-0.3.38 -18268abd340cb351e0c01b9c44e9f8cc05492364 release-0.3.39 -e60fe4cf1d4ea3c34be8c49047c712c6d46c1727 release-0.3.40 -715d243270806d38be776fc3ed826d97514a73d6 release-0.3.41 -5e8fb59c18c19347a5607fb5af075fe1e2925b9a release-0.3.42 -947c6fd27699e0199249ad592151f844c8a900b0 release-0.3.43 -4946078f0a79e6cc952d3e410813aac9b8bda650 release-0.3.44 -95d7da23ea5315a6e9255ce036ed2c51f091f180 release-0.3.45 -1e720b0be7ecd92358da8a60944669fa493e78cd release-0.3.46 -39b7d7b33c918d8f4abc86c4075052d8c19da3c7 release-0.3.47 -7cbef16c71a1f43a07f8141f02e0135c775f0f5b release-0.3.48 -4c8cd5ae5cc100add5c08c252d991b82b1838c6b release-0.3.49 -400711951595aef7cd2ef865b84b31df52b15782 release-0.3.50 -649c9063d0fda23620eaeaf0f6393be0a672ebe7 release-0.3.51 -9079ee4735aefa98165bb2cb26dee4f58d58c1d7 release-0.3.52 -6d5c1535bb9dcd891c5963971f767421a334a728 release-0.3.53 -5fd7a5e990477189c40718c8c3e01002a2c20b81 release-0.3.54 -63a820b0bc6ca629c8e45a069b52d622ddc27a2d release-0.3.55 -562806624c4afb1687cba83bc1852f5d0fecbac3 release-0.3.56 -cec32b3753acf610ac1a6227d14032c1a89d6319 release-0.3.57 -b80f94fa2197b99db5e033fec92e0426d1fe5026 release-0.3.58 -e924670896abe2769ea0fcfd2058b405bed8e8ec release-0.3.59 -921a7ce4baf42fd1091b7e40f89c858c6b23053e release-0.3.60 -df95dcff753a6dc5e94257302aea02c18c7a7c87 release-0.3.61 -7e24168b0853ee7e46c9c7b943ef077dc64f17f5 release-0.4.0 -8183d4ba50f8500465efb27e66dd23f98775dd21 release-0.4.1 -610267a772c7bf911b499d37f66c21ce8f2ebaf7 release-0.4.2 -39dd0b045441e21512e0a6061a03d0df63414d8b release-0.4.3 -5e42c1615f4de0079bd4d8913886d588ce6a295d release-0.4.4 -40266f92b829a870808b3d4ee54c8fccdecbd2d6 release-0.4.5 -56e33c6efee7ff63cdc52bd1cf172bde195079df release-0.4.6 -119bad43bfd493400c57a05848eada2c35a46810 release-0.4.7 -0f404f82a1343cb4e4b277a44e3417385798e5e5 release-0.4.8 -d24a717314365c857b9f283d6072c2a427d5e342 release-0.4.9 -d6f0a00015fdef861fd67fb583b9690638650656 release-0.4.10 -e372368dadd7b2ecd0182b2f1b11db86fc27b2c3 release-0.4.11 -fd57967d850d2361072c72562d1ed03598473478 release-0.4.12 -979045fdcbd20cf7188545c1c589ff240251f890 release-0.4.13 -93c94cfa9f78f0a5740595dde4466ec4fba664f8 release-0.4.14 -589ee12e8d7c2ae5e4f4676bcc7a1279a76f9e8e release-0.5.0 -13416db8a807e5acb4021bc3c581203de57e2f50 release-0.5.1 -06c58edc88831fb31c492a8eddcf2c6056567f18 release-0.5.2 -e2ac5fa41bcba14adbbb722d45c083c30c07bb5c release-0.5.3 -393dbc659df15ccd411680b5c1ce87ed86d4c144 release-0.5.4 -38cc7bd8e04f2c519fd4526c12841a876be353cb release-0.5.5 -6d1fcec2ea79101c756316c015f72e75f601a5ab release-0.5.6 -aed8a9de62456c4b360358bc112ccca32ce02e8d release-0.5.7 -7642f45af67d805452df2667486201c36efaff85 release-0.5.8 -779216610662c3a459935d506f66a9b16b9c9576 release-0.5.9 -9eeb585454f3daa30cf768e95c088a092fe229b9 release-0.5.10 -bb491c8197e38ca10ae63b1f1ecb36bf6fdaf950 release-0.5.11 -613369e08810f36bbcc9734ef1059a03ccbf5e16 release-0.5.12 -bd796ef5c9c9dd34bfac20261b98685e0410122a release-0.5.13 -8a730c49f906d783b47e4b44d735efd083936c64 release-0.5.14 -cb447039152d85e9145139ff2575a6199b9af9d4 release-0.5.15 -64854c7c95d04f838585ca08492823000503fa61 release-0.5.16 -d1ffcf84ea1244f659145c36ff28de6fcdf528b2 release-0.5.17 -796a6e30ca9d29504195c10210dbc8deced0ae83 release-0.5.18 -1f81c711d2a039e1f93b9b515065a2235372d455 release-0.5.19 -8e8f6082654aedb4438c8fca408cfc316c7c5a2a release-0.5.20 -e9551132f7dd40da5719dd5bcf924c86f1436f85 release-0.5.21 -533a252896c4d1cff1586ae42129d610f7497811 release-0.5.22 -f461a49b6c747e0b67f721f2be172902afea5528 release-0.5.23 -2d5ef73671f690b65bf6d9e22e7155f68f484d5a release-0.5.24 -77bf42576050862c268e267ef3e508b145845a25 release-0.5.25 -2aefee4d4ed69eb7567680bf27a2efd212232488 release-0.6.0 -7ac0fe9bec9a2b5f8e191f6fdd6922bfd916a6cb release-0.6.1 -4882735ebc71eeec0fbfe645bdfdb31306872d82 release-0.6.2 -b94731c73d0922f472ff938b9d252ba29020f20c release-0.6.3 -13e649b813d6ccba5db33a61e08ebe09d683cd5b release-0.6.4 -80de622646b0059fd4c553eff47c391bf7503b89 release-0.6.5 -3b05edb2619d5935023b979ee7a9611b61b6c9e5 release-0.6.6 -1dcfd375100c4479611f71efb99271d0a3059215 release-0.6.7 -0228185d4c5772947b842e856ad74cf7f7fd52f3 release-0.6.8 -d1879c52326ecac45c713203670f54220879911e release-0.6.9 -5a80c6ccbe2ad24fa3d4ff6f9fe4a2b07408d19d release-0.6.10 -f88a8b0b39601b19cd740e4db614ab0b5b874686 release-0.6.11 -5557460a7247a1602ae96efd1d0ccf781344cb58 release-0.6.12 -451b02cc770a794cd41363461b446948ae1d8bc8 release-0.6.13 -537b6ef014c4a133e0ab0b7dc817508e0647e315 release-0.6.14 -5e68764f0d6e91a983170fa806e7450a9e9b33fe release-0.6.15 -158aa4e8cc46fcf9504a61469d22daf3476b17bf release-0.6.16 -d8fcca555542619228d9fab89e1665b993f8c3ee release-0.6.17 -60707ebc037086cf004736a0d4979e2a608da033 release-0.6.18 -3c2a99d3a71af846855be35e62edb9a12f363f44 release-0.6.19 -3e0a27f9358ffc1b5249e0ea2311ce7da5c8967e release-0.6.20 -143f4d65b1c875d6563ccb7f653d9157afc72194 release-0.6.21 -95e6160d2b7d0af8ffd1b95a23cadadf8f0b3f6d release-0.6.22 -69a03d5e3b6e6660079ef1ef172db7ac08d8370e release-0.6.23 -3e2a58fb48f1e1a99ebf851e0d47a7034c52ae22 release-0.6.24 -3b8607c05a8bebcfa59235c2126a70d737f0ccf5 release-0.6.25 -07ad5b2606614c4be4ee720c46cf4af126059d31 release-0.6.26 -be531addfabe5214f409d457140c1038af10d199 release-0.6.27 -58f05255d3a345d04baef5cff0ca1ae0ac7ecebb release-0.6.28 -eb2bd21dc8d03f6c94016f04ffb9adaf83a2b606 release-0.6.29 -55408deb3cd171efa9b81d23d7a1dd1ccde0b839 release-0.6.30 -d4288915bba73c4c3c9cf5d39d34e86879eb2b45 release-0.6.31 -0a189588830b8629c4dfea68feb49af36b59e4a9 release-0.7.0 -6ab27a06f3346cf9ec8737f5dbcc82dd4031e30f release-0.7.1 -a07e258cef3b0a0b6e76a6ff4ba4651c5facc85a release-0.7.2 -9992c4583513d2804fc2e7fec860fbc7ab043009 release-0.7.3 -4dc24d50230fbadfc037a414a86390db2de69dd2 release-0.7.4 -9527137b4354a648a229c7169850c7c65272c00d release-0.7.5 -c2f0f7cf306f302254beae512bda18713922375c release-0.7.6 -bbcf6d75556fdcee8bd4aba8f6c27014be9920ee release-0.7.7 -43bde71f0bbe5a33b161760d7f9f980d50386597 release-0.7.8 -769f0dd7081e9011394f264aa22aa66fd79730d8 release-0.7.9 -511edfa732da637f5f0c9476335df7dca994706d release-0.7.10 -0e7023bf6b2461309c29885935443449a41be807 release-0.7.11 -9ad1bd2b21d93902863807528e426862aedee737 release-0.7.12 -d90ea21e24ea35379aef50c5d70564158e110a15 release-0.7.13 -c07d2d20d95c83d804079bbdcecbce4a0c8282f0 release-0.7.14 -0cd7bb051f67eac2b179fb9f9cc988b9ba18ed76 release-0.7.15 -eab2e87deba73ae6abd9cc740e8d4365bed96322 release-0.7.16 -91d7a9eb8ade90e9421d7b1e3c2e47a6bc427876 release-0.7.17 -fc10f7b5cb1305fb930f8ac40b46882d0828d61e release-0.7.18 -9dba9779e37e5969a2d408c792084fd7acfec062 release-0.7.19 -61838d1bcbddc7bc4dd9f30d535573a6fddca8f9 release-0.7.20 -5f665d0fa6a5f6e748157f2ccbc445b2db8125d0 release-0.7.21 -24763afa5efe91e54f00b2ae5b87666eb6c08c3b release-0.7.22 -0562fb355a25266150cbe8c8d4e00f55e3654df3 release-0.7.23 -19c452ecd083550816873a8a31eb3ed9879085e6 release-0.7.24 -46b68faf271d6fdcaaf3ad2c69f6167ea9e9fa28 release-0.7.25 -d04bfca0c7e3ae2e4422bc1d383553139d6f0a19 release-0.7.26 -9425d9c7f8ead95b00a3929a9a5e487e0e3c8499 release-0.7.27 -fbc3e7e8b3ee756568a875f87d8a954a2f9d3bf6 release-0.7.28 -5176dfdf153fc785b18604197d58806f919829ad release-0.7.29 -87e07ccdf0a4ec53458d9d7a4ea66e1239910968 release-0.7.30 -9fddd7e1a7a27f8463867f41a461aad57df461b2 release-0.7.31 -780b2ba1ec6daf6e3773774e26b05b9ff0d5483e release-0.7.32 -83027471a25385b1c671968be761e9aa7a8591a7 release-0.7.33 -1e9a362c3dcee221ca6e34308c483ed93867aca2 release-0.7.34 -c7ee9e15717b54ead5f4a554686e74abe66c6b07 release-0.7.35 -b84548abe9b9d4f4e203f848696e52c8c82c308f release-0.7.36 -3286f0bab8e77dbc7ebb370b1dc379592ccff123 release-0.7.37 -11a4e2ed5b166b9c9f119171aa399a9e3aa4684a release-0.7.38 -f822655d4120629977794c32d3b969343b6c30db release-0.7.39 -8a350e49d2b6751296db6d8e27277ccf63ed412a release-0.7.40 -c4a56c197eeafd71fc1caef7a9d890a330e3c23d release-0.7.41 -a9575a57a5443df39611774cf3840e9088132b0e release-0.7.42 -7503d95d6eadad14c28b2db183ba09848265274b release-0.7.43 -9be652e9114435fc6f1fdec84c0458d56702db91 release-0.7.44 -797e070d480a34b31ddac0d364784773f1bbbcf9 release-0.7.45 -9b5037e7ec7db25875c40f9d1cf20a853388b124 release-0.7.46 -d1d0e6d7ff0ca3c0dd1be1ef1cfff2e3fd0b4e1c release-0.7.47 -9816fb28eda599bfd53940e6d3b6617d1ecb6323 release-0.7.48 -452b9d09df8e3f2fb04b2a33d04d2f3a6436eb34 release-0.7.49 -e4350efa7cf7a0e868c2236a1137de8a33bd8ec6 release-0.7.50 -f51f2bec766c8b6d7e1799d904f18f8ea631bd44 release-0.7.51 -18e39e566781c9c187e2eb62bebd9d669d68f08c release-0.7.52 -b073eaa1dcea296a3488b83d455fab6621a73932 release-0.7.53 -01c6fe6c2a55998434cd3b05dd10ca487ac3fb6c release-0.7.54 -3ed9377e686f2521e6ec15873084381033fb490d release-0.7.55 -a1e44954549c35023b409f728c678be8bf898148 release-0.7.56 -fbb1918a85e38a7becdb1a001dbaf5933f23a919 release-0.7.57 -87f4a49a9cc34a5b11c8784cc5ea89e97b4b2bd8 release-0.7.58 -0c22cb4862c8beb4ee1b9e4627125162a29a5304 release-0.7.59 -82d56c2425ef857cd430b8530a3f9e1127145a67 release-0.8.0 -f4acb784b53cd952559567971b97dde1e818a2b6 release-0.8.1 -b3503597c1a0f0f378afdc5e5e5b85e2c095a4be release-0.8.2 -c98da980514a02ba81c421b25bf91803ffffddf3 release-0.8.3 -db34ec0c53c4b9dec12ffdf70caf89a325ab9577 release-0.8.4 -0914802433b8678ba2cdf91280766f00f4b9b76e release-0.8.5 -ff52ee9e6422f3759f43a442b7ba615595b3a3d4 release-0.8.6 -7607237b4829fff1f60999f4663c50ed9d5182f7 release-0.8.7 -1cef1807bc12cb05ac52fb0e7a0f111d3760b569 release-0.8.8 -a40f8475511d74a468ade29c1505e8986600d7a3 release-0.8.9 -2d9faf2260df6c3e5d4aa1781493c31f27a557d0 release-0.8.10 -d0d61c32331a6505381b5218318f7b69db167ca8 release-0.8.11 -ca7a1c6c798a7eb5b294d4ac3179ec87ecf297d3 release-0.8.12 -81c8277cd8ed55febcb2dd9d9213076f6c0ccb09 release-0.8.13 -3089486a8dc5844b5b6e9f78d536b4b26f7ffa16 release-0.8.14 -d364c2c12dd9723a2dfac3f096f5e55d4cfe6838 release-0.8.15 -52163a1027c3efd6b4c461b60a2ca6266c23e193 release-0.8.16 -06564e9a2d9ec5852132c212e85eda0bf1300307 release-0.8.17 -7aaa959da85e09e29bcac3b1cadec35b0a25b64d release-0.8.18 -4bc73c644329a510da4e96b7241b80ead7772f83 release-0.8.19 -ea3d168fb99c32a5c3545717ecc61e85a375e5dd release-0.8.20 -27951ca037e63dae45ff5b6279124c224ae1255a release-0.8.21 -d56c8b5df517c2bf6e7bc2827b8bf3e08cda90e1 release-0.8.22 -3c6ac062b379b126212cbb27e98a3c8275ef381a release-0.8.23 -89b9173476de14688b1418fbf7df10f91d1719ef release-0.8.24 -aa550cb4159ae0d566006e091fb1c7a888771050 release-0.8.25 -06ce92293f6a65651b08c466f90f55bd69984b98 release-0.8.26 -ea50b0d79ef1d7d901cd0e4dcd7373447849d719 release-0.8.27 -e68b1c35cad86105ff1c5b240f53442f4c36356e release-0.8.28 -78d3582a30afe63fc0adb17c3ac8891a64e47146 release-0.8.29 -9852c5965a3292a1b6127dbb4da9fce4912d898a release-0.8.30 -4f84115914490e572bcbee5069157b7334df2744 release-0.8.31 -59dee6f7f3afeb1fad6ed5983756e48c81ad2a5c release-0.8.32 -a4456378d234c07038456cf32bfe3c651f1d5e82 release-0.8.33 -21cb50799a20575a42f9733342d37a426f79db4d release-0.8.34 -7cb3cb8d78ef7ae63561733ed91fd07933896bc8 release-0.8.35 -aed68639d4eb6afe944b7fb50499c16f7f3f503c release-0.8.36 -265b7fd2ae21c75bbffa5115b83a0123d6c4acb4 release-0.8.37 -fa5f1ca353c0c5aa5415f51d72fd7bbcc02d1ed7 release-0.8.38 -af10bf9d4c6532850aa1f70cdf7504bd109b284c release-0.8.39 -4846ec9f83cb5bc4c8519d5641b35fb9b190430c release-0.8.40 -718b4cb3faf7efe4e0648140f064bf7a92c3f7e8 release-0.8.41 -b5a3065749093282ddd19845e0b77ffc2e54333e release-0.8.42 -34df9fb22fed415cdad52def04095dc6d4b48222 release-0.8.43 -00ec8cd76fb89af27363b76c40d9f88bf4679c3b release-0.8.44 -e16dd52a0d226c23dcae9a11252564a04753bbed release-0.8.45 -f034d9173df0a433e0bbcf5974f12ea9eb9076c0 release-0.8.46 -4434dc967087315efcd0658206a67fe6c85528f3 release-0.8.47 -0b65c962e0cd6783a854877b52c903cb058eec8c release-0.8.48 -a2b7e94b9807e981866bf07e37b715847d1b7120 release-0.8.49 -e7bdb8edc1bab2bc352a9fb6ce765c46575c35bf release-0.8.50 -21dacebd12f65cb57ceb8d2688db5b07fad6e06d release-0.8.51 -67dd7533b99c8945b5b8b5b393504d4e003a1c50 release-0.8.52 -010468d890dbac33a4cae6dfb2017db70721b2fe release-0.8.53 -62b599022a2fa625b526c2ad1711dc6db7d66786 release-0.9.0 -71281dd73b17a0ead5535d531afaee098da723cb release-0.9.1 -16cff36b0e49fc9fdeee13b2e92690286bcc1b3d release-0.9.2 -b7b306325972661117694879d3e22faf4cf0df32 release-0.9.3 -fe671505a8ea86a76f0358b3ec4de84a9037ac2b release-0.9.4 -70542931bc5436d1bbd38f152245d93ac063968d release-0.9.5 -27e2f3b7a3db1819c5d0ba28327ceaba84a13c4e release-0.9.6 -657d05d63915ce2f6c4d763091059f5f85bb10e5 release-0.9.7 -e0fd9f36005923b8f98d1ba1ea583cb7625f318f release-1.0.0 -f8f89eb4e0c27e857ec517d893d4f9a454985084 release-1.0.1 -c50df367648e53d55e80b60a447c9c66caa0d326 release-1.0.2 -80d586db316512b5a9d39f00fe185f7f91523f52 release-1.0.3 -c9c2805ac9245cc48ce6efeba2b4a444f859d6aa release-1.0.4 -fa2c37b1122c2c983b6e91d1188e387d72dde4d6 release-1.0.5 -f31aea5b06654c9163be5acd6d9b7aaf0fdf6b33 release-1.1.0 -44bf95f670656fae01ccb266b3863843ea13d324 release-1.1.1 -da1289482a143dfa016769649bdff636c26f53c8 release-1.1.2 -bac8ba08a6570bac2ecd3bf2ad64b0ac3030c903 release-1.1.3 -911060bc8221d4113a693ae97952a1fa88663ca8 release-1.1.4 -e47531dfabbf8e5f8b8aff9ff353642ea4aa7abb release-1.1.5 -f9ddecfe331462f870a95e4c1c3ba1bb8f19f2d3 release-1.1.6 -378c297bb7459fb99aa9c77decac0d35391a3932 release-1.1.7 -71600ce67510af093d4bc0117a78b3b4678c6b3a release-1.1.8 -482d7d907f1ab92b78084d8b8631ed0eb7dd08f7 release-1.1.9 -c7e65deabf0db5109e8d8f6cf64cd3fb7633a3d1 release-1.1.10 -9590f0cf5aab8e6e0b0c8ae59c70187b2b97d886 release-1.1.11 -ade8fc136430cfc04a8d0885c757968b0987d56c release-1.1.12 -6a6836e65827fd3cb10a406e7bbbe36e0dad8736 release-1.1.13 -6845f4ac909233f5a08ed8a51de137713a888328 release-1.1.14 -2397e9c72f1bc5eac67006e12ad3e33e0ea9ba74 release-1.1.15 -7b7c49639a7bceecabf4963c60b26b65a77d6ce0 release-1.1.16 -f7e1113a9a1648cad122543e7080e895cf2d88f4 release-1.1.17 -2b22743c3079b41233ded0fc35af8aa89bcfab91 release-1.1.18 -0f0b425659e0b26f5bc8ea14a42dbf34de2eaba6 release-1.1.19 -f582d662cc408eb7a132c21f4b298b71d0701abb release-1.2.0 -9ee68d629722f583d43d92271f2eb84281afc630 release-1.3.0 -61b6a3438afef630774e568eefd89c53e3b93287 release-1.3.1 -7ccd50a0a455f2f2d3b241f376e1193ad956196d release-1.2.1 -0000000000000000000000000000000000000000 release-1.2.1 -50107e2d96bbfc2c59e46f889b1a5f68dd10cf19 release-1.3.2 -2c5e1e88c8cf710caf551c5c67eba00443601efe release-1.3.3 -a43447fb82aa03eabcd85352758ae14606a84d35 release-1.3.4 -90f3b4ea7992a7bf9385851a3e77173363091eea release-1.3.5 -3aeb14f88daeb973e4708310daa3dc68ac1200f7 release-1.3.6 -dafd375f1c882b15fa4a9b7aa7c801c55082395e release-1.3.7 -ab7ce0eb4cf78a656750ab1d8e55ef61f7e535ec release-1.3.8 -1b1a9337a7399ad3cdc5e3a2f9fbaaec990271d5 release-1.3.9 -2c053b2572694eb9cd4aed26a498b6cb1f51bbcc release-1.3.10 -36409ac209872ce53019f084e4e07467c5d9d25e release-1.3.11 -560dc55e90c13860a79d8f3e0d67a81c7b0257bb release-1.3.12 -dc195ffe0965b2b9072f8e213fe74ecce38f6773 release-1.3.13 -e04428778567dd4de329bbbe97ad653e22801612 release-1.3.14 -cd84e467c72967b9f5fb4d96bfc708c93edeb634 release-1.3.15 -23159600bdea695db8f9d2890aaf73424303e49c release-1.3.16 -7809529022b83157067e7d1e2fb65d57db5f4d99 release-1.4.0 -48a84bc3ff074a65a63e353b9796ff2b14239699 release-1.5.0 -99eed1a88fc33f32d66e2ec913874dfef3e12fcc release-1.5.1 -5bdca4812974011731e5719a6c398b54f14a6d61 release-1.5.2 -644a079526295aca11c52c46cb81e3754e6ad4ad release-1.5.3 -376a5e7694004048a9d073e4feb81bb54ee3ba91 release-1.5.4 -60e0409b9ec7ee194c6d8102f0656598cc4a6cfe release-1.5.5 -70c5cd3a61cb476c2afb3a61826e59c7cda0b7a7 release-1.5.6 -9ba2542d75bf62a3972278c63561fc2ef5ec573a release-1.5.7 -eaa76f24975948b0ce8be01838d949122d44ed67 release-1.5.8 -5a1759f33b7fa6270e1617c08d7e655b7b127f26 release-1.5.9 -b798fc020e3a84ef68e6c9f47865a319c826d33c release-1.5.10 -f995a10d4c7e9a817157a6ce7b753297ad32897e release-1.5.11 -97b47d95e4449cbde976657cf8cbbc118351ffe0 release-1.5.12 -fd722b890eabc600394349730a093f50dac31639 release-1.5.13 -d161d68df8be32e5cbf72b07db1a707714827803 release-1.7.0 -0351a6d89c3dbcc7a76295024ba6b70e27b9a497 release-1.7.1 -0bd223a546192fdf2e862f33938f4ec2a3b5b283 release-1.7.2 -fe7cd01828d5ca7491059f0690bb4453645eb28b release-1.7.3 -cbb146b120296852e781079d5138b04495bab6df release-1.7.4 -fe129aa02db9001d220f1db7c3c056f79482c111 release-1.7.5 -a8d111bb68847f61d682a3c8792fecb2e52efa2c release-1.7.6 -6d2fbc30f8a7f70136cf08f32d5ff3179d524873 release-1.7.7 -d5ea659b8bab2d6402a2266efa691f705e84001e release-1.7.8 -34b201c1abd1e2d4faeae4650a21574771a03c0e release-1.7.9 -860cfbcc4606ee36d898a9cd0c5ae8858db984d6 release-1.7.10 -2b3b737b5456c05cd63d3d834f4fb4d3776953d0 release-1.7.11 -3ef00a71f56420a9c3e9cec311c9a2109a015d67 release-1.7.12 -53d850fe292f157d2fb999c52788ec1dc53c91ed release-1.9.0 -884a967c369f73ab16ea859670d690fb094d3850 release-1.9.1 -3a32d6e7404a79a0973bcd8d0b83181c5bf66074 release-1.9.2 -e27a215601292872f545a733859e06d01af1017d release-1.9.3 -5cb7e2eed2031e32d2e5422caf9402758c38a6ad release-1.9.4 -942475e10cb47654205ede7ccbe7d568698e665b release-1.9.5 -b78018cfaa2f0ec20494fccb16252daa87c48a31 release-1.9.6 -54117529e40b988590ea2d38aae909b0b191663f release-1.9.7 -1bdc497c81607d854e3edf8b9a3be324c3d136b6 release-1.9.8 -ef107f3ddc237a3007e2769ec04adde0dcf627fa release-1.9.9 -be00ca08e41a69e585b6aff70a725ed6c9e1a876 release-1.9.10 -fe66cff450a95beed36a2515210eb2d7ef62c9d3 release-1.9.11 -ead3907d74f90a14d1646f1b2b56ba01d3d11702 release-1.9.12 -5936b7ed929237f1a73b467f662611cdc0309e51 release-1.9.13 -4106db71cbcb9c8274700199ac17e520902c6c0f release-1.9.14 -13070ecfda67397985f0e986eb9c42ecb46d05b5 release-1.9.15 -271ee30c6791847980cd139d31807541f5e569bf release-1.11.0 -cb783d9cc19761e14e1285d91c38f4b84d0b8756 release-1.11.1 -4d3b3a13a8cf5fc3351a7f167d1c13325e00f21c release-1.11.2 -b83a067949a3384a49fd3d943eb8d0997b31f87b release-1.11.3 -953512ca02c6f63b4fcbbc3e10d0d9835896bf99 release-1.11.4 -5253015a339aaca0a3111473d3e931b6d4752393 release-1.11.5 -5e371426b3bcba4312ce08606194b89b758927d1 release-1.11.6 -5c8f60faf33ca8926473d2da27b4c3c417bd4630 release-1.11.7 -4591da489a30f790def29bc5987f43409b503cae release-1.11.8 -20a45c768e5ed26b740679d0e22045c98727c3cc release-1.11.9 -1ad0999a7ded3d4fb01c7acf8ff57c80b643da7e release-1.11.10 -d8b321a876d6254e9e98795e3b194ef053290354 release-1.11.11 -7f394e433f0003222aa6531931ecc0b24740d5e4 release-1.11.12 -3d0e8655f897959e48cc74e87670bb5492a58871 release-1.11.13 -3671096a45bce570a2afa20b9faf42c7fb0f7e66 release-1.13.0 -539f7893ecb96bee60965528c8958d7eb2f1ce6b release-1.13.1 -5be2b25bdc65775a85f18f68a4be4f58c7384415 release-1.13.2 -8457ce87640f9bfe6221c4ac4466ced20e03bebe release-1.13.3 -bbc642c813c829963ce8197c0ca237ab7601f3d4 release-1.13.4 -0d45b4cf7c2e4e626a5a16e1fe604402ace1cea5 release-1.13.5 -f87da7d9ca02b8ced4caa6c5eb9013ccd47b0117 release-1.13.6 -47cca243d0ed39bf5dcb9859184affc958b79b6f release-1.13.7 -20ca4bcff108d3e66977f4d97508637093492287 release-1.13.8 -fb1212c7eca4c5328fe17d6cd95b010c67336aac release-1.13.9 -31c929e16910c38492581ef474e72fa67c28f124 release-1.13.10 -64179f242cb55fc206bca59de9bfdc4cf5ebcec7 release-1.13.11 -051e5fa03b92b8a564f6b12debd483d267391e82 release-1.13.12 -990b3e885636d763b97ed02d0d2cfc161a4e0c09 release-1.15.0 -4189160cb946bb38d0bc0a452b5eb4cdd8979fb5 release-1.15.1 -b234199c7ed8a156a6bb98f7ff58302c857c954f release-1.15.2 -28b3e17ca7eba1e6a0891afde0e4bc5bcc99c861 release-1.15.3 -49d49835653857daa418e68d6cbfed4958c78fca release-1.15.4 -f062e43d74fc2578bb100a9e82a953efa1eb9e4e release-1.15.5 -2351853ce6867b6166823bdf94333c0a76633c0a release-1.15.6 -051a039ce1c7e09144de4a4846669ec7116cecea release-1.15.7 -ee551e3f6dba336c0d875e266d7d55385f379b42 release-1.15.8 -d2fd76709909767fc727a5b4affcf1dc9ca488a7 release-1.15.9 -75f5c7f628411c79c7044102049f7ab4f7a246e7 release-1.15.10 -5155d0296a5ef9841f035920527ffdb771076b44 release-1.15.11 -0130ca3d58437b3c7c707cdddd813d530c68da9a release-1.15.12 -054c1c46395caff79bb4caf16f40b331f71bb6dd release-1.17.0 -7816bd7dabf6ee86c53c073b90a7143161546e06 release-1.17.1 -2fc9f853a6b7cd29dc84e0af2ed3cf78e0da6ca8 release-1.17.2 -ed4303aa1b31a9aad5440640c0840d9d0af45fed release-1.17.3 -ce2ced3856909f36f8130c99eaa4dbdbae636ddc release-1.17.4 -9af0dddbddb2c368bfedd2801bc100ffad01e19b release-1.17.5 -de68d0d94320cbf033599c6f3ca37e5335c67fd7 release-1.17.6 -e56295fe0ea76bf53b06bffa77a2d3a9a335cb8c release-1.17.7 -fdacd273711ddf20f778c1fb91529ab53979a454 release-1.17.8 -5e8d52bca714d4b85284ddb649d1ba4a3ca978a8 release-1.17.9 -c44970de01474f6f3e01b0adea85ec1d03e3a5f2 release-1.17.10 -cbe6ba650211541310618849168631ce0b788f35 release-1.19.0 -062920e2f3bf871ef7a3d8496edec1b3065faf80 release-1.19.1 -a7b46539f507e6c64efa0efda69ad60b6f4ffbce release-1.19.2 -3cbc2602325f0ac08917a4397d76f5155c34b7b1 release-1.19.3 -dc0cc425fa63a80315f6efb68697cadb6626cdf2 release-1.19.4 -8e5b068f761cd512d10c9671fbde0b568c1fd08b release-1.19.5 -f618488eb769e0ed74ef0d93cd118d2ad79ef94d release-1.19.6 -3fa6e2095a7a51acc630517e1c27a7b7ac41f7b3 release-1.19.7 -8c65d21464aaa5923775f80c32474adc7a320068 release-1.19.8 -da571b8eaf8f30f36c43b3c9b25e01e31f47149c release-1.19.9 -ffcbb9980ee2bad27b4d7b1cd680b14ff47b29aa release-1.19.10 -df34dcc9ac072ffd0945e5a1f3eb7987e8275375 release-1.21.0 -a68ac0677f8553b1f84d357bc9da114731ab5f47 release-1.21.1 -bfbc52374adcbf2f9060afd62de940f6fab3bba5 release-1.21.2 -2217a9c1d0b86026f22700b3c089545db1964f55 release-1.21.3 -39be8a682c58308d9399cddd57e37f9fdb7bdf3e release-1.21.4 -d986378168fd4d70e0121cabac274c560cca9bdf release-1.21.5 -714eb4b2c09e712fb2572a2164ce2bf67638ccac release-1.21.6 -5da2c0902e8e2aa4534008a582a60c61c135960e release-1.23.0 -a63d0a70afea96813ba6667997bc7d68b5863f0d release-1.23.1 -aa901551a7ebad1e8b0f8c11cb44e3424ba29707 release-1.23.2 -ff3afd1ce6a6b65057741df442adfaa71a0e2588 release-1.23.3 -ac779115ed6ee4f3039e9aea414a54e560450ee2 release-1.23.4 -12dcf92b0c2c68552398f19644ce3104459807d7 release-1.25.0 -f8134640e8615448205785cf00b0bc810489b495 release-1.25.1 -1d839f05409d1a50d0f15a2bf36547001f99ae40 release-1.25.2 -294a3d07234f8f65d7b0e0b0e2c5b05c12c5da0a release-1.25.3 -173a0a7dbce569adbb70257c6ec4f0f6bc585009 release-1.25.4 -8618e4d900cc71082fbe7dc72af087937d64faf5 release-1.25.5 -a58202a8c41bf0bd97eef1b946e13105a105520d release-1.26.0 -a63c124e34bcf2d1d1feb8d40ff075103b967c4c release-1.26.1 -e4c5da06073ca24e2ffc5c8f8b8d7833a926356f release-1.26.2 diff --git a/CHANGES b/CHANGES deleted file mode 100644 index 9c2fb00..0000000 --- a/CHANGES +++ /dev/null @@ -1,9198 +0,0 @@ - -Changes with nginx 1.26.3 05 Feb 2025 - - *) Security: insufficient check in virtual servers handling with TLSv1.3 - SNI allowed to reuse SSL sessions in a different virtual server, to - bypass client SSL certificates verification (CVE-2025-23419). - - *) Bugfix: in the ngx_http_mp4_module. - Thanks to Nils Bars. - - *) Workaround: "gzip filter failed to use preallocated memory" alerts - appeared in logs when using zlib-ng. - - *) Bugfix: nginx could not build libatomic library using the library - sources if the --with-libatomic=DIR option was used. - - *) Bugfix: nginx now ignores QUIC version negotiation packets from - clients. - - *) Bugfix: nginx could not be built on Solaris 10 and earlier with the - ngx_http_v3_module. - - *) Bugfixes in HTTP/3. - - -Changes with nginx 1.26.2 14 Aug 2024 - - *) Security: processing of a specially crafted mp4 file by the - ngx_http_mp4_module might cause a worker process crash - (CVE-2024-7347). - Thanks to Nils Bars. - - -Changes with nginx 1.26.1 29 May 2024 - - *) Security: when using HTTP/3, processing of a specially crafted QUIC - session might cause a worker process crash, worker process memory - disclosure on systems with MTU larger than 4096 bytes, or might have - potential other impact (CVE-2024-32760, CVE-2024-31079, - CVE-2024-35200, CVE-2024-34161). - Thanks to Nils Bars of CISPA. - - *) Bugfix: reduced memory consumption for long-lived requests if "gzip", - "gunzip", "ssi", "sub_filter", or "grpc_pass" directives are used. - - *) Bugfix: nginx could not be built by gcc 14 if the --with-libatomic - option was used. - Thanks to Edgar Bonet. - - *) Bugfix: in HTTP/3. - - -Changes with nginx 1.26.0 23 Apr 2024 - - *) 1.26.x stable branch. - - -Changes with nginx 1.25.5 16 Apr 2024 - - *) Feature: virtual servers in the stream module. - - *) Feature: the ngx_stream_pass_module. - - *) Feature: the "deferred", "accept_filter", and "setfib" parameters of - the "listen" directive in the stream module. - - *) Feature: cache line size detection for some architectures. - Thanks to Piotr Sikora. - - *) Feature: support for Homebrew on Apple Silicon. - Thanks to Piotr Sikora. - - *) Bugfix: Windows cross-compilation bugfixes and improvements. - Thanks to Piotr Sikora. - - *) Bugfix: unexpected connection closure while using 0-RTT in QUIC. - Thanks to Vladimir Khomutov. - - -Changes with nginx 1.25.4 14 Feb 2024 - - *) Security: when using HTTP/3 a segmentation fault might occur in a - worker process while processing a specially crafted QUIC session - (CVE-2024-24989, CVE-2024-24990). - - *) Bugfix: connections with pending AIO operations might be closed - prematurely during graceful shutdown of old worker processes. - - *) Bugfix: socket leak alerts no longer logged when fast shutdown was - requested after graceful shutdown of old worker processes. - - *) Bugfix: a socket descriptor error, a socket leak, or a segmentation - fault in a worker process (for SSL proxying) might occur if AIO was - used in a subrequest. - - *) Bugfix: a segmentation fault might occur in a worker process if SSL - proxying was used along with the "image_filter" directive and errors - with code 415 were redirected with the "error_page" directive. - - *) Bugfixes and improvements in HTTP/3. - - -Changes with nginx 1.25.3 24 Oct 2023 - - *) Change: improved detection of misbehaving clients when using HTTP/2. - - *) Feature: startup speedup when using a large number of locations. - Thanks to Yusuke Nojima. - - *) Bugfix: a segmentation fault might occur in a worker process when - using HTTP/2 without SSL; the bug had appeared in 1.25.1. - - *) Bugfix: the "Status" backend response header line with an empty - reason phrase was handled incorrectly. - - *) Bugfix: memory leak during reconfiguration when using the PCRE2 - library. - Thanks to ZhenZhong Wu. - - *) Bugfixes and improvements in HTTP/3. - - -Changes with nginx 1.25.2 15 Aug 2023 - - *) Feature: path MTU discovery when using HTTP/3. - - *) Feature: TLS_AES_128_CCM_SHA256 cipher suite support when using - HTTP/3. - - *) Change: now nginx uses appname "nginx" when loading OpenSSL - configuration. - - *) Change: now nginx does not try to load OpenSSL configuration if the - --with-openssl option was used to built OpenSSL and the OPENSSL_CONF - environment variable is not set. - - *) Bugfix: in the $body_bytes_sent variable when using HTTP/3. - - *) Bugfix: in HTTP/3. - - -Changes with nginx 1.25.1 13 Jun 2023 - - *) Feature: the "http2" directive, which enables HTTP/2 on a per-server - basis; the "http2" parameter of the "listen" directive is now - deprecated. - - *) Change: HTTP/2 server push support has been removed. - - *) Change: the deprecated "ssl" directive is not supported anymore. - - *) Bugfix: in HTTP/3 when using OpenSSL. - - -Changes with nginx 1.25.0 23 May 2023 - - *) Feature: experimental HTTP/3 support. - - -Changes with nginx 1.23.4 28 Mar 2023 - - *) Change: now TLSv1.3 protocol is enabled by default. - - *) Change: now nginx issues a warning if protocol parameters of a - listening socket are redefined. - - *) Change: now nginx closes connections with lingering if pipelining was - used by the client. - - *) Feature: byte ranges support in the ngx_http_gzip_static_module. - - *) Bugfix: port ranges in the "listen" directive did not work; the bug - had appeared in 1.23.3. - Thanks to Valentin Bartenev. - - *) Bugfix: incorrect location might be chosen to process a request if a - prefix location longer than 255 characters was used in the - configuration. - - *) Bugfix: non-ASCII characters in file names on Windows were not - supported by the ngx_http_autoindex_module, the ngx_http_dav_module, - and the "include" directive. - - *) Change: the logging level of the "data length too long", "length too - short", "bad legacy version", "no shared signature algorithms", "bad - digest length", "missing sigalgs extension", "encrypted length too - long", "bad length", "bad key update", "mixed handshake and non - handshake data", "ccs received early", "data between ccs and - finished", "packet length too long", "too many warn alerts", "record - too small", and "got a fin before a ccs" SSL errors has been lowered - from "crit" to "info". - - *) Bugfix: a socket leak might occur when using HTTP/2 and the - "error_page" directive to redirect errors with code 400. - - *) Bugfix: messages about logging to syslog errors did not contain - information that the errors happened while logging to syslog. - Thanks to Safar Safarly. - - *) Workaround: "gzip filter failed to use preallocated memory" alerts - appeared in logs when using zlib-ng. - - *) Bugfix: in the mail proxy server. - - -Changes with nginx 1.23.3 13 Dec 2022 - - *) Bugfix: an error might occur when reading PROXY protocol version 2 - header with large number of TLVs. - - *) Bugfix: a segmentation fault might occur in a worker process if SSI - was used to process subrequests created by other modules. - Thanks to Ciel Zhao. - - *) Workaround: when a hostname used in the "listen" directive resolves - to multiple addresses, nginx now ignores duplicates within these - addresses. - - *) Bugfix: nginx might hog CPU during unbuffered proxying if SSL - connections to backends were used. - - -Changes with nginx 1.23.2 19 Oct 2022 - - *) Security: processing of a specially crafted mp4 file by the - ngx_http_mp4_module might cause a worker process crash, worker - process memory disclosure, or might have potential other impact - (CVE-2022-41741, CVE-2022-41742). - - *) Feature: the "$proxy_protocol_tlv_..." variables. - - *) Feature: TLS session tickets encryption keys are now automatically - rotated when using shared memory in the "ssl_session_cache" - directive. - - *) Change: the logging level of the "bad record type" SSL errors has - been lowered from "crit" to "info". - Thanks to Murilo Andrade. - - *) Change: now when using shared memory in the "ssl_session_cache" - directive the "could not allocate new session" errors are logged at - the "warn" level instead of "alert" and not more often than once per - second. - - *) Bugfix: nginx/Windows could not be built with OpenSSL 3.0.x. - - *) Bugfix: in logging of the PROXY protocol errors. - Thanks to Sergey Brester. - - *) Workaround: shared memory from the "ssl_session_cache" directive was - spent on sessions using TLS session tickets when using TLSv1.3 with - OpenSSL. - - *) Workaround: timeout specified with the "ssl_session_timeout" - directive did not work when using TLSv1.3 with OpenSSL or BoringSSL. - - -Changes with nginx 1.23.1 19 Jul 2022 - - *) Feature: memory usage optimization in configurations with SSL - proxying. - - *) Feature: looking up of IPv4 addresses while resolving now can be - disabled with the "ipv4=off" parameter of the "resolver" directive. - - *) Change: the logging level of the "bad key share", "bad extension", - "bad cipher", and "bad ecpoint" SSL errors has been lowered from - "crit" to "info". - - *) Bugfix: while returning byte ranges nginx did not remove the - "Content-Range" header line if it was present in the original backend - response. - - *) Bugfix: a proxied response might be truncated during reconfiguration - on Linux; the bug had appeared in 1.17.5. - - -Changes with nginx 1.23.0 21 Jun 2022 - - *) Change in internal API: now header lines are represented as linked - lists. - - *) Change: now nginx combines arbitrary header lines with identical - names when sending to FastCGI, SCGI, and uwsgi backends, in the - $r->header_in() method of the ngx_http_perl_module, and during lookup - of the "$http_...", "$sent_http_...", "$sent_trailer_...", - "$upstream_http_...", and "$upstream_trailer_..." variables. - - *) Bugfix: if there were multiple "Vary" header lines in the backend - response, nginx only used the last of them when caching. - - *) Bugfix: if there were multiple "WWW-Authenticate" header lines in the - backend response and errors with code 401 were intercepted or the - "auth_request" directive was used, nginx only sent the first of the - header lines to the client. - - *) Change: the logging level of the "application data after close - notify" SSL errors has been lowered from "crit" to "info". - - *) Bugfix: connections might hang if nginx was built on Linux 2.6.17 or - newer, but was used on systems without EPOLLRDHUP support, notably - with epoll emulation layers; the bug had appeared in 1.17.5. - Thanks to Marcus Ball. - - *) Bugfix: nginx did not cache the response if the "Expires" response - header line disabled caching, but following "Cache-Control" header - line enabled caching. - - -Changes with nginx 1.21.6 25 Jan 2022 - - *) Bugfix: when using EPOLLEXCLUSIVE on Linux client connections were - unevenly distributed among worker processes. - - *) Bugfix: nginx returned the "Connection: keep-alive" header line in - responses during graceful shutdown of old worker processes. - - *) Bugfix: in the "ssl_session_ticket_key" when using TLSv1.3. - - -Changes with nginx 1.21.5 28 Dec 2021 - - *) Change: now nginx is built with the PCRE2 library by default. - - *) Change: now nginx always uses sendfile(SF_NODISKIO) on FreeBSD. - - *) Feature: support for sendfile(SF_NOCACHE) on FreeBSD. - - *) Feature: the $ssl_curve variable. - - *) Bugfix: connections might hang when using HTTP/2 without SSL with the - "sendfile" and "aio" directives. - - -Changes with nginx 1.21.4 02 Nov 2021 - - *) Change: support for NPN instead of ALPN to establish HTTP/2 - connections has been removed. - - *) Change: now nginx rejects SSL connections if ALPN is used by the - client, but no supported protocols can be negotiated. - - *) Change: the default value of the "sendfile_max_chunk" directive was - changed to 2 megabytes. - - *) Feature: the "proxy_half_close" directive in the stream module. - - *) Feature: the "ssl_alpn" directive in the stream module. - - *) Feature: the $ssl_alpn_protocol variable. - - *) Feature: support for SSL_sendfile() when using OpenSSL 3.0. - - *) Feature: the "mp4_start_key_frame" directive in the - ngx_http_mp4_module. - Thanks to Tracey Jaquith. - - *) Bugfix: in the $content_length variable when using chunked transfer - encoding. - - *) Bugfix: after receiving a response with incorrect length from a - proxied backend nginx might nevertheless cache the connection. - Thanks to Awdhesh Mathpal. - - *) Bugfix: invalid headers from backends were logged at the "info" level - instead of "error"; the bug had appeared in 1.21.1. - - *) Bugfix: requests might hang when using HTTP/2 and the "aio_write" - directive. - - -Changes with nginx 1.21.3 07 Sep 2021 - - *) Change: optimization of client request body reading when using - HTTP/2. - - *) Bugfix: in request body filters internal API when using HTTP/2 and - buffering of the data being processed. - - -Changes with nginx 1.21.2 31 Aug 2021 - - *) Change: now nginx rejects HTTP/1.0 requests with the - "Transfer-Encoding" header line. - - *) Change: export ciphers are no longer supported. - - *) Feature: OpenSSL 3.0 compatibility. - - *) Feature: the "Auth-SSL-Protocol" and "Auth-SSL-Cipher" header lines - are now passed to the mail proxy authentication server. - Thanks to Rob Mueller. - - *) Feature: request body filters API now permits buffering of the data - being processed. - - *) Bugfix: backend SSL connections in the stream module might hang after - an SSL handshake. - - *) Bugfix: the security level, which is available in OpenSSL 1.1.0 or - newer, did not affect loading of the server certificates when set - with "@SECLEVEL=N" in the "ssl_ciphers" directive. - - *) Bugfix: SSL connections with gRPC backends might hang if select, - poll, or /dev/poll methods were used. - - *) Bugfix: when using HTTP/2 client request body was always written to - disk if the "Content-Length" header line was not present in the - request. - - -Changes with nginx 1.21.1 06 Jul 2021 - - *) Change: now nginx always returns an error for the CONNECT method. - - *) Change: now nginx always returns an error if both "Content-Length" - and "Transfer-Encoding" header lines are present in the request. - - *) Change: now nginx always returns an error if spaces or control - characters are used in the request line. - - *) Change: now nginx always returns an error if spaces or control - characters are used in a header name. - - *) Change: now nginx always returns an error if spaces or control - characters are used in the "Host" request header line. - - *) Change: optimization of configuration testing when using many - listening sockets. - - *) Bugfix: nginx did not escape """, "<", ">", "\", "^", "`", "{", "|", - and "}" characters when proxying with changed URI. - - *) Bugfix: SSL variables might be empty when used in logs; the bug had - appeared in 1.19.5. - - *) Bugfix: keepalive connections with gRPC backends might not be closed - after receiving a GOAWAY frame. - - *) Bugfix: reduced memory consumption for long-lived requests when - proxying with more than 64 buffers. - - -Changes with nginx 1.21.0 25 May 2021 - - *) Security: 1-byte memory overwrite might occur during DNS server - response processing if the "resolver" directive was used, allowing an - attacker who is able to forge UDP packets from the DNS server to - cause worker process crash or, potentially, arbitrary code execution - (CVE-2021-23017). - - *) Feature: variables support in the "proxy_ssl_certificate", - "proxy_ssl_certificate_key" "grpc_ssl_certificate", - "grpc_ssl_certificate_key", "uwsgi_ssl_certificate", and - "uwsgi_ssl_certificate_key" directives. - - *) Feature: the "max_errors" directive in the mail proxy module. - - *) Feature: the mail proxy module supports POP3 and IMAP pipelining. - - *) Feature: the "fastopen" parameter of the "listen" directive in the - stream module. - Thanks to Anbang Wen. - - *) Bugfix: special characters were not escaped during automatic redirect - with appended trailing slash. - - *) Bugfix: connections with clients in the mail proxy module might be - closed unexpectedly when using SMTP pipelining. - - -Changes with nginx 1.19.10 13 Apr 2021 - - *) Change: the default value of the "keepalive_requests" directive was - changed to 1000. - - *) Feature: the "keepalive_time" directive. - - *) Feature: the $connection_time variable. - - *) Workaround: "gzip filter failed to use preallocated memory" alerts - appeared in logs when using zlib-ng. - - -Changes with nginx 1.19.9 30 Mar 2021 - - *) Bugfix: nginx could not be built with the mail proxy module, but - without the ngx_mail_ssl_module; the bug had appeared in 1.19.8. - - *) Bugfix: "upstream sent response body larger than indicated content - length" errors might occur when working with gRPC backends; the bug - had appeared in 1.19.1. - - *) Bugfix: nginx might not close a connection till keepalive timeout - expiration if the connection was closed by the client while - discarding the request body. - - *) Bugfix: nginx might not detect that a connection was already closed - by the client when waiting for auth_delay or limit_req delay, or when - working with backends. - - *) Bugfix: in the eventport method. - - -Changes with nginx 1.19.8 09 Mar 2021 - - *) Feature: flags in the "proxy_cookie_flags" directive can now contain - variables. - - *) Feature: the "proxy_protocol" parameter of the "listen" directive, - the "proxy_protocol" and "set_real_ip_from" directives in mail proxy. - - *) Bugfix: HTTP/2 connections were immediately closed when using - "keepalive_timeout 0"; the bug had appeared in 1.19.7. - - *) Bugfix: some errors were logged as unknown if nginx was built with - glibc 2.32. - - *) Bugfix: in the eventport method. - - -Changes with nginx 1.19.7 16 Feb 2021 - - *) Change: connections handling in HTTP/2 has been changed to better - match HTTP/1.x; the "http2_recv_timeout", "http2_idle_timeout", and - "http2_max_requests" directives have been removed, the - "keepalive_timeout" and "keepalive_requests" directives should be - used instead. - - *) Change: the "http2_max_field_size" and "http2_max_header_size" - directives have been removed, the "large_client_header_buffers" - directive should be used instead. - - *) Feature: now, if free worker connections are exhausted, nginx starts - closing not only keepalive connections, but also connections in - lingering close. - - *) Bugfix: "zero size buf in output" alerts might appear in logs if an - upstream server returned an incorrect response during unbuffered - proxying; the bug had appeared in 1.19.1. - - *) Bugfix: HEAD requests were handled incorrectly if the "return" - directive was used with the "image_filter" or "xslt_stylesheet" - directives. - - *) Bugfix: in the "add_trailer" directive. - - -Changes with nginx 1.19.6 15 Dec 2020 - - *) Bugfix: "no live upstreams" errors if a "server" inside "upstream" - block was marked as "down". - - *) Bugfix: a segmentation fault might occur in a worker process if HTTPS - was used; the bug had appeared in 1.19.5. - - *) Bugfix: nginx returned the 400 response on requests like - "GET http://example.com?args HTTP/1.0". - - *) Bugfix: in the ngx_http_flv_module and ngx_http_mp4_module. - Thanks to Chris Newton. - - -Changes with nginx 1.19.5 24 Nov 2020 - - *) Feature: the -e switch. - - *) Feature: the same source files can now be specified in different - modules while building addon modules. - - *) Bugfix: SSL shutdown did not work when lingering close was used. - - *) Bugfix: "upstream sent frame for closed stream" errors might occur - when working with gRPC backends. - - *) Bugfix: in request body filters internal API. - - -Changes with nginx 1.19.4 27 Oct 2020 - - *) Feature: the "ssl_conf_command", "proxy_ssl_conf_command", - "grpc_ssl_conf_command", and "uwsgi_ssl_conf_command" directives. - - *) Feature: the "ssl_reject_handshake" directive. - - *) Feature: the "proxy_smtp_auth" directive in mail proxy. - - -Changes with nginx 1.19.3 29 Sep 2020 - - *) Feature: the ngx_stream_set_module. - - *) Feature: the "proxy_cookie_flags" directive. - - *) Feature: the "userid_flags" directive. - - *) Bugfix: the "stale-if-error" cache control extension was erroneously - applied if backend returned a response with status code 500, 502, - 503, 504, 403, 404, or 429. - - *) Bugfix: "[crit] cache file ... has too long header" messages might - appear in logs if caching was used and the backend returned responses - with the "Vary" header line. - - *) Workaround: "[crit] SSL_write() failed" messages might appear in logs - when using OpenSSL 1.1.1. - - *) Bugfix: "SSL_shutdown() failed (SSL: ... bad write retry)" messages - might appear in logs; the bug had appeared in 1.19.2. - - *) Bugfix: a segmentation fault might occur in a worker process when - using HTTP/2 if errors with code 400 were redirected to a proxied - location using the "error_page" directive. - - *) Bugfix: socket leak when using HTTP/2 and subrequests in the njs - module. - - -Changes with nginx 1.19.2 11 Aug 2020 - - *) Change: now nginx starts closing keepalive connections before all - free worker connections are exhausted, and logs a warning about this - to the error log. - - *) Change: optimization of client request body reading when using - chunked transfer encoding. - - *) Bugfix: memory leak if the "ssl_ocsp" directive was used. - - *) Bugfix: "zero size buf in output" alerts might appear in logs if a - FastCGI server returned an incorrect response; the bug had appeared - in 1.19.1. - - *) Bugfix: a segmentation fault might occur in a worker process if - different large_client_header_buffers sizes were used in different - virtual servers. - - *) Bugfix: SSL shutdown might not work. - - *) Bugfix: "SSL_shutdown() failed (SSL: ... bad write retry)" messages - might appear in logs. - - *) Bugfix: in the ngx_http_slice_module. - - *) Bugfix: in the ngx_http_xslt_filter_module. - - -Changes with nginx 1.19.1 07 Jul 2020 - - *) Change: the "lingering_close", "lingering_time", and - "lingering_timeout" directives now work when using HTTP/2. - - *) Change: now extra data sent by a backend are always discarded. - - *) Change: now after receiving a too short response from a FastCGI - server nginx tries to send the available part of the response to the - client, and then closes the client connection. - - *) Change: now after receiving a response with incorrect length from a - gRPC backend nginx stops response processing with an error. - - *) Feature: the "min_free" parameter of the "proxy_cache_path", - "fastcgi_cache_path", "scgi_cache_path", and "uwsgi_cache_path" - directives. - Thanks to Adam Bambuch. - - *) Bugfix: nginx did not delete unix domain listen sockets during - graceful shutdown on the SIGQUIT signal. - - *) Bugfix: zero length UDP datagrams were not proxied. - - *) Bugfix: proxying to uwsgi backends using SSL might not work. - Thanks to Guanzhong Chen. - - *) Bugfix: in error handling when using the "ssl_ocsp" directive. - - *) Bugfix: on XFS and NFS file systems disk cache size might be - calculated incorrectly. - - *) Bugfix: "negative size buf in writer" alerts might appear in logs if - a memcached server returned a malformed response. - - -Changes with nginx 1.19.0 26 May 2020 - - *) Feature: client certificate validation with OCSP. - - *) Bugfix: "upstream sent frame for closed stream" errors might occur - when working with gRPC backends. - - *) Bugfix: OCSP stapling might not work if the "resolver" directive was - not specified. - - *) Bugfix: connections with incorrect HTTP/2 preface were not logged. - - -Changes with nginx 1.17.10 14 Apr 2020 - - *) Feature: the "auth_delay" directive. - - -Changes with nginx 1.17.9 03 Mar 2020 - - *) Change: now nginx does not allow several "Host" request header lines. - - *) Bugfix: nginx ignored additional "Transfer-Encoding" request header - lines. - - *) Bugfix: socket leak when using HTTP/2. - - *) Bugfix: a segmentation fault might occur in a worker process if OCSP - stapling was used. - - *) Bugfix: in the ngx_http_mp4_module. - - *) Bugfix: nginx used status code 494 instead of 400 if errors with code - 494 were redirected with the "error_page" directive. - - *) Bugfix: socket leak when using subrequests in the njs module and the - "aio" directive. - - -Changes with nginx 1.17.8 21 Jan 2020 - - *) Feature: variables support in the "grpc_pass" directive. - - *) Bugfix: a timeout might occur while handling pipelined requests in an - SSL connection; the bug had appeared in 1.17.5. - - *) Bugfix: in the "debug_points" directive when using HTTP/2. - Thanks to Daniil Bondarev. - - -Changes with nginx 1.17.7 24 Dec 2019 - - *) Bugfix: a segmentation fault might occur on start or during - reconfiguration if the "rewrite" directive with an empty replacement - string was used in the configuration. - - *) Bugfix: a segmentation fault might occur in a worker process if the - "break" directive was used with the "alias" directive or with the - "proxy_pass" directive with a URI. - - *) Bugfix: the "Location" response header line might contain garbage if - the request URI was rewritten to the one containing a null character. - - *) Bugfix: requests with bodies were handled incorrectly when returning - redirections with the "error_page" directive; the bug had appeared in - 0.7.12. - - *) Bugfix: socket leak when using HTTP/2. - - *) Bugfix: a timeout might occur while handling pipelined requests in an - SSL connection; the bug had appeared in 1.17.5. - - *) Bugfix: in the ngx_http_dav_module. - - -Changes with nginx 1.17.6 19 Nov 2019 - - *) Feature: the $proxy_protocol_server_addr and - $proxy_protocol_server_port variables. - - *) Feature: the "limit_conn_dry_run" directive. - - *) Feature: the $limit_req_status and $limit_conn_status variables. - - -Changes with nginx 1.17.5 22 Oct 2019 - - *) Feature: now nginx uses ioctl(FIONREAD), if available, to avoid - reading from a fast connection for a long time. - - *) Bugfix: incomplete escaped characters at the end of the request URI - were ignored. - - *) Bugfix: "/." and "/.." at the end of the request URI were not - normalized. - - *) Bugfix: in the "merge_slashes" directive. - - *) Bugfix: in the "ignore_invalid_headers" directive. - Thanks to Alan Kemp. - - *) Bugfix: nginx could not be built with MinGW-w64 gcc 8.1 or newer. - - -Changes with nginx 1.17.4 24 Sep 2019 - - *) Change: better detection of incorrect client behavior in HTTP/2. - - *) Change: in handling of not fully read client request body when - returning errors in HTTP/2. - - *) Bugfix: the "worker_shutdown_timeout" directive might not work when - using HTTP/2. - - *) Bugfix: a segmentation fault might occur in a worker process when - using HTTP/2 and the "proxy_request_buffering" directive. - - *) Bugfix: the ECONNABORTED error log level was "crit" instead of - "error" on Windows when using SSL. - - *) Bugfix: nginx ignored extra data when using chunked transfer - encoding. - - *) Bugfix: nginx always returned the 500 error if the "return" directive - was used and an error occurred during reading client request body. - - *) Bugfix: in memory allocation error handling. - - -Changes with nginx 1.17.3 13 Aug 2019 - - *) Security: when using HTTP/2 a client might cause excessive memory - consumption and CPU usage (CVE-2019-9511, CVE-2019-9513, - CVE-2019-9516). - - *) Bugfix: "zero size buf" alerts might appear in logs when using - gzipping; the bug had appeared in 1.17.2. - - *) Bugfix: a segmentation fault might occur in a worker process if the - "resolver" directive was used in SMTP proxy. - - -Changes with nginx 1.17.2 23 Jul 2019 - - *) Change: minimum supported zlib version is 1.2.0.4. - Thanks to Ilya Leoshkevich. - - *) Change: the $r->internal_redirect() embedded perl method now expects - escaped URIs. - - *) Feature: it is now possible to switch to a named location using the - $r->internal_redirect() embedded perl method. - - *) Bugfix: in error handling in embedded perl. - - *) Bugfix: a segmentation fault might occur on start or during - reconfiguration if hash bucket size larger than 64 kilobytes was used - in the configuration. - - *) Bugfix: nginx might hog CPU during unbuffered proxying and when - proxying WebSocket connections if the select, poll, or /dev/poll - methods were used. - - *) Bugfix: in the ngx_http_xslt_filter_module. - - *) Bugfix: in the ngx_http_ssi_filter_module. - - -Changes with nginx 1.17.1 25 Jun 2019 - - *) Feature: the "limit_req_dry_run" directive. - - *) Feature: when using the "hash" directive inside the "upstream" block - an empty hash key now triggers round-robin balancing. - Thanks to Niklas Keller. - - *) Bugfix: a segmentation fault might occur in a worker process if - caching was used along with the "image_filter" directive, and errors - with code 415 were redirected with the "error_page" directive; the - bug had appeared in 1.11.10. - - *) Bugfix: a segmentation fault might occur in a worker process if - embedded perl was used; the bug had appeared in 1.7.3. - - -Changes with nginx 1.17.0 21 May 2019 - - *) Feature: variables support in the "limit_rate" and "limit_rate_after" - directives. - - *) Feature: variables support in the "proxy_upload_rate" and - "proxy_download_rate" directives in the stream module. - - *) Change: minimum supported OpenSSL version is 0.9.8. - - *) Change: now the postpone filter is always built. - - *) Bugfix: the "include" directive did not work inside the "if" and - "limit_except" blocks. - - *) Bugfix: in byte ranges processing. - - -Changes with nginx 1.15.12 16 Apr 2019 - - *) Bugfix: a segmentation fault might occur in a worker process if - variables were used in the "ssl_certificate" or "ssl_certificate_key" - directives and OCSP stapling was enabled. - - -Changes with nginx 1.15.11 09 Apr 2019 - - *) Bugfix: in the "ssl_stapling_file" directive on Windows. - - -Changes with nginx 1.15.10 26 Mar 2019 - - *) Change: when using a hostname in the "listen" directive nginx now - creates listening sockets for all addresses the hostname resolves to - (previously, only the first address was used). - - *) Feature: port ranges in the "listen" directive. - - *) Feature: loading of SSL certificates and secret keys from variables. - - *) Workaround: the $ssl_server_name variable might be empty when using - OpenSSL 1.1.1. - - *) Bugfix: nginx/Windows could not be built with Visual Studio 2015 or - newer; the bug had appeared in 1.15.9. - - -Changes with nginx 1.15.9 26 Feb 2019 - - *) Feature: variables support in the "ssl_certificate" and - "ssl_certificate_key" directives. - - *) Feature: the "poll" method is now available on Windows when using - Windows Vista or newer. - - *) Bugfix: if the "select" method was used on Windows and an error - occurred while establishing a backend connection, nginx waited for - the connection establishment timeout to expire. - - *) Bugfix: the "proxy_upload_rate" and "proxy_download_rate" directives - in the stream module worked incorrectly when proxying UDP datagrams. - - -Changes with nginx 1.15.8 25 Dec 2018 - - *) Feature: the $upstream_bytes_sent variable. - Thanks to Piotr Sikora. - - *) Feature: new directives in vim syntax highlighting scripts. - Thanks to Gena Makhomed. - - *) Bugfix: in the "proxy_cache_background_update" directive. - - *) Bugfix: in the "geo" directive when using unix domain listen sockets. - - *) Workaround: the "ignoring stale global SSL error ... bad length" - alerts might appear in logs when using the "ssl_early_data" directive - with OpenSSL. - - *) Bugfix: in nginx/Windows. - - *) Bugfix: in the ngx_http_autoindex_module on 32-bit platforms. - - -Changes with nginx 1.15.7 27 Nov 2018 - - *) Feature: the "proxy_requests" directive in the stream module. - - *) Feature: the "delay" parameter of the "limit_req" directive. - Thanks to Vladislav Shabanov and Peter Shchuchkin. - - *) Bugfix: memory leak on errors during reconfiguration. - - *) Bugfix: in the $upstream_response_time, $upstream_connect_time, and - $upstream_header_time variables. - - *) Bugfix: a segmentation fault might occur in a worker process if the - ngx_http_mp4_module was used on 32-bit platforms. - - -Changes with nginx 1.15.6 06 Nov 2018 - - *) Security: when using HTTP/2 a client might cause excessive memory - consumption (CVE-2018-16843) and CPU usage (CVE-2018-16844). - - *) Security: processing of a specially crafted mp4 file with the - ngx_http_mp4_module might result in worker process memory disclosure - (CVE-2018-16845). - - *) Feature: the "proxy_socket_keepalive", "fastcgi_socket_keepalive", - "grpc_socket_keepalive", "memcached_socket_keepalive", - "scgi_socket_keepalive", and "uwsgi_socket_keepalive" directives. - - *) Bugfix: if nginx was built with OpenSSL 1.1.0 and used with OpenSSL - 1.1.1, the TLS 1.3 protocol was always enabled. - - *) Bugfix: working with gRPC backends might result in excessive memory - consumption. - - -Changes with nginx 1.15.5 02 Oct 2018 - - *) Bugfix: a segmentation fault might occur in a worker process when - using OpenSSL 1.1.0h or newer; the bug had appeared in 1.15.4. - - *) Bugfix: of minor potential bugs. - - -Changes with nginx 1.15.4 25 Sep 2018 - - *) Feature: now the "ssl_early_data" directive can be used with OpenSSL. - - *) Bugfix: in the ngx_http_uwsgi_module. - Thanks to Chris Caputo. - - *) Bugfix: connections with some gRPC backends might not be cached when - using the "keepalive" directive. - - *) Bugfix: a socket leak might occur when using the "error_page" - directive to redirect early request processing errors, notably errors - with code 400. - - *) Bugfix: the "return" directive did not change the response code when - returning errors if the request was redirected by the "error_page" - directive. - - *) Bugfix: standard error pages and responses of the - ngx_http_autoindex_module module used the "bgcolor" attribute, and - might be displayed incorrectly when using custom color settings in - browsers. - Thanks to Nova DasSarma. - - *) Change: the logging level of the "no suitable key share" and "no - suitable signature algorithm" SSL errors has been lowered from "crit" - to "info". - - -Changes with nginx 1.15.3 28 Aug 2018 - - *) Feature: now TLSv1.3 can be used with BoringSSL. - - *) Feature: the "ssl_early_data" directive, currently available with - BoringSSL. - - *) Feature: the "keepalive_timeout" and "keepalive_requests" directives - in the "upstream" block. - - *) Bugfix: the ngx_http_dav_module did not truncate destination file - when copying a file over an existing one with the COPY method. - - *) Bugfix: the ngx_http_dav_module used zero access rights on the - destination file and did not preserve file modification time when - moving a file between different file systems with the MOVE method. - - *) Bugfix: the ngx_http_dav_module used default access rights when - copying a file with the COPY method. - - *) Workaround: some clients might not work when using HTTP/2; the bug - had appeared in 1.13.5. - - *) Bugfix: nginx could not be built with LibreSSL 2.8.0. - - -Changes with nginx 1.15.2 24 Jul 2018 - - *) Feature: the $ssl_preread_protocol variable in the - ngx_stream_ssl_preread_module. - - *) Feature: now when using the "reset_timedout_connection" directive - nginx will reset connections being closed with the 444 code. - - *) Change: a logging level of the "http request", "https proxy request", - "unsupported protocol", and "version too low" SSL errors has been - lowered from "crit" to "info". - - *) Bugfix: DNS requests were not resent if initial sending of a request - failed. - - *) Bugfix: the "reuseport" parameter of the "listen" directive was - ignored if the number of worker processes was specified after the - "listen" directive. - - *) Bugfix: when using OpenSSL 1.1.0 or newer it was not possible to - switch off "ssl_prefer_server_ciphers" in a virtual server if it was - switched on in the default server. - - *) Bugfix: SSL session reuse with upstream servers did not work with the - TLS 1.3 protocol. - - -Changes with nginx 1.15.1 03 Jul 2018 - - *) Feature: the "random" directive inside the "upstream" block. - - *) Feature: improved performance when using the "hash" and "ip_hash" - directives with the "zone" directive. - - *) Feature: the "reuseport" parameter of the "listen" directive now uses - SO_REUSEPORT_LB on FreeBSD 12. - - *) Bugfix: HTTP/2 server push did not work if SSL was terminated by a - proxy server in front of nginx. - - *) Bugfix: the "tcp_nopush" directive was always used on backend - connections. - - *) Bugfix: sending a disk-buffered request body to a gRPC backend might - fail. - - -Changes with nginx 1.15.0 05 Jun 2018 - - *) Change: the "ssl" directive is deprecated; the "ssl" parameter of the - "listen" directive should be used instead. - - *) Change: now nginx detects missing SSL certificates during - configuration testing when using the "ssl" parameter of the "listen" - directive. - - *) Feature: now the stream module can handle multiple incoming UDP - datagrams from a client within a single session. - - *) Bugfix: it was possible to specify an incorrect response code in the - "proxy_cache_valid" directive. - - *) Bugfix: nginx could not be built by gcc 8.1. - - *) Bugfix: logging to syslog stopped on local IP address changes. - - *) Bugfix: nginx could not be built by clang with CUDA SDK installed; - the bug had appeared in 1.13.8. - - *) Bugfix: "getsockopt(TCP_FASTOPEN) ... failed" messages might appear - in logs during binary upgrade when using unix domain listen sockets - on FreeBSD. - - *) Bugfix: nginx could not be built on Fedora 28 Linux. - - *) Bugfix: request processing rate might exceed configured rate when - using the "limit_req" directive. - - *) Bugfix: in handling of client addresses when using unix domain listen - sockets to work with datagrams on Linux. - - *) Bugfix: in memory allocation error handling. - - -Changes with nginx 1.13.12 10 Apr 2018 - - *) Bugfix: connections with gRPC backends might be closed unexpectedly - when returning a large response. - - -Changes with nginx 1.13.11 03 Apr 2018 - - *) Feature: the "proxy_protocol" parameter of the "listen" directive now - supports the PROXY protocol version 2. - - *) Bugfix: nginx could not be built with OpenSSL 1.1.1 statically on - Linux. - - *) Bugfix: in the "http_404", "http_500", etc. parameters of the - "proxy_next_upstream" directive. - - -Changes with nginx 1.13.10 20 Mar 2018 - - *) Feature: the "set" parameter of the "include" SSI directive now - allows writing arbitrary responses to a variable; the - "subrequest_output_buffer_size" directive defines maximum response - size. - - *) Feature: now nginx uses clock_gettime(CLOCK_MONOTONIC) if available, - to avoid timeouts being incorrectly triggered on system time changes. - - *) Feature: the "escape=none" parameter of the "log_format" directive. - Thanks to Johannes Baiter and Calin Don. - - *) Feature: the $ssl_preread_alpn_protocols variable in the - ngx_stream_ssl_preread_module. - - *) Feature: the ngx_http_grpc_module. - - *) Bugfix: in memory allocation error handling in the "geo" directive. - - *) Bugfix: when using variables in the "auth_basic_user_file" directive - a null character might appear in logs. - Thanks to Vadim Filimonov. - - -Changes with nginx 1.13.9 20 Feb 2018 - - *) Feature: HTTP/2 server push support; the "http2_push" and - "http2_push_preload" directives. - - *) Bugfix: "header already sent" alerts might appear in logs when using - cache; the bug had appeared in 1.9.13. - - *) Bugfix: a segmentation fault might occur in a worker process if the - "ssl_verify_client" directive was used and no SSL certificate was - specified in a virtual server. - - *) Bugfix: in the ngx_http_v2_module. - - *) Bugfix: in the ngx_http_dav_module. - - -Changes with nginx 1.13.8 26 Dec 2017 - - *) Feature: now nginx automatically preserves the CAP_NET_RAW capability - in worker processes when using the "transparent" parameter of the - "proxy_bind", "fastcgi_bind", "memcached_bind", "scgi_bind", and - "uwsgi_bind" directives. - - *) Feature: improved CPU cache line size detection. - Thanks to Debayan Ghosh. - - *) Feature: new directives in vim syntax highlighting scripts. - Thanks to Gena Makhomed. - - *) Bugfix: binary upgrade refused to work if nginx was re-parented to a - process with PID different from 1 after its parent process has - finished. - - *) Bugfix: the ngx_http_autoindex_module incorrectly handled requests - with bodies. - - *) Bugfix: in the "proxy_limit_rate" directive when used with the - "keepalive" directive. - - *) Bugfix: some parts of a response might be buffered when using - "proxy_buffering off" if the client connection used SSL. - Thanks to Patryk Lesiewicz. - - *) Bugfix: in the "proxy_cache_background_update" directive. - - *) Bugfix: it was not possible to start a parameter with a variable in - the "${name}" form with the name in curly brackets without enclosing - the parameter into single or double quotes. - - -Changes with nginx 1.13.7 21 Nov 2017 - - *) Bugfix: in the $upstream_status variable. - - *) Bugfix: a segmentation fault might occur in a worker process if a - backend returned a "101 Switching Protocols" response to a - subrequest. - - *) Bugfix: a segmentation fault occurred in a master process if a shared - memory zone size was changed during a reconfiguration and the - reconfiguration failed. - - *) Bugfix: in the ngx_http_fastcgi_module. - - *) Bugfix: nginx returned the 500 error if parameters without variables - were specified in the "xslt_stylesheet" directive. - - *) Workaround: "gzip filter failed to use preallocated memory" alerts - appeared in logs when using a zlib library variant from Intel. - - *) Bugfix: the "worker_shutdown_timeout" directive did not work when - using mail proxy and when proxying WebSocket connections. - - -Changes with nginx 1.13.6 10 Oct 2017 - - *) Bugfix: switching to the next upstream server in the stream module - did not work when using the "ssl_preread" directive. - - *) Bugfix: in the ngx_http_v2_module. - Thanks to Piotr Sikora. - - *) Bugfix: nginx did not support dates after the year 2038 on 32-bit - platforms with 64-bit time_t. - - *) Bugfix: in handling of dates prior to the year 1970 and after the - year 10000. - - *) Bugfix: in the stream module timeouts waiting for UDP datagrams from - upstream servers were not logged or logged at the "info" level - instead of "error". - - *) Bugfix: when using HTTP/2 nginx might return the 400 response without - logging the reason. - - *) Bugfix: in processing of corrupted cache files. - - *) Bugfix: cache control headers were ignored when caching errors - intercepted by error_page. - - *) Bugfix: when using HTTP/2 client request body might be corrupted. - - *) Bugfix: in handling of client addresses when using unix domain - sockets. - - *) Bugfix: nginx hogged CPU when using the "hash ... consistent" - directive in the upstream block if large weights were used and all or - most of the servers were unavailable. - - -Changes with nginx 1.13.5 05 Sep 2017 - - *) Feature: the $ssl_client_escaped_cert variable. - - *) Bugfix: the "ssl_session_ticket_key" directive and the "include" - parameter of the "geo" directive did not work on Windows. - - *) Bugfix: incorrect response length was returned on 32-bit platforms - when requesting more than 4 gigabytes with multiple ranges. - - *) Bugfix: the "expires modified" directive and processing of the - "If-Range" request header line did not use the response last - modification time if proxying without caching was used. - - -Changes with nginx 1.13.4 08 Aug 2017 - - *) Feature: the ngx_http_mirror_module. - - *) Bugfix: client connections might be dropped during configuration - testing when using the "reuseport" parameter of the "listen" - directive on Linux. - - *) Bugfix: request body might not be available in subrequests if it was - saved to a file and proxying was used. - - *) Bugfix: cleaning cache based on the "max_size" parameter did not work - on Windows. - - *) Bugfix: any shared memory allocation required 4096 bytes on Windows. - - *) Bugfix: nginx worker might be terminated abnormally when using the - "zone" directive inside the "upstream" block on Windows. - - -Changes with nginx 1.13.3 11 Jul 2017 - - *) Security: a specially crafted request might result in an integer - overflow and incorrect processing of ranges in the range filter, - potentially resulting in sensitive information leak (CVE-2017-7529). - - -Changes with nginx 1.13.2 27 Jun 2017 - - *) Change: nginx now returns 200 instead of 416 when a range starting - with 0 is requested from an empty file. - - *) Feature: the "add_trailer" directive. - Thanks to Piotr Sikora. - - *) Bugfix: nginx could not be built on Cygwin and NetBSD; the bug had - appeared in 1.13.0. - - *) Bugfix: nginx could not be built under MSYS2 / MinGW 64-bit. - Thanks to Orgad Shaneh. - - *) Bugfix: a segmentation fault might occur in a worker process when - using SSI with many includes and proxy_pass with variables. - - *) Bugfix: in the ngx_http_v2_module. - Thanks to Piotr Sikora. - - -Changes with nginx 1.13.1 30 May 2017 - - *) Feature: now a hostname can be used as the "set_real_ip_from" - directive parameter. - - *) Feature: vim syntax highlighting scripts improvements. - - *) Feature: the "worker_cpu_affinity" directive now works on DragonFly - BSD. - Thanks to Sepherosa Ziehau. - - *) Bugfix: SSL renegotiation on backend connections did not work when - using OpenSSL before 1.1.0. - - *) Workaround: nginx could not be built with Oracle Developer Studio - 12.5. - - *) Workaround: now cache manager ignores long locked cache entries when - cleaning cache based on the "max_size" parameter. - - *) Bugfix: client SSL connections were immediately closed if deferred - accept and the "proxy_protocol" parameter of the "listen" directive - were used. - - *) Bugfix: in the "proxy_cache_background_update" directive. - - *) Workaround: now the "tcp_nodelay" directive sets the TCP_NODELAY - option before an SSL handshake. - - -Changes with nginx 1.13.0 25 Apr 2017 - - *) Change: SSL renegotiation is now allowed on backend connections. - - *) Feature: the "rcvbuf" and "sndbuf" parameters of the "listen" - directives of the mail proxy and stream modules. - - *) Feature: the "return" and "error_page" directives can now be used to - return 308 redirections. - Thanks to Simon Leblanc. - - *) Feature: the "TLSv1.3" parameter of the "ssl_protocols" directive. - - *) Feature: when logging signals nginx now logs PID of the process which - sent the signal. - - *) Bugfix: in memory allocation error handling. - - *) Bugfix: if a server in the stream module listened on a wildcard - address, the source address of a response UDP datagram could differ - from the original datagram destination address. - - -Changes with nginx 1.11.13 04 Apr 2017 - - *) Feature: the "http_429" parameter of the "proxy_next_upstream", - "fastcgi_next_upstream", "scgi_next_upstream", and - "uwsgi_next_upstream" directives. - Thanks to Piotr Sikora. - - *) Bugfix: in memory allocation error handling. - - *) Bugfix: requests might hang when using the "sendfile" and - "timer_resolution" directives on Linux. - - *) Bugfix: requests might hang when using the "sendfile" and "aio_write" - directives with subrequests. - - *) Bugfix: in the ngx_http_v2_module. - Thanks to Piotr Sikora. - - *) Bugfix: a segmentation fault might occur in a worker process when - using HTTP/2. - - *) Bugfix: requests might hang when using the "limit_rate", - "sendfile_max_chunk", "limit_req" directives, or the $r->sleep() - embedded perl method with subrequests. - - *) Bugfix: in the ngx_http_slice_module. - - -Changes with nginx 1.11.12 24 Mar 2017 - - *) Bugfix: nginx might hog CPU; the bug had appeared in 1.11.11. - - -Changes with nginx 1.11.11 21 Mar 2017 - - *) Feature: the "worker_shutdown_timeout" directive. - - *) Feature: vim syntax highlighting scripts improvements. - Thanks to Wei-Ko Kao. - - *) Bugfix: a segmentation fault might occur in a worker process if the - $limit_rate variable was set to an empty string. - - *) Bugfix: the "proxy_cache_background_update", - "fastcgi_cache_background_update", "scgi_cache_background_update", - and "uwsgi_cache_background_update" directives might work incorrectly - if the "if" directive was used. - - *) Bugfix: a segmentation fault might occur in a worker process if - number of large_client_header_buffers in a virtual server was - different from the one in the default server. - - *) Bugfix: in the mail proxy server. - - -Changes with nginx 1.11.10 14 Feb 2017 - - *) Change: cache header format has been changed, previously cached - responses will be invalidated. - - *) Feature: support of "stale-while-revalidate" and "stale-if-error" - extensions in the "Cache-Control" backend response header line. - - *) Feature: the "proxy_cache_background_update", - "fastcgi_cache_background_update", "scgi_cache_background_update", - and "uwsgi_cache_background_update" directives. - - *) Feature: nginx is now able to cache responses with the "Vary" header - line up to 128 characters long (instead of 42 characters in previous - versions). - - *) Feature: the "build" parameter of the "server_tokens" directive. - Thanks to Tom Thorogood. - - *) Bugfix: "[crit] SSL_write() failed" messages might appear in logs - when handling requests with the "Expect: 100-continue" request header - line. - - *) Bugfix: the ngx_http_slice_module did not work in named locations. - - *) Bugfix: a segmentation fault might occur in a worker process when - using AIO after an "X-Accel-Redirect" redirection. - - *) Bugfix: reduced memory consumption for long-lived requests using - gzipping. - - -Changes with nginx 1.11.9 24 Jan 2017 - - *) Bugfix: nginx might hog CPU when using the stream module; the bug had - appeared in 1.11.5. - - *) Bugfix: EXTERNAL authentication mechanism in mail proxy was accepted - even if it was not enabled in the configuration. - - *) Bugfix: a segmentation fault might occur in a worker process if the - "ssl_verify_client" directive of the stream module was used. - - *) Bugfix: the "ssl_verify_client" directive of the stream module might - not work. - - *) Bugfix: closing keepalive connections due to no free worker - connections might be too aggressive. - Thanks to Joel Cunningham. - - *) Bugfix: an incorrect response might be returned when using the - "sendfile" directive on FreeBSD and macOS; the bug had appeared in - 1.7.8. - - *) Bugfix: a truncated response might be stored in cache when using the - "aio_write" directive. - - *) Bugfix: a socket leak might occur when using the "aio_write" - directive. - - -Changes with nginx 1.11.8 27 Dec 2016 - - *) Feature: the "absolute_redirect" directive. - - *) Feature: the "escape" parameter of the "log_format" directive. - - *) Feature: client SSL certificates verification in the stream module. - - *) Feature: the "ssl_session_ticket_key" directive supports AES256 - encryption of TLS session tickets when used with 80-byte keys. - - *) Feature: vim-commentary support in vim scripts. - Thanks to Armin Grodon. - - *) Bugfix: recursion when evaluating variables was not limited. - - *) Bugfix: in the ngx_stream_ssl_preread_module. - - *) Bugfix: if a server in an upstream in the stream module failed, it - was considered alive only when a test connection sent to it after - fail_timeout was closed; now a successfully established connection is - enough. - - *) Bugfix: nginx/Windows could not be built with 64-bit Visual Studio. - - *) Bugfix: nginx/Windows could not be built with OpenSSL 1.1.0. - - -Changes with nginx 1.11.7 13 Dec 2016 - - *) Change: now in case of a client certificate verification error the - $ssl_client_verify variable contains a string with the failure - reason, for example, "FAILED:certificate has expired". - - *) Feature: the $ssl_ciphers, $ssl_curves, $ssl_client_v_start, - $ssl_client_v_end, and $ssl_client_v_remain variables. - - *) Feature: the "volatile" parameter of the "map" directive. - - *) Bugfix: dependencies specified for a module were ignored while - building dynamic modules. - - *) Bugfix: when using HTTP/2 and the "limit_req" or "auth_request" - directives client request body might be corrupted; the bug had - appeared in 1.11.0. - - *) Bugfix: a segmentation fault might occur in a worker process when - using HTTP/2; the bug had appeared in 1.11.3. - - *) Bugfix: in the ngx_http_mp4_module. - Thanks to Congcong Hu. - - *) Bugfix: in the ngx_http_perl_module. - - -Changes with nginx 1.11.6 15 Nov 2016 - - *) Change: format of the $ssl_client_s_dn and $ssl_client_i_dn variables - has been changed to follow RFC 2253 (RFC 4514); values in the old - format are available in the $ssl_client_s_dn_legacy and - $ssl_client_i_dn_legacy variables. - - *) Change: when storing temporary files in a cache directory they will - be stored in the same subdirectories as corresponding cache files - instead of a separate subdirectory for temporary files. - - *) Feature: EXTERNAL authentication mechanism support in mail proxy. - Thanks to Robert Norris. - - *) Feature: WebP support in the ngx_http_image_filter_module. - - *) Feature: variables support in the "proxy_method" directive. - Thanks to Dmitry Lazurkin. - - *) Feature: the "http2_max_requests" directive in the - ngx_http_v2_module. - - *) Feature: the "proxy_cache_max_range_offset", - "fastcgi_cache_max_range_offset", "scgi_cache_max_range_offset", and - "uwsgi_cache_max_range_offset" directives. - - *) Bugfix: graceful shutdown of old worker processes might require - infinite time when using HTTP/2. - - *) Bugfix: in the ngx_http_mp4_module. - - *) Bugfix: "ignore long locked inactive cache entry" alerts might appear - in logs when proxying WebSocket connections with caching enabled. - - *) Bugfix: nginx did not write anything to log and returned a response - with code 502 instead of 504 when a timeout occurred during an SSL - handshake to a backend. - - -Changes with nginx 1.11.5 11 Oct 2016 - - *) Change: the --with-ipv6 configure option was removed, now IPv6 - support is configured automatically. - - *) Change: now if there are no available servers in an upstream, nginx - will not reset number of failures of all servers as it previously - did, but will wait for fail_timeout to expire. - - *) Feature: the ngx_stream_ssl_preread_module. - - *) Feature: the "server" directive in the "upstream" context supports - the "max_conns" parameter. - - *) Feature: the --with-compat configure option. - - *) Feature: "manager_files", "manager_threshold", and "manager_sleep" - parameters of the "proxy_cache_path", "fastcgi_cache_path", - "scgi_cache_path", and "uwsgi_cache_path" directives. - - *) Bugfix: flags passed by the --with-ld-opt configure option were not - used while building perl module. - - *) Bugfix: in the "add_after_body" directive when used with the - "sub_filter" directive. - - *) Bugfix: in the $realip_remote_addr variable. - - *) Bugfix: the "dav_access", "proxy_store_access", - "fastcgi_store_access", "scgi_store_access", and "uwsgi_store_access" - directives ignored permissions specified for user. - - *) Bugfix: unix domain listen sockets might not be inherited during - binary upgrade on Linux. - - *) Bugfix: nginx returned the 400 response on requests with the "-" - character in the HTTP method. - - -Changes with nginx 1.11.4 13 Sep 2016 - - *) Feature: the $upstream_bytes_received variable. - - *) Feature: the $bytes_received, $session_time, $protocol, $status, - $upstream_addr, $upstream_bytes_sent, $upstream_bytes_received, - $upstream_connect_time, $upstream_first_byte_time, and - $upstream_session_time variables in the stream module. - - *) Feature: the ngx_stream_log_module. - - *) Feature: the "proxy_protocol" parameter of the "listen" directive, - the $proxy_protocol_addr and $proxy_protocol_port variables in the - stream module. - - *) Feature: the ngx_stream_realip_module. - - *) Bugfix: nginx could not be built with the stream module and the - ngx_http_ssl_module, but without ngx_stream_ssl_module; the bug had - appeared in 1.11.3. - - *) Feature: the IP_BIND_ADDRESS_NO_PORT socket option was not used; the - bug had appeared in 1.11.2. - - *) Bugfix: in the "ranges" parameter of the "geo" directive. - - *) Bugfix: an incorrect response might be returned when using the "aio - threads" and "sendfile" directives; the bug had appeared in 1.9.13. - - -Changes with nginx 1.11.3 26 Jul 2016 - - *) Change: now the "accept_mutex" directive is turned off by default. - - *) Feature: now nginx uses EPOLLEXCLUSIVE on Linux. - - *) Feature: the ngx_stream_geo_module. - - *) Feature: the ngx_stream_geoip_module. - - *) Feature: the ngx_stream_split_clients_module. - - *) Feature: variables support in the "proxy_pass" and "proxy_ssl_name" - directives in the stream module. - - *) Bugfix: socket leak when using HTTP/2. - - *) Bugfix: in configure tests. - Thanks to Piotr Sikora. - - -Changes with nginx 1.11.2 05 Jul 2016 - - *) Change: now nginx always uses internal MD5 and SHA1 implementations; - the --with-md5 and --with-sha1 configure options were canceled. - - *) Feature: variables support in the stream module. - - *) Feature: the ngx_stream_map_module. - - *) Feature: the ngx_stream_return_module. - - *) Feature: a port can be specified in the "proxy_bind", "fastcgi_bind", - "memcached_bind", "scgi_bind", and "uwsgi_bind" directives. - - *) Feature: now nginx uses the IP_BIND_ADDRESS_NO_PORT socket option - when available. - - *) Bugfix: a segmentation fault might occur in a worker process when - using HTTP/2 and the "proxy_request_buffering" directive. - - *) Bugfix: the "Content-Length" request header line was always added to - requests passed to backends, including requests without body, when - using HTTP/2. - - *) Bugfix: "http request count is zero" alerts might appear in logs when - using HTTP/2. - - *) Bugfix: unnecessary buffering might occur when using the "sub_filter" - directive; the issue had appeared in 1.9.4. - - -Changes with nginx 1.11.1 31 May 2016 - - *) Security: a segmentation fault might occur in a worker process while - writing a specially crafted request body to a temporary file - (CVE-2016-4450); the bug had appeared in 1.3.9. - - -Changes with nginx 1.11.0 24 May 2016 - - *) Feature: the "transparent" parameter of the "proxy_bind", - "fastcgi_bind", "memcached_bind", "scgi_bind", and "uwsgi_bind" - directives. - - *) Feature: the $request_id variable. - - *) Feature: the "map" directive supports combinations of multiple - variables as resulting values. - - *) Feature: now nginx checks if EPOLLRDHUP events are supported by - kernel, and optimizes connection handling accordingly if the "epoll" - method is used. - - *) Feature: the "ssl_certificate" and "ssl_certificate_key" directives - can be specified multiple times to load certificates of different - types (for example, RSA and ECDSA). - - *) Feature: the "ssl_ecdh_curve" directive now allows specifying a list - of curves when using OpenSSL 1.0.2 or newer; by default a list built - into OpenSSL is used. - - *) Change: to use DHE ciphers it is now required to specify parameters - using the "ssl_dhparam" directive. - - *) Feature: the $proxy_protocol_port variable. - - *) Feature: the $realip_remote_port variable in the - ngx_http_realip_module. - - *) Feature: the ngx_http_realip_module is now able to set the client - port in addition to the address. - - *) Change: the "421 Misdirected Request" response now used when - rejecting requests to a virtual server different from one negotiated - during an SSL handshake; this improves interoperability with some - HTTP/2 clients when using client certificates. - - *) Change: HTTP/2 clients can now start sending request body - immediately; the "http2_body_preread_size" directive controls size of - the buffer used before nginx will start reading client request body. - - *) Bugfix: cached error responses were not updated when using the - "proxy_cache_bypass" directive. - - -Changes with nginx 1.9.15 19 Apr 2016 - - *) Bugfix: "recv() failed" errors might occur when using HHVM as a - FastCGI server. - - *) Bugfix: when using HTTP/2 and the "limit_req" or "auth_request" - directives a timeout or a "client violated flow control" error might - occur while reading client request body; the bug had appeared in - 1.9.14. - - *) Workaround: a response might not be shown by some browsers if HTTP/2 - was used and client request body was not fully read; the bug had - appeared in 1.9.14. - - *) Bugfix: connections might hang when using the "aio threads" - directive. - Thanks to Mindaugas Rasiukevicius. - - -Changes with nginx 1.9.14 05 Apr 2016 - - *) Feature: OpenSSL 1.1.0 compatibility. - - *) Feature: the "proxy_request_buffering", "fastcgi_request_buffering", - "scgi_request_buffering", and "uwsgi_request_buffering" directives - now work with HTTP/2. - - *) Bugfix: "zero size buf in output" alerts might appear in logs when - using HTTP/2. - - *) Bugfix: the "client_max_body_size" directive might work incorrectly - when using HTTP/2. - - *) Bugfix: of minor bugs in logging. - - -Changes with nginx 1.9.13 29 Mar 2016 - - *) Change: non-idempotent requests (POST, LOCK, PATCH) are no longer - passed to the next server by default if a request has been sent to a - backend; the "non_idempotent" parameter of the "proxy_next_upstream" - directive explicitly allows retrying such requests. - - *) Feature: the ngx_http_perl_module can be built dynamically. - - *) Feature: UDP support in the stream module. - - *) Feature: the "aio_write" directive. - - *) Feature: now cache manager monitors number of elements in caches and - tries to avoid cache keys zone overflows. - - *) Bugfix: "task already active" and "second aio post" alerts might - appear in logs when using the "sendfile" and "aio" directives with - subrequests. - - *) Bugfix: "zero size buf in output" alerts might appear in logs if - caching was used and a client closed a connection prematurely. - - *) Bugfix: connections with clients might be closed needlessly if - caching was used. - Thanks to Justin Li. - - *) Bugfix: nginx might hog CPU if the "sendfile" directive was used on - Linux or Solaris and a file being sent was changed during sending. - - *) Bugfix: connections might hang when using the "sendfile" and "aio - threads" directives. - - *) Bugfix: in the "proxy_pass", "fastcgi_pass", "scgi_pass", and - "uwsgi_pass" directives when using variables. - Thanks to Piotr Sikora. - - *) Bugfix: in the ngx_http_sub_filter_module. - - *) Bugfix: if an error occurred in a cached backend connection, the - request was passed to the next server regardless of the - proxy_next_upstream directive. - - *) Bugfix: "CreateFile() failed" errors when creating temporary files on - Windows. - - -Changes with nginx 1.9.12 24 Feb 2016 - - *) Feature: Huffman encoding of response headers in HTTP/2. - Thanks to Vlad Krasnov. - - *) Feature: the "worker_cpu_affinity" directive now supports more than - 64 CPUs. - - *) Bugfix: compatibility with 3rd party C++ modules; the bug had - appeared in 1.9.11. - Thanks to Piotr Sikora. - - *) Bugfix: nginx could not be built statically with OpenSSL on Linux; - the bug had appeared in 1.9.11. - - *) Bugfix: the "add_header ... always" directive with an empty value did - not delete "Last-Modified" and "ETag" header lines from error - responses. - - *) Workaround: "called a function you should not call" and "shutdown - while in init" messages might appear in logs when using OpenSSL - 1.0.2f. - - *) Bugfix: invalid headers might be logged incorrectly. - - *) Bugfix: socket leak when using HTTP/2. - - *) Bugfix: in the ngx_http_v2_module. - - -Changes with nginx 1.9.11 09 Feb 2016 - - *) Feature: TCP support in resolver. - - *) Feature: dynamic modules. - - *) Bugfix: the $request_length variable did not include size of request - headers when using HTTP/2. - - *) Bugfix: in the ngx_http_v2_module. - - -Changes with nginx 1.9.10 26 Jan 2016 - - *) Security: invalid pointer dereference might occur during DNS server - response processing if the "resolver" directive was used, allowing an - attacker who is able to forge UDP packets from the DNS server to - cause segmentation fault in a worker process (CVE-2016-0742). - - *) Security: use-after-free condition might occur during CNAME response - processing if the "resolver" directive was used, allowing an attacker - who is able to trigger name resolution to cause segmentation fault in - a worker process, or might have potential other impact - (CVE-2016-0746). - - *) Security: CNAME resolution was insufficiently limited if the - "resolver" directive was used, allowing an attacker who is able to - trigger arbitrary name resolution to cause excessive resource - consumption in worker processes (CVE-2016-0747). - - *) Feature: the "auto" parameter of the "worker_cpu_affinity" directive. - - *) Bugfix: the "proxy_protocol" parameter of the "listen" directive did - not work with IPv6 listen sockets. - - *) Bugfix: connections to upstream servers might be cached incorrectly - when using the "keepalive" directive. - - *) Bugfix: proxying used the HTTP method of the original request after - an "X-Accel-Redirect" redirection. - - -Changes with nginx 1.9.9 09 Dec 2015 - - *) Bugfix: proxying to unix domain sockets did not work when using - variables; the bug had appeared in 1.9.8. - - -Changes with nginx 1.9.8 08 Dec 2015 - - *) Feature: pwritev() support. - - *) Feature: the "include" directive inside the "upstream" block. - - *) Feature: the ngx_http_slice_module. - - *) Bugfix: a segmentation fault might occur in a worker process when - using LibreSSL; the bug had appeared in 1.9.6. - - *) Bugfix: nginx could not be built on OS X in some cases. - - -Changes with nginx 1.9.7 17 Nov 2015 - - *) Feature: the "nohostname" parameter of logging to syslog. - - *) Feature: the "proxy_cache_convert_head" directive. - - *) Feature: the $realip_remote_addr variable in the - ngx_http_realip_module. - - *) Bugfix: the "expires" directive might not work when using variables. - - *) Bugfix: a segmentation fault might occur in a worker process when - using HTTP/2; the bug had appeared in 1.9.6. - - *) Bugfix: if nginx was built with the ngx_http_v2_module it was - possible to use the HTTP/2 protocol even if the "http2" parameter of - the "listen" directive was not specified. - - *) Bugfix: in the ngx_http_v2_module. - - -Changes with nginx 1.9.6 27 Oct 2015 - - *) Bugfix: a segmentation fault might occur in a worker process when - using HTTP/2. - Thanks to Piotr Sikora and Denis Andzakovic. - - *) Bugfix: the $server_protocol variable was empty when using HTTP/2. - - *) Bugfix: backend SSL connections in the stream module might be timed - out unexpectedly. - - *) Bugfix: a segmentation fault might occur in a worker process if - different ssl_session_cache settings were used in different virtual - servers. - - *) Bugfix: nginx/Windows could not be built with MinGW gcc; the bug had - appeared in 1.9.4. - Thanks to Kouhei Sutou. - - *) Bugfix: time was not updated when the timer_resolution directive was - used on Windows. - - *) Miscellaneous minor fixes and improvements. - Thanks to Markus Linnala, Kurtis Nusbaum and Piotr Sikora. - - -Changes with nginx 1.9.5 22 Sep 2015 - - *) Feature: the ngx_http_v2_module (replaces ngx_http_spdy_module). - Thanks to Dropbox and Automattic for sponsoring this work. - - *) Change: now the "output_buffers" directive uses two buffers by - default. - - *) Change: now nginx limits subrequests recursion, not simultaneous - subrequests. - - *) Change: now nginx checks the whole cache key when returning a - response from cache. - Thanks to Gena Makhomed and Sergey Brester. - - *) Bugfix: "header already sent" alerts might appear in logs when using - cache; the bug had appeared in 1.7.5. - - *) Bugfix: "writev() failed (4: Interrupted system call)" errors might - appear in logs when using CephFS and the "timer_resolution" directive - on Linux. - - *) Bugfix: in invalid configurations handling. - Thanks to Markus Linnala. - - *) Bugfix: a segmentation fault occurred in a worker process if the - "sub_filter" directive was used at http level; the bug had appeared - in 1.9.4. - - -Changes with nginx 1.9.4 18 Aug 2015 - - *) Change: the "proxy_downstream_buffer" and "proxy_upstream_buffer" - directives of the stream module are replaced with the - "proxy_buffer_size" directive. - - *) Feature: the "tcp_nodelay" directive in the stream module. - - *) Feature: multiple "sub_filter" directives can be used simultaneously. - - *) Feature: variables support in the search string of the "sub_filter" - directive. - - *) Workaround: configuration testing might fail under Linux OpenVZ. - Thanks to Gena Makhomed. - - *) Bugfix: old worker processes might hog CPU after reconfiguration with - a large number of worker_connections. - - *) Bugfix: a segmentation fault might occur in a worker process if the - "try_files" and "alias" directives were used inside a location given - by a regular expression; the bug had appeared in 1.7.1. - - *) Bugfix: the "try_files" directive inside a nested location given by a - regular expression worked incorrectly if the "alias" directive was - used in the outer location. - - *) Bugfix: in hash table initialization error handling. - - *) Bugfix: nginx could not be built with Visual Studio 2015. - - -Changes with nginx 1.9.3 14 Jul 2015 - - *) Change: duplicate "http", "mail", and "stream" blocks are now - disallowed. - - *) Feature: connection limiting in the stream module. - - *) Feature: data rate limiting in the stream module. - - *) Bugfix: the "zone" directive inside the "upstream" block did not work - on Windows. - - *) Bugfix: compatibility with LibreSSL in the stream module. - Thanks to Piotr Sikora. - - *) Bugfix: in the "--builddir" configure parameter. - Thanks to Piotr Sikora. - - *) Bugfix: the "ssl_stapling_file" directive did not work; the bug had - appeared in 1.9.2. - Thanks to Faidon Liambotis and Brandon Black. - - *) Bugfix: a segmentation fault might occur in a worker process if the - "ssl_stapling" directive was used; the bug had appeared in 1.9.2. - Thanks to Matthew Baldwin. - - -Changes with nginx 1.9.2 16 Jun 2015 - - *) Feature: the "backlog" parameter of the "listen" directives of the - mail proxy and stream modules. - - *) Feature: the "allow" and "deny" directives in the stream module. - - *) Feature: the "proxy_bind" directive in the stream module. - - *) Feature: the "proxy_protocol" directive in the stream module. - - *) Feature: the -T switch. - - *) Feature: the REQUEST_SCHEME parameter added to the fastcgi.conf, - fastcgi_params, scgi_params, and uwsgi_params standard configuration - files. - - *) Bugfix: the "reuseport" parameter of the "listen" directive of the - stream module did not work. - - *) Bugfix: OCSP stapling might return an expired OCSP response in some - cases. - - -Changes with nginx 1.9.1 26 May 2015 - - *) Change: now SSLv3 protocol is disabled by default. - - *) Change: some long deprecated directives are not supported anymore. - - *) Feature: the "reuseport" parameter of the "listen" directive. - Thanks to Yingqi Lu at Intel and Sepherosa Ziehau. - - *) Feature: the $upstream_connect_time variable. - - *) Bugfix: in the "hash" directive on big-endian platforms. - - *) Bugfix: nginx might fail to start on some old Linux variants; the bug - had appeared in 1.7.11. - - *) Bugfix: in IP address parsing. - Thanks to Sergey Polovko. - - -Changes with nginx 1.9.0 28 Apr 2015 - - *) Change: obsolete aio and rtsig event methods have been removed. - - *) Feature: the "zone" directive inside the "upstream" block. - - *) Feature: the stream module. - - *) Feature: byte ranges support in the ngx_http_memcached_module. - Thanks to Martin Mlynář. - - *) Feature: shared memory can now be used on Windows versions with - address space layout randomization. - Thanks to Sergey Brester. - - *) Feature: the "error_log" directive can now be used on mail and server - levels in mail proxy. - - *) Bugfix: the "proxy_protocol" parameter of the "listen" directive did - not work if not specified in the first "listen" directive for a - listen socket. - - -Changes with nginx 1.7.12 07 Apr 2015 - - *) Feature: now the "tcp_nodelay" directive works with backend SSL - connections. - - *) Feature: now thread pools can be used to read cache file headers. - - *) Bugfix: in the "proxy_request_buffering" directive. - - *) Bugfix: a segmentation fault might occur in a worker process when - using thread pools on Linux. - - *) Bugfix: in error handling when using the "ssl_stapling" directive. - Thanks to Filipe da Silva. - - *) Bugfix: in the ngx_http_spdy_module. - - -Changes with nginx 1.7.11 24 Mar 2015 - - *) Change: the "sendfile" parameter of the "aio" directive is - deprecated; now nginx automatically uses AIO to pre-load data for - sendfile if both "aio" and "sendfile" directives are used. - - *) Feature: experimental thread pools support. - - *) Feature: the "proxy_request_buffering", "fastcgi_request_buffering", - "scgi_request_buffering", and "uwsgi_request_buffering" directives. - - *) Feature: request body filters experimental API. - - *) Feature: client SSL certificates support in mail proxy. - Thanks to Sven Peter, Franck Levionnois, and Filipe Da Silva. - - *) Feature: startup speedup when using the "hash ... consistent" - directive in the upstream block. - Thanks to Wai Keen Woon. - - *) Feature: debug logging into a cyclic memory buffer. - - *) Bugfix: in hash table handling. - Thanks to Chris West. - - *) Bugfix: in the "proxy_cache_revalidate" directive. - - *) Bugfix: SSL connections might hang if deferred accept or the - "proxy_protocol" parameter of the "listen" directive were used. - Thanks to James Hamlin. - - *) Bugfix: the $upstream_response_time variable might contain a wrong - value if the "image_filter" directive was used. - - *) Bugfix: in integer overflow handling. - Thanks to Régis Leroy. - - *) Bugfix: it was not possible to enable SSLv3 with LibreSSL. - - *) Bugfix: the "ignoring stale global SSL error ... called a function - you should not call" alerts appeared in logs when using LibreSSL. - - *) Bugfix: certificates specified by the "ssl_client_certificate" and - "ssl_trusted_certificate" directives were inadvertently used to - automatically construct certificate chains. - - -Changes with nginx 1.7.10 10 Feb 2015 - - *) Feature: the "use_temp_path" parameter of the "proxy_cache_path", - "fastcgi_cache_path", "scgi_cache_path", and "uwsgi_cache_path" - directives. - - *) Feature: the $upstream_header_time variable. - - *) Workaround: now on disk overflow nginx tries to write error logs once - a second only. - - *) Bugfix: the "try_files" directive did not ignore normal files while - testing directories. - Thanks to Damien Tournoud. - - *) Bugfix: alerts "sendfile() failed" if the "sendfile" directive was - used on OS X; the bug had appeared in 1.7.8. - - *) Bugfix: alerts "sem_post() failed" might appear in logs. - - *) Bugfix: nginx could not be built with musl libc. - Thanks to James Taylor. - - *) Bugfix: nginx could not be built on Tru64 UNIX. - Thanks to Goetz T. Fischer. - - -Changes with nginx 1.7.9 23 Dec 2014 - - *) Feature: variables support in the "proxy_cache", "fastcgi_cache", - "scgi_cache", and "uwsgi_cache" directives. - - *) Feature: variables support in the "expires" directive. - - *) Feature: loading of secret keys from hardware tokens with OpenSSL - engines. - Thanks to Dmitrii Pichulin. - - *) Feature: the "autoindex_format" directive. - - *) Bugfix: cache revalidation is now only used for responses with 200 - and 206 status codes. - Thanks to Piotr Sikora. - - *) Bugfix: the "TE" client request header line was passed to backends - while proxying. - - *) Bugfix: the "proxy_pass", "fastcgi_pass", "scgi_pass", and - "uwsgi_pass" directives might not work correctly inside the "if" and - "limit_except" blocks. - - *) Bugfix: the "proxy_store" directive with the "on" parameter was - ignored if the "proxy_store" directive with an explicitly specified - file path was used on a previous level. - - *) Bugfix: nginx could not be built with BoringSSL. - Thanks to Lukas Tribus. - - -Changes with nginx 1.7.8 02 Dec 2014 - - *) Change: now the "If-Modified-Since", "If-Range", etc. client request - header lines are passed to a backend while caching if nginx knows in - advance that the response will not be cached (e.g., when using - proxy_cache_min_uses). - - *) Change: now after proxy_cache_lock_timeout nginx sends a request to a - backend with caching disabled; the new directives - "proxy_cache_lock_age", "fastcgi_cache_lock_age", - "scgi_cache_lock_age", and "uwsgi_cache_lock_age" specify a time - after which the lock will be released and another attempt to cache a - response will be made. - - *) Change: the "log_format" directive can now be used only at http - level. - - *) Feature: the "proxy_ssl_certificate", "proxy_ssl_certificate_key", - "proxy_ssl_password_file", "uwsgi_ssl_certificate", - "uwsgi_ssl_certificate_key", and "uwsgi_ssl_password_file" - directives. - Thanks to Piotr Sikora. - - *) Feature: it is now possible to switch to a named location using - "X-Accel-Redirect". - Thanks to Toshikuni Fukaya. - - *) Feature: now the "tcp_nodelay" directive works with SPDY connections. - - *) Feature: new directives in vim syntax highliting scripts. - Thanks to Peter Wu. - - *) Bugfix: nginx ignored the "s-maxage" value in the "Cache-Control" - backend response header line. - Thanks to Piotr Sikora. - - *) Bugfix: in the ngx_http_spdy_module. - Thanks to Piotr Sikora. - - *) Bugfix: in the "ssl_password_file" directive when using OpenSSL - 0.9.8zc, 1.0.0o, 1.0.1j. - - *) Bugfix: alerts "header already sent" appeared in logs if the - "post_action" directive was used; the bug had appeared in 1.5.4. - - *) Bugfix: alerts "the http output chain is empty" might appear in logs - if the "postpone_output 0" directive was used with SSI includes. - - *) Bugfix: in the "proxy_cache_lock" directive with SSI subrequests. - Thanks to Yichun Zhang. - - -Changes with nginx 1.7.7 28 Oct 2014 - - *) Change: now nginx takes into account the "Vary" header line in a - backend response while caching. - - *) Feature: the "proxy_force_ranges", "fastcgi_force_ranges", - "scgi_force_ranges", and "uwsgi_force_ranges" directives. - - *) Feature: the "proxy_limit_rate", "fastcgi_limit_rate", - "scgi_limit_rate", and "uwsgi_limit_rate" directives. - - *) Feature: the "Vary" parameter of the "proxy_ignore_headers", - "fastcgi_ignore_headers", "scgi_ignore_headers", and - "uwsgi_ignore_headers" directives. - - *) Bugfix: the last part of a response received from a backend with - unbufferred proxy might not be sent to a client if "gzip" or "gunzip" - directives were used. - - *) Bugfix: in the "proxy_cache_revalidate" directive. - Thanks to Piotr Sikora. - - *) Bugfix: in error handling. - Thanks to Yichun Zhang and Daniil Bondarev. - - *) Bugfix: in the "proxy_next_upstream_tries" and - "proxy_next_upstream_timeout" directives. - Thanks to Feng Gu. - - *) Bugfix: nginx/Windows could not be built with MinGW-w64 gcc. - Thanks to Kouhei Sutou. - - -Changes with nginx 1.7.6 30 Sep 2014 - - *) Change: the deprecated "limit_zone" directive is not supported - anymore. - - *) Feature: the "limit_conn_zone" and "limit_req_zone" directives now - can be used with combinations of multiple variables. - - *) Bugfix: request body might be transmitted incorrectly when retrying a - FastCGI request to the next upstream server. - - *) Bugfix: in logging to syslog. - - -Changes with nginx 1.7.5 16 Sep 2014 - - *) Security: it was possible to reuse SSL sessions in unrelated contexts - if a shared SSL session cache or the same TLS session ticket key was - used for multiple "server" blocks (CVE-2014-3616). - Thanks to Antoine Delignat-Lavaud. - - *) Change: now the "stub_status" directive does not require a parameter. - - *) Feature: the "always" parameter of the "add_header" directive. - - *) Feature: the "proxy_next_upstream_tries", - "proxy_next_upstream_timeout", "fastcgi_next_upstream_tries", - "fastcgi_next_upstream_timeout", "memcached_next_upstream_tries", - "memcached_next_upstream_timeout", "scgi_next_upstream_tries", - "scgi_next_upstream_timeout", "uwsgi_next_upstream_tries", and - "uwsgi_next_upstream_timeout" directives. - - *) Bugfix: in the "if" parameter of the "access_log" directive. - - *) Bugfix: in the ngx_http_perl_module. - Thanks to Piotr Sikora. - - *) Bugfix: the "listen" directive of the mail proxy module did not allow - to specify more than two parameters. - - *) Bugfix: the "sub_filter" directive did not work with a string to - replace consisting of a single character. - - *) Bugfix: requests might hang if resolver was used and a timeout - occurred during a DNS request. - - *) Bugfix: in the ngx_http_spdy_module when using with AIO. - - *) Bugfix: a segmentation fault might occur in a worker process if the - "set" directive was used to change the "$http_...", "$sent_http_...", - or "$upstream_http_..." variables. - - *) Bugfix: in memory allocation error handling. - Thanks to Markus Linnala and Feng Gu. - - -Changes with nginx 1.7.4 05 Aug 2014 - - *) Security: pipelined commands were not discarded after STARTTLS - command in SMTP proxy (CVE-2014-3556); the bug had appeared in 1.5.6. - Thanks to Chris Boulton. - - *) Change: URI escaping now uses uppercase hexadecimal digits. - Thanks to Piotr Sikora. - - *) Feature: now nginx can be build with BoringSSL and LibreSSL. - Thanks to Piotr Sikora. - - *) Bugfix: requests might hang if resolver was used and a DNS server - returned a malformed response; the bug had appeared in 1.5.8. - - *) Bugfix: in the ngx_http_spdy_module. - Thanks to Piotr Sikora. - - *) Bugfix: the $uri variable might contain garbage when returning errors - with code 400. - Thanks to Sergey Bobrov. - - *) Bugfix: in error handling in the "proxy_store" directive and the - ngx_http_dav_module. - Thanks to Feng Gu. - - *) Bugfix: a segmentation fault might occur if logging of errors to - syslog was used; the bug had appeared in 1.7.1. - - *) Bugfix: the $geoip_latitude, $geoip_longitude, $geoip_dma_code, and - $geoip_area_code variables might not work. - Thanks to Yichun Zhang. - - *) Bugfix: in memory allocation error handling. - Thanks to Tatsuhiko Kubo and Piotr Sikora. - - -Changes with nginx 1.7.3 08 Jul 2014 - - *) Feature: weak entity tags are now preserved on response - modifications, and strong ones are changed to weak. - - *) Feature: cache revalidation now uses If-None-Match header if - possible. - - *) Feature: the "ssl_password_file" directive. - - *) Bugfix: the If-None-Match request header line was ignored if there - was no Last-Modified header in a response returned from cache. - - *) Bugfix: "peer closed connection in SSL handshake" messages were - logged at "info" level instead of "error" while connecting to - backends. - - *) Bugfix: in the ngx_http_dav_module module in nginx/Windows. - - *) Bugfix: SPDY connections might be closed prematurely if caching was - used. - - -Changes with nginx 1.7.2 17 Jun 2014 - - *) Feature: the "hash" directive inside the "upstream" block. - - *) Feature: defragmentation of free shared memory blocks. - Thanks to Wandenberg Peixoto and Yichun Zhang. - - *) Bugfix: a segmentation fault might occur in a worker process if the - default value of the "access_log" directive was used; the bug had - appeared in 1.7.0. - Thanks to Piotr Sikora. - - *) Bugfix: trailing slash was mistakenly removed from the last parameter - of the "try_files" directive. - - *) Bugfix: nginx could not be built on OS X in some cases. - - *) Bugfix: in the ngx_http_spdy_module. - - -Changes with nginx 1.7.1 27 May 2014 - - *) Feature: the "$upstream_cookie_..." variables. - - *) Feature: the $ssl_client_fingerprint variable. - - *) Feature: the "error_log" and "access_log" directives now support - logging to syslog. - - *) Feature: the mail proxy now logs client port on connect. - - *) Bugfix: memory leak if the "ssl_stapling" directive was used. - Thanks to Filipe da Silva. - - *) Bugfix: the "alias" directive used inside a location given by a - regular expression worked incorrectly if the "if" or "limit_except" - directives were used. - - *) Bugfix: the "charset" directive did not set a charset to encoded - backend responses. - - *) Bugfix: a "proxy_pass" directive without URI part might use original - request after the $args variable was set. - Thanks to Yichun Zhang. - - *) Bugfix: in the "none" parameter in the "smtp_auth" directive; the bug - had appeared in 1.5.6. - Thanks to Svyatoslav Nikolsky. - - *) Bugfix: if sub_filter and SSI were used together, then responses - might be transferred incorrectly. - - *) Bugfix: nginx could not be built with the --with-file-aio option on - Linux/aarch64. - - -Changes with nginx 1.7.0 24 Apr 2014 - - *) Feature: backend SSL certificate verification. - - *) Feature: support for SNI while working with SSL backends. - - *) Feature: the $ssl_server_name variable. - - *) Feature: the "if" parameter of the "access_log" directive. - - -Changes with nginx 1.5.13 08 Apr 2014 - - *) Change: improved hash table handling; the default values of the - "variables_hash_max_size" and "types_hash_bucket_size" were changed - to 1024 and 64 respectively. - - *) Feature: the ngx_http_mp4_module now supports the "end" argument. - - *) Feature: byte ranges support in the ngx_http_mp4_module and while - saving responses to cache. - - *) Bugfix: alerts "ngx_slab_alloc() failed: no memory" no longer logged - when using shared memory in the "ssl_session_cache" directive and in - the ngx_http_limit_req_module. - - *) Bugfix: the "underscores_in_headers" directive did not allow - underscore as a first character of a header. - Thanks to Piotr Sikora. - - *) Bugfix: cache manager might hog CPU on exit in nginx/Windows. - - *) Bugfix: nginx/Windows terminated abnormally if the - "ssl_session_cache" directive was used with the "shared" parameter. - - *) Bugfix: in the ngx_http_spdy_module. - - -Changes with nginx 1.5.12 18 Mar 2014 - - *) Security: a heap memory buffer overflow might occur in a worker - process while handling a specially crafted request by - ngx_http_spdy_module, potentially resulting in arbitrary code - execution (CVE-2014-0133). - Thanks to Lucas Molas, researcher at Programa STIC, Fundación Dr. - Manuel Sadosky, Buenos Aires, Argentina. - - *) Feature: the "proxy_protocol" parameters of the "listen" and - "real_ip_header" directives, the $proxy_protocol_addr variable. - - *) Bugfix: in the "fastcgi_next_upstream" directive. - Thanks to Lucas Molas. - - -Changes with nginx 1.5.11 04 Mar 2014 - - *) Security: memory corruption might occur in a worker process on 32-bit - platforms while handling a specially crafted request by - ngx_http_spdy_module, potentially resulting in arbitrary code - execution (CVE-2014-0088); the bug had appeared in 1.5.10. - Thanks to Lucas Molas, researcher at Programa STIC, Fundación Dr. - Manuel Sadosky, Buenos Aires, Argentina. - - *) Feature: the $ssl_session_reused variable. - - *) Bugfix: the "client_max_body_size" directive might not work when - reading a request body using chunked transfer encoding; the bug had - appeared in 1.3.9. - Thanks to Lucas Molas. - - *) Bugfix: a segmentation fault might occur in a worker process when - proxying WebSocket connections. - - *) Bugfix: a segmentation fault might occur in a worker process if the - ngx_http_spdy_module was used on 32-bit platforms; the bug had - appeared in 1.5.10. - - *) Bugfix: the $upstream_status variable might contain wrong data if the - "proxy_cache_use_stale" or "proxy_cache_revalidate" directives were - used. - Thanks to Piotr Sikora. - - *) Bugfix: a segmentation fault might occur in a worker process if - errors with code 400 were redirected to a named location using the - "error_page" directive. - - *) Bugfix: nginx/Windows could not be built with Visual Studio 2013. - - -Changes with nginx 1.5.10 04 Feb 2014 - - *) Feature: the ngx_http_spdy_module now uses SPDY 3.1 protocol. - Thanks to Automattic and MaxCDN for sponsoring this work. - - *) Feature: the ngx_http_mp4_module now skips tracks too short for a - seek requested. - - *) Bugfix: a segmentation fault might occur in a worker process if the - $ssl_session_id variable was used in logs; the bug had appeared in - 1.5.9. - - *) Bugfix: the $date_local and $date_gmt variables used wrong format - outside of the ngx_http_ssi_filter_module. - - *) Bugfix: client connections might be immediately closed if deferred - accept was used; the bug had appeared in 1.3.15. - - *) Bugfix: alerts "getsockopt(TCP_FASTOPEN) ... failed" appeared in logs - during binary upgrade on Linux; the bug had appeared in 1.5.8. - Thanks to Piotr Sikora. - - -Changes with nginx 1.5.9 22 Jan 2014 - - *) Change: now nginx expects escaped URIs in "X-Accel-Redirect" headers. - - *) Feature: the "ssl_buffer_size" directive. - - *) Feature: the "limit_rate" directive can now be used to rate limit - responses sent in SPDY connections. - - *) Feature: the "spdy_chunk_size" directive. - - *) Feature: the "ssl_session_tickets" directive. - Thanks to Dirkjan Bussink. - - *) Bugfix: the $ssl_session_id variable contained full session - serialized instead of just a session id. - Thanks to Ivan Ristić. - - *) Bugfix: nginx incorrectly handled escaped "?" character in the - "include" SSI command. - - *) Bugfix: the ngx_http_dav_module did not unescape destination URI of - the COPY and MOVE methods. - - *) Bugfix: resolver did not understand domain names with a trailing dot. - Thanks to Yichun Zhang. - - *) Bugfix: alerts "zero size buf in output" might appear in logs while - proxying; the bug had appeared in 1.3.9. - - *) Bugfix: a segmentation fault might occur in a worker process if the - ngx_http_spdy_module was used. - - *) Bugfix: proxied WebSocket connections might hang right after - handshake if the select, poll, or /dev/poll methods were used. - - *) Bugfix: the "xclient" directive of the mail proxy module incorrectly - handled IPv6 client addresses. - - -Changes with nginx 1.5.8 17 Dec 2013 - - *) Feature: IPv6 support in resolver. - - *) Feature: the "listen" directive supports the "fastopen" parameter. - Thanks to Mathew Rodley. - - *) Feature: SSL support in the ngx_http_uwsgi_module. - Thanks to Roberto De Ioris. - - *) Feature: vim syntax highlighting scripts were added to contrib. - Thanks to Evan Miller. - - *) Bugfix: a timeout might occur while reading client request body in an - SSL connection using chunked transfer encoding. - - *) Bugfix: the "master_process" directive did not work correctly in - nginx/Windows. - - *) Bugfix: the "setfib" parameter of the "listen" directive might not - work. - - *) Bugfix: in the ngx_http_spdy_module. - - -Changes with nginx 1.5.7 19 Nov 2013 - - *) Security: a character following an unescaped space in a request line - was handled incorrectly (CVE-2013-4547); the bug had appeared in - 0.8.41. - Thanks to Ivan Fratric of the Google Security Team. - - *) Change: a logging level of auth_basic errors about no user/password - provided has been lowered from "error" to "info". - - *) Feature: the "proxy_cache_revalidate", "fastcgi_cache_revalidate", - "scgi_cache_revalidate", and "uwsgi_cache_revalidate" directives. - - *) Feature: the "ssl_session_ticket_key" directive. - Thanks to Piotr Sikora. - - *) Bugfix: the directive "add_header Cache-Control ''" added a - "Cache-Control" response header line with an empty value. - - *) Bugfix: the "satisfy any" directive might return 403 error instead of - 401 if auth_request and auth_basic directives were used. - Thanks to Jan Marc Hoffmann. - - *) Bugfix: the "accept_filter" and "deferred" parameters of the "listen" - directive were ignored for listen sockets created during binary - upgrade. - Thanks to Piotr Sikora. - - *) Bugfix: some data received from a backend with unbufferred proxy - might not be sent to a client immediately if "gzip" or "gunzip" - directives were used. - Thanks to Yichun Zhang. - - *) Bugfix: in error handling in ngx_http_gunzip_filter_module. - - *) Bugfix: responses might hang if the ngx_http_spdy_module was used - with the "auth_request" directive. - - *) Bugfix: memory leak in nginx/Windows. - - -Changes with nginx 1.5.6 01 Oct 2013 - - *) Feature: the "fastcgi_buffering" directive. - - *) Feature: the "proxy_ssl_protocols" and "proxy_ssl_ciphers" - directives. - Thanks to Piotr Sikora. - - *) Feature: optimization of SSL handshakes when using long certificate - chains. - - *) Feature: the mail proxy supports SMTP pipelining. - - *) Bugfix: in the ngx_http_auth_basic_module when using "$apr1$" - password encryption method. - Thanks to Markus Linnala. - - *) Bugfix: in MacOSX, Cygwin, and nginx/Windows incorrect location might - be used to process a request if locations were given using characters - in different cases. - - *) Bugfix: automatic redirect with appended trailing slash for proxied - locations might not work. - - *) Bugfix: in the mail proxy server. - - *) Bugfix: in the ngx_http_spdy_module. - - -Changes with nginx 1.5.5 17 Sep 2013 - - *) Change: now nginx assumes HTTP/1.0 by default if it is not able to - detect protocol reliably. - - *) Feature: the "disable_symlinks" directive now uses O_PATH on Linux. - - *) Feature: now nginx uses EPOLLRDHUP events to detect premature - connection close by clients if the "epoll" method is used. - - *) Bugfix: in the "valid_referers" directive if the "server_names" - parameter was used. - - *) Bugfix: the $request_time variable did not work in nginx/Windows. - - *) Bugfix: in the "image_filter" directive. - Thanks to Lanshun Zhou. - - *) Bugfix: OpenSSL 1.0.1f compatibility. - Thanks to Piotr Sikora. - - -Changes with nginx 1.5.4 27 Aug 2013 - - *) Change: the "js" extension MIME type has been changed to - "application/javascript"; default value of the "charset_types" - directive was changed accordingly. - - *) Change: now the "image_filter" directive with the "size" parameter - returns responses with the "application/json" MIME type. - - *) Feature: the ngx_http_auth_request_module. - - *) Bugfix: a segmentation fault might occur on start or during - reconfiguration if the "try_files" directive was used with an empty - parameter. - - *) Bugfix: memory leak if relative paths were specified using variables - in the "root" or "auth_basic_user_file" directives. - - *) Bugfix: the "valid_referers" directive incorrectly executed regular - expressions if a "Referer" header started with "https://". - Thanks to Liangbin Li. - - *) Bugfix: responses might hang if subrequests were used and an SSL - handshake error happened during subrequest processing. - Thanks to Aviram Cohen. - - *) Bugfix: in the ngx_http_autoindex_module. - - *) Bugfix: in the ngx_http_spdy_module. - - -Changes with nginx 1.5.3 30 Jul 2013 - - *) Change in internal API: now u->length defaults to -1 if working with - backends in unbuffered mode. - - *) Change: now after receiving an incomplete response from a backend - server nginx tries to send an available part of the response to a - client, and then closes client connection. - - *) Bugfix: a segmentation fault might occur in a worker process if the - ngx_http_spdy_module was used with the "client_body_in_file_only" - directive. - - *) Bugfix: the "so_keepalive" parameter of the "listen" directive might - be handled incorrectly on DragonFlyBSD. - Thanks to Sepherosa Ziehau. - - *) Bugfix: in the ngx_http_xslt_filter_module. - - *) Bugfix: in the ngx_http_sub_filter_module. - - -Changes with nginx 1.5.2 02 Jul 2013 - - *) Feature: now several "error_log" directives can be used. - - *) Bugfix: the $r->header_in() embedded perl method did not return value - of the "Cookie" and "X-Forwarded-For" request header lines; the bug - had appeared in 1.3.14. - - *) Bugfix: in the ngx_http_spdy_module. - Thanks to Jim Radford. - - *) Bugfix: nginx could not be built on Linux with x32 ABI. - Thanks to Serguei Ivantsov. - - -Changes with nginx 1.5.1 04 Jun 2013 - - *) Feature: the "ssi_last_modified", "sub_filter_last_modified", and - "xslt_last_modified" directives. - Thanks to Alexey Kolpakov. - - *) Feature: the "http_403" parameter of the "proxy_next_upstream", - "fastcgi_next_upstream", "scgi_next_upstream", and - "uwsgi_next_upstream" directives. - - *) Feature: the "allow" and "deny" directives now support unix domain - sockets. - - *) Bugfix: nginx could not be built with the ngx_mail_ssl_module, but - without ngx_http_ssl_module; the bug had appeared in 1.3.14. - - *) Bugfix: in the "proxy_set_body" directive. - Thanks to Lanshun Zhou. - - *) Bugfix: in the "lingering_time" directive. - Thanks to Lanshun Zhou. - - *) Bugfix: the "fail_timeout" parameter of the "server" directive in the - "upstream" context might not work if "max_fails" parameter was used; - the bug had appeared in 1.3.0. - - *) Bugfix: a segmentation fault might occur in a worker process if the - "ssl_stapling" directive was used. - Thanks to Piotr Sikora. - - *) Bugfix: in the mail proxy server. - Thanks to Filipe Da Silva. - - *) Bugfix: nginx/Windows might stop accepting connections if several - worker processes were used. - - -Changes with nginx 1.5.0 07 May 2013 - - *) Security: a stack-based buffer overflow might occur in a worker - process while handling a specially crafted request, potentially - resulting in arbitrary code execution (CVE-2013-2028); the bug had - appeared in 1.3.9. - Thanks to Greg MacManus, iSIGHT Partners Labs. - - -Changes with nginx 1.4.0 24 Apr 2013 - - *) Bugfix: nginx could not be built with the ngx_http_perl_module if the - --with-openssl option was used; the bug had appeared in 1.3.16. - - *) Bugfix: in a request body handling in the ngx_http_perl_module; the - bug had appeared in 1.3.9. - - -Changes with nginx 1.3.16 16 Apr 2013 - - *) Bugfix: a segmentation fault might occur in a worker process if - subrequests were used; the bug had appeared in 1.3.9. - - *) Bugfix: the "tcp_nodelay" directive caused an error if a WebSocket - connection was proxied into a unix domain socket. - - *) Bugfix: the $upstream_response_length variable has an incorrect value - "0" if buffering was not used. - Thanks to Piotr Sikora. - - *) Bugfix: in the eventport and /dev/poll methods. - - -Changes with nginx 1.3.15 26 Mar 2013 - - *) Change: opening and closing a connection without sending any data in - it is no longer logged to access_log with error code 400. - - *) Feature: the ngx_http_spdy_module. - Thanks to Automattic for sponsoring this work. - - *) Feature: the "limit_req_status" and "limit_conn_status" directives. - Thanks to Nick Marden. - - *) Feature: the "image_filter_interlace" directive. - Thanks to Ian Babrou. - - *) Feature: $connections_waiting variable in the - ngx_http_stub_status_module. - - *) Feature: the mail proxy module now supports IPv6 backends. - - *) Bugfix: request body might be transmitted incorrectly when retrying a - request to the next upstream server; the bug had appeared in 1.3.9. - Thanks to Piotr Sikora. - - *) Bugfix: in the "client_body_in_file_only" directive; the bug had - appeared in 1.3.9. - - *) Bugfix: responses might hang if subrequests were used and a DNS error - happened during subrequest processing. - Thanks to Lanshun Zhou. - - *) Bugfix: in backend usage accounting. - - -Changes with nginx 1.3.14 05 Mar 2013 - - *) Feature: $connections_active, $connections_reading, and - $connections_writing variables in the ngx_http_stub_status_module. - - *) Feature: support of WebSocket connections in the - ngx_http_uwsgi_module and ngx_http_scgi_module. - - *) Bugfix: in virtual servers handling with SNI. - - *) Bugfix: new sessions were not always stored if the "ssl_session_cache - shared" directive was used and there was no free space in shared - memory. - Thanks to Piotr Sikora. - - *) Bugfix: multiple X-Forwarded-For headers were handled incorrectly. - Thanks to Neal Poole for sponsoring this work. - - *) Bugfix: in the ngx_http_mp4_module. - Thanks to Gernot Vormayr. - - -Changes with nginx 1.3.13 19 Feb 2013 - - *) Change: a compiler with name "cc" is now used by default. - - *) Feature: support for proxying of WebSocket connections. - Thanks to Apcera and CloudBees for sponsoring this work. - - *) Feature: the "auth_basic_user_file" directive supports "{SHA}" - password encryption method. - Thanks to Louis Opter. - - -Changes with nginx 1.3.12 05 Feb 2013 - - *) Feature: variables support in the "proxy_bind", "fastcgi_bind", - "memcached_bind", "scgi_bind", and "uwsgi_bind" directives. - - *) Feature: the $pipe, $request_length, $time_iso8601, and $time_local - variables can now be used not only in the "log_format" directive. - Thanks to Kiril Kalchev. - - *) Feature: IPv6 support in the ngx_http_geoip_module. - Thanks to Gregor Kališnik. - - *) Bugfix: in the "proxy_method" directive. - - *) Bugfix: a segmentation fault might occur in a worker process if - resolver was used with the poll method. - - *) Bugfix: nginx might hog CPU during SSL handshake with a backend if - the select, poll, or /dev/poll methods were used. - - *) Bugfix: the "[crit] SSL_write() failed (SSL:)" error. - - *) Bugfix: in the "client_body_in_file_only" directive; the bug had - appeared in 1.3.9. - - *) Bugfix: in the "fastcgi_keep_conn" directive. - - -Changes with nginx 1.3.11 10 Jan 2013 - - *) Bugfix: a segmentation fault might occur if logging was used; the bug - had appeared in 1.3.10. - - *) Bugfix: the "proxy_pass" directive did not work with IP addresses - without port specified; the bug had appeared in 1.3.10. - - *) Bugfix: a segmentation fault occurred on start or during - reconfiguration if the "keepalive" directive was specified more than - once in a single upstream block. - - *) Bugfix: parameter "default" of the "geo" directive did not set - default value for IPv6 addresses. - - -Changes with nginx 1.3.10 25 Dec 2012 - - *) Change: domain names specified in configuration file are now resolved - to IPv6 addresses as well as IPv4 ones. - - *) Change: now if the "include" directive with mask is used on Unix - systems, included files are sorted in alphabetical order. - - *) Change: the "add_header" directive adds headers to 201 responses. - - *) Feature: the "geo" directive now supports IPv6 addresses in CIDR - notation. - - *) Feature: the "flush" and "gzip" parameters of the "access_log" - directive. - - *) Feature: variables support in the "auth_basic" directive. - - *) Bugfix: nginx could not be built with the ngx_http_perl_module in - some cases. - - *) Bugfix: a segmentation fault might occur in a worker process if the - ngx_http_xslt_module was used. - - *) Bugfix: nginx could not be built on MacOSX in some cases. - Thanks to Piotr Sikora. - - *) Bugfix: the "limit_rate" directive with high rates might result in - truncated responses on 32-bit platforms. - Thanks to Alexey Antropov. - - *) Bugfix: a segmentation fault might occur in a worker process if the - "if" directive was used. - Thanks to Piotr Sikora. - - *) Bugfix: a "100 Continue" response was issued with "413 Request Entity - Too Large" responses. - - *) Bugfix: the "image_filter", "image_filter_jpeg_quality" and - "image_filter_sharpen" directives might be inherited incorrectly. - Thanks to Ian Babrou. - - *) Bugfix: "crypt_r() failed" errors might appear if the "auth_basic" - directive was used on Linux. - - *) Bugfix: in backup servers handling. - Thanks to Thomas Chen. - - *) Bugfix: proxied HEAD requests might return incorrect response if the - "gzip" directive was used. - - -Changes with nginx 1.3.9 27 Nov 2012 - - *) Feature: support for chunked transfer encoding while reading client - request body. - - *) Feature: the $request_time and $msec variables can now be used not - only in the "log_format" directive. - - *) Bugfix: cache manager and cache loader processes might not be able to - start if more than 512 listen sockets were used. - - *) Bugfix: in the ngx_http_dav_module. - - -Changes with nginx 1.3.8 30 Oct 2012 - - *) Feature: the "optional_no_ca" parameter of the "ssl_verify_client" - directive. - Thanks to Mike Kazantsev and Eric O'Connor. - - *) Feature: the $bytes_sent, $connection, and $connection_requests - variables can now be used not only in the "log_format" directive. - Thanks to Benjamin Grössing. - - *) Feature: the "auto" parameter of the "worker_processes" directive. - - *) Bugfix: "cache file ... has md5 collision" alert. - - *) Bugfix: in the ngx_http_gunzip_filter_module. - - *) Bugfix: in the "ssl_stapling" directive. - - -Changes with nginx 1.3.7 02 Oct 2012 - - *) Feature: OCSP stapling support. - Thanks to Comodo, DigiCert and GlobalSign for sponsoring this work. - - *) Feature: the "ssl_trusted_certificate" directive. - - *) Feature: resolver now randomly rotates addresses returned from cache. - Thanks to Anton Jouline. - - *) Bugfix: OpenSSL 0.9.7 compatibility. - - -Changes with nginx 1.3.6 12 Sep 2012 - - *) Feature: the ngx_http_gunzip_filter_module. - - *) Feature: the "memcached_gzip_flag" directive. - - *) Feature: the "always" parameter of the "gzip_static" directive. - - *) Bugfix: in the "limit_req" directive; the bug had appeared in 1.1.14. - Thanks to Charles Chen. - - *) Bugfix: nginx could not be built by gcc 4.7 with -O2 optimization if - the --with-ipv6 option was used. - - -Changes with nginx 1.3.5 21 Aug 2012 - - *) Change: the ngx_http_mp4_module module no longer skips tracks in - formats other than H.264 and AAC. - - *) Bugfix: a segmentation fault might occur in a worker process if the - "map" directive was used with variables as values. - - *) Bugfix: 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. - - *) Bugfix: in the -p command-line parameter handling. - - *) Bugfix: in the mail proxy server. - - *) Bugfix: of minor potential bugs. - Thanks to Coverity. - - *) Bugfix: nginx/Windows could not be built with Visual Studio 2005 - Express. - Thanks to HAYASHI Kentaro. - - -Changes with nginx 1.3.4 31 Jul 2012 - - *) Change: the "ipv6only" parameter is now turned on by default for - listening IPv6 sockets. - - *) Feature: the Clang compiler support. - - *) Bugfix: extra listening sockets might be created. - Thanks to Roman Odaisky. - - *) Bugfix: nginx/Windows might hog CPU if a worker process failed to - start. - Thanks to Ricardo Villalobos Guevara. - - *) Bugfix: 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. - - -Changes with nginx 1.3.3 10 Jul 2012 - - *) Feature: entity tags support and the "etag" directive. - - *) Bugfix: trailing dot in a source value was not ignored if the "map" - directive was used with the "hostnames" parameter. - - *) Bugfix: 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. - - -Changes with nginx 1.3.2 26 Jun 2012 - - *) Change: the "single" parameter of the "keepalive" directive is now - ignored. - - *) Change: SSL compression is now disabled when using all versions of - OpenSSL, including ones prior to 1.0.0. - - *) Feature: it is now possible to use the "ip_hash" directive to balance - IPv6 clients. - - *) Feature: the $status variable can now be used not only in the - "log_format" directive. - - *) Bugfix: a segmentation fault might occur in a worker process on - shutdown if the "resolver" directive was used. - - *) Bugfix: a segmentation fault might occur in a worker process if the - ngx_http_mp4_module was used. - - *) Bugfix: in the ngx_http_mp4_module. - - *) Bugfix: a segmentation fault might occur in a worker process if - conflicting wildcard server names were used. - - *) Bugfix: nginx might be terminated abnormally on a SIGBUS signal on - ARM platform. - - *) Bugfix: an alert "sendmsg() failed (9: Bad file number)" on HP-UX - while reconfiguration. - - -Changes with nginx 1.3.1 05 Jun 2012 - - *) Security: now nginx/Windows ignores trailing dot in URI path - component, and does not allow URIs with ":$" in it. - Thanks to Vladimir Kochetkov, Positive Research Center. - - *) Feature: the "proxy_pass", "fastcgi_pass", "scgi_pass", "uwsgi_pass" - directives, and the "server" directive inside the "upstream" block, - now support IPv6 addresses. - - *) Feature: the "resolver" directive now supports IPv6 addresses and an - optional port specification. - - *) Feature: the "least_conn" directive inside the "upstream" block. - - *) Feature: it is now possible to specify a weight for servers while - using the "ip_hash" directive. - - *) Bugfix: a segmentation fault might occur in a worker process if the - "image_filter" directive was used; the bug had appeared in 1.3.0. - - *) Bugfix: nginx could not be built with ngx_cpp_test_module; the bug - had appeared in 1.1.12. - - *) Bugfix: access to variables from SSI and embedded perl module might - not work after reconfiguration. - Thanks to Yichun Zhang. - - *) Bugfix: in the ngx_http_xslt_filter_module. - Thanks to Kuramoto Eiji. - - *) Bugfix: memory leak if $geoip_org variable was used. - Thanks to Denis F. Latypoff. - - *) Bugfix: in the "proxy_cookie_domain" and "proxy_cookie_path" - directives. - - -Changes with nginx 1.3.0 15 May 2012 - - *) Feature: the "debug_connection" directive now supports IPv6 addresses - and the "unix:" parameter. - - *) Feature: the "set_real_ip_from" directive and the "proxy" parameter - of the "geo" directive now support IPv6 addresses. - - *) Feature: the "real_ip_recursive", "geoip_proxy", and - "geoip_proxy_recursive" directives. - - *) Feature: the "proxy_recursive" parameter of the "geo" directive. - - *) Bugfix: a segmentation fault might occur in a worker process if the - "resolver" directive was used. - - *) Bugfix: a segmentation fault might occur in a worker process if the - "fastcgi_pass", "scgi_pass", or "uwsgi_pass" directives were used and - backend returned incorrect response. - - *) Bugfix: a segmentation fault might occur in a worker process if the - "rewrite" directive was used and new request arguments in a - replacement used variables. - - *) Bugfix: nginx might hog CPU if the open file resource limit was - reached. - - *) Bugfix: nginx might loop infinitely over backends if the - "proxy_next_upstream" directive with the "http_404" parameter was - used and there were backup servers specified in an upstream block. - - *) Bugfix: adding the "down" parameter of the "server" directive might - cause unneeded client redistribution among backend servers if the - "ip_hash" directive was used. - - *) Bugfix: socket leak. - Thanks to Yichun Zhang. - - *) Bugfix: in the ngx_http_fastcgi_module. - - -Changes with nginx 1.2.0 23 Apr 2012 - - *) Bugfix: a segmentation fault might occur in a worker process if the - "try_files" directive was used; the bug had appeared in 1.1.19. - - *) Bugfix: response might be truncated if there were more than IOV_MAX - buffers used. - - *) Bugfix: in the "crop" parameter of the "image_filter" directive. - Thanks to Maxim Bublis. - - -Changes with nginx 1.1.19 12 Apr 2012 - - *) Security: specially crafted mp4 file might allow to overwrite memory - locations in a worker process if the ngx_http_mp4_module was used, - potentially resulting in arbitrary code execution (CVE-2012-2089). - Thanks to Matthew Daley. - - *) Bugfix: nginx/Windows might be terminated abnormally. - Thanks to Vincent Lee. - - *) Bugfix: nginx hogged CPU if all servers in an upstream were marked as - "backup". - - *) Bugfix: the "allow" and "deny" directives might be inherited - incorrectly if they were used with IPv6 addresses. - - *) Bugfix: the "modern_browser" and "ancient_browser" directives might - be inherited incorrectly. - - *) Bugfix: timeouts might be handled incorrectly on Solaris/SPARC. - - *) Bugfix: in the ngx_http_mp4_module. - - -Changes with nginx 1.1.18 28 Mar 2012 - - *) Change: keepalive connections are no longer disabled for Safari by - default. - - *) Feature: the $connection_requests variable. - - *) Feature: $tcpinfo_rtt, $tcpinfo_rttvar, $tcpinfo_snd_cwnd and - $tcpinfo_rcv_space variables. - - *) Feature: the "worker_cpu_affinity" directive now works on FreeBSD. - - *) Feature: the "xslt_param" and "xslt_string_param" directives. - Thanks to Samuel Behan. - - *) Bugfix: in configure tests. - Thanks to Piotr Sikora. - - *) Bugfix: in the ngx_http_xslt_filter_module. - - *) Bugfix: nginx could not be built on Debian GNU/Hurd. - - -Changes with nginx 1.1.17 15 Mar 2012 - - *) Security: content of previously freed memory might be sent to a - client if backend returned specially crafted response. - Thanks to Matthew Daley. - - *) Bugfix: in the embedded perl module if used from SSI. - Thanks to Matthew Daley. - - *) Bugfix: in the ngx_http_uwsgi_module. - - -Changes with nginx 1.1.16 29 Feb 2012 - - *) Change: the simultaneous subrequest limit has been raised to 200. - - *) Feature: the "from" parameter of the "disable_symlinks" directive. - - *) Feature: the "return" and "error_page" directives can now be used to - return 307 redirections. - - *) Bugfix: a segmentation fault might occur in a worker process if the - "resolver" directive was used and there was no "error_log" directive - specified at global level. - Thanks to Roman Arutyunyan. - - *) Bugfix: a segmentation fault might occur in a worker process if the - "proxy_http_version 1.1" or "fastcgi_keep_conn on" directives were - used. - - *) Bugfix: memory leaks. - Thanks to Lanshun Zhou. - - *) Bugfix: in the "disable_symlinks" directive. - - *) Bugfix: on ZFS filesystem disk cache size might be calculated - incorrectly; the bug had appeared in 1.0.1. - - *) Bugfix: nginx could not be built by the icc 12.1 compiler. - - *) Bugfix: nginx could not be built by gcc on Solaris; the bug had - appeared in 1.1.15. - - -Changes with nginx 1.1.15 15 Feb 2012 - - *) Feature: the "disable_symlinks" directive. - - *) Feature: the "proxy_cookie_domain" and "proxy_cookie_path" - directives. - - *) Bugfix: nginx might log incorrect error "upstream prematurely closed - connection" instead of correct "upstream sent too big header" one. - Thanks to Feibo Li. - - *) Bugfix: nginx could not be built with the ngx_http_perl_module if the - --with-openssl option was used. - - *) Bugfix: the number of internal redirects to named locations was not - limited. - - *) Bugfix: calling $r->flush() multiple times might cause errors in the - ngx_http_gzip_filter_module. - - *) Bugfix: temporary files might be not removed if the "proxy_store" - directive was used with SSI includes. - - *) Bugfix: in some cases non-cacheable variables (such as the $args - variable) returned old empty cached value. - - *) Bugfix: a segmentation fault might occur in a worker process if too - many SSI subrequests were issued simultaneously; the bug had appeared - in 0.7.25. - - -Changes with nginx 1.1.14 30 Jan 2012 - - *) Feature: multiple "limit_req" limits may be used simultaneously. - - *) Bugfix: in error handling while connecting to a backend. - Thanks to Piotr Sikora. - - *) Bugfix: in AIO error handling on FreeBSD. - - *) Bugfix: in the OpenSSL library initialization. - - *) Bugfix: the "proxy_redirect" directives might be inherited - incorrectly. - - *) Bugfix: memory leak during reconfiguration if the "pcre_jit" - directive was used. - - -Changes with nginx 1.1.13 16 Jan 2012 - - *) Feature: the "TLSv1.1" and "TLSv1.2" parameters of the - "ssl_protocols" directive. - - *) Bugfix: the "limit_req" directive parameters were not inherited - correctly; the bug had appeared in 1.1.12. - - *) Bugfix: the "proxy_redirect" directive incorrectly processed - "Refresh" header if regular expression were used. - - *) Bugfix: the "proxy_cache_use_stale" directive with "error" parameter - did not return answer from cache if there were no live upstreams. - - *) Bugfix: the "worker_cpu_affinity" directive might not work. - - *) Bugfix: nginx could not be built on Solaris; the bug had appeared in - 1.1.12. - - *) Bugfix: in the ngx_http_mp4_module. - - -Changes with nginx 1.1.12 26 Dec 2011 - - *) Change: a "proxy_pass" directive without URI part now uses changed - URI after redirection with the "error_page" directive. - Thanks to Lanshun Zhou. - - *) Feature: the "proxy/fastcgi/scgi/uwsgi_cache_lock", - "proxy/fastcgi/scgi/uwsgi_cache_lock_timeout" directives. - - *) Feature: the "pcre_jit" directive. - - *) Feature: the "if" SSI command supports captures in regular - expressions. - - *) Bugfix: the "if" SSI command did not work inside the "block" command. - - *) Bugfix: the "limit_conn_log_level" and "limit_req_log_level" - directives might not work. - - *) Bugfix: the "limit_rate" directive did not allow to use full - throughput, even if limit value was very high. - - *) Bugfix: the "sendfile_max_chunk" directive did not work, if the - "limit_rate" directive was used. - - *) Bugfix: a "proxy_pass" directive without URI part always used - original request URI if variables were used. - - *) Bugfix: a "proxy_pass" directive without URI part might use original - request after redirection with the "try_files" directive. - Thanks to Lanshun Zhou. - - *) Bugfix: in the ngx_http_scgi_module. - - *) Bugfix: in the ngx_http_mp4_module. - - *) Bugfix: nginx could not be built on Solaris; the bug had appeared in - 1.1.9. - - -Changes with nginx 1.1.11 12 Dec 2011 - - *) Feature: the "so_keepalive" parameter of the "listen" directive. - Thanks to Vsevolod Stakhov. - - *) Feature: the "if_not_empty" parameter of the - "fastcgi/scgi/uwsgi_param" directives. - - *) Feature: the $https variable. - - *) Feature: the "proxy_redirect" directive supports variables in the - first parameter. - - *) Feature: the "proxy_redirect" directive supports regular expressions. - - *) Bugfix: the $sent_http_cache_control variable might contain a wrong - value if the "expires" directive was used. - Thanks to Yichun Zhang. - - *) Bugfix: the "read_ahead" directive might not work combined with - "try_files" and "open_file_cache". - - *) Bugfix: a segmentation fault might occur in a worker process if small - time was used in the "inactive" parameter of the "proxy_cache_path" - directive. - - *) Bugfix: responses from cache might hang. - - -Changes with nginx 1.1.10 30 Nov 2011 - - *) Bugfix: a segmentation fault occurred in a worker process if AIO was - used on Linux; the bug had appeared in 1.1.9. - - -Changes with nginx 1.1.9 28 Nov 2011 - - *) Change: now double quotes are encoded in an "echo" SSI-command - output. - Thanks to Zaur Abasmirzoev. - - *) Feature: the "valid" parameter of the "resolver" directive. By - default TTL returned by a DNS server is used. - Thanks to Kirill A. Korinskiy. - - *) Bugfix: nginx might hang after a worker process abnormal termination. - - *) Bugfix: a segmentation fault might occur in a worker process if SNI - was used; the bug had appeared in 1.1.2. - - *) Bugfix: in the "keepalive_disable" directive; the bug had appeared in - 1.1.8. - Thanks to Alexander Usov. - - *) Bugfix: SIGWINCH signal did not work after first binary upgrade; the - bug had appeared in 1.1.1. - - *) Bugfix: backend responses with length not matching "Content-Length" - header line are no longer cached. - - *) Bugfix: in the "scgi_param" directive, if complex parameters were - used. - - *) Bugfix: in the "epoll" event method. - Thanks to Yichun Zhang. - - *) Bugfix: in the ngx_http_flv_module. - Thanks to Piotr Sikora. - - *) Bugfix: in the ngx_http_mp4_module. - - *) Bugfix: IPv6 addresses are now handled properly in a request line and - in a "Host" request header line. - - *) Bugfix: "add_header" and "expires" directives did not work if a - request was proxied and response status code was 206. - - *) Bugfix: nginx could not be built on FreeBSD 10. - - *) Bugfix: nginx could not be built on AIX. - - -Changes with nginx 1.1.8 14 Nov 2011 - - *) Change: the ngx_http_limit_zone_module was renamed to the - ngx_http_limit_conn_module. - - *) Change: the "limit_zone" directive was superseded by the - "limit_conn_zone" directive with a new syntax. - - *) Feature: support for multiple "limit_conn" limits on the same level. - - *) Feature: the "image_filter_sharpen" directive. - - *) Bugfix: a segmentation fault might occur in a worker process if - resolver got a big DNS response. - Thanks to Ben Hawkes. - - *) Bugfix: in cache key calculation if internal MD5 implementation was - used; the bug had appeared in 1.0.4. - - *) Bugfix: the "If-Modified-Since", "If-Range", etc. client request - header lines might be passed to backend while caching; or not passed - without caching if caching was enabled in another part of the - configuration. - - *) Bugfix: the module ngx_http_mp4_module sent incorrect - "Content-Length" response header line if the "start" argument was - used. - Thanks to Piotr Sikora. - - -Changes with nginx 1.1.7 31 Oct 2011 - - *) Feature: support of several DNS servers in the "resolver" directive. - Thanks to Kirill A. Korinskiy. - - *) Bugfix: a segmentation fault occurred on start or during - reconfiguration if the "ssl" directive was used at http level and - there was no "ssl_certificate" defined. - - *) Bugfix: reduced memory consumption while proxying big files if they - were buffered to disk. - - *) Bugfix: a segmentation fault might occur in a worker process if - "proxy_http_version 1.1" directive was used. - - *) Bugfix: in the "expires @time" directive. - - -Changes with nginx 1.1.6 17 Oct 2011 - - *) Change in internal API: now module context data are cleared while - internal redirect to named location. - Requested by Yichun Zhang. - - *) Change: if a server in an upstream failed, only one request will be - sent to it after fail_timeout; the server will be considered alive if - it will successfully respond to the request. - - *) Change: now the 0x7F-0xFF characters are escaped as \xXX in an - access_log. - - *) Feature: "proxy/fastcgi/scgi/uwsgi_ignore_headers" directives support - the following additional values: X-Accel-Limit-Rate, - X-Accel-Buffering, X-Accel-Charset. - - *) Feature: decrease of memory consumption if SSL is used. - - *) Bugfix: some UTF-8 characters were processed incorrectly. - Thanks to Alexey Kuts. - - *) Bugfix: the ngx_http_rewrite_module directives specified at "server" - level were executed twice if no matching locations were defined. - - *) Bugfix: a socket leak might occurred if "aio sendfile" was used. - - *) Bugfix: connections with fast clients might be closed after - send_timeout if file AIO was used. - - *) Bugfix: in the ngx_http_autoindex_module. - - *) Bugfix: the module ngx_http_mp4_module did not support seeking on - 32-bit platforms. - - -Changes with nginx 1.1.5 05 Oct 2011 - - *) Feature: the "uwsgi_buffering" and "scgi_buffering" directives. - Thanks to Peter Smit. - - *) Bugfix: non-cacheable responses might be cached if - "proxy_cache_bypass" directive was used. - Thanks to John Ferlito. - - *) Bugfix: in HTTP/1.1 support in the ngx_http_proxy_module. - - *) Bugfix: cached responses with an empty body were returned - incorrectly; the bug had appeared in 0.8.31. - - *) Bugfix: 201 responses of the ngx_http_dav_module were incorrect; the - bug had appeared in 0.8.32. - - *) Bugfix: in the "return" directive. - - *) Bugfix: the "ssl_session_cache builtin" directive caused segmentation - fault; the bug had appeared in 1.1.1. - - -Changes with nginx 1.1.4 20 Sep 2011 - - *) Feature: the ngx_http_upstream_keepalive module. - - *) Feature: the "proxy_http_version" directive. - - *) Feature: the "fastcgi_keep_conn" directive. - - *) Feature: the "worker_aio_requests" directive. - - *) Bugfix: if nginx was built --with-file-aio it could not be run on - Linux kernel which did not support AIO. - - *) Bugfix: in Linux AIO error processing. - Thanks to Hagai Avrahami. - - *) Bugfix: reduced memory consumption for long-lived requests. - - *) Bugfix: the module ngx_http_mp4_module did not support 64-bit MP4 - "co64" atom. - - -Changes with nginx 1.1.3 14 Sep 2011 - - *) Feature: the module ngx_http_mp4_module. - - *) Bugfix: in Linux AIO combined with open_file_cache. - - *) Bugfix: open_file_cache did not update file info on retest if file - was not atomically changed. - - *) Bugfix: nginx could not be built on MacOSX 10.7. - - -Changes with nginx 1.1.2 05 Sep 2011 - - *) Change: now if total size of all ranges is greater than source - response size, then nginx disables ranges and returns just the source - response. - - *) Feature: the "max_ranges" directive. - - *) Bugfix: the "ssl_verify_client", "ssl_verify_depth", and - "ssl_prefer_server_ciphers" directives might work incorrectly if SNI - was used. - - *) Bugfix: in the "proxy/fastcgi/scgi/uwsgi_ignore_client_abort" - directives. - - -Changes with nginx 1.1.1 22 Aug 2011 - - *) Change: now cache loader processes either as many files as specified - by "loader_files" parameter or works no longer than time specified by - the "loader_threshold" parameter during each iteration. - - *) Change: now SIGWINCH signal works only in daemon mode. - - *) Feature: now shared zones and caches use POSIX semaphores on Solaris. - Thanks to Den Ivanov. - - *) Feature: accept filters are now supported on NetBSD. - - *) Bugfix: nginx could not be built on Linux 3.0. - - *) Bugfix: nginx did not use gzipping in some cases; the bug had - appeared in 1.1.0. - - *) Bugfix: request body might be processed incorrectly if client used - pipelining. - - *) Bugfix: in the "request_body_in_single_buf" directive. - - *) Bugfix: in "proxy_set_body" and "proxy_pass_request_body" directives - if SSL connection to backend was used. - - *) Bugfix: nginx hogged CPU if all servers in an upstream were marked as - "down". - - *) Bugfix: a segmentation fault might occur during reconfiguration if - ssl_session_cache was defined but not used in previous configuration. - - *) Bugfix: a segmentation fault might occur in a worker process if many - backup servers were used in an upstream. - - *) Bugfix: a segmentation fault might occur in a worker process if - "fastcgi/scgi/uwsgi_param" directives were used with values starting - with "HTTP_"; the bug had appeared in 0.8.40. - - -Changes with nginx 1.1.0 01 Aug 2011 - - *) Feature: cache loader run time decrease. - - *) Feature: "loader_files", "loader_sleep", and "loader_threshold" - options of the "proxy/fastcgi/scgi/uwsgi_cache_path" directives. - - *) Feature: loading time decrease of configuration with large number of - HTTPS sites. - - *) Feature: now nginx supports ECDHE key exchange ciphers. - Thanks to Adrian Kotelba. - - *) Feature: the "lingering_close" directive. - Thanks to Maxim Dounin. - - *) Bugfix: in closing connection for pipelined requests. - Thanks to Maxim Dounin. - - *) Bugfix: nginx did not disable gzipping if client sent "gzip;q=0" in - "Accept-Encoding" request header line. - - *) Bugfix: in timeout in unbuffered proxied mode. - Thanks to Maxim Dounin. - - *) Bugfix: memory leaks when a "proxy_pass" directive contains variables - and proxies to an HTTPS backend. - Thanks to Maxim Dounin. - - *) Bugfix: in parameter validation of a "proxy_pass" directive with - variables. - Thanks to Lanshun Zhou. - - *) Bugfix: SSL did not work on QNX. - Thanks to Maxim Dounin. - - *) Bugfix: SSL modules could not be built by gcc 4.6 without - --with-debug option. - - -Changes with nginx 1.0.5 19 Jul 2011 - - *) Change: now default SSL ciphers are "HIGH:!aNULL:!MD5". - Thanks to Rob Stradling. - - *) Feature: the "referer_hash_max_size" and "referer_hash_bucket_size" - directives. - Thanks to Witold Filipczyk. - - *) Feature: $uid_reset variable. - - *) Bugfix: a segmentation fault might occur in a worker process, if a - caching was used. - Thanks to Lanshun Zhou. - - *) Bugfix: worker processes may got caught in an endless loop during - reconfiguration, if a caching was used; the bug had appeared in - 0.8.48. - Thanks to Maxim Dounin. - - *) Bugfix: "stalled cache updating" alert. - Thanks to Maxim Dounin. - - -Changes with nginx 1.0.4 01 Jun 2011 - - *) Change: now regular expressions case sensitivity in the "map" - directive is given by prefixes "~" or "~*". - - *) Feature: now shared zones and caches use POSIX semaphores on Linux. - Thanks to Denis F. Latypoff. - - *) Bugfix: "stalled cache updating" alert. - - *) Bugfix: nginx could not be built --without-http_auth_basic_module; - the bug had appeared in 1.0.3. - - -Changes with nginx 1.0.3 25 May 2011 - - *) Feature: the "auth_basic_user_file" directive supports "$apr1", - "{PLAIN}", and "{SSHA}" password encryption methods. - Thanks to Maxim Dounin. - - *) Feature: the "geoip_org" directive and $geoip_org variable. - Thanks to Alexander Uskov, Arnaud Granal, and Denis F. Latypoff. - - *) Feature: ngx_http_geo_module and ngx_http_geoip_module support IPv4 - addresses mapped to IPv6 addresses. - - *) Bugfix: a segmentation fault occurred in a worker process during - testing IPv4 address mapped to IPv6 address, if access or deny rules - were defined only for IPv6; the bug had appeared in 0.8.22. - - *) Bugfix: a cached response may be broken if "proxy/fastcgi/scgi/ - uwsgi_cache_bypass" and "proxy/fastcgi/scgi/uwsgi_no_cache" directive - values were different; the bug had appeared in 0.8.46. - - -Changes with nginx 1.0.2 10 May 2011 - - *) Feature: now shared zones and caches use POSIX semaphores. - - *) Bugfix: in the "rotate" parameter of the "image_filter" directive. - Thanks to Adam Bocim. - - *) Bugfix: nginx could not be built on Solaris; the bug had appeared in - 1.0.1. - - -Changes with nginx 1.0.1 03 May 2011 - - *) Change: now the "split_clients" directive uses MurmurHash2 algorithm - because of better distribution. - Thanks to Oleg Mamontov. - - *) Change: now long strings starting with zero are not considered as - false values. - Thanks to Maxim Dounin. - - *) Change: now nginx uses a default listen backlog value 511 on Linux. - - *) Feature: the $upstream_... variables may be used in the SSI and perl - modules. - - *) Bugfix: now nginx limits better disk cache size. - Thanks to Oleg Mamontov. - - *) Bugfix: a segmentation fault might occur while parsing incorrect IPv4 - address; the bug had appeared in 0.9.3. - Thanks to Maxim Dounin. - - *) Bugfix: nginx could not be built by gcc 4.6 without --with-debug - option. - - *) Bugfix: nginx could not be built on Solaris 9 and earlier; the bug - had appeared in 0.9.3. - Thanks to Dagobert Michelsen. - - *) Bugfix: $request_time variable had invalid values if subrequests were - used; the bug had appeared in 0.8.47. - Thanks to Igor A. Valcov. - - -Changes with nginx 1.0.0 12 Apr 2011 - - *) Bugfix: a cache manager might hog CPU after reload. - Thanks to Maxim Dounin. - - *) Bugfix: an "image_filter crop" directive worked incorrectly coupled - with an "image_filter rotate 180" directive. - - *) Bugfix: a "satisfy any" directive disabled custom 401 error page. - - -Changes with nginx 0.9.7 04 Apr 2011 - - *) Feature: now keepalive connections may be closed premature, if there - are no free worker connections. - Thanks to Maxim Dounin. - - *) Feature: the "rotate" parameter of the "image_filter" directive. - Thanks to Adam Bocim. - - *) Bugfix: a case when a backend in "fastcgi_pass", "scgi_pass", or - "uwsgi_pass" directives is given by expression and refers to a - defined upstream. - - -Changes with nginx 0.9.6 21 Mar 2011 - - *) Feature: the "map" directive supports regular expressions as value of - the first parameter. - - *) Feature: $time_iso8601 access_log variable. - Thanks to Michael Lustfield. - - -Changes with nginx 0.9.5 21 Feb 2011 - - *) Change: now nginx uses a default listen backlog value -1 on Linux. - Thanks to Andrei Nigmatulin. - - *) Feature: the "utf8" parameter of "geoip_country" and "geoip_city" - directives. - Thanks to Denis F. Latypoff. - - *) Bugfix: in a default "proxy_redirect" directive if "proxy_pass" - directive has no URI part. - Thanks to Maxim Dounin. - - *) Bugfix: an "error_page" directive did not work with nonstandard error - codes; the bug had appeared in 0.8.53. - Thanks to Maxim Dounin. - - -Changes with nginx 0.9.4 21 Jan 2011 - - *) Feature: the "server_name" directive supports the $hostname variable. - - *) Feature: 494 code for "Request Header Too Large" error. - - -Changes with nginx 0.9.3 13 Dec 2010 - - *) Bugfix: if there was a single server for given IPv6 address:port - pair, then captures in regular expressions in a "server_name" - directive did not work. - - *) Bugfix: nginx could not be built on Solaris; the bug had appeared in - 0.9.0. - - -Changes with nginx 0.9.2 06 Dec 2010 - - *) Feature: the "If-Unmodified-Since" client request header line - support. - - *) Workaround: fallback to accept() syscall if accept4() was not - implemented; the issue had appeared in 0.9.0. - - *) Bugfix: nginx could not be built on Cygwin; the bug had appeared in - 0.9.0. - - *) Bugfix: for OpenSSL vulnerability CVE-2010-4180. - Thanks to Maxim Dounin. - - -Changes with nginx 0.9.1 30 Nov 2010 - - *) Bugfix: "return CODE message" directives did not work; the bug had - appeared in 0.9.0. - - -Changes with nginx 0.9.0 29 Nov 2010 - - *) Feature: the "keepalive_disable" directive. - - *) Feature: the "map" directive supports variables as value of a defined - variable. - - *) Feature: the "map" directive supports empty strings as value of the - first parameter. - - *) Feature: the "map" directive supports expressions as the first - parameter. - - *) Feature: nginx(8) manual page. - Thanks to Sergey Osokin. - - *) Feature: Linux accept4() support. - Thanks to Simon Liu. - - *) Workaround: elimination of Linux linker warning about "sys_errlist" - and "sys_nerr"; the warning had appeared in 0.8.35. - - *) Bugfix: a segmentation fault might occur in a worker process, if the - "auth_basic" directive was used. - Thanks to Michail Laletin. - - *) Bugfix: compatibility with ngx_http_eval_module; the bug had appeared - in 0.8.42. - - -Changes with nginx 0.8.53 18 Oct 2010 - - *) Feature: now the "error_page" directive allows to change a status - code in a redirect. - - *) Feature: the "gzip_disable" directive supports special "degradation" - mask. - - *) Bugfix: a socket leak might occurred if file AIO was used. - Thanks to Maxim Dounin. - - *) Bugfix: if the first server had no "listen" directive and there was - no explicit default server, then a next server with a "listen" - directive became the default server; the bug had appeared in 0.8.21. - - -Changes with nginx 0.8.52 28 Sep 2010 - - *) Bugfix: nginx used SSL mode for a listen socket if any listen option - was set; the bug had appeared in 0.8.51. - - -Changes with nginx 0.8.51 27 Sep 2010 - - *) Change: the "secure_link_expires" directive has been canceled. - - *) Change: a logging level of resolver errors has been lowered from - "alert" to "error". - - *) Feature: now a listen socket "ssl" parameter may be set several - times. - - -Changes with nginx 0.8.50 02 Sep 2010 - - *) Feature: the "secure_link", "secure_link_md5", and - "secure_link_expires" directives of the ngx_http_secure_link_module. - - *) Feature: the -q switch. - Thanks to Gena Makhomed. - - *) Bugfix: worker processes may got caught in an endless loop during - reconfiguration, if a caching was used; the bug had appeared in - 0.8.48. - - *) Bugfix: in the "gzip_disable" directive. - Thanks to Derrick Petzold. - - *) Bugfix: nginx/Windows could not send stop, quit, reopen, and reload - signals to a process run in other session. - - -Changes with nginx 0.8.49 09 Aug 2010 - - *) Feature: the "image_filter_jpeg_quality" directive supports - variables. - - *) Bugfix: a segmentation fault might occur in a worker process, if the - $geoip_region_name variables was used; the bug had appeared in - 0.8.48. - - *) Bugfix: errors intercepted by error_page were cached only for next - request; the bug had appeared in 0.8.48. - - -Changes with nginx 0.8.48 03 Aug 2010 - - *) Change: now the "server_name" directive default value is an empty - name "". - Thanks to Gena Makhomed. - - *) Change: now the "server_name_in_redirect" directive default value is - "off". - - *) Feature: the $geoip_dma_code, $geoip_area_code, and - $geoip_region_name variables. - Thanks to Christine McGonagle. - - *) Bugfix: the "proxy_pass", "fastcgi_pass", "uwsgi_pass", and - "scgi_pass" directives were not inherited inside "limit_except" - blocks. - - *) Bugfix: the "proxy_cache_min_uses", "fastcgi_cache_min_uses" - "uwsgi_cache_min_uses", and "scgi_cache_min_uses" directives did not - work; the bug had appeared in 0.8.46. - - *) Bugfix: the "fastcgi_split_path_info" directive used incorrectly - captures, if only parts of an URI were captured. - Thanks to Yuriy Taraday and Frank Enderle. - - *) Bugfix: the "rewrite" directive did not escape a ";" character during - copying from URI to query string. - Thanks to Daisuke Murase. - - *) Bugfix: the ngx_http_image_filter_module closed a connection, if an - image was larger than "image_filter_buffer" size. - - -Changes with nginx 0.8.47 28 Jul 2010 - - *) Bugfix: $request_time variable had invalid values for subrequests. - - *) Bugfix: errors intercepted by error_page could not be cached. - - *) Bugfix: a cache manager process may got caught in an endless loop, if - max_size parameter was used; the bug had appeared in 0.8.46. - - -Changes with nginx 0.8.46 19 Jul 2010 - - *) Change: now the "proxy_no_cache", "fastcgi_no_cache", - "uwsgi_no_cache", and "scgi_no_cache" directives affect on a cached - response saving only. - - *) Feature: the "proxy_cache_bypass", "fastcgi_cache_bypass", - "uwsgi_cache_bypass", and "scgi_cache_bypass" directives. - - *) Bugfix: nginx did not free memory in cache keys zones if there was an - error during working with backend: the memory was freed only after - inactivity time or on memory low condition. - - -Changes with nginx 0.8.45 13 Jul 2010 - - *) Feature: ngx_http_xslt_filter improvements. - Thanks to Laurence Rowe. - - *) Bugfix: SSI response might be truncated after include with - wait="yes"; the bug had appeared in 0.7.25. - Thanks to Maxim Dounin. - - *) Bugfix: the "listen" directive did not support the "setfib=0" - parameter. - - -Changes with nginx 0.8.44 05 Jul 2010 - - *) Change: now nginx does not cache by default backend responses, if - they have a "Set-Cookie" header line. - - *) Feature: the "listen" directive supports the "setfib" parameter. - Thanks to Andrew Filonov. - - *) Bugfix: the "sub_filter" directive might change character case on - partial match. - - *) Bugfix: compatibility with HP/UX. - - *) Bugfix: compatibility with AIX xlC_r compiler. - - *) Bugfix: nginx treated large SSLv2 packets as plain requests. - Thanks to Miroslaw Jaworski. - - -Changes with nginx 0.8.43 30 Jun 2010 - - *) Feature: large geo ranges base loading speed-up. - - *) Bugfix: an error_page redirection to "location /zero {return 204;}" - without changing status code kept the error body; the bug had - appeared in 0.8.42. - - *) Bugfix: nginx might close IPv6 listen socket during reconfiguration. - Thanks to Maxim Dounin. - - *) Bugfix: the $uid_set variable may be used at any request processing - stage. - - -Changes with nginx 0.8.42 21 Jun 2010 - - *) Change: now nginx tests locations given by regular expressions, if - request was matched exactly by a location given by a prefix string. - The previous behavior has been introduced in 0.7.1. - - *) Feature: the ngx_http_scgi_module. - Thanks to Manlio Perillo. - - *) Feature: a text answer may be added to a "return" directive. - - -Changes with nginx 0.8.41 15 Jun 2010 - - *) Security: nginx/Windows worker might be terminated abnormally if a - requested file name has invalid UTF-8 encoding. - - *) Change: now nginx allows to use spaces in a request line. - - *) Bugfix: the "proxy_redirect" directive changed incorrectly a backend - "Refresh" response header line. - Thanks to Andrey Andreew and Max Sogin. - - *) Bugfix: nginx did not support path without host name in "Destination" - request header line. - - -Changes with nginx 0.8.40 07 Jun 2010 - - *) Security: now nginx/Windows ignores default file stream name. - Thanks to Jose Antonio Vazquez Gonzalez. - - *) Feature: the ngx_http_uwsgi_module. - Thanks to Roberto De Ioris. - - *) Feature: a "fastcgi_param" directive with value starting with "HTTP_" - overrides a client request header line. - - *) Bugfix: the "If-Modified-Since", "If-Range", etc. client request - header lines were passed to FastCGI-server while caching. - - *) Bugfix: listen unix domain socket could not be changed during - reconfiguration. - Thanks to Maxim Dounin. - - -Changes with nginx 0.8.39 31 May 2010 - - *) Bugfix: an inherited "alias" directive worked incorrectly in - inclusive location. - - *) Bugfix: in "alias" with variables and "try_files" directives - combination. - - *) Bugfix: listen unix domain and IPv6 sockets did not inherit while - online upgrade. - Thanks to Maxim Dounin. - - -Changes with nginx 0.8.38 24 May 2010 - - *) Feature: the "proxy_no_cache" and "fastcgi_no_cache" directives. - - *) Feature: now the "rewrite" directive does a redirect automatically if - the $scheme variable is used. - Thanks to Piotr Sikora. - - *) Bugfix: now "limit_req" delay directive conforms to the described - algorithm. - Thanks to Maxim Dounin. - - *) Bugfix: the $uid_got variable might not be used in the SSI and perl - modules. - - -Changes with nginx 0.8.37 17 May 2010 - - *) Feature: the ngx_http_split_clients_module. - - *) Feature: the "map" directive supports keys more than 255 characters. - - *) Bugfix: nginx ignored the "private" and "no-store" values in the - "Cache-Control" backend response header line. - - *) Bugfix: a "stub" parameter of an "include" SSI directive was not - used, if empty response has 200 status code. - - *) Bugfix: if a proxied or FastCGI request was internally redirected to - another proxied or FastCGI location, then a segmentation fault might - occur in a worker process; the bug had appeared in 0.8.33. - Thanks to Yichun Zhang. - - *) Bugfix: IMAP connections may hang until they timed out while talking - to Zimbra server. - Thanks to Alan Batie. - - -Changes with nginx 0.8.36 22 Apr 2010 - - *) Bugfix: the ngx_http_dav_module handled incorrectly the DELETE, COPY, - and MOVE methods for symlinks. - - *) Bugfix: values of the $query_string, $arg_..., etc. variables cached - in main request were used by the SSI module in subrequests. - - *) Bugfix: a variable value was repeatedly encoded after each an "echo" - SSI-command output; the bug had appeared in 0.6.14. - - *) Bugfix: a worker process hung if a FIFO file was requested. - Thanks to Vicente Aguilar and Maxim Dounin. - - *) Bugfix: OpenSSL-1.0.0 compatibility on 64-bit Linux. - Thanks to Maxim Dounin. - - *) Bugfix: nginx could not be built --without-http-cache; the bug had - appeared in 0.8.35. - - -Changes with nginx 0.8.35 01 Apr 2010 - - *) Change: now the charset filter runs before the SSI filter. - - *) Feature: the "chunked_transfer_encoding" directive. - - *) Bugfix: an "&" character was not escaped when it was copied in - arguments part in a rewrite rule. - - *) Bugfix: nginx might be terminated abnormally while a signal - processing or if the directive "timer_resolution" was used on - platforms which do not support kqueue or eventport notification - methods. - Thanks to George Xie and Maxim Dounin. - - *) Bugfix: if temporary files and permanent storage area resided at - different file systems, then permanent file modification times were - incorrect. - Thanks to Maxim Dounin. - - *) Bugfix: ngx_http_memcached_module might issue the error message - "memcached sent invalid trailer". - Thanks to Maxim Dounin. - - *) Bugfix: nginx could not built zlib-1.2.4 library using the library - sources. - Thanks to Maxim Dounin. - - *) Bugfix: a segmentation fault occurred in a worker process, if there - was large stderr output before FastCGI response; the bug had appeared - in 0.8.34. - Thanks to Maxim Dounin. - - -Changes with nginx 0.8.34 03 Mar 2010 - - *) Bugfix: nginx did not support all ciphers and digests used in client - certificates. - Thanks to Innocenty Enikeew. - - *) Bugfix: nginx cached incorrectly FastCGI responses if there was large - stderr output before response. - - *) Bugfix: nginx did not support HTTPS referrers. - - *) Bugfix: nginx/Windows might not find file if path in configuration - was given in other character case; the bug had appeared in 0.8.33. - - *) Bugfix: the $date_local variable has an incorrect value, if the "%s" - format was used. - Thanks to Maxim Dounin. - - *) Bugfix: if ssl_session_cache was not set or was set to "none", then - during client certificate verify the error "session id context - uninitialized" might occur; the bug had appeared in 0.7.1. - - *) Bugfix: a geo range returned default value if the range included two - or more /16 networks and did not begin at /16 network boundary. - - *) Bugfix: a block used in a "stub" parameter of an "include" SSI - directive was output with "text/plain" MIME type. - - *) Bugfix: $r->sleep() did not work; the bug had appeared in 0.8.11. - - -Changes with nginx 0.8.33 01 Feb 2010 - - *) Security: now nginx/Windows ignores trailing spaces in URI. - Thanks to Dan Crowley, Core Security Technologies. - - *) Security: now nginx/Windows ignores short files names. - Thanks to Dan Crowley, Core Security Technologies. - - *) Change: now keepalive connections after POST requests are not - disabled for MSIE 7.0+. - Thanks to Adam Lounds. - - *) Workaround: now keepalive connections are disabled for Safari. - Thanks to Joshua Sierles. - - *) Bugfix: if a proxied or FastCGI request was internally redirected to - another proxied or FastCGI location, then $upstream_response_time - variable may have abnormally large value; the bug had appeared in - 0.8.7. - - *) Bugfix: a segmentation fault might occur in a worker process, while - discarding a request body; the bug had appeared in 0.8.11. - - -Changes with nginx 0.8.32 11 Jan 2010 - - *) Bugfix: UTF-8 encoding usage in the ngx_http_autoindex_module. - Thanks to Maxim Dounin. - - *) Bugfix: regular expression named captures worked for two names only. - Thanks to Maxim Dounin. - - *) Bugfix: now the "localhost" name is used in the "Host" request header - line, if an unix domain socket is defined in the "auth_http" - directive. - Thanks to Maxim Dounin. - - *) Bugfix: nginx did not support chunked transfer encoding for 201 - responses. - Thanks to Julian Reich. - - *) Bugfix: if the "expires modified" set date in the past, then a - negative number was set in the "Cache-Control" response header line. - Thanks to Alex Kapranoff. - - -Changes with nginx 0.8.31 23 Dec 2009 - - *) Feature: now the "error_page" directive may redirect the 301 and 302 - responses. - - *) Feature: the $geoip_city_continent_code, $geoip_latitude, and - $geoip_longitude variables. - Thanks to Arvind Sundararajan. - - *) Feature: now the ngx_http_image_filter_module deletes always EXIF and - other application specific data if the data consume more than 5% of a - JPEG file. - - *) Bugfix: nginx closed a connection if a cached response had an empty - body. - Thanks to Piotr Sikora. - - *) Bugfix: nginx might not be built by gcc 4.x if the -O2 or higher - optimization option was used. - Thanks to Maxim Dounin and Denis F. Latypoff. - - *) Bugfix: regular expressions in location were always tested in - case-sensitive mode; the bug had appeared in 0.8.25. - - *) Bugfix: nginx cached a 304 response if there was the "If-None-Match" - header line in a proxied request. - Thanks to Tim Dettrick and David Kostal. - - *) Bugfix: nginx/Windows tried to delete a temporary file twice if the - file should replace an already existent file. - - -Changes with nginx 0.8.30 15 Dec 2009 - - *) Change: now the default buffer size of the - "large_client_header_buffers" directive is 8K. - Thanks to Andrew Cholakian. - - *) Feature: the conf/fastcgi.conf for simple FastCGI configurations. - - *) Bugfix: nginx/Windows tried to rename a temporary file twice if the - file should replace an already existent file. - - *) Bugfix: of "double free or corruption" error issued if host could not - be resolved; the bug had appeared in 0.8.22. - Thanks to Konstantin Svist. - - *) Bugfix: in libatomic usage on some platforms. - Thanks to W-Mark Kubacki. - - -Changes with nginx 0.8.29 30 Nov 2009 - - *) Change: now the "009" status code is written to an access log for - proxied HTTP/0.9 responses. - - *) Feature: the "addition_types", "charset_types", "gzip_types", - "ssi_types", "sub_filter_types", and "xslt_types" directives support - an "*" parameter. - - *) Feature: GCC 4.1+ built-in atomic operations usage. - Thanks to W-Mark Kubacki. - - *) Feature: the --with-libatomic[=DIR] option in the configure. - Thanks to W-Mark Kubacki. - - *) Bugfix: listen unix domain socket had limited access rights. - - *) Bugfix: cached HTTP/0.9 responses were handled incorrectly. - - *) Bugfix: regular expression named captures given by "?P<...>" did not - work in a "server_name" directive. - Thanks to Maxim Dounin. - - -Changes with nginx 0.8.28 23 Nov 2009 - - *) Bugfix: nginx could not be built with the --without-pcre parameter; - the bug had appeared in 0.8.25. - - -Changes with nginx 0.8.27 17 Nov 2009 - - *) Bugfix: regular expressions did not work in nginx/Windows; the bug - had appeared in 0.8.25. - - -Changes with nginx 0.8.26 16 Nov 2009 - - *) Bugfix: in captures usage in "rewrite" directive; the bug had - appeared in 0.8.25. - - *) Bugfix: nginx could not be built without the --with-debug option; the - bug had appeared in 0.8.25. - - -Changes with nginx 0.8.25 16 Nov 2009 - - *) Change: now no message is written in an error log if a variable is - not found by $r->variable() method. - - *) Feature: the ngx_http_degradation_module. - - *) Feature: regular expression named captures. - - *) Feature: now URI part is not required a "proxy_pass" directive if - variables are used. - - *) Feature: now the "msie_padding" directive works for Chrome too. - - *) Bugfix: a segmentation fault occurred in a worker process on low - memory condition; the bug had appeared in 0.8.18. - - *) Bugfix: nginx sent gzipped responses to clients those do not support - gzip, if "gzip_static on" and "gzip_vary off"; the bug had appeared - in 0.8.16. - - -Changes with nginx 0.8.24 11 Nov 2009 - - *) Bugfix: nginx always added "Content-Encoding: gzip" response header - line in 304 responses sent by ngx_http_gzip_static_module. - - *) Bugfix: nginx could not be built without the --with-debug option; the - bug had appeared in 0.8.23. - - *) Bugfix: the "unix:" parameter of the "set_real_ip_from" directive - inherited incorrectly from previous level. - - *) Bugfix: in resolving empty name. - - -Changes with nginx 0.8.23 11 Nov 2009 - - *) Security: now SSL/TLS renegotiation is disabled. - Thanks to Maxim Dounin. - - *) Bugfix: listen unix domain socket did not inherit while online - upgrade. - - *) Bugfix: the "unix:" parameter of the "set_real_ip_from" directive did - not without yet another directive with any IP address. - - *) Bugfix: segmentation fault and infinite looping in resolver. - - *) Bugfix: in resolver. - Thanks to Artem Bokhan. - - -Changes with nginx 0.8.22 03 Nov 2009 - - *) Feature: the "proxy_bind", "fastcgi_bind", and "memcached_bind" - directives. - - *) Feature: the "access" and the "deny" directives support IPv6. - - *) Feature: the "set_real_ip_from" directive supports IPv6 addresses in - request headers. - - *) Feature: the "unix:" parameter of the "set_real_ip_from" directive. - - *) Bugfix: nginx did not delete unix domain socket after configuration - testing. - - *) Bugfix: nginx deleted unix domain socket while online upgrade. - - *) Bugfix: the "!-x" operator did not work. - Thanks to Maxim Dounin. - - *) Bugfix: a segmentation fault might occur in a worker process, if - limit_rate was used in HTTPS server. - Thanks to Maxim Dounin. - - *) Bugfix: a segmentation fault might occur in a worker process while - $limit_rate logging. - Thanks to Maxim Dounin. - - *) Bugfix: a segmentation fault might occur in a worker process, if - there was no "listen" directive in "server" block; the bug had - appeared in 0.8.21. - - -Changes with nginx 0.8.21 26 Oct 2009 - - *) Feature: now the "-V" switch shows TLS SNI support. - - *) Feature: the "listen" directive of the HTTP module supports unix - domain sockets. - Thanks to Hongli Lai. - - *) Feature: the "default_server" parameter of the "listen" directive. - - *) Feature: now a "default" parameter is not required to set listen - socket options. - - *) Bugfix: nginx did not support dates in 2038 year on 32-bit platforms; - - *) Bugfix: socket leak; the bug had appeared in 0.8.11. - - -Changes with nginx 0.8.20 14 Oct 2009 - - *) Change: now default SSL ciphers are "HIGH:!ADH:!MD5". - - *) Bugfix: the ngx_http_autoindex_module did not show the trailing slash - in links to a directory; the bug had appeared in 0.7.15. - - *) Bugfix: nginx did not close a log file set by the --error-log-path - configuration option; the bug had appeared in 0.7.53. - - *) Bugfix: nginx did not treat a comma as separator in the - "Cache-Control" backend response header line. - - *) Bugfix: nginx/Windows might not create temporary file, a cache file, - or "proxy/fastcgi_store"d file if a worker had no enough access - rights for top level directories. - - *) Bugfix: the "Set-Cookie" and "P3P" FastCGI response header lines were - not hidden while caching if no "fastcgi_hide_header" directives were - used with any parameters. - - *) Bugfix: nginx counted incorrectly disk cache size. - - -Changes with nginx 0.8.19 06 Oct 2009 - - *) Change: now SSLv2 protocol is disabled by default. - - *) Change: now default SSL ciphers are "ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM". - - *) Bugfix: a "limit_req" directive did not work; the bug had appeared in - 0.8.18. - - -Changes with nginx 0.8.18 06 Oct 2009 - - *) Feature: the "read_ahead" directive. - - *) Feature: now several "perl_modules" directives may be used. - - *) Feature: the "limit_req_log_level" and "limit_conn_log_level" - directives. - - *) Bugfix: now "limit_req" directive conforms to the leaky bucket - algorithm. - Thanks to Maxim Dounin. - - *) Bugfix: nginx did not work on Linux/sparc. - Thanks to Marcus Ramberg. - - *) Bugfix: nginx sent '\0' in a "Location" response header line on MKCOL - request. - Thanks to Xie Zhenye. - - *) Bugfix: zero status code was logged instead of 499 status code; the - bug had appeared in 0.8.11. - - *) Bugfix: socket leak; the bug had appeared in 0.8.11. - - -Changes with nginx 0.8.17 28 Sep 2009 - - *) Security: now "/../" are disabled in "Destination" request header - line. - - *) Change: now $host variable value is always low case. - - *) Feature: the $ssl_session_id variable. - - *) Bugfix: socket leak; the bug had appeared in 0.8.11. - - -Changes with nginx 0.8.16 22 Sep 2009 - - *) Feature: the "image_filter_transparency" directive. - - *) Bugfix: "addition_types" directive was incorrectly named - "addtion_types". - - *) Bugfix: resolver cache poisoning. - Thanks to Matthew Dempsky. - - *) Bugfix: memory leak in resolver. - Thanks to Matthew Dempsky. - - *) Bugfix: invalid request line in $request variable was written in - access_log only if error_log was set to "info" or "debug" level. - - *) Bugfix: in PNG alpha-channel support in the - ngx_http_image_filter_module. - - *) Bugfix: nginx always added "Vary: Accept-Encoding" response header - line, if both "gzip_static" and "gzip_vary" were on. - - *) Bugfix: in UTF-8 encoding support by "try_files" directive in - nginx/Windows. - - *) Bugfix: in "post_action" directive usage; the bug had appeared in - 0.8.11. - Thanks to Igor Artemiev. - - -Changes with nginx 0.8.15 14 Sep 2009 - - *) Security: a segmentation fault might occur in worker process while - specially crafted request handling. - Thanks to Chris Ries. - - *) Bugfix: if names .domain.tld, .sub.domain.tld, and .domain-some.tld - were defined, then the name .sub.domain.tld was matched by - .domain.tld. - - *) Bugfix: in transparency support in the ngx_http_image_filter_module. - - *) Bugfix: in file AIO. - - *) Bugfix: in X-Accel-Redirect usage; the bug had appeared in 0.8.11. - - *) Bugfix: in embedded perl module; the bug had appeared in 0.8.11. - - -Changes with nginx 0.8.14 07 Sep 2009 - - *) Bugfix: an expired cached response might stick in the "UPDATING" - state. - - *) Bugfix: a segmentation fault might occur in worker process, if - error_log was set to info or debug level. - Thanks to Sergey Bochenkov. - - *) Bugfix: in embedded perl module; the bug had appeared in 0.8.11. - - *) Bugfix: an "error_page" directive did not redirect a 413 error; the - bug had appeared in 0.6.10. - - -Changes with nginx 0.8.13 31 Aug 2009 - - *) Bugfix: in the "aio sendfile" directive; the bug had appeared in - 0.8.12. - - *) Bugfix: nginx could not be built without the --with-file-aio option - on FreeBSD; the bug had appeared in 0.8.12. - - -Changes with nginx 0.8.12 31 Aug 2009 - - *) Feature: the "sendfile" parameter in the "aio" directive on FreeBSD. - - *) Bugfix: in try_files; the bug had appeared in 0.8.11. - - *) Bugfix: in memcached; the bug had appeared in 0.8.11. - - -Changes with nginx 0.8.11 28 Aug 2009 - - *) Change: now directive "gzip_disable msie6" does not disable gzipping - for MSIE 6.0 SV1. - - *) Feature: file AIO support on FreeBSD and Linux. - - *) Feature: the "directio_alignment" directive. - - -Changes with nginx 0.8.10 24 Aug 2009 - - *) Bugfix: memory leaks if GeoIP City database was used. - - *) Bugfix: in copying temporary files to permanent storage area; the bug - had appeared in 0.8.9. - - -Changes with nginx 0.8.9 17 Aug 2009 - - *) Feature: now the start cache loader runs in a separate process; this - should improve large caches handling. - - *) Feature: now temporary files and permanent storage area may reside at - different file systems. - - -Changes with nginx 0.8.8 10 Aug 2009 - - *) Bugfix: in handling FastCGI headers split in records. - - *) Bugfix: a segmentation fault occurred in worker process, if a request - was handled in two proxied or FastCGIed locations and a caching was - enabled in the first location; the bug had appeared in 0.8.7. - - -Changes with nginx 0.8.7 27 Jul 2009 - - *) Change: minimum supported OpenSSL version is 0.9.7. - - *) Change: the "ask" parameter of the "ssl_verify_client" directive was - changed to the "optional" parameter and now it checks a client - certificate if it was offered. - Thanks to Brice Figureau. - - *) Feature: the $ssl_client_verify variable. - Thanks to Brice Figureau. - - *) Feature: the "ssl_crl" directive. - Thanks to Brice Figureau. - - *) Feature: the "proxy" parameter of the "geo" directive. - - *) Feature: the "image_filter" directive supports variables for setting - size. - - *) Bugfix: the $ssl_client_cert variable usage corrupted memory; the bug - had appeared in 0.7.7. - Thanks to Sergey Zhuravlev. - - *) Bugfix: "proxy_pass_header" and "fastcgi_pass_header" directives did - not pass to a client the "X-Accel-Redirect", "X-Accel-Limit-Rate", - "X-Accel-Buffering", and "X-Accel-Charset" lines from backend - response header. - Thanks to Maxim Dounin. - - *) Bugfix: in handling "Last-Modified" and "Accept-Ranges" backend - response header lines; the bug had appeared in 0.7.44. - Thanks to Maxim Dounin. - - *) Bugfix: the "[alert] zero size buf" error if subrequest returns an - empty response; the bug had appeared in 0.8.5. - - -Changes with nginx 0.8.6 20 Jul 2009 - - *) Feature: the ngx_http_geoip_module. - - *) Bugfix: XSLT filter may fail with message "not well formed XML - document" for valid XML document. - Thanks to Kuramoto Eiji. - - *) Bugfix: now in MacOSX, Cygwin, and nginx/Windows locations given by a - regular expression are always tested in case insensitive mode. - - *) Bugfix: now nginx/Windows ignores trailing dots in URI. - Thanks to Hugo Leisink. - - *) Bugfix: name of file specified in --conf-path was not honored during - installation; the bug had appeared in 0.6.6. - Thanks to Maxim Dounin. - - -Changes with nginx 0.8.5 13 Jul 2009 - - *) Bugfix: now nginx allows underscores in a request method. - - *) Bugfix: a 500 error code was returned for invalid login/password - while HTTP Basic authentication on Windows. - - *) Bugfix: ngx_http_perl_module responses did not work in subrequests. - - *) Bugfix: in ngx_http_limit_req_module. - Thanks to Maxim Dounin. - - -Changes with nginx 0.8.4 22 Jun 2009 - - *) Bugfix: nginx could not be built --without-http-cache; the bug had - appeared in 0.8.3. - - -Changes with nginx 0.8.3 19 Jun 2009 - - *) Feature: the $upstream_cache_status variable. - - *) Bugfix: nginx could not be built on MacOSX 10.6. - - *) Bugfix: nginx could not be built --without-http-cache; the bug had - appeared in 0.8.2. - - *) Bugfix: a segmentation fault occurred in worker process, if a backend - 401 error was intercepted and the backend did not set the - "WWW-Authenticate" response header line. - Thanks to Eugene Mychlo. - - -Changes with nginx 0.8.2 15 Jun 2009 - - *) Bugfix: in open_file_cache and proxy/fastcgi cache interaction on - start up. - - *) Bugfix: open_file_cache might cache open file descriptors too long; - the bug had appeared in 0.7.4. - - -Changes with nginx 0.8.1 08 Jun 2009 - - *) Feature: the "updating" parameter in "proxy_cache_use_stale" and - "fastcgi_cache_use_stale" directives. - - *) Bugfix: the "If-Modified-Since", "If-Range", etc. client request - header lines were passed to backend while caching if no - "proxy_set_header" directive was used with any parameters. - - *) Bugfix: the "Set-Cookie" and "P3P" response header lines were not - hidden while caching if no "proxy_hide_header/fastcgi_hide_header" - directives were used with any parameters. - - *) Bugfix: the ngx_http_image_filter_module did not support GIF87a - format. - Thanks to Denis Ilyinyh. - - *) Bugfix: nginx could not be built modules on Solaris 10 and early; the - bug had appeared in 0.7.56. - - -Changes with nginx 0.8.0 02 Jun 2009 - - *) Feature: the "keepalive_requests" directive. - - *) Feature: the "limit_rate_after" directive. - Thanks to Ivan Debnar. - - *) Bugfix: XLST filter did not work in subrequests. - - *) Bugfix: in relative paths handling in nginx/Windows. - - *) Bugfix: in proxy_store, fastcgi_store, proxy_cache, and fastcgi_cache - in nginx/Windows. - - *) Bugfix: in memory allocation error handling. - Thanks to Maxim Dounin and Kirill A. Korinskiy. - - -Changes with nginx 0.7.59 25 May 2009 - - *) Feature: the "proxy_cache_methods" and "fastcgi_cache_methods" - directives. - - *) Bugfix: socket leak; the bug had appeared in 0.7.25. - Thanks to Maxim Dounin. - - *) Bugfix: a segmentation fault occurred in worker process, if a request - had no body and the $request_body variable was used; - the bug had appeared in 0.7.58. - - *) Bugfix: the SSL modules might not built on Solaris and Linux; - the bug had appeared in 0.7.56. - - *) Bugfix: ngx_http_xslt_filter_module responses were not handled by - SSI, charset, and gzip filters. - - *) Bugfix: a "charset" directive did not set a charset to - ngx_http_gzip_static_module responses. - - -Changes with nginx 0.7.58 18 May 2009 - - *) Feature: a "listen" directive of the mail proxy module supports IPv6. - - *) Feature: the "image_filter_jpeg_quality" directive. - - *) Feature: the "client_body_in_single_buffer" directive. - - *) Feature: the $request_body variable. - - *) Bugfix: in ngx_http_autoindex_module in file name links having a ":" - symbol in the name. - - *) Bugfix: "make upgrade" procedure did not work; the bug had appeared - in 0.7.53. - Thanks to Denis F. Latypoff. - - -Changes with nginx 0.7.57 12 May 2009 - - *) Bugfix: a floating-point fault occurred in worker process, if the - ngx_http_image_filter_module errors were redirected to named - location; the bug had appeared in 0.7.56. - - -Changes with nginx 0.7.56 11 May 2009 - - *) Feature: nginx/Windows supports IPv6 in a "listen" directive of the - HTTP module. - - *) Bugfix: in ngx_http_image_filter_module. - - -Changes with nginx 0.7.55 06 May 2009 - - *) Bugfix: the http_XXX parameters in "proxy_cache_use_stale" and - "fastcgi_cache_use_stale" directives did not work. - - *) Bugfix: fastcgi cache did not cache header only responses. - - *) Bugfix: of "select() failed (9: Bad file descriptor)" error in - nginx/Unix and "select() failed (10038: ...)" error in nginx/Windows. - - *) Bugfix: a segmentation fault might occur in worker process, if an - "debug_connection" directive was used; the bug had appeared in - 0.7.54. - - *) Bugfix: fix ngx_http_image_filter_module building errors. - - *) Bugfix: the files bigger than 2G could not be transferred using - $r->sendfile. - Thanks to Maxim Dounin. - - -Changes with nginx 0.7.54 01 May 2009 - - *) Feature: the ngx_http_image_filter_module. - - *) Feature: the "proxy_ignore_headers" and "fastcgi_ignore_headers" - directives. - - *) Bugfix: a segmentation fault might occur in worker process, if an - "open_file_cache_errors off" directive was used; the bug had appeared - in 0.7.53. - - *) Bugfix: the "port_in_redirect off" directive did not work; the bug - had appeared in 0.7.39. - - *) Bugfix: improve handling of "select" method errors. - - *) Bugfix: of "select() failed (10022: ...)" error in nginx/Windows. - - *) Bugfix: in error text descriptions in nginx/Windows; the bug had - appeared in 0.7.53. - - -Changes with nginx 0.7.53 27 Apr 2009 - - *) Change: now a log set by --error-log-path is created from the very - start-up. - - *) Feature: now the start up errors and warnings are outputted to an - error_log and stderr. - - *) Feature: the empty --prefix= configure parameter forces nginx to use - a directory where it was run as prefix. - - *) Feature: the -p switch. - - *) Feature: the -s switch on Unix platforms. - - *) Feature: the -? and -h switches. - Thanks to Jerome Loyet. - - *) Feature: now switches may be set in condensed form. - - *) Bugfix: nginx/Windows did not work if configuration file was given by - the -c switch. - - *) Bugfix: temporary files might be not removed if the "proxy_store", - "fastcgi_store", "proxy_cache", or "fastcgi_cache" were used. - Thanks to Maxim Dounin. - - *) Bugfix: an incorrect value was passed to mail proxy authentication - server in "Auth-Method" header line; the bug had appeared - in 0.7.34. - Thanks to Simon Lecaille. - - *) Bugfix: system error text descriptions were not logged on Linux; - the bug had appeared in 0.7.45. - - *) Bugfix: the "fastcgi_cache_min_uses" directive did not work. - Thanks to Andrew Vorobyoff. - - -Changes with nginx 0.7.52 20 Apr 2009 - - *) Feature: the first native Windows binary release. - - *) Bugfix: in processing HEAD method while caching. - - *) Bugfix: in processing the "If-Modified-Since", "If-Range", etc. - client request header lines while caching. - - *) Bugfix: now the "Set-Cookie" and "P3P" header lines are hidden in - cacheable responses. - - *) Bugfix: if nginx was built with the ngx_http_perl_module and with a - perl which supports threads, then during a master process exit the - message "panic: MUTEX_LOCK" might be issued. - - *) Bugfix: nginx could not be built --without-http-cache; the bug had - appeared in 0.7.48. - - *) Bugfix: nginx could not be built on platforms different from i386, - amd64, sparc, and ppc; the bug had appeared in 0.7.42. - - -Changes with nginx 0.7.51 12 Apr 2009 - - *) Feature: the "try_files" directive supports a response code in the - fallback parameter. - - *) Feature: now any response code can be used in the "return" directive. - - *) Bugfix: the "error_page" directive made an external redirect without - query string; the bug had appeared in 0.7.44. - - *) Bugfix: if servers listened on several defined explicitly addresses, - then virtual servers might not work; the bug had appeared in 0.7.39. - - -Changes with nginx 0.7.50 06 Apr 2009 - - *) Bugfix: the $arg_... variables did not work; the bug had appeared in - 0.7.49. - - -Changes with nginx 0.7.49 06 Apr 2009 - - *) Bugfix: a segmentation fault might occur in worker process, if the - $arg_... variables were used; the bug had appeared in 0.7.48. - - -Changes with nginx 0.7.48 06 Apr 2009 - - *) Feature: the "proxy_cache_key" directive. - - *) Bugfix: now nginx takes into account the "X-Accel-Expires", - "Expires", and "Cache-Control" header lines in a backend response. - - *) Bugfix: now nginx caches responses for the GET requests only. - - *) Bugfix: the "fastcgi_cache_key" directive was not inherited. - - *) Bugfix: the $arg_... variables did not work with SSI subrequests. - Thanks to Maxim Dounin. - - *) Bugfix: nginx could not be built with uclibc library. - Thanks to Timothy Redaelli. - - *) Bugfix: nginx could not be built on OpenBSD; the bug had - appeared in 0.7.46. - - -Changes with nginx 0.7.47 01 Apr 2009 - - *) Bugfix: nginx could not be built on FreeBSD 6 and early versions; the - bug had appeared in 0.7.46. - - *) Bugfix: nginx could not be built on MacOSX; the bug had - appeared in 0.7.46. - - *) Bugfix: if the "max_size" parameter was set, then the cache manager - might purge a whole cache; the bug had appeared in 0.7.46. - - *) Change: a segmentation fault might occur in worker process, if the - "proxy_cache"/"fastcgi_cache" and the "proxy_cache_valid"/ - "fastcgi_cache_valid" were set on different levels; the bug had - appeared in 0.7.46. - - *) Bugfix: a segmentation fault might occur in worker process, if a - request was redirected to a proxied or FastCGI server via error_page - or try_files; the bug had appeared in 0.7.44. - - -Changes with nginx 0.7.46 30 Mar 2009 - - *) Bugfix: the previous release tarball was incorrect. - - -Changes with nginx 0.7.45 30 Mar 2009 - - *) Change: now the "proxy_cache" and the "proxy_cache_valid" directives - can be set on different levels. - - *) Change: the "clean_time" parameter of the "proxy_cache_path" - directive is canceled. - - *) Feature: the "max_size" parameter of the "proxy_cache_path" - directive. - - *) Feature: the ngx_http_fastcgi_module preliminary cache support. - - *) Feature: now on shared memory allocation errors directive and zone - names are logged. - - *) Bugfix: the directive "add_header last-modified ''" did not delete a - "Last-Modified" response header line; the bug had appeared in 0.7.44. - - *) Bugfix: a relative path in the "auth_basic_user_file" directive given - without variables did not work; the bug had appeared in 0.7.44. - Thanks to Jerome Loyet. - - *) Bugfix: in an "alias" directive given using variables without - references to captures of regular expressions; the bug had appeared - in 0.7.42. - - -Changes with nginx 0.7.44 23 Mar 2009 - - *) Feature: the ngx_http_proxy_module preliminary cache support. - - *) Feature: the --with-pcre option in the configure. - - *) Feature: the "try_files" directive is now allowed on the server block - level. - - *) Bugfix: the "try_files" directive handled incorrectly a query string - in a fallback parameter. - - *) Bugfix: the "try_files" directive might test incorrectly directories. - - *) Bugfix: if there was a single server for given address:port pair, - then captures in regular expressions in a "server_name" directive did - not work. - - -Changes with nginx 0.7.43 18 Mar 2009 - - *) Bugfix: a request was handled incorrectly, if a "root" directive used - variables; the bug had appeared in 0.7.42. - - *) Bugfix: if a server listened on wildcard address, then the - $server_addr variable value was "0.0.0.0"; the bug had appeared in - 0.7.36. - - -Changes with nginx 0.7.42 16 Mar 2009 - - *) Change: now the "Invalid argument" error returned by - setsockopt(TCP_NODELAY) on Solaris, is ignored. - - *) Change: now if a file specified in a "auth_basic_user_file" directive - is absent, then the 403 error is returned instead of the 500 one. - - *) Feature: the "auth_basic_user_file" directive supports variables. - Thanks to Kirill A. Korinskiy. - - *) Feature: the "listen" directive supports the "ipv6only" parameter. - Thanks to Zhang Hua. - - *) Bugfix: in an "alias" directive with references to captures of - regular expressions; the bug had appeared in 0.7.40. - - *) Bugfix: compatibility with Tru64 UNIX. - Thanks to Dustin Marquess. - - *) Bugfix: nginx could not be built without PCRE library; the bug had - appeared in 0.7.41. - - -Changes with nginx 0.7.41 11 Mar 2009 - - *) Bugfix: a segmentation fault might occur in worker process, if a - "server_name" or a "location" directives had captures in regular - expressions; the issue had appeared in 0.7.40. - Thanks to Vladimir Sopot. - - -Changes with nginx 0.7.40 09 Mar 2009 - - *) Feature: the "location" directive supports captures in regular - expressions. - - *) Feature: an "alias" directive with capture references may be used - inside a location given by a regular expression with captures. - - *) Feature: the "server_name" directive supports captures in regular - expressions. - - *) Workaround: the ngx_http_autoindex_module did not show the trailing - slash in directories on XFS filesystem; the issue had appeared in - 0.7.15. - Thanks to Dmitry Kuzmenko. - - -Changes with nginx 0.7.39 02 Mar 2009 - - *) Bugfix: large response with SSI might hang, if gzipping was enabled; - the bug had appeared in 0.7.28. - Thanks to Artem Bokhan. - - *) Bugfix: a segmentation fault might occur in worker process, if short - static variants are used in a "try_files" directive. - - -Changes with nginx 0.7.38 23 Feb 2009 - - *) Feature: authentication failures logging. - - *) Bugfix: name/password in auth_basic_user_file were ignored after odd - number of empty lines. - Thanks to Alexander Zagrebin. - - *) Bugfix: a segmentation fault occurred in a master process, if long - path was used in unix domain socket; the bug had appeared in 0.7.36. - - -Changes with nginx 0.7.37 21 Feb 2009 - - *) Bugfix: directives using upstreams did not work; the bug had appeared - in 0.7.36. - - -Changes with nginx 0.7.36 21 Feb 2009 - - *) Feature: a preliminary IPv6 support; the "listen" directive of the - HTTP module supports IPv6. - - *) Bugfix: the $ancient_browser variable did not work for browsers - preset by a "modern_browser" directives. - - -Changes with nginx 0.7.35 16 Feb 2009 - - *) Bugfix: a "ssl_engine" directive did not use a SSL-accelerator for - asymmetric ciphers. - Thanks to Marcin Gozdalik. - - *) Bugfix: a "try_files" directive set MIME type depending on an - original request extension. - - *) Bugfix: "*domain.tld" names were handled incorrectly in - "server_name", "valid_referers", and "map" directives, if - ".domain.tld" and ".subdomain.domain.tld" wildcards were used; - the bug had appeared in 0.7.9. - - -Changes with nginx 0.7.34 10 Feb 2009 - - *) Feature: the "off" parameter of the "if_modified_since" directive. - - *) Feature: now nginx sends an HELO/EHLO command after a XCLIENT - command. - Thanks to Maxim Dounin. - - *) Feature: Microsoft specific "AUTH LOGIN with User Name" mode support - in mail proxy server. - Thanks to Maxim Dounin. - - *) Bugfix: in a redirect rewrite directive original arguments were - concatenated with new arguments by a "?" rather than an "&"; - the bug had appeared in 0.1.18. - Thanks to Maxim Dounin. - - *) Bugfix: nginx could not be built on AIX. - - -Changes with nginx 0.7.33 02 Feb 2009 - - *) Bugfix: a double response might be returned if the epoll or rtsig - methods are used and a redirect was returned to a request with body. - Thanks to Eden Li. - - *) Bugfix: the $sent_http_location variable was empty for some redirects - types. - - *) Bugfix: a segmentation fault might occur in worker process if - "resolver" directive was used in SMTP proxy. - - -Changes with nginx 0.7.32 26 Jan 2009 - - *) Feature: now a directory existence testing can be set explicitly in - the "try_files" directive. - - *) Bugfix: fastcgi_store stored files not always. - - *) Bugfix: in geo ranges. - - *) Bugfix: in shared memory allocations if nginx was built without - debugging. - Thanks to Andrey Kvasov. - - -Changes with nginx 0.7.31 19 Jan 2009 - - *) Change: now the "try_files" directive tests files only and ignores - directories. - - *) Feature: the "fastcgi_split_path_info" directive. - - *) Bugfixes in an "Expect" request header line support. - - *) Bugfixes in geo ranges. - - *) Bugfix: in a miss case ngx_http_memcached_module returned the "END" - line as response body instead of default 404 page body; the bug had - appeared in 0.7.18. - Thanks to Maxim Dounin. - - *) Bugfix: while SMTP proxying nginx issued message "250 2.0.0 OK" - instead of "235 2.0.0 OK"; the bug had appeared in 0.7.22. - Thanks to Maxim Dounin. - - -Changes with nginx 0.7.30 24 Dec 2008 - - *) Bugfix: a segmentation fault occurred in worker process, if variables - were used in the "fastcgi_pass" or "proxy_pass" directives and host - name must be resolved; the bug had appeared in 0.7.29. - - -Changes with nginx 0.7.29 24 Dec 2008 - - *) Bugfix: the "fastcgi_pass" and "proxy_pass" directives did not - support variables if unix domain sockets were used. - - *) Bugfixes in subrequest processing; the bugs had appeared in 0.7.25. - - *) Bugfix: a "100 Continue" response was issued for HTTP/1.0 requests; - Thanks to Maxim Dounin. - - *) Bugfix: in memory allocation in the ngx_http_gzip_filter_module on - Cygwin. - - -Changes with nginx 0.7.28 22 Dec 2008 - - *) Change: in memory allocation in the ngx_http_gzip_filter_module. - - *) Change: the default "gzip_buffers" directive values have been changed - to 32 4k or 16 8k from 4 4k/8k. - - -Changes with nginx 0.7.27 15 Dec 2008 - - *) Feature: the "try_files" directive. - - *) Feature: variables support in the "fastcgi_pass" directive. - - *) Feature: now the $geo variable may get an address from a variable. - Thanks to Andrei Nigmatulin. - - *) Feature: now a location's modifier may be used without space before - name. - - *) Feature: the $upstream_response_length variable. - - *) Bugfix: now a "add_header" directive does not add an empty value. - - *) Bugfix: if zero length static file was requested, then nginx just - closed connection; the bug had appeared in 0.7.25. - - *) Bugfix: a MOVE method could not move file in non-existent directory. - - *) Bugfix: a segmentation fault occurred in worker process, if no one - named location was defined in server, but some one was used in an - error_page directive. - Thanks to Sergey Bochenkov. - - -Changes with nginx 0.7.26 08 Dec 2008 - - *) Bugfix: in subrequest processing; the bug had appeared in 0.7.25. - - -Changes with nginx 0.7.25 08 Dec 2008 - - *) Change: in subrequest processing. - - *) Change: now POSTs without "Content-Length" header line are allowed. - - *) Bugfix: now the "limit_req" and "limit_conn" directives log a - prohibition reason. - - *) Bugfix: in the "delete" parameter of the "geo" directive. - - -Changes with nginx 0.7.24 01 Dec 2008 - - *) Feature: the "if_modified_since" directive. - - *) Bugfix: nginx did not process a FastCGI server response, if the - server send too many messages to stderr before response. - - *) Bugfix: the "$cookie_..." variables did not work in the SSI and the - perl module. - - -Changes with nginx 0.7.23 27 Nov 2008 - - *) Feature: the "delete" and "ranges" parameters in the "geo" directive. - - *) Feature: speeding up loading of geo base with large number of values. - - *) Feature: decrease of memory required for geo base load. - - -Changes with nginx 0.7.22 20 Nov 2008 - - *) Feature: the "none" parameter in the "smtp_auth" directive. - Thanks to Maxim Dounin. - - *) Feature: the "$cookie_..." variables. - - *) Bugfix: the "directio" directive did not work in XFS filesystem. - - *) Bugfix: the resolver did not understand big DNS responses. - Thanks to Zyb. - - -Changes with nginx 0.7.21 11 Nov 2008 - - *) Changes in the ngx_http_limit_req_module. - - *) Feature: the EXSLT support in the ngx_http_xslt_module. - Thanks to Denis F. Latypoff. - - *) Workaround: compatibility with glibc 2.3. - Thanks to Eric Benson and Maxim Dounin. - - *) Bugfix: nginx could not run on MacOSX 10.4 and earlier; the bug had - appeared in 0.7.6. - - -Changes with nginx 0.7.20 10 Nov 2008 - - *) Changes in the ngx_http_gzip_filter_module. - - *) Feature: the ngx_http_limit_req_module. - - *) Bugfix: worker processes might exit on a SIGBUS signal on sparc and - ppc platforms; the bug had appeared in 0.7.3. - Thanks to Maxim Dounin. - - *) Bugfix: the "proxy_pass http://host/some:uri" directives did not - work; the bug had appeared in 0.7.12. - - *) Bugfix: in HTTPS mode requests might fail with the "bad write retry" - error. - - *) Bugfix: the ngx_http_secure_link_module did not work inside - locations, whose names are less than 3 characters. - - *) Bugfix: $server_addr variable might have no value. - - -Changes with nginx 0.7.19 13 Oct 2008 - - *) Bugfix: version number update. - - -Changes with nginx 0.7.18 13 Oct 2008 - - *) Change: the "underscores_in_headers" directive; now nginx does not - allows underscores in a client request header line names. - - *) Feature: the ngx_http_secure_link_module. - - *) Feature: the "real_ip_header" directive supports any header. - - *) Feature: the "log_subrequest" directive. - - *) Feature: the $realpath_root variable. - - *) Feature: the "http_502" and "http_504" parameters of the - "proxy_next_upstream" directive. - - *) Bugfix: the "http_503" parameter of the "proxy_next_upstream" or - "fastcgi_next_upstream" directives did not work. - - *) Bugfix: nginx might send a "Transfer-Encoding: chunked" header line - for HEAD requests. - - *) Bugfix: now accept threshold depends on worker_connections. - - -Changes with nginx 0.7.17 15 Sep 2008 - - *) Feature: now the "directio" directive works on Linux. - - *) Feature: the $pid variable. - - *) Bugfix: the "directio" optimization that had appeared in 0.7.15 did - not work with open_file_cache. - - *) Bugfix: the "access_log" with variables did not work on Linux; the - bug had appeared in 0.7.7. - - *) Bugfix: the ngx_http_charset_module did not understand quoted charset - name received from backend. - - -Changes with nginx 0.7.16 08 Sep 2008 - - *) Bugfix: nginx could not be built on 64-bit platforms; the bug had - appeared in 0.7.15. - - -Changes with nginx 0.7.15 08 Sep 2008 - - *) Feature: the ngx_http_random_index_module. - - *) Feature: the "directio" directive has been optimized for file - requests starting from arbitrary position. - - *) Feature: the "directio" directive turns off sendfile if it is - necessary. - - *) Feature: now nginx allows underscores in a client request header line - names. - - -Changes with nginx 0.7.14 01 Sep 2008 - - *) Change: now the ssl_certificate and ssl_certificate_key directives - have no default values. - - *) Feature: the "listen" directive supports the "ssl" parameter. - - *) Feature: now nginx takes into account a time zone change while - reconfiguration on FreeBSD and Linux. - - *) Bugfix: the "listen" directive parameters such as "backlog", - "rcvbuf", etc. were not set, if a default server was not the first - one. - - *) Bugfix: if URI part captured by a "rewrite" directive was used as a - query string, then the query string was not escaped. - - *) Bugfix: configuration file validity test improvements. - - -Changes with nginx 0.7.13 26 Aug 2008 - - *) Bugfix: nginx could not be built on Linux and Solaris; the bug had - appeared in 0.7.12. - - -Changes with nginx 0.7.12 26 Aug 2008 - - *) Feature: the "server_name" directive supports empty name "". - - *) Feature: the "gzip_disable" directive supports special "msie6" mask. - - *) Bugfix: if the "max_fails=0" parameter was used in upstream with - several servers, then a worker process exited on a SIGFPE signal. - Thanks to Maxim Dounin. - - *) Bugfix: a request body was dropped while redirection via an - "error_page" directive. - - *) Bugfix: a full response was returned for request method HEAD while - redirection via an "error_page" directive. - - *) Bugfix: the $r->header_in() method did not return value of the - "Host", "User-Agent", and "Connection" request header lines; the bug - had appeared in 0.7.0. - - -Changes with nginx 0.7.11 18 Aug 2008 - - *) Change: now ngx_http_charset_module does not work by default with - text/css MIME type. - - *) Feature: now nginx returns the 405 status code for POST method - requesting a static file only if the file exists. - - *) Feature: the "proxy_ssl_session_reuse" directive. - - *) Bugfix: a "proxy_pass" directive without URI part might use original - request after the "X-Accel-Redirect" redirection was used. - - *) Bugfix: if a directory has search only rights and the first index - file was absent, then nginx returned the 500 status code. - - *) Bugfix: in inclusive locations; the bugs had appeared in 0.7.1. - - -Changes with nginx 0.7.10 13 Aug 2008 - - *) Bugfix: in the "addition_types", "charset_types", "gzip_types", - "ssi_types", "sub_filter_types", and "xslt_types" directives; the - bugs had appeared in 0.7.9. - - *) Bugfix: of recursive error_page for 500 status code. - - *) Bugfix: now the ngx_http_realip_module sets address not for whole - keepalive connection, but for each request passed via the connection. - - -Changes with nginx 0.7.9 12 Aug 2008 - - *) Change: now ngx_http_charset_module works by default with following - MIME types: text/html, text/css, text/xml, text/plain, - text/vnd.wap.wml, application/x-javascript, and application/rss+xml. - - *) Feature: the "charset_types" and "addition_types" directives. - - *) Feature: now the "gzip_types", "ssi_types", and "sub_filter_types" - directives use hash. - - *) Feature: the ngx_cpp_test_module. - - *) Feature: the "expires" directive supports daily time. - - *) Feature: the ngx_http_xslt_module improvements and bug fixing. - Thanks to Denis F. Latypoff and Maxim Dounin. - - *) Bugfix: the "log_not_found" directive did not work for index files - tests. - - *) Bugfix: HTTPS connections might hang, if kqueue, epoll, rtsig, or - eventport methods were used; the bug had appeared in 0.7.7. - - *) Bugfix: if the "server_name", "valid_referers", and "map" directives - used an "*.domain.tld" wildcard and exact name "domain.tld" was not - set, then the exact name was matched by the wildcard; the bug had - appeared in 0.3.18. - - -Changes with nginx 0.7.8 04 Aug 2008 - - *) Feature: the ngx_http_xslt_module. - - *) Feature: the "$arg_..." variables. - - *) Feature: Solaris directio support. - Thanks to Ivan Debnar. - - *) Bugfix: now if FastCGI server sends a "Location" header line without - status line, then nginx uses 302 status code. - Thanks to Maxim Dounin. - - -Changes with nginx 0.7.7 30 Jul 2008 - - *) Change: now the EAGAIN error returned by connect() is not considered - as temporary error. - - *) Change: now the $ssl_client_cert variable value is a certificate with - TAB character intended before each line except first one; an - unchanged certificate is available in the $ssl_client_raw_cert - variable. - - *) Feature: the "ask" parameter in the "ssl_verify_client" directive. - - *) Feature: byte-range processing improvements. - Thanks to Maxim Dounin. - - *) Feature: the "directio" directive. - Thanks to Jiang Hong. - - *) Feature: MacOSX 10.5 sendfile() support. - - *) Bugfix: now in MacOSX and Cygwin locations are tested in case - insensitive mode; however, the compare is provided by single-byte - locales only. - - *) Bugfix: mail proxy SSL connections hanged, if select, poll, or - /dev/poll methods were used. - - *) Bugfix: UTF-8 encoding usage in the ngx_http_autoindex_module. - - -Changes with nginx 0.7.6 07 Jul 2008 - - *) Bugfix: now if variables are used in the "access_log" directive a - request root existence is always tested. - - *) Bugfix: the ngx_http_flv_module did not support several values in a - query string. - - -Changes with nginx 0.7.5 01 Jul 2008 - - *) Bugfixes in variables support in the "access_log" directive; the bugs - had appeared in 0.7.4. - - *) Bugfix: nginx could not be built --without-http_gzip_module; the bug - had appeared in 0.7.3. - Thanks to Kirill A. Korinskiy. - - *) Bugfix: if sub_filter and SSI were used together, then responses - might were transferred incorrectly. - - -Changes with nginx 0.7.4 30 Jun 2008 - - *) Feature: variables support in the "access_log" directive. - - *) Feature: the "open_log_file_cache" directive. - - *) Feature: the -g switch. - - *) Feature: the "Expect" request header line support. - - *) Bugfix: large SSI inclusions might be truncated. - - -Changes with nginx 0.7.3 23 Jun 2008 - - *) Change: the "rss" extension MIME type has been changed to - "application/rss+xml". - - *) Change: now the "gzip_vary" directive turned on issues a - "Vary: Accept-Encoding" header line for uncompressed responses too. - - *) Feature: now the "rewrite" directive does a redirect automatically if - the "https://" protocol is used. - - *) Bugfix: the "proxy_pass" directive did not work with the HTTPS - protocol; the bug had appeared in 0.6.9. - - -Changes with nginx 0.7.2 16 Jun 2008 - - *) Feature: now nginx supports EDH key exchange ciphers. - - *) Feature: the "ssl_dhparam" directive. - - *) Feature: the $ssl_client_cert variable. - Thanks to Manlio Perillo. - - *) Bugfix: after changing URI via a "rewrite" directive nginx did not - search a new location; the bug had appeared in 0.7.1. - Thanks to Maxim Dounin. - - *) Bugfix: nginx could not be built without PCRE library; the bug had - appeared in 0.7.1. - - *) Bugfix: when a request to a directory was redirected with the slash - added, nginx dropped a query string from the original request. - - -Changes with nginx 0.7.1 26 May 2008 - - *) Change: now locations are searched in a tree. - - *) Change: the "optimize_server_names" directive was canceled due to the - "server_name_in_redirect" directive introduction. - - *) Change: some long deprecated directives are not supported anymore. - - *) Change: the "none" parameter in the "ssl_session_cache" directive; - now this is default parameter. - Thanks to Rob Mueller. - - *) Bugfix: worker processes might not catch reconfiguration and log - rotation signals. - - *) Bugfix: nginx could not be built on latest Fedora 9 Linux. - Thanks to Roxis. - - -Changes with nginx 0.7.0 19 May 2008 - - *) Change: now the 0x00-0x1F, '"' and '\' characters are escaped as \xXX - in an access_log. - Thanks to Maxim Dounin. - - *) Change: now nginx allows several "Host" request header line. - - *) Feature: the "modified" flag in the "expires" directive. - - *) Feature: the $uid_got and $uid_set variables may be used at any - request processing stage. - - *) Feature: the $hostname variable. - Thanks to Andrei Nigmatulin. - - *) Feature: DESTDIR support. - Thanks to Todd A. Fisher and Andras Voroskoi. - - *) Bugfix: a segmentation fault might occur in worker process on Linux, - if keepalive was enabled. - - -Changes with nginx 0.6.31 12 May 2008 - - *) Bugfix: nginx did not process FastCGI response if header was at the - end of FastCGI record; the bug had appeared in 0.6.2. - Thanks to Sergey Serov. - - *) Bugfix: a segmentation fault might occur in worker process if a file - was deleted and the "open_file_cache_errors" directive was off. - - -Changes with nginx 0.6.30 29 Apr 2008 - - *) Change: now if an "include" directive pattern does not match any - file, then nginx does not issue an error. - - *) Feature: now the time in directives may be specified without spaces, - for example, "1h50m". - - *) Bugfix: memory leaks if the "ssl_verify_client" directive was on. - Thanks to Chavelle Vincent. - - *) Bugfix: the "sub_filter" directive might set text to change into - output. - - *) Bugfix: the "error_page" directive did not take into account - arguments in redirected URI. - - *) Bugfix: now nginx always opens files in binary mode under Cygwin. - - *) Bugfix: nginx could not be built on OpenBSD; the bug had appeared in - 0.6.15. - - -Changes with nginx 0.6.29 18 Mar 2008 - - *) Feature: the ngx_google_perftools_module. - - *) Bugfix: the ngx_http_perl_module could not be built on 64-bit - platforms; the bug had appeared in 0.6.27. - - -Changes with nginx 0.6.28 13 Mar 2008 - - *) Bugfix: the rtsig method could not be built; the bug had appeared in - 0.6.27. - - -Changes with nginx 0.6.27 12 Mar 2008 - - *) Change: now by default the rtsig method is not built on - Linux 2.6.18+. - - *) Change: now a request method is not changed while redirection to a - named location via an "error_page" directive. - - *) Feature: the "resolver" and "resolver_timeout" directives in SMTP - proxy. - - *) Feature: the "post_action" directive supports named locations. - - *) Bugfix: a segmentation fault occurred in worker process, if a request - was redirected from proxy, FastCGI, or memcached location to static - named locations. - - *) Bugfix: browsers did not repeat SSL handshake if there is no valid - client certificate in first handshake. - Thanks to Alexander V. Inyukhin. - - *) Bugfix: if response code 495-497 was redirected via an "error_page" - directive without code change, then nginx tried to allocate too many - memory. - - *) Bugfix: memory leak in long-lived non buffered connections. - - *) Bugfix: memory leak in resolver. - - *) Bugfix: a segmentation fault occurred in worker process, if a request - was redirected from proxy, FastCGI, or memcached location to static - named locations. - - *) Bugfix: in the $proxy_host and $proxy_port variables caching. - Thanks to Sergey Bochenkov. - - *) Bugfix: a "proxy_pass" directive with variables used incorrectly the - same port as in another "proxy_pass" directive with the same host - name and without variables. - Thanks to Sergey Bochenkov. - - *) Bugfix: an alert "sendmsg() failed (9: Bad file descriptor)" on some - 64-bit platforms while reconfiguration. - - *) Bugfix: a segmentation fault occurred in worker process, if empty - stub block was used second time in SSI. - - *) Bugfix: in copying URI part contained escaped symbols into arguments. - - -Changes with nginx 0.6.26 11 Feb 2008 - - *) Bugfix: the "proxy_store" and "fastcgi_store" directives did not - check a response length. - - *) Bugfix: a segmentation fault occurred in worker process, if big value - was used in a "expires" directive. - Thanks to Joaquin Cuenca Abela. - - *) Bugfix: nginx incorrectly detected cache line size on Pentium 4. - Thanks to Gena Makhomed. - - *) Bugfix: in proxied or FastCGI subrequests a client original method - was used instead of the GET method. - - *) Bugfix: socket leak in HTTPS mode if deferred accept was used. - Thanks to Ben Maurer. - - *) Bugfix: nginx issued the bogus error message "SSL_shutdown() failed - (SSL: )"; the bug had appeared in 0.6.23. - - *) Bugfix: in HTTPS mode requests might fail with the "bad write retry" - error; the bug had appeared in 0.6.23. - - -Changes with nginx 0.6.25 08 Jan 2008 - - *) Change: now the "server_name_in_redirect" directive is used instead - of the "server_name" directive's special "*" parameter. - - *) Change: now wildcard and regex names can be used as main name in a - "server_name" directive. - - *) Change: the "satisfy_any" directive was replaced by the "satisfy" - directive. - - *) Workaround: old worker processes might hog CPU after reconfiguration - if they was run under Linux OpenVZ. - - *) Feature: the "min_delete_depth" directive. - - *) Bugfix: the COPY and MOVE methods did not work with single files. - - *) Bugfix: the ngx_http_gzip_static_module did not allow the - ngx_http_dav_module to work; the bug had appeared in 0.6.23. - - *) Bugfix: socket leak in HTTPS mode if deferred accept was used. - Thanks to Ben Maurer. - - *) Bugfix: nginx could not be built without PCRE library; the bug had - appeared in 0.6.23. - - -Changes with nginx 0.6.24 27 Dec 2007 - - *) Bugfix: a segmentation fault might occur in worker process if HTTPS - was used; the bug had appeared in 0.6.23. - - -Changes with nginx 0.6.23 27 Dec 2007 - - *) Change: the "off" parameter in the "ssl_session_cache" directive; now - this is default parameter. - - *) Change: the "open_file_cache_retest" directive was renamed to the - "open_file_cache_valid". - - *) Feature: the "open_file_cache_min_uses" directive. - - *) Feature: the ngx_http_gzip_static_module. - - *) Feature: the "gzip_disable" directive. - - *) Feature: the "memcached_pass" directive may be used inside the "if" - block. - - *) Bugfix: a segmentation fault occurred in worker process, if the - "memcached_pass" and "if" directives were used in the same location. - - *) Bugfix: if a "satisfy_any on" directive was used and not all access - and auth modules directives were set, then other given access and - auth directives were not tested; - - *) Bugfix: regex parameters in a "valid_referers" directive were not - inherited from previous level. - - *) Bugfix: a "post_action" directive did run if a request was completed - with 499 status code. - - *) Bugfix: optimization of 16K buffer usage in a SSL connection. - Thanks to Ben Maurer. - - *) Bugfix: the STARTTLS in SMTP mode did not work. - Thanks to Oleg Motienko. - - *) Bugfix: in HTTPS mode requests might fail with the "bad write retry" - error; the bug had appeared in 0.5.13. - - -Changes with nginx 0.6.22 19 Dec 2007 - - *) Change: now all ngx_http_perl_module methods return values copied to - perl's allocated memory. - - *) Bugfix: if nginx was built with ngx_http_perl_module, the perl before - 5.8.6 was used, and perl supported threads, then during - reconfiguration the master process aborted; the bug had appeared in - 0.5.9. - Thanks to Boris Zhmurov. - - *) Bugfix: the ngx_http_perl_module methods may get invalid values of - the regex captures. - - *) Bugfix: a segmentation fault occurred in worker process, if the - $r->has_request_body() method was called for a request whose small - request body was already received. - - *) Bugfix: large_client_header_buffers did not freed before going to - keep-alive state. - Thanks to Olexander Shtepa. - - *) Bugfix: the last address was missed in the $upstream_addr variable; - the bug had appeared in 0.6.18. - - *) Bugfix: the "fastcgi_catch_stderr" directive did return error code; - now it returns 502 code, that can be rerouted to a next server using - the "fastcgi_next_upstream invalid_header" directive. - - *) Bugfix: a segmentation fault occurred in master process if the - "fastcgi_catch_stderr" directive was used; the bug had appeared in - 0.6.10. - Thanks to Manlio Perillo. - - -Changes with nginx 0.6.21 03 Dec 2007 - - *) Change: if variable values used in a "proxy_pass" directive contain - IP-addresses only, then a "resolver" directive is not mandatory. - - *) Bugfix: a segmentation fault might occur in worker process if a - "proxy_pass" directive with URI-part was used; the bug had appeared - in 0.6.19. - - *) Bugfix: if resolver was used on platform that does not support - kqueue, then nginx issued an alert "name is out of response". - Thanks to Andrei Nigmatulin. - - *) Bugfix: if the $server_protocol was used in FastCGI parameters and a - request line length was near to the "client_header_buffer_size" - directive value, then nginx issued an alert "fastcgi: the request - record is too big". - - *) Bugfix: if a plain text HTTP/0.9 version request was made to HTTPS - server, then nginx returned usual response. - - -Changes with nginx 0.6.20 28 Nov 2007 - - *) Bugfix: a segmentation fault might occur in worker process if a - "proxy_pass" directive with URI-part was used; the bug had appeared - in 0.6.19. - - -Changes with nginx 0.6.19 27 Nov 2007 - - *) Bugfix: the 0.6.18 version could not be built. - - -Changes with nginx 0.6.18 27 Nov 2007 - - *) Change: now the ngx_http_userid_module adds start time microseconds - to the cookie field contains a pid value. - - *) Change: now the full request line instead of URI only is written to - error_log. - - *) Feature: variables support in the "proxy_pass" directive. - - *) Feature: the "resolver" and "resolver_timeout" directives. - - *) Feature: now the directive "add_header last-modified ''" deletes a - "Last-Modified" response header line. - - *) Bugfix: the "limit_rate" directive did not allow to use full - throughput, even if limit value was very high. - - -Changes with nginx 0.6.17 15 Nov 2007 - - *) Feature: the "If-Range" request header line support. - Thanks to Alexander V. Inyukhin. - - *) Bugfix: URL double escaping in a redirect of the "msie_refresh" - directive; the bug had appeared in 0.6.4. - - *) Bugfix: the "autoindex" directive did not work with the "alias /" - directive. - - *) Bugfix: a segmentation fault might occur in worker process if - subrequests were used. - - *) Bugfix: the big responses may be transferred truncated if SSL and - gzip were used. - - *) Bugfix: the $status variable was equal to 0 if a proxied server - returned response in HTTP/0.9 version. - - -Changes with nginx 0.6.16 29 Oct 2007 - - *) Change: now the uname(2) is used on Linux instead of procfs. - Thanks to Ilya Novikov. - - *) Bugfix: if the "?" character was in a "error_page" directive, then it - was escaped in a proxied request; the bug had appeared in 0.6.11. - - *) Bugfix: compatibility with mget. - - -Changes with nginx 0.6.15 22 Oct 2007 - - *) Feature: Cygwin compatibility. - Thanks to Vladimir Kutakov. - - *) Feature: the "merge_slashes" directive. - - *) Feature: the "gzip_vary" directive. - - *) Feature: the "server_tokens" directive. - - *) Bugfix: nginx did not unescape URI in the "include" SSI command. - - *) Bugfix: the segmentation fault was occurred on start or while - reconfiguration if variable was used in the "charset" or - "source_charset" directives. - - *) Bugfix: nginx returned the 400 response on requests like - "GET http://www.domain.com HTTP/1.0". - Thanks to James Oakley. - - *) Bugfix: if request with request body was redirected using the - "error_page" directive, then nginx tried to read the request body - again; the bug had appeared in 0.6.7. - - *) Bugfix: a segmentation fault occurred in worker process if no - server_name was explicitly defined for server processing request; the - bug had appeared in 0.6.7. - - -Changes with nginx 0.6.14 15 Oct 2007 - - *) Change: now by default the "echo" SSI command uses entity encoding. - - *) Feature: the "encoding" parameter in the "echo" SSI command. - - *) Feature: the "access_log" directive may be used inside the - "limit_except" block. - - *) Bugfix: if all upstream servers were failed, then all servers had got - weight the was equal one until servers became alive; the bug had - appeared in 0.6.6. - - *) Bugfix: a segmentation fault occurred in worker process if - $date_local and $date_gmt were used outside the - ngx_http_ssi_filter_module. - - *) Bugfix: a segmentation fault might occur in worker process if debug - log was enabled. - Thanks to Andrei Nigmatulin. - - *) Bugfix: ngx_http_memcached_module did not set - $upstream_response_time. - Thanks to Maxim Dounin. - - *) Bugfix: a worker process may got caught in an endless loop, if the - memcached was used. - - *) Bugfix: nginx supported low case only "close" and "keep-alive" values - in the "Connection" request header line; the bug had appeared in - 0.6.11. - - *) Bugfix: sub_filter did not work with empty substitution. - - *) Bugfix: in sub_filter parsing. - - -Changes with nginx 0.6.13 24 Sep 2007 - - *) Bugfix: nginx did not close directory file on HEAD request if - autoindex was used. - Thanks to Arkadiusz Patyk. - - -Changes with nginx 0.6.12 21 Sep 2007 - - *) Change: mail proxy was split on three modules: pop3, imap and smtp. - - *) Feature: the --without-mail_pop3_module, --without-mail_imap_module, - and --without-mail_smtp_module configuration parameters. - - *) Feature: the "smtp_greeting_delay" and "smtp_client_buffer" - directives of the ngx_mail_smtp_module. - - *) Bugfix: the trailing wildcards did not work; the bug had appeared in - 0.6.9. - - *) Bugfix: nginx could not start on Solaris if the shared PCRE library - located in non-standard place was used. - - *) Bugfix: the "proxy_hide_header" and "fastcgi_hide_header" directives - did not hide response header lines whose name was longer than 32 - characters. - Thanks to Manlio Perillo. - - -Changes with nginx 0.6.11 11 Sep 2007 - - *) Bugfix: active connection counter always increased if mail proxy was - used. - - *) Bugfix: if backend returned response header only using non-buffered - proxy, then nginx closed backend connection on timeout. - - *) Bugfix: nginx did not support several "Connection" request header - lines. - - *) Bugfix: if the "max_fails" was set for upstream server, then after - first failure server weight was always one; the bug had appeared in - 0.6.6. - - -Changes with nginx 0.6.10 03 Sep 2007 - - *) Feature: the "open_file_cache", "open_file_cache_retest", and - "open_file_cache_errors" directives. - - *) Bugfix: socket leak; the bug had appeared in 0.6.7. - - *) Bugfix: a charset set by the "charset" directive was not appended to - the "Content-Type" header set by $r->send_http_header(). - - *) Bugfix: a segmentation fault might occur in worker process if - /dev/poll method was used. - - -Changes with nginx 0.6.9 28 Aug 2007 - - *) Bugfix: a worker process may got caught in an endless loop, if the - HTTPS protocol was used; the bug had appeared in 0.6.7. - - *) Bugfix: if server listened on two addresses or ports and trailing - wildcard was used, then nginx did not run. - - *) Bugfix: the "ip_hash" directive might incorrectly mark servers as - down. - - *) Bugfix: nginx could not be built on amd64; the bug had appeared in - 0.6.8. - - -Changes with nginx 0.6.8 20 Aug 2007 - - *) Change: now nginx tries to set the "worker_priority", - "worker_rlimit_nofile", "worker_rlimit_core", and - "worker_rlimit_sigpending" without super-user privileges. - - *) Change: now nginx escapes space and "%" in request to a mail proxy - authentication server. - - *) Change: now nginx escapes "%" in $memcached_key variable. - - *) Bugfix: nginx used path relative to configuration prefix for - non-absolute configuration file path specified in the "-c" key; the - bug had appeared in 0.6.6. - - *) Bugfix: nginx did not work on FreeBSD/sparc64. - - -Changes with nginx 0.6.7 15 Aug 2007 - - *) Change: now the paths specified in the "include", - "auth_basic_user_file", "perl_modules", "ssl_certificate", - "ssl_certificate_key", and "ssl_client_certificate" directives are - relative to directory of nginx configuration file nginx.conf, but not - to nginx prefix directory. - - *) Change: the --sysconfdir=PATH option in configure was canceled. - - *) Change: the special make target "upgrade1" was defined for online - upgrade of 0.1.x versions. - - *) Feature: the "server_name" and "valid_referers" directives support - regular expressions. - - *) Feature: the "server" directive in the "upstream" context supports - the "backup" parameter. - - *) Feature: the ngx_http_perl_module supports the - $r->discard_request_body. - - *) Feature: the "add_header Last-Modified ..." directive changes the - "Last-Modified" response header line. - - *) Bugfix: if a response different than 200 was returned to a request - with body and connection went to the keep-alive state after the - request, then nginx returned 400 for the next request. - - *) Bugfix: a segmentation fault occurred in worker process if invalid - address was set in the "auth_http" directive. - - *) Bugfix: now nginx uses default listen backlog value 511 on all - platforms except FreeBSD. - Thanks to Jiang Hong. - - *) Bugfix: a worker process may got caught in an endless loop, if a - "server" inside "upstream" block was marked as "down"; the bug had - appeared in 0.6.6. - - *) Bugfix: now Solaris sendfilev() is not used to transfer the client - request body to FastCGI-server via the unix domain socket. - - -Changes with nginx 0.6.6 30 Jul 2007 - - *) Feature: the --sysconfdir=PATH option in configure. - - *) Feature: named locations. - - *) Feature: the $args variable can be set with the "set" directive. - - *) Feature: the $is_args variable. - - *) Bugfix: fair big weight upstream balancer. - - *) Bugfix: if a client has closed connection to mail proxy then nginx - might not close connection to backend. - - *) Bugfix: if the same host without specified port was used as backend - for HTTP and HTTPS, then nginx used only one port - 80 or 443. - - *) Bugfix: fix building on Solaris/amd64 by Sun Studio 11 and early - versions; the bug had appeared in 0.6.4. - - -Changes with nginx 0.6.5 23 Jul 2007 - - *) Feature: $nginx_version variable. - Thanks to Nick S. Grechukh. - - *) Feature: the mail proxy supports AUTHENTICATE in IMAP mode. - Thanks to Maxim Dounin. - - *) Feature: the mail proxy supports STARTTLS in SMTP mode. - Thanks to Maxim Dounin. - - *) Bugfix: now nginx escapes space in $memcached_key variable. - - *) Bugfix: nginx was incorrectly built by Sun Studio on Solaris/amd64. - Thanks to Jiang Hong. - - *) Bugfix: of minor potential bugs. - Thanks to Coverity's Scan. - - -Changes with nginx 0.6.4 17 Jul 2007 - - *) Security: the "msie_refresh" directive allowed XSS. - Thanks to Maxim Boguk. - - *) Change: the "proxy_store" and "fastcgi_store" directives were - changed. - - *) Feature: the "proxy_store_access" and "fastcgi_store_access" - directives. - - *) Bugfix: nginx did not work on Solaris/sparc64 if it was built by Sun - Studio. - Thanks to Andrei Nigmatulin. - - *) Workaround: for Sun Studio 12. - Thanks to Jiang Hong. - - -Changes with nginx 0.6.3 12 Jul 2007 - - *) Feature: the "proxy_store" and "fastcgi_store" directives. - - *) Bugfix: a segmentation fault might occur in worker process if the - "auth_http_header" directive was used. - Thanks to Maxim Dounin. - - *) Bugfix: a segmentation fault occurred in worker process if the - CRAM-MD5 authentication method was used, but it was not enabled. - - *) Bugfix: a segmentation fault might occur in worker process when the - HTTPS protocol was used in the "proxy_pass" directive. - - *) Bugfix: a segmentation fault might occur in worker process if the - eventport method was used. - - *) Bugfix: the "proxy_ignore_client_abort" and - "fastcgi_ignore_client_abort" directives did not work; the bug had - appeared in 0.5.13. - - -Changes with nginx 0.6.2 09 Jul 2007 - - *) Bugfix: if the FastCGI header was split in records, then nginx passed - garbage in the header to a client. - - -Changes with nginx 0.6.1 17 Jun 2007 - - *) Bugfix: in SSI parsing. - - *) Bugfix: if remote SSI subrequest was used, then posterior local file - subrequest might transferred to client in wrong order. - - *) Bugfix: large SSI inclusions buffered in temporary files were - truncated. - - *) Bugfix: the perl $$ variable value in ngx_http_perl_module was equal - to the master process identification number. - - -Changes with nginx 0.6.0 14 Jun 2007 - - *) Feature: the "server_name", "map", and "valid_referers" directives - support the "www.example.*" wildcards. - - -Changes with nginx 0.5.25 11 Jun 2007 - - *) Bugfix: nginx could not be built with the - --without-http_rewrite_module parameter; the bug had appeared in - 0.5.24. - - -Changes with nginx 0.5.24 06 Jun 2007 - - *) Security: the "ssl_verify_client" directive did not work if request - was made using HTTP/0.9. - - *) Bugfix: a part of response body might be passed uncompressed if gzip - was used; the bug had appeared in 0.5.23. - - -Changes with nginx 0.5.23 04 Jun 2007 - - *) Feature: the ngx_http_ssl_module supports Server Name Indication TLS - extension. - - *) Feature: the "fastcgi_catch_stderr" directive. - Thanks to Nick S. Grechukh, OWOX project. - - *) Bugfix: a segmentation fault occurred in master process if two - virtual servers should bind() to the overlapping ports. - - *) Bugfix: if nginx was built with ngx_http_perl_module and perl - supported threads, then during second reconfiguration the error - messages "panic: MUTEX_LOCK" and "perl_parse() failed" were issued. - - *) Bugfix: in the HTTPS protocol in the "proxy_pass" directive. - - -Changes with nginx 0.5.22 29 May 2007 - - *) Bugfix: a big request body might not be passed to backend; the bug - had appeared in 0.5.21. - - -Changes with nginx 0.5.21 28 May 2007 - - *) Bugfix: if server has more than about ten locations, then regex - locations might be chosen not in that order as they were specified. - - *) Bugfix: a worker process may got caught in an endless loop on 64-bit - platform, if the 33-rd or next in succession backend has failed. - Thanks to Anton Povarov. - - *) Bugfix: a bus error might occur on Solaris/sparc64 if the PCRE - library was used. - Thanks to Andrei Nigmatulin. - - *) Bugfix: in the HTTPS protocol in the "proxy_pass" directive. - - -Changes with nginx 0.5.20 07 May 2007 - - *) Feature: the "sendfile_max_chunk" directive. - - *) Feature: the "$http_...", "$sent_http_...", and "$upstream_http_..." - variables may be changed using the "set" directive. - - *) Bugfix: a segmentation fault might occur in worker process if the SSI - command 'if expr="$var = /"' was used. - - *) Bugfix: trailing boundary of multipart range response was transferred - incorrectly. - Thanks to Evan Miller. - - *) Bugfix: nginx did not work on Solaris/sparc64 if it was built by Sun - Studio. - Thanks to Andrei Nigmatulin. - - *) Bugfix: the ngx_http_perl_module could not be built by Solaris make. - Thanks to Andrei Nigmatulin. - - -Changes with nginx 0.5.19 24 Apr 2007 - - *) Change: now the $request_time variable has millisecond precision. - - *) Change: the method $r->rflush of ngx_http_perl_module was renamed to - the $r->flush. - - *) Feature: the $upstream_addr variable. - - *) Feature: the "proxy_headers_hash_max_size" and - "proxy_headers_hash_bucket_size" directives. - Thanks to Volodymyr Kostyrko. - - *) Bugfix: the files more than 2G could not be transferred using - sendfile and limit_rate on 64-bit platforms. - - *) Bugfix: the files more than 2G could not be transferred using - sendfile on 64-bit Linux. - - -Changes with nginx 0.5.18 19 Apr 2007 - - *) Feature: the ngx_http_sub_filter_module. - - *) Feature: the "$upstream_http_..." variables. - - *) Feature: now the $upstream_status and $upstream_response_time - variables keep data about all upstreams before X-Accel-Redirect. - - *) Bugfix: a segmentation fault occurred in master process after first - reconfiguration and receiving any signal if nginx was built with - ngx_http_perl_module and perl did not support multiplicity; the bug - had appeared in 0.5.9. - - *) Bugfix: if perl did not support multiplicity, then after - reconfiguration perl code did not work; the bug had appeared in - 0.3.38. - - -Changes with nginx 0.5.17 02 Apr 2007 - - *) Change: now nginx always returns the 405 status for the TRACE method. - - *) Feature: now nginx supports the "include" directive inside the - "types" block. - - *) Bugfix: the $document_root variable usage in the "root" and "alias" - directives is disabled: this caused recursive stack overflow. - - *) Bugfix: in the HTTPS protocol in the "proxy_pass" directive. - - *) Bugfix: in some cases non-cacheable variables (such as $uri variable) - returned old cached value. - - -Changes with nginx 0.5.16 26 Mar 2007 - - *) Bugfix: the C-class network was not used as hash key in the "ip_hash" - directive. - Thanks to Pavel Yarkovoy. - - *) Bugfix: a segmentation fault might occur in worker process if a - charset was set in the "Content-Type" header line and the line has - trailing ";"; the bug had appeared in 0.3.50. - - *) Bugfix: the "[alert] zero size buf" error when FastCGI server was - used and a request body written in a temporary file was multiple of - 32K. - - *) Bugfix: nginx could not be built on Solaris without the --with-debug - option; the bug had appeared in 0.5.15. - - -Changes with nginx 0.5.15 19 Mar 2007 - - *) Feature: the mail proxy supports authenticated SMTP proxying and the - "smtp_auth", "smtp_capabilities", and "xclient" directives. - Thanks to Anton Yuzhaninov and Maxim Dounin. - - *) Feature: now the keep-alive connections are closed just after - receiving the reconfiguration signal. - - *) Change: the "imap" and "auth" directives were renamed to the "mail" - and "pop3_auth" directives. - - *) Bugfix: a segmentation fault occurred in worker process if the - CRAM-MD5 authentication method was used and the APOP method was - disabled. - - *) Bugfix: if the "starttls only" directive was used in POP3 protocol, - then nginx allowed authentication without switching to the SSL mode. - - *) Bugfix: worker processes did not exit after reconfiguration and did - not rotate logs if the eventport method was used. - - *) Bugfix: a worker process may got caught in an endless loop, if the - "ip_hash" directive was used. - - *) Bugfix: now nginx does not log some alerts if eventport or /dev/poll - methods are used. - - -Changes with nginx 0.5.14 23 Feb 2007 - - *) Bugfix: nginx ignored superfluous closing "}" in the end of - configuration file. - - -Changes with nginx 0.5.13 19 Feb 2007 - - *) Feature: the COPY and MOVE methods. - - *) Bugfix: the ngx_http_realip_module set garbage for requests passed - via keep-alive connection. - - *) Bugfix: nginx did not work on big-endian 64-bit Linux. - Thanks to Andrei Nigmatulin. - - *) Bugfix: now when IMAP/POP3 proxy receives too long command it closes - the connection right away, but not after timeout. - - *) Bugfix: if the "epoll" method was used and a client closed a - connection prematurely, then nginx closed the connection after a send - timeout only. - - *) Bugfix: nginx could not be built on platforms different from i386, - amd64, sparc, and ppc; the bug had appeared in 0.5.8. - - -Changes with nginx 0.5.12 12 Feb 2007 - - *) Bugfix: nginx could not be built on platforms different from i386, - amd64, sparc, and ppc; the bug had appeared in 0.5.8. - - *) Bugfix: a segmentation fault might occur in worker process if the - temporary files were used while working with FastCGI server; the bug - had appeared in 0.5.8. - - *) Bugfix: a segmentation fault might occur in worker process if the - $fastcgi_script_name variable was logged. - - *) Bugfix: ngx_http_perl_module could not be built on Solaris. - - -Changes with nginx 0.5.11 05 Feb 2007 - - *) Feature: now configure detects system PCRE library in MacPorts. - Thanks to Chris McGrath. - - *) Bugfix: the response was incorrect if several ranges were requested; - the bug had appeared in 0.5.6. - - *) Bugfix: the "create_full_put_path" directive could not create the - intermediate directories if no "dav_access" directive was set. - Thanks to Evan Miller. - - *) Bugfix: the "0" response code might be logged in the access_log - instead of the "400" and "408" error codes. - - *) Bugfix: a segmentation fault might occur in worker process if nginx - was built with -O2 optimization. - - -Changes with nginx 0.5.10 26 Jan 2007 - - *) Bugfix: while online executable file upgrade the new master process - did not inherit the listening sockets; the bug had appeared in 0.5.9. - - *) Bugfix: a segmentation fault might occur in worker process if nginx - was built with -O2 optimization; the bug had appeared in 0.5.1. - - -Changes with nginx 0.5.9 25 Jan 2007 - - *) Change: now the ngx_http_memcached_module uses the $memcached_key - variable value as a key. - - *) Feature: the $memcached_key variable. - - *) Feature: the "clean" parameter in the "client_body_in_file_only" - directive. - - *) Feature: the "env" directive. - - *) Feature: the "sendfile" directive is available inside the "if" block. - - *) Feature: now on failure of the writing to access nginx logs a message - to error_log, but not more often than once a minute. - - *) Bugfix: the "access_log off" directive did not always turn off the - logging. - - -Changes with nginx 0.5.8 19 Jan 2007 - - *) Bugfix: a segmentation fault might occur if - "client_body_in_file_only on" was used and a request body was small. - - *) Bugfix: a segmentation fault occurred if - "client_body_in_file_only on" and "proxy_pass_request_body off" or - "fastcgi_pass_request_body off" directives were used, and nginx - switched to a next upstream. - - *) Bugfix: if the "proxy_buffering off" directive was used and a client - connection was non-active, then the connection was closed after send - timeout; the bug had appeared in 0.4.7. - - *) Bugfix: if the "epoll" method was used and a client closed a - connection prematurely, then nginx closed the connection after a send - timeout only. - - *) Bugfix: the "[alert] zero size buf" error when FastCGI server was - used. - - *) Bugfixes in the "limit_zone" directive. - - -Changes with nginx 0.5.7 15 Jan 2007 - - *) Feature: the ssl_session_cache storage optimization. - - *) Bugfixes in the "ssl_session_cache" and "limit_zone" directives. - - *) Bugfix: the segmentation fault was occurred on start or while - reconfiguration if the "ssl_session_cache" or "limit_zone" directives - were used on 64-bit platforms. - - *) Bugfix: a segmentation fault occurred if the "add_before_body" or - "add_after_body" directives were used and there was no "Content-Type" - header line in response. - - *) Bugfix: the OpenSSL library was always built with the threads - support. - Thanks to Den Ivanov. - - *) Bugfix: the PCRE-6.5+ library and the icc compiler compatibility. - - -Changes with nginx 0.5.6 09 Jan 2007 - - *) Change: now the ngx_http_index_module ignores all methods except the - GET, HEAD, and POST methods. - - *) Feature: the ngx_http_limit_zone_module. - - *) Feature: the $binary_remote_addr variable. - - *) Feature: the "ssl_session_cache" directives of the - ngx_http_ssl_module and ngx_imap_ssl_module. - - *) Feature: the DELETE method supports recursive removal. - - *) Bugfix: the byte-ranges were transferred incorrectly if the - $r->sendfile() was used. - - -Changes with nginx 0.5.5 24 Dec 2006 - - *) Change: the -v switch does not show compiler information any more. - - *) Feature: the -V switch. - - *) Feature: the "worker_rlimit_core" directive supports size in K, M, - and G. - - *) Bugfix: the nginx.pm module now could be installed by an unprivileged - user. - - *) Bugfix: a segmentation fault might occur if the $r->request_body or - $r->request_body_file methods were used. - - *) Bugfix: the ppc platform specific bugs. - - -Changes with nginx 0.5.4 15 Dec 2006 - - *) Feature: the "perl" directive may be used inside the "limit_except" - block. - - *) Bugfix: the ngx_http_dav_module required the "Date" request header - line for the DELETE method. - - *) Bugfix: if one only parameter was used in the "dav_access" directive, - then nginx might report about configuration error. - - *) Bugfix: a segmentation fault might occur if the $host variable was - used; the bug had appeared in 0.4.14. - - -Changes with nginx 0.5.3 13 Dec 2006 - - *) Feature: the ngx_http_perl_module supports the $r->status, - $r->log_error, and $r->sleep methods. - - *) Feature: the $r->variable method supports variables that do not exist - in nginx configuration. - - *) Bugfix: the $r->has_request_body method did not work. - - -Changes with nginx 0.5.2 11 Dec 2006 - - *) Bugfix: if the "proxy_pass" directive used the name of the "upstream" - block, then nginx tried to resolve the name; the bug had appeared in - 0.5.1. - - -Changes with nginx 0.5.1 11 Dec 2006 - - *) Bugfix: the "post_action" directive might not run after a - unsuccessful completion of a request. - - *) Workaround: for Eudora for Mac; the bug had appeared in 0.4.11. - Thanks to Bron Gondwana. - - *) Bugfix: if the "upstream" name was used in the "fastcgi_pass", then - the message "no port in upstream" was issued; the bug had appeared in - 0.5.0. - - *) Bugfix: if the "proxy_pass" and "fastcgi_pass" directives used the - same servers but different ports, then these directives uses the - first described port; the bug had appeared in 0.5.0. - - *) Bugfix: if the "proxy_pass" and "fastcgi_pass" directives used the - unix domain sockets, then these directives used first described - socket; the bug had appeared in 0.5.0. - - *) Bugfix: ngx_http_auth_basic_module ignored the user if it was in the - last line in the password file and there was no the carriage return, - the line feed, or the ":" symbol after the password. - - *) Bugfix: the $upstream_response_time variable might be equal to - "0.000", although response time was more than 1 millisecond. - - -Changes with nginx 0.5.0 04 Dec 2006 - - *) Change: the parameters in the "%name" form in the "log_format" - directive are not supported anymore. - - *) Change: the "proxy_upstream_max_fails", - "proxy_upstream_fail_timeout", "fastcgi_upstream_max_fails", - "fastcgi_upstream_fail_timeout", "memcached_upstream_max_fails", and - "memcached_upstream_fail_timeout" directives are not supported - anymore. - - *) Feature: the "server" directive in the "upstream" context supports - the "max_fails", "fail_timeout", and "down" parameters. - - *) Feature: the "ip_hash" directive inside the "upstream" block. - - *) Feature: the WAIT status in the "Auth-Status" header line of the - IMAP/POP3 proxy authentication server response. - - *) Bugfix: nginx could not be built on 64-bit platforms; the bug had - appeared in 0.4.14. - - -Changes with nginx 0.4.14 27 Nov 2006 - - *) Feature: the "proxy_pass_error_message" directive in IMAP/POP3 proxy. - - *) Feature: now configure detects system PCRE library on FreeBSD, Linux, - and NetBSD. - - *) Bugfix: ngx_http_perl_module did not work with perl built with the - threads support; the bug had appeared in 0.3.38. - - *) Bugfix: ngx_http_perl_module did not work if perl was called - recursively. - - *) Bugfix: nginx ignored a host name in a request line. - - *) Bugfix: a worker process may got caught in an endless loop, if a - FastCGI server sent too many data to the stderr. - - *) Bugfix: the $upstream_response_time variable may be negative if the - system time was changed backward. - - *) Bugfix: the "Auth-Login-Attempt" parameter was not sent to IMAP/POP3 - proxy authentication server when POP3 was used. - - *) Bugfix: a segmentation fault might occur if connect to IMAP/POP3 - proxy authentication server failed. - - -Changes with nginx 0.4.13 15 Nov 2006 - - *) Feature: the "proxy_pass" directive may be used inside the - "limit_except" block. - - *) Feature: the "limit_except" directive supports all WebDAV methods. - - *) Bugfix: if the "add_before_body" directive was used without the - "add_after_body" directive, then a response did not transferred - complete. - - *) Bugfix: a large request body did not receive if the epoll method and - the deferred accept() were used. - - *) Bugfix: a charset could not be set for ngx_http_autoindex_module - responses; the bug had appeared in 0.3.50. - - *) Bugfix: the "[alert] zero size buf" error when FastCGI server was - used; - - *) Bugfix: the --group= configuration parameter was ignored. - Thanks to Thomas Moschny. - - *) Bugfix: the 50th subrequest in SSI response did not work; the bug had - appeared in 0.3.50. - - -Changes with nginx 0.4.12 31 Oct 2006 - - *) Feature: the ngx_http_perl_module supports the $r->variable method. - - *) Bugfix: if a big static file was included using SSI in a response, - then the response may be transferred incomplete. - - *) Bugfix: nginx did not omit the "#fragment" part in URI. - - -Changes with nginx 0.4.11 25 Oct 2006 - - *) Feature: the POP3 proxy supports the AUTH LOGIN PLAIN and CRAM-MD5. - - *) Feature: the ngx_http_perl_module supports the $r->allow_ranges - method. - - *) Bugfix: if the APOP was enabled in the POP3 proxy, then the USER/PASS - commands might not work; the bug had appeared in 0.4.10. - - -Changes with nginx 0.4.10 23 Oct 2006 - - *) Feature: the POP3 proxy supports the APOP command. - - *) Bugfix: if the select, poll or /dev/poll methods were used, then - while waiting authentication server response the IMAP/POP3 proxy - hogged CPU. - - *) Bugfix: a segmentation fault might occur if the $server_addr variable - was used in the "map" directive. - - *) Bugfix: the ngx_http_flv_module did not support the byte ranges for - full responses; the bug had appeared in 0.4.7. - - *) Bugfix: nginx could not be built on Debian amd64; the bug had - appeared in 0.4.9. - - -Changes with nginx 0.4.9 13 Oct 2006 - - *) Feature: the "set" parameter in the "include" SSI command. - - *) Feature: the ngx_http_perl_module now tests the nginx.pm module - version. - - -Changes with nginx 0.4.8 11 Oct 2006 - - *) Bugfix: if an "include" SSI command were before another "include" SSI - command with a "wait" parameter, then the "wait" parameter might not - work. - - *) Bugfix: the ngx_http_flv_module added the FLV header to the full - responses. - Thanks to Alexey Kovyrin. - - -Changes with nginx 0.4.7 10 Oct 2006 - - *) Feature: the ngx_http_flv_module. - - *) Feature: the $request_body_file variable. - - *) Feature: the "charset" and "source_charset" directives support the - variables. - - *) Bugfix: if an "include" SSI command were before another "include" SSI - command with a "wait" parameter, then the "wait" parameter might not - work. - - *) Bugfix: if the "proxy_buffering off" directive was used or while - working with memcached the connections might not be closed on - timeout. - - *) Bugfix: nginx did not run on 64-bit platforms except amd64, sparc64, - and ppc64. - - -Changes with nginx 0.4.6 06 Oct 2006 - - *) Bugfix: nginx did not run on 64-bit platforms except amd64, sparc64, - and ppc64. - - *) Bugfix: nginx sent the chunked response for HTTP/1.1 request, - if its length was set by text string in the - $r->headers_out("Content-Length", ...) method. - - *) Bugfix: after redirecting error by an "error_page" directive any - ngx_http_rewrite_module directive returned this error code; the bug - had appeared in 0.4.4. - - -Changes with nginx 0.4.5 02 Oct 2006 - - *) Bugfix: nginx could not be built on Linux and Solaris; the bug had - appeared in 0.4.4. - - -Changes with nginx 0.4.4 02 Oct 2006 - - *) Feature: the $scheme variable. - - *) Feature: the "expires" directive supports the "max" parameter. - - *) Feature: the "include" directive supports the "*" mask. - Thanks to Jonathan Dance. - - *) Bugfix: the "return" directive always overrode the "error_page" - response code redirected by the "error_page" directive. - - *) Bugfix: a segmentation fault occurred if zero-length body was in PUT - method. - - *) Bugfix: the redirect was changed incorrectly if the variables were - used in the "proxy_redirect" directive. - - -Changes with nginx 0.4.3 26 Sep 2006 - - *) Change: now the 499 error could not be redirected using an - "error_page" directive. - - *) Feature: the Solaris 10 event ports support. - - *) Feature: the ngx_http_browser_module. - - *) Bugfix: a segmentation fault may occur while redirecting the 400 - error to the proxied server using a "proxy_pass" directive. - - *) Bugfix: a segmentation fault occurred if an unix domain socket was - used in a "proxy_pass" directive; the bug had appeared in 0.3.47. - - *) Bugfix: SSI did work with memcached and nonbuffered responses. - - *) Workaround: of the Sun Studio PAUSE hardware capability bug. - - -Changes with nginx 0.4.2 14 Sep 2006 - - *) Bugfix: the O_NOATIME flag support on Linux was canceled; the bug had - appeared in 0.4.1. - - -Changes with nginx 0.4.1 14 Sep 2006 - - *) Bugfix: the DragonFlyBSD compatibility. - Thanks to Pavel Nazarov. - - *) Workaround: of bug in 64-bit Linux sendfile(), when file is more than - 2G. - - *) Feature: now on Linux nginx uses O_NOATIME flag for static requests. - Thanks to Yusuf Goolamabbas. - - -Changes with nginx 0.4.0 30 Aug 2006 - - *) Change in internal API: the HTTP modules initialization was moved - from the init module phase to the HTTP postconfiguration phase. - - *) Change: now the request body is not read beforehand for the - ngx_http_perl_module: it's required to start the reading using the - $r->has_request_body method. - - *) Feature: the ngx_http_perl_module supports the DECLINED return code. - - *) Feature: the ngx_http_dav_module supports the incoming "Date" header - line for the PUT method. - - *) Feature: the "ssi" directive is available inside the "if" block. - - *) Bugfix: a segmentation fault occurred if there was an "index" - directive with variables and the first index name was without - variables; the bug had appeared in 0.1.29. - - -Changes with nginx 0.3.61 28 Aug 2006 - - *) Change: now the "tcp_nodelay" directive is turned on by default. - - *) Feature: the "msie_refresh" directive. - - *) Feature: the "recursive_error_pages" directive. - - *) Bugfix: the "rewrite" directive returned incorrect redirect, if the - redirect had the captured escaped symbols from original URI. - - -Changes with nginx 0.3.60 18 Aug 2006 - - *) Bugfix: a worker process may got caught in an endless loop while an - error redirection; the bug had appeared in 0.3.59. - - -Changes with nginx 0.3.59 16 Aug 2006 - - *) Feature: now is possible to do several redirection using the - "error_page" directive. - - *) Bugfix: the "dav_access" directive did not support three parameters. - - *) Bugfix: the "error_page" directive did not changes the "Content-Type" - header line after the "X-Accel-Redirect" was used; the bug had - appeared in 0.3.58. - - -Changes with nginx 0.3.58 14 Aug 2006 - - *) Feature: the "error_page" directive supports the variables. - - *) Change: now the procfs interface instead of sysctl is used on Linux. - - *) Change: now the "Content-Type" header line is inherited from first - response when the "X-Accel-Redirect" was used. - - *) Bugfix: the "error_page" directive did not redirect the 413 error. - - *) Bugfix: the trailing "?" did not remove old arguments if no new - arguments were added to a rewritten URI. - - *) Bugfix: nginx could not run on 64-bit FreeBSD 7.0-CURRENT. - - -Changes with nginx 0.3.57 09 Aug 2006 - - *) Feature: the $ssl_client_serial variable. - - *) Bugfix: in the "!-e" operator of the "if" directive. - Thanks to Andrian Budanstov. - - *) Bugfix: while a client certificate verification nginx did not send to - a client the required certificates information. - - *) Bugfix: the $document_root variable did not support the variables in - the "root" directive. - - -Changes with nginx 0.3.56 04 Aug 2006 - - *) Feature: the "dav_access" directive. - - *) Feature: the "if" directive supports the "-d", "!-d", "-e", "!-e", - "-x", and "!-x" operators. - - *) Bugfix: a segmentation fault occurred if a request returned a - redirect and some sent to client header lines were logged in the - access log. - - -Changes with nginx 0.3.55 28 Jul 2006 - - *) Feature: the "stub" parameter in the "include" SSI command. - - *) Feature: the "block" SSI command. - - *) Feature: the unicode2nginx script was added to contrib. - - *) Bugfix: if a "root" was specified by variable only, then the root was - relative to a server prefix. - - *) Bugfix: if the request contained "//" or "/./" and escaped symbols - after them, then the proxied request was sent unescaped. - - *) Bugfix: the $r->header_in("Cookie") of the ngx_http_perl_module now - returns all "Cookie" header lines. - - *) Bugfix: a segmentation fault occurred if - "client_body_in_file_only on" was used and nginx switched to a next - upstream. - - *) Bugfix: on some condition while reconfiguration character codes - inside the "charset_map" may be treated invalid; the bug had appeared - in 0.3.50. - - -Changes with nginx 0.3.54 11 Jul 2006 - - *) Feature: nginx now logs the subrequest information to the error log. - - *) Feature: the "proxy_next_upstream", "fastcgi_next_upstream", and - "memcached_next_upstream" directives support the "off" parameter. - - *) Feature: the "debug_connection" directive supports the CIDR address - form. - - *) Bugfix: if a response of proxied server or FastCGI server was - converted from UTF-8 or back, then it may be transferred incomplete. - - *) Bugfix: the $upstream_response_time variable had the time of the - first request to a backend only. - - *) Bugfix: nginx could not be built on amd64 platform; the bug had - appeared in 0.3.53. - - -Changes with nginx 0.3.53 07 Jul 2006 - - *) Change: the "add_header" directive adds the string to 204, 301, and - 302 responses. - - *) Feature: the "server" directive in the "upstream" context supports - the "weight" parameter. - - *) Feature: the "server_name" directive supports the "*" wildcard. - - *) Feature: nginx supports the request body size more than 2G. - - *) Bugfix: if a client was successfully authorized using "satisfy_any - on", then anyway the message "access forbidden by rule" was written - in the log. - - *) Bugfix: the "PUT" method may erroneously not create a file and return - the 409 code. - - *) Bugfix: if the IMAP/POP3 backend returned an error, then nginx - continued proxying anyway. - - -Changes with nginx 0.3.52 03 Jul 2006 - - *) Change: the ngx_http_index_module behavior for the "POST /" requests - is reverted to the 0.3.40 version state: the module now does not - return the 405 error. - - *) Bugfix: the worker process may got caught in an endless loop if the - limit rate was used; the bug had appeared in 0.3.37. - - *) Bugfix: ngx_http_charset_module logged "unknown charset" alert, even - if the recoding was not needed; the bug had appeared in 0.3.50. - - *) Bugfix: if a code response of the PUT request was 409, then a - temporary file was not removed. - - -Changes with nginx 0.3.51 30 Jun 2006 - - *) Bugfix: the "<" symbols might disappeared some conditions in the SSI; - the bug had appeared in 0.3.50. - - -Changes with nginx 0.3.50 28 Jun 2006 - - *) Change: the "proxy_redirect_errors" and "fastcgi_redirect_errors" - directives was renamed to the "proxy_intercept_errors" and - "fastcgi_intercept_errors" directives. - - *) Feature: the ngx_http_charset_module supports the recoding from the - single byte encodings to the UTF-8 encoding and back. - - *) Feature: the "X-Accel-Charset" response header line is supported in - proxy and FastCGI mode. - - *) Bugfix: the "\" escape symbol in the "\"" and "\'" pairs in the SSI - command was removed only if the command also has the "$" symbol. - - *) Bugfix: the " !

' > /var/www/html/loc2.html - -nginx -t -invoke-rc.d nginx restart || { journalctl -n all -xu nginx.service; exit 1; } - -curl --fail -w "response_code: %{http_code}\n" http://127.0.0.1/loc1.html diff --git a/debian/ufw/nginx b/debian/ufw/nginx deleted file mode 100644 index ad886ba..0000000 --- a/debian/ufw/nginx +++ /dev/null @@ -1,19 +0,0 @@ -[Nginx HTTP] -title=Web Server (Nginx, HTTP) -description=Small, but very powerful and efficient web server -ports=80/tcp - -[Nginx HTTPS] -title=Web Server (Nginx, HTTPS) -description=Small, but very powerful and efficient web server -ports=443/tcp - -[Nginx Full] -title=Web Server (Nginx, HTTP + HTTPS) -description=Small, but very powerful and efficient web server -ports=80,443/tcp - -[Nginx QUIC] -title=Web Server (Nginx, HTTP + HTTPS + QUIC) -description=Small, but very powerful and efficient web server -ports=80,443/tcp|443/udp diff --git a/debian/upstream/signing-key.asc b/debian/upstream/signing-key.asc deleted file mode 100644 index 52abfd2..0000000 --- a/debian/upstream/signing-key.asc +++ /dev/null @@ -1,257 +0,0 @@ ------BEGIN PGP PUBLIC KEY BLOCK----- - -mQINBGZXLBYBEACxv3nUIdUtFCpH1G4hBB+eVSsWwnHVTDtSYfINHmN8dQfyGy22 -XcX2DR6ZW9/I5e06McAz4e3hTuhD5+sF7zv4Dd/xEqxpra08liVvB3QlJ6kawBJa -Bn29s/N/A06yUrOVC1ZjhpDLshaHeyHjWDVLUX9ibLx1N3BQoeoH/5lgTmfF4JPk -LfnTMwHWQ5phT52MVE+B/XExldIPAn27m2ZfXHXnSUMKCRybQNypBiIp6OBfirwa -pyjaRO1AajwalSkbSV9o/fL3liluv1HimQ11/5y0rxMdi+aaeca9oA4Gvfdh/biO -MYcTeiZx72BKqDwMfJVXSjQ8XOYbfCjWp8dNkS5Yd4bmX+ITXRkZHqQxgmoKWr7B -9/i+asColt/qqsQ6PROa2y86TbQSfn/HM8L6c85BkJrI41abJ2QHShVzpk0e/464 -hqxvnAZCrmdM+GBSuYfDDqHHHgxhIzHnKnyRX/MtfhZA/CUFUOe+m6j214KKtkMQ -6EpZzgH52FFD6Vi1NkQvfYx5pqEdmJfRKR9ABf8fYI8U8ryNgIq7f13bwoX4haZy -ql/fC4lTG6OEppgdQe7afyAmdi7G/w1pMcbz5Wwp91R+1372XifynBdeTrUsbK25 -P42TH3OADC2Id+MaaGh1AjY1bFifOGRf48rnrcMn0Q4Lw3l56wgjou4MUQARAQAB -tCtuZ2lueCBzaWduaW5nIGtleSA8c2lnbmluZy1rZXktMkBuZ2lueC5jb20+iQIi -BBMBCgAWBQJmVywWCRAv0hMQtJ9rRgIbAwIZAQAAq08P/jeIVEj9/cJFzdOeBqjg -F9DNZljkR+2z5UAkQSHfkzWgHRbdAnjT1bc/ltLi6w/z/97kOZhaiSx6TLRg2mX/ -5nuC4KijhT9rNc/d5j/BHS4U7lFK8c5ED5wxGvJZcF0VCSfeaiuxoO3QiNYX1iiD -qEyJ1XL/XHd7LjJ4gKxsohKL1rRLSuvtOkK799YArNit5ueATDWW6EUSZaxOiMNz -MaQFMEkjoiPVlj7jNwZN7KHNXkaJjiER0kmJ9XWDtkgSHOZrUNX2PHJpxxCtQj7d -YpOFM/DHvNUZ9dHXm3Ioo3R/MUcC4mbZpAvs4YwZ/yRqov/MX4WEUtvcCY36EL5t -hUDK09huMMBLBdM0jgVLsJnXn5ksMdVkpgFyeR/SKEaUTmQrgkCIwqvRxDegAkNN -lmAiNhxdKD+CrWws+EzQYOeWVRUO9aHKC5ttwhhQuxyvmNgoAMhd8x8Tcm7grC/m -ZOqYWzpEWd1DEyi9jaTkhrSWMd5jc5lvCwOHDRzVi1HmIJy+cybPbQpkbFY6vj/7 -shx2Aa+QKRJs+33Ztg0drc3j+mDk9NJQy0KPIbqee0gy0pmaKNiJOxdIWI6ra3cM -3lh5OG+CGakga1X9YiCWv4/OgDYY/6cFTqEN0wXruFLNZ7P4iowJgPU1KZauvDZl -gfsgBoKJ35Nf6p9PdjcjcyW5iQEzBBABCAAdFiEEcziXMGntP0Q/TTffpk/VsXrb -OagFAmZXLlcACgkQpk/VsXrbOaiWowgAvU9HwLkK74VGjosmPpcjurRowUp+/KOA -HmIro2wQ6JVlUrSL2Rz+RIBJ1BKTgGnVZznkXywXHWK2LI4nL3aDoAuyyrzQk1pj -hO1ZJGJBvh9Zq/kGRgEdlTe2sXVX2G7fr4fhd6BcYYvUBQ5OWR6Hh6uS+G1QVw0y -Lu5Gp+7kyolyH6iYlgvxseche+EIqBPyHe5fyb1t8Zcu1uHoQHj9O90FvJSbq4dR -d0tTlqK1tDklT+Aod2UobBCurn45udjiAKtzH6Bg2dvF/oY4udSC9/HgNPbm7JuY -clEaLukWMdFOCEj9Xr6krHtUh7zTiU6pHvUL2SYMPhsJj6AKZRg52IkBMwQQAQgA -HRYhBFc7/Ws9j7xkEHmmq6v1vYJ72b9iBQJmVz0rAAoJEKv1vYJ72b9iVTwH/Awq -vgnXbJ5mCGbLdQgrDoUYe+1nw/qWbl7Hpn/px55BEIW5S0itI50c9sOS2QFQMdRh -YVqZ+YH4aH5pDNW2kFik4Y+CFoJI9QkrEUx66PYIMu3RVBEE7/HQEwND/IbEAeMg -PpGQdEfEDD8kevlinJTyDXJ3dfBa6HEDpK0wDYrBx3mbHP7ouACsZcxqSdx4kOyv -U2Xvlc5pVRsdvJ7AsVRhRaRdSO8YlqU1Ue/OM/Ejj+GZ1Qo8EDge5887HiY8gcjy -J4FS1n2+3839n990s5xDCFSB1G8KmwgkfbkS6gEpA5wf9nk3tiSPS+HMfjMb50GJ -SayUVrAyUupv/Sxvyo+JAjMEEAEIAB0WIQTWeGzjA9mpAimY3GzIRk1UmvdcCgUC -ZldKbQAKCRDIRk1UmvdcCn6EEACUhtMnJGtrunotTwywt/jfkqexA+lhQ+S9V5eF -IIK6Tlq1asFy0s+twYJBQzTXt+hmL8GrBgeQp26CA8wrbxmnUOrXO1K9ksaXXjj0 -SRo9Xr/flCmeFKFRSSVy18UZVwf1vftFwF2lQspU+xZmj7vgr+2vKa3Z+81J8tHw -3/Sc5pt3EGB8GeCiEThe3zr49KpANejy/7feASSS+BBBUbNqnCFImfwLJ2V99mGx -GdejudbTYEXsn6jyVWTeKBcaLM4ArS20O0DJkqBcVC1Ymq+K3AGmKnrLJXDSwaV/ -+yv5pyqApf6Lu9tx7wy6upBop8KroB9xiTN5UIiYhwtHBlpOLkmXB7K549CYX34y -aOHJjez8Txn1bDhbCOe8WOnPEDI8V4RQBr0/xePru6lfwSmSriquVuBGZSir6qxA -1folqrEuoF5aEuxFper6yC/zfVP85znqBOh8OaYTGBeb622UswzLTbW4y2M3E9Ws -KhaXzTqXgIn3INCJLCv4CHiGQQB6zN6meGdOkEV0IaZvq3O4iZOAVFmKbN3GZcKT -Kjxq295LNO15c0WCauik3FRjSppyvcAqoCEbr+LVAX3/ZV3oELhQPnkZCuAFQUB+ -LKxTcTEIdjFKrPEvDgXLL9CNe747ANcLCV02SRRGYnfQ1aoxJNQlzbFw0unHjyDk -vKcD44kBswQQAQgAHRYhBBPIKmO2A1dhVuMKTqDqmBtmsNlnBQJmV1HlAAoJEKDq -mBtmsNlni3gMALfZSqIL7v66dMyjLQR81G4o6rEAixTuFc3B8xDmWDHKIjmdRMTN -mm2KGz0CG7VjdHSe3oOBYok4fDVS0o636EOxndOHszuB9cfhMMXNDFi4T1xcZCLm -UTdXCH88cagwTf6REsbfuXF8WiFemNNiPzMzLmnTlUe7Va2t+gKD/Q9vSlDLKz66 -IZBMdDoAHDKHZTtvwlAKswnpO0cDIeZjO0C1+YFLLSJ1nYQbh6mH+hJvNLimWPKR -ZQCPAa5w0Gutz91cE9nv03yg3FMcjlEgklQ77g/nGGFJnQHAeMhfgUUfPLx1rI9/ -5NON5w7Wf3PXOlTYWO25ieUVKESu8dUCFktKRMnzauej2vjnQlMFG0upzw8dhytn -E83WanvRzVynanK38PCNYQ3INsydN3wvJNetHpBdpyPfOa61dOUtu1TBvV80qcBR -wIe6vbWZx0WB59b3KV8Sc68j8OJxF6i3E0IRby4f0hcoqogBkry0NPK/rtL2HHnN -vcV0wl+DODz9hw== -=oWlI ------END PGP PUBLIC KEY BLOCK----- ------BEGIN PGP PUBLIC KEY BLOCK----- - -mQENBE5OMmIBCAD+FPYKGriGGf7NqwKfWC83cBV01gabgVWQmZbMcFzeW+hMsgxH -W6iimD0RsfZ9oEbfJCPG0CRSZ7ppq5pKamYs2+EJ8Q2ysOFHHwpGrA2C8zyNAs4I -QxnZZIbETgcSwFtDun0XiqPwPZgyuXVm9PAbLZRbfBzm8wR/3SWygqZBBLdQk5TE -fDR+Eny/M1RVR4xClECONF9UBB2ejFdI1LD45APbP2hsN/piFByU1t7yK2gpFyRt -97WzGHn9MV5/TL7AmRPM4pcr3JacmtCnxXeCZ8nLqedoSuHFuhwyDnlAbu8I16O5 -XRrfzhrHRJFM1JnIiGmzZi6zBvH0ItfyX6ttABEBAAG0KW5naW54IHNpZ25pbmcg -a2V5IDxzaWduaW5nLWtleUBuZ2lueC5jb20+iQE+BBMBAgAoBQJOTjJiAhsDBQkJ -ZgGABgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRCr9b2Ce9m/YpvjB/98uV4t -94d0oEh5XlqEZzVMrcTgPQ3BZt05N5xVuYaglv7OQtdlErMXmRWaFZEqDaMHdniC -sF63jWMd29vC4xpzIfmsLK3ce9oYo4t9o4WWqBUdf0Ff1LMz1dfLG2HDtKPfYg3C -8NESud09zuP5NohaE8Qzj/4p6rWDiRpuZ++4fnL3Dt3N6jXILwr/TM/Ma7jvaXGP -DO3kzm4dNKp5b5bn2nT2QWLPnEKxvOg5Zoej8l9+KFsUnXoWoYCkMQ2QTpZQFNwF -xwJGoAz8K3PwVPUrIL6b1lsiNovDgcgP0eDgzvwLynWKBPkRRjtgmWLoeaS9FAZV -ccXJMmANXJFuCf26iQFVBBMBCAA/AhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIX -gBYhBFc7/Ws9j7xkEHmmq6v1vYJ72b9iBQJmULK1BQkdphrTAAoJEKv1vYJ72b9i -2+AH/RSX5voZXtSAl0fxVc9GDrGesOsykkSELnailOkWiFEHZS842U1EQst9Omki -OC14xk9fY36gK8bxXnLwww4hnnh/fpj7vJkJpVCi2uO3RKizyN6rp+7xbZ2lCKfp -5tsDg5U4iaaziTNtb4ISq79gLmLY/gqBwGksRozmChsl2QOVgg0KDTI5TP+41IwW -AFuO+XzHZ7OEegxwHta65KeVNipYjCarTRcRhGxA0rpLdBynkZ/OaI5+J6UZVfna -2eyDgHPlMo+v12+g/wOFOwShVWo4PwIsZw1jzBCLhspgezn7IolQFMHtVxCJAkgw -XhLgogChbe885HzTB6GlMowXclGJATMEEAEIAB0WIQRzOJcwae0/RD9NN9+mT9Wx -ets5qAUCZlcuRQAKCRCmT9Wxets5qD1GB/4/NIcvCRj3LvFbrtmtbExBoBP6Hv/8 -U4wUpuJbAAxImJ9uNKKaH+cmvoshkWTSUBXTvNjAQW3SM9oW+V3G7wicUtH+7cnd -xExuqf5e6f6IGqKCgrV25g0WWvJZG6ynMDDkgnyu3fTE7GkVKwoWQ6qV6Akar8oV -29P+xe2U7AWPvw+O+SBghl32x8DA/nUjIyLbvBQuXb6BjHOxrTw3WOJDfwHwOyMd -P7NHe7RE70cSj/TNabuNw9c31H0+PAj+UWfvgs5diPVJ9Fd/PK4pWQoh/4poMEbc -/1Ol0G7SItUKO6v4aHn89g00xnqUxrfwbCWCEF9EjnfFtlsDbGSWIdz8iQE+BBMB -AgAoAhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAUCV2K1+AUJGB4fQQAKCRCr -9b2Ce9m/YloaB/9XGrolkocm7l/tsVjaBQCteXKuwsm4XhCuAQ6YAwA1L1UheGOG -/aa2xJvrXE8X32tgcTjrKoYoXWcdxaFjlXGTt6jV85qRguUzvMOxxSEM2Dn115et -N9piPl0Zz+4rkx8+2vJGF+eMlruPXg/zd88NvyLq5gGHEsFRBMVufYmHtNfcp4ok -C1klWiRIRSdp4QY1wdrN1O+/oCTl8Bzy6hcHjLIq3aoumcLxMjtBoclc/5OTioLD -wSDfVx7rWyfRhcBzVbwDoe/PD08AoAA6fxXvWjSxy+dGhEaXoTHjkCbz/l6NxrK3 -JFyauDgU4K4MytsZ1HDiMgMW8hZXxszoICTTiQEcBBABAgAGBQJOTkelAAoJEKZP -1bF62zmo79oH/1XDb29SYtWp+MTJTPFEwlWRiyRuDXy3wBd/BpwBRIWfWzMs1gnC -jNjk0EVBVGa2grvy9JtxJKMd6l/PWXVucSt+U/+GO8rBkw14SdhqxaS2l14v6gyM -eUrSbY3XfToGfwHC4sa/Thn8X4jFaQ2XN5dAIzJGU1s5JA0tjEzUwCnmrKmyMlXZ -aoQVrmORGjCuH0I0aAFkRS0UtnB9HPpxhGVbs24xXZQnZDNbUQeulFxS4uP3OLDB -AeCHl+v4t/uotIad8v6JSO93vc1evIje6lguE81HHmJn9noxPItvOvSMb2yPsE8m -H4cJHRTFNSEhPW6ghmlfWa9ZwiVX5igxcvaIRgQQEQIABgUCTk5b0gAKCRDs8OkL -LBcgg1G+AKCnacLb/+W6cflirUIExgZdUJqoogCeNPVwXiHEIVqithAM1pdY/gca -QZmIRgQQEQIABgUCTk5fYQAKCRCpN2E5pSTFPnNWAJ9gUozyiS+9jf2rJvqmJSeW -uCgVRwCcCUFhXRCpQO2YVa3l3WuB+rgKjsSJAjMEEAEIAB0WIQTWeGzjA9mpAimY -3GzIRk1UmvdcCgUCZldKdQAKCRDIRk1UmvdcCj1hEACv1XfhwpsBPVNzcfzMIpfY -xAQF28m/VFLwD8FYKoVgb4rF2wLBtt9kaoPZxphEvV/FWHhpa3Tyr3L320r6sVk2 -5Ou6G/AH6kNF6vYn98chEmbCc7DE2B03G1HFFuRSOmp0ZwafJ6MYUhjpDrf6fFDL -fmdkr/hjLwCYvFQsHXYiIWDFBPZ6RvVC6ozbdFr4eWj+CIPZM4jcGTgSI/u67tC6 -8tOdX4a8/ujdkLDjyf2xgbWT8ZxY3o0fvfLFEQVpNMUsYtiW/kTPBsq48Gq2BWow -/2Ld86KjgBOyElnVy9kMLCB4d/DPnSdBkjHzWWDx2c/PDGWIGnES6O7NYvRQ9Sr0 -bQwtr70nvai2OkpYVszVwOqyr4vDeTIt0GFKOMRDRrscVGmlGr2mpExiCEgGyAjR -Z/aZDCzEnsswfJ+6IARYzE5nB3+pbJnzQNvj9r/YL8T9HkWID4sWJnnNmaFoWEMF -m+yvI8vyVMGPSqfVtN9pEpx/pzV/Q525nFYuUlEsqGgaDydnwe6AV9gZsRyA+YjE -H3gI1gxGwRyupldmstzoYzTktb4o1KL/vGj/onUIk8mFKx8p1X9VPWW0+8LqnAYf -Ui3jDoXE/9avsF6ipS7y1k8ga81z01NOvuhai3c9pvMAIYrNTvoQVz8vTIOtJac1 -PEoU6jdm8blCt2UjGp8A4okBswQQAQgAHRYhBBPIKmO2A1dhVuMKTqDqmBtmsNln -BQJmV1HrAAoJEKDqmBtmsNlntoEMANBPdskGMrU4ZxHMlOTd1JX74ucp5jez0Y2o -bwlxOiWroraYVBnWT9v150kNf1Tb5mDxi820qebiSPZxhlI1Kj7NrPFNxQkhhNzN -7Xr/M9OGpkwxosEpcMAiWfofyAdrnwos+MA/edu/EoyVRs6zpo75nP9GKUZwVcjH -KtvPMojkZYpxjxsio0aK8LW8VwDtsbwPIXDIHzE7sxUvThrMdXumrh7gKqaC6gep -HZB2lL5ES0kVE3/yjZR1khmcmF1zELeC0IddJjX2R9HMcSLixdJ2V8/VFsWMb2KQ -pGtDzCuRyyxbugzBIxiGV2Xb7XwOByaikc1duqFv3gtk7Vk8wgQN3YwLkZ6pztlK -vCbqy2b2wlPviGjApQ2GVd6EEmlCk2gKPkjrn2lxS2BXWorM+ANSswJT+eILi9yW -Q5zzmYK2vFTzL7FAMeqS/671jNhZQ8O7jvbY/mRhl66k2MY7/JgI+coP0cY+HHr2 -ozw9yNdOZmnk2Prj7+mBuchbT3BJOQ== -=AgHy ------END PGP PUBLIC KEY BLOCK----- ------BEGIN PGP PUBLIC KEY BLOCK----- - -mQINBGZXO1wBEADEm061e/MGo2f7rpSqokI59in/egWbeQE26vwxB7vPu4e7j+cU -Vg3AezwCbf3nVRAE9DpJ+yuB0KVkM/0QszjOEEBuehZYJrUiwMyiY6jAk8xtqjpV -PsOMyZrypoJhwzg/sYNadUPw4UoHJ/xq4wNA2ZG9Xf0l8M3shYJPmKWLz/eefa5V -Ef/toQ7a55l0aJ7XyACTU6dv4bkHHqomDImK2C94s+KyCxaFyz6NgFz25V/j66Am -gB1m6UGGsvP4qYXW+KTsLz9XDvJeLLHWNcqQoyUO5Vs5C3hGozL7kEkyK/1qHcou -XXkeGN365z93ZeK+VdBZKJtsCswPk2wdDBByU9lAUNHYcLHf6S8fwCACeIqJ6LaY -MKmZUN2gR/boTyMERHEA8XnWXTDp7EsSNIc+LkU5AT8yesANcczH5k/XOI4hltJC -piEsSgg9V7FvO4eA2iQWGv/Y4nlUfw3lbRuRFvd7oqVQKlX4iIs++kVCCegBvtNA -1naxPbvTqrC4THvBSSZpOW/y/6XibAr/scCNNW1mEhwm5SPBHq9Sv35p6xKDTcgQ -8o3KLM8tKKt6kokAqlrXk9Nq6LYrZKwg5a9crFF7nCL2xgxZy1OJQVcPuhhZy5WT -WReE5RJdlF5VGRT9nMJ3B4Vlp5luQnMUFYXTAKQd6Cogbb99J4MjDttAlwARAQAB -tCtuZ2lueCBzaWduaW5nIGtleSA8c2lnbmluZy1rZXktM0BuZ2lueC5jb20+iQIi -BBMBCgAWBQJmVztcCRC83NijjYiiswIbAwIZAQAA9FMQAJ/e8F1egZGbRIV6qU/Q -bJD3EsKZZlitQSVXbBpxqDlkD+uzSFATGjiLGvJoTzfpJpJjI7FwrtO74lRkjCl9 -wQUNJ+wm2Kod6rEEQc6lWkDsgxpjqAAGVS0lmMf+VPBGQ+kc8S3ZdCOWEeq7nThZ -/xWR+UuQQcz1vCKmEgwTrr5MJVcqDg4wiH1Z4lRVfjTezf9IWk+xeE3mV8h7Ltbr -N5ZvOkiw88JLrbQsurxx+lYEaGIZyIk3huiDE/KpsMdw9KXUfoDcBqWc7oDjqKL+ -QEaq7TW6VetKyJaakP6Do+Opx0BtS3eH86PEZqtULEw9WifC86GtRr50iTXWBTfI -MFZo4AwigHXvZ5WrJvLfldY+scoU1rPMouYlZJ9W+6YHLjf/jpr4W1w6LKKXX3ah -h4VLtlOmrOLA21E7RQ0PwoE6nT7DAm1DsMFCXy7lyp3u5IXGahnJddWCb0Px3RTm -PZgOt+YAGJDsP46ngl5LxhilMK5f5R8v5n1lJ/XzFcXCEN4i/d8A1jx9DQx4CJN1 -wp/WZzJ6GjnCqMCdOBlQ2eNmhR+q1bAI79kSv86ahaM/aS1FvHMz8ppzwkRhv5jY -eR9aRlAwaCPOjbWhYJt/xveOWmxCdg5ta+Pj5g+41wHZyNf9aqR314aKwsxo2AYH -uUe+PgpsHbe1sQTkb/W1OfSCiQEzBBABCAAdFiEEcziXMGntP0Q/TTffpk/VsXrb -OagFAmZXO+kACgkQpk/VsXrbOajGgwf8CAXJwSIhGOWFSgV6vpvZPChTsgteZxhT -8NrJJLxL8X34Rw5YctSli4akkchTonm5RRp/SlvI2fPe0o6q2ymF4BASPJ/oSI3p -Gs/jwctHz8hwaVN0xQ4SBXgquIFWrLRNOjCxEV/vMRJRzuF9jrrdv3vxZEugETI+ -rnoEZu2Z2ZlMj7PPeiScf8dFXax67+Xi5S2KJCaXm1QGAJvttHrwsbBAIE9CVUg4 -UmXwADQ6HkOKjY+QS5AP8Ak1dg8/oadgyMqB4GrcE44KUpo4YafP37XnwXfQNKpk -Rb0bO9Qm9lM/LhPulBY8WIPkmrFCVhGTE6K5ZvI59R4nECHHx24/LYkBMwQQAQgA -HRYhBFc7/Ws9j7xkEHmmq6v1vYJ72b9iBQJmVzzzAAoJEKv1vYJ72b9iPPIIAJ5k -hTz2d7CaJefHzoraogKSIeBnA3OR+nDgdDl9Mp8i2WLGu9YYhIrPU0iSVw8jqa8t -GIjCw4/bS9HN8oub2Ip802xDLugCz1Yz6CXjCXN2rlNPsdBV8IIKNHOv93qMvnZS -DwyBUAvAs4XzF7zbYgfZ30B0gRI0g0+Nt44oDOn3PfO/kNUJyBVPT9m7l3JUHuZT -FPOD8a0oJPvW+iYlSkmPELBvgehsX7MVLoeQ5qtS1KkuWr+y1wqD5kxqabMPcfdU -jAr4ssXs/pSsYJVyS4CuUWkY4FiCJm4KtU+XPDs1RCTzMkW6HHgSebocTZzLETYw -XsDx80qd21UAdGc116qJAjMEEAEIAB0WIQTWeGzjA9mpAimY3GzIRk1UmvdcCgUC -ZldKYgAKCRDIRk1UmvdcCoG/D/9qLmHYOGnsmedUbgtLmuBJOuA6oqnaWxYI45eV -+vaAaI2+QfRoJTrjklTXv29Pi4LTzN5YBySSIkv/z9ry5Xsz5yroNY9Xb6JdrqOt -fLa/U0wddNuJbmIom4gUPXGInhHUBbP6mNz+s6e2ukBEWvb2XIsGe5v291QXMohQ -/PT8zTIwNYaw2zVF6Sa/0spA9/9XA5BdUcrtl7xPgYL7pLVmKYGJlCf5TOaWfLDJ -mIMeeUznVK9vK+vT+YqUPfFyIqO7dvio/+MRFjePoD6csT4UBT009ugy8vrYg2YR -K9uaRxP3laz9b6xdUM648ycUQLoI4fLhyKAHwPU9/Q+4rOFdrL72ZGVKzv1XOB0H -VXf0/E4JmJBydM7AyXHNxIPDtNFydosGn6VZsEvSPZdQSCsCeBs9UuBWgwFb1XBB -61XiHGnheb3U3ZRkajS1ZNdxfohHrBzHnd8tbDkv5Rq+XoUmDauoeM0VcN15hl4a -M/JzkeOrHuJicn3mg+HRHxQSCl3D37bVQT7O36n7cff22GykT7XQUBBxMlhKzygD -SgdQUtSEt0eu7AXIvr6yl0kobgZQS3wzUIaY0JEuv2ahtEXXjoPzCVWB2OHIpPbu -D58cpyyEVqr+ZecaI4HlaO9lVShf+K0rf/6DC12rC2gNzzv/fCIinDiqiMsPTfEM -fduRSYkBswQQAQgAHRYhBBPIKmO2A1dhVuMKTqDqmBtmsNlnBQJmV1HlAAoJEKDq -mBtmsNlnhI4L/0MHtfCZ2nuKTF/BkxJ7oB3Uule0tWiFj5SU97GjcVj1LgawGY7Y -+zoyEd6Twpl6H/+QkZBB55Bf8+cTzRbDzH1Og0fSORu0pGC0uxWdYu1sTLeTnn93 -mesXAvevHFNbsPchIWwsVJopTdzMWuAQS5hMMMtNb/14ZfnBadzhjvaJeH3DlZVK -0cGFp0qfbMfjr9yRJzQ1IkiXsS4G4uKg9T+KRsPr4+JalurWJgLnBXZGetNNjjUa -UCV1KZY/iWCAlZjkZ5z7yBRj5nUWLb5AVouEQPEDbn+i/0uEjukC+G6EMq2mgbrh -m0bFHbHAYBaf9EH0eP799HpoAx2aziDB5igAC516i3BnqxINI9mXHh92tU/H797I -oYZvpBsAHDWDHj6O74jwk5lXF5Qwri8gjA8aTudmuQX3uX4h0/FyGGQJW4/wWecH -/1fMuvHHyRtOSsJsheDwcSjrw5WlsyNjvSIbBPV2fIx60W2haVMUVX6CrxAeq44F -UYda9m8fOnaIew== -=TEOn ------END PGP PUBLIC KEY BLOCK----- ------BEGIN PGP PUBLIC KEY BLOCK----- - -mQINBGKE4psBEADpHSM/IxFD1nXBmnODYXzcl2A+6b6m9m1m2Y4Dlr0ed+y5Lxne -QidE9I74A2KSm6+eHW2yh4i1ZwZbmwpmQqM+j5BMt7axoXOdKSyN+fYtUakzNbBN -EDRKT79q/zIzkgTJradHkCQkwF1W3go+qPXjR2ZEnLma9dZED9VNI6PmOpeYaASo -IkEfbKbwa/vPrvnDSSYY6Y02RXSRk5U1NvQgVUTJP9WGK7NlPUcTBDELLQv6fFPU -kjBOel6MecsQ+v8iq4RJF2cbVF0hNjbAiNldjLV74Xd7yWVRlCbdb2agyvQjMNrD -jHSvbEMiNB3R8yBHVW2Zldv8q0XjcwoDfdiZYFJe3lRUYmv6I2p+/DptD4r/3ILI -peGZtSeOdQEw+vvODL/Ehq03anTrzcpZ6sDLfLrYJhYcrltj0/LMUnLDAjciwRUq -XI46EfxwqsdLeqoZFQeO3LOFsh0kJKR2xOrUHIVy84NJ4Gmro6WmUkb1NfdjyHzF -z8Lfbo46NKoTcwFsFF0q74jVVIVNUyIS91DusiMqLCsP8jqDOz/kyP4bOJQ+aUXf -BANn4Ll1TFWsJ417moxz+Pi5sTaI0na8z2XB1N9WPsSml3FS75hJPJshN2T3VIea -zB7GFWqk33ynSDt+cAisG5nsK9fFdcH+t5wm59oobyFbFhKxwX6ROuxlZwARAQAB -tCRTZXJnZXkgS2FuZGF1cm92IDxwbHVrbmV0QG5naW54LmNvbT6JAk4EEwEKADgW -IQTWeGzjA9mpAimY3GzIRk1UmvdcCgUCYoTimwIbAwULCQgHAwUVCgkICwUWAwIB -AAIeAQIXgAAKCRDIRk1UmvdcCqbOD/9Htgk3mWvUFmrApkWQTIDNmLACZ1Sw1PXj -Uqte8StYB0bYY+nmAXs7O5eC2h1ViParl7En1joEEMQQmH0qSnw4X1CM/hA8TAYW -mBPITTNWo/R52WoyWeWGFnFNIperQmuIZc+pXm0VEFVPiX/2DXbCIu+jaXySvlCN -LekmOD4VC7dJS8/ohoaXOR2T8ufS+1CsyPXomEb+COhqRZ3EVBa+k7pnElkFft3Y -a1fR0AgatZFQpy+ukePhK7s/M5RGhDJWHgSAZFkf+X2jVV4NRJ+XsY80gU5DD2ZX -QT6Je6Knxqk7FnWNSxkhReH6Ss5flZSoGDCmJ2AsPtGeUhus2fGqeN+waGKTZC35 -die2V4/cro1SWswSI6Y5GFDZT1olIUztPmSXU/A3oyizJI7XZybwUbpk5kK83VXm -el3U/7Qr/VErlDWFefZWeUvT1RILZ8IRoNj4dv158RnKHt9G508A5qz4hUPKoSeq -SiXhYwfkc31WPzIJ4ev+X5Ka2sG/CKbEMJ7qwc0Kadiu+ePPfqqbXjpTWRyrbcRM -hRNcLNUi1SLWMBClOQG+5GNG1dPPHkbj4dO1OZuaUMwQdu8R8NlsGoVWS40bmVv5 -pXstzYCl7k/UnC/Ytlq61GeAoq8ILa6jGj0EWqlhvi0ZNMN+fROhzrRlTzIr/+WE -Xf8EiVNFSbQlU2VyZ2V5IEthbmRhdXJvdiA8cy5rYW5kYXVyb3ZAZjUuY29tPokC -TgQTAQoAOBYhBNZ4bOMD2akCKZjcbMhGTVSa91wKBQJihO2zAhsDBQsJCAcDBRUK -CQgLBRYDAgEAAh4BAheAAAoJEMhGTVSa91wKgLQQANaf4UMndkWoefDQPkJ5qR4K -fuV0WRz59riZEApTkVpPXzl8Y1i8Rgt9pa1v1i12vPyIXKav1rJXQcuDEzqrhQ2G -yvuAE2U/t2mYaMUmwxWO2d8JA3slvBSgOkiYpbLooDizAdKMT5UQWGyw31Wm51iz -HjoztebsyXeXgq9VDjv3D8LUBr/OY3Hguj6HV+zRtC95qgXYadW2FiCtvBK6RTDb -iShTuseLSheGh9dZIUSnzaOiJpDA61ZDYtFZxSpe67vEzhSfHVsF+ZdCjoWhhVv+ -+2wR4E0VQQtOM9uX1PMlZ5Ymr02/gidsXCM0ZjYXx4cDDhnq+nKomN64VloXWY9t -PIi86XmzcSWlGUd+Ac6LyW7/f64bUWs4Ih0Idl0PF0sAr/6axKUsIs1nbn5MEtXk -ZPAjcDLqLb9IIQaXRurm/il8v+bLXVBOJq33YUuGRuz8pu4vPA5Q97zglqhlIgbu -prHMJ9hl5q39JwS3As2rK0o6Q9VVKr29rqSEfk4wEttvk0QMMU5zEvVl8MtqPj42 -qURqpHOadFbYMTwhUmRBUszRZPa5/pWqq0gWOtpyCWFVAsHFWQGJM1Eo6gGEyHZM -YgBp+d29p2p409r1+06U67GBnXvUy0RyIpkLQtU+lyOJ6vvrBmmsDs/gc69GnlSC -tZmCt0pLesJ7ZJzGdDkduQINBGKE4psBEADQr/enuDeVT11v6ejuYrg7aaZaGFUe -3i28bQ4pRUKNfxs7zVYDDHi2i2bhS5j2yQnbsQtGcgoenw6lapmdQRzr4vjQAz9o -kT6l4qpqvFFQM0wZTnigVDmmO9vTHR8Uk3iCKTd2ax3oko/xPWWYJautJ6ex8cOA -coHSDeOjuIWSxCKq0BDFp6LoxkM8nuyLAX2cbhI3LncaZhVveMeN+Fmcsv+WpkKs -yhX92umZuGwlraSyFy23FiRWSZPu9qVIxMMHvVrQJIgfhyWaHFzoF4M4qDoSKx92 -uWfUWgFwPOxOJ6/YcPsX4T8qTl9htmwPN0BibPTlcWaIFXtiU5bE1MivUPeACrI/ -gwUfCR3Mg+GYc13C6jzepREUhI7PLi3+A203PlMZd/aaSZkP6j+h4cwdapH5P4uF -7T1EQ0MSdx3neAvu5p0IM6JpriwxfT3HsG+Y952T6MIeXcjNRebsBrygJhJ0/vyr -wV5t8jL0yQty4CiE/QFnBs42l+rngi7K7Y1AZRBGK7JA09XaoLrfLmS+PrbYPsaJ -flkM8GzUB7BBCLozxDHPzmPkf/A1w3XHZnYuZmS+pvjWCIoKpLQHI99oSUGho/TR -gMRO4v7EAzluqCiepMl0xwFfHB115ND/mATazc4Pt6FxUsqffzfZrN01e1UVPrp5 -4x6YLO80JnOY6QARAQABiQI2BBgBCgAgFiEE1nhs4wPZqQIpmNxsyEZNVJr3XAoF -AmKE4psCGwwACgkQyEZNVJr3XAp9ghAAgCgErxQYn/Lh/mzsxYXPnisggcBpceks -mGw7knj1EGkXqq9CHn3EjCw8dB5N857UFlUr++DHwpFL5O36PRQo33RIUFbmBypG -8C/xX1jWGu3xcaqS3P1ncsSSl6ckdvy9pjMxThm/RkXO0eJCn7FcanwPJXEB3Pbb -mm0wLI2OXl/m7l5QAr7kErnPvGNzcbX6G35Q/MY8mumBWQ9H53R5ZPpi+OS40Wfn -pZNKdh/Acwa7+2RokPqoOcJfxVdBOUigXTzb45qZgqEsSR7bkZAy2E80A/sJKPqs -OGjp9cog3rBYyNBn5dasfR9KeBtluKnjUbzutXsQoKUSECY00YGrtneSXMku5hoE -Dguk68w/L63ZApYHO/JTgJAYvqPOErAVUegPIw2CT1/2qi5vpClBcKkNS7RXrssA -X+lElE0zbzX3bNG+lQuXby7jNUFYltkEiz6vTtc4HuHy8u40DHMswzkoDr0T8IE0 -7ZRAWXwV1nlA/dI337cHCsWMJyqem5wZZO13iqe07qaCg1uvBPeqDo81hOCn1us7 -l5SYRUTlt7KSFEHZ+Sx4bmVneAuRi5okaQdmrepy/ss/vVpRwWuQxsPkvT8boS7s -mqOVsZFcNOuUJPUyOz1dHUL6FMYpk1dw+9n41gO4fLBzJekFTB/fxL6SRbYFWWn7 -x0VGHDmuaYQ= -=HmVo ------END PGP PUBLIC KEY BLOCK----- diff --git a/debian/vim/nginx.yaml b/debian/vim/nginx.yaml deleted file mode 100644 index 37cf6bf..0000000 --- a/debian/vim/nginx.yaml +++ /dev/null @@ -1,6 +0,0 @@ -addon: nginx -description: "allow syntax highlighting for Nginx configuration files" -files: - - ftdetect/nginx.vim - - indent/nginx.vim - - syntax/nginx.vim diff --git a/debian/watch b/debian/watch deleted file mode 100644 index 86d8da1..0000000 --- a/debian/watch +++ /dev/null @@ -1,3 +0,0 @@ -version=4 -opts=pgpsigurlmangle=s/$/.asc/ \ -https://nginx.org/download/nginx-(\d+\.\d+[02468]\.\d+)\.tar\.gz diff --git a/html/50x.html b/html/50x.html deleted file mode 100644 index a57c2f9..0000000 --- a/html/50x.html +++ /dev/null @@ -1,19 +0,0 @@ - - - -Error - - - -

An error occurred.

-

Sorry, the page you are looking for is currently unavailable.
-Please try again later.

-

If you are the system administrator of this resource then you should check -the error log for details.

-

Faithfully yours, nginx.

- - diff --git a/html/index.html b/html/index.html deleted file mode 100644 index e8f5622..0000000 --- a/html/index.html +++ /dev/null @@ -1,23 +0,0 @@ - - - -Welcome to nginx! - - - -

Welcome to nginx!

-

If you see this page, the nginx web server is successfully installed and -working. Further configuration is required.

- -

For online documentation and support please refer to -nginx.org.
-Commercial support is available at -nginx.com.

- -

Thank you for using nginx.

- - diff --git a/man/nginx.8 b/man/nginx.8 deleted file mode 100644 index 10db3e6..0000000 --- a/man/nginx.8 +++ /dev/null @@ -1,214 +0,0 @@ -.\" -.\" Copyright (C) 2010, 2019 Sergey A. Osokin -.\" Copyright (C) Nginx, Inc. -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" 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 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 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) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.\" -.Dd November 5, 2020 -.Dt NGINX 8 -.Os -.Sh NAME -.Nm nginx -.Nd "HTTP and reverse proxy server, mail proxy server" -.Sh SYNOPSIS -.Nm -.Op Fl ?hqTtVv -.Op Fl c Ar file -.Op Fl e Ar file -.Op Fl g Ar directives -.Op Fl p Ar prefix -.Op Fl s Ar signal -.Sh DESCRIPTION -.Nm -(pronounced -.Dq engine x ) -is an HTTP and reverse proxy server, a mail proxy server, and a generic -TCP/UDP proxy server. -It is known for its high performance, stability, rich feature set, simple -configuration, and low resource consumption. -.Pp -The options are as follows: -.Bl -tag -width ".Fl d Ar directives" -.It Fl ?\& , h -Print help. -.It Fl c Ar file -Use an alternative configuration -.Ar file . -.It Fl e Ar file -Use an alternative error log -.Ar file . -Special value -.Cm stderr -indicates that the standard error output should be used. -.It Fl g Ar directives -Set global configuration directives. -See -.Sx EXAMPLES -for details. -.It Fl p Ar prefix -Set the prefix path. -The default value is -.Pa %%PREFIX%% . -.It Fl q -Suppress non-error messages during configuration testing. -.It Fl s Ar signal -Send a signal to the master process. -The argument -.Ar signal -can be one of: -.Cm stop , quit , reopen , reload . -The following table shows the corresponding system signals: -.Pp -.Bl -tag -width ".Cm reopen" -compact -.It Cm stop -.Dv SIGTERM -.It Cm quit -.Dv SIGQUIT -.It Cm reopen -.Dv SIGUSR1 -.It Cm reload -.Dv SIGHUP -.El -.It Fl T -Same as -.Fl t , -but additionally dump configuration files to standard output. -.It Fl t -Do not run, just test the configuration file. -.Nm -checks the configuration file syntax and then tries to open files -referenced in the configuration file. -.It Fl V -Print the -.Nm -version, compiler version, and -.Pa configure -script parameters. -.It Fl v -Print the -.Nm -version. -.El -.Sh SIGNALS -The master process of -.Nm -can handle the following signals: -.Pp -.Bl -tag -width ".Dv SIGINT , SIGTERM" -compact -.It Dv SIGINT , SIGTERM -Shut down quickly. -.It Dv SIGHUP -Reload configuration, start the new worker process with a new -configuration, and gracefully shut down old worker processes. -.It Dv SIGQUIT -Shut down gracefully. -.It Dv SIGUSR1 -Reopen log files. -.It Dv SIGUSR2 -Upgrade the -.Nm -executable on the fly. -.It Dv SIGWINCH -Shut down worker processes gracefully. -.El -.Pp -While there is no need to explicitly control worker processes normally, -they support some signals too: -.Pp -.Bl -tag -width ".Dv SIGINT , SIGTERM" -compact -.It Dv SIGTERM -Shut down quickly. -.It Dv SIGQUIT -Shut down gracefully. -.It Dv SIGUSR1 -Reopen log files. -.El -.Sh DEBUGGING LOG -To enable a debugging log, reconfigure -.Nm -to build with debugging: -.Pp -.Dl "./configure --with-debug ..." -.Pp -and then set the -.Cm debug -level of the -.Va error_log : -.Pp -.Dl "error_log /path/to/log debug;" -.Pp -It is also possible to enable the debugging for a particular IP address: -.Bd -literal -offset indent -events { - debug_connection 127.0.0.1; -} -.Ed -.Sh ENVIRONMENT -The -.Ev NGINX -environment variable is used internally by -.Nm -and should not be set directly by the user. -.Sh FILES -.Bl -tag -width indent -.It Pa %%PID_PATH%% -Contains the process ID of -.Nm . -The contents of this file are not sensitive, so it can be world-readable. -.It Pa %%CONF_PATH%% -The main configuration file. -.It Pa %%ERROR_LOG_PATH%% -Error log file. -.El -.Sh EXIT STATUS -Exit status is 0 on success, or 1 if the command fails. -.Sh EXAMPLES -Test configuration file -.Pa ~/mynginx.conf -with global directives for PID and quantity of worker processes: -.Bd -literal -offset indent -nginx -t -c ~/mynginx.conf \e - -g "pid /var/run/mynginx.pid; worker_processes 2;" -.Ed -.Sh SEE ALSO -.\"Xr nginx.conf 5 -.\"Pp -Documentation at -.Pa http://nginx.org/en/docs/ . -.Pp -For questions and technical support, please refer to -.Pa http://nginx.org/en/support.html . -.Sh HISTORY -Development of -.Nm -started in 2002, with the first public release on October 4, 2004. -.Sh AUTHORS -.An -nosplit -.An Igor Sysoev Aq Mt igor@sysoev.ru . -.Pp -This manual page was originally written by -.An Sergey A. Osokin Aq Mt osa@FreeBSD.org.ru -as a result of compiling many -.Nm -documents from all over the world. diff --git a/modules/PLACEHOLDER b/modules/PLACEHOLDER deleted file mode 100644 index e69de29..0000000 diff --git a/modules/nginx-secure-token-module b/modules/nginx-secure-token-module deleted file mode 160000 index 24f7b99..0000000 --- a/modules/nginx-secure-token-module +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 24f7b99d9b665e11c92e585d6645ed6f45f7d310 diff --git a/modules/nginx-stream-preread-str-module b/modules/nginx-stream-preread-str-module deleted file mode 160000 index 7326626..0000000 --- a/modules/nginx-stream-preread-str-module +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7326626fce5d6ec31ac892377e0a734e503d40e6 diff --git a/modules/njs b/modules/njs deleted file mode 160000 index 4fd3ff9..0000000 --- a/modules/njs +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4fd3ff98e413ede57c88456cf84b116a8382061a diff --git a/modules/quickjs b/modules/quickjs deleted file mode 160000 index 1fdc768..0000000 --- a/modules/quickjs +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1fdc768fdc8571300755cdd3e4654ce99c0255ce diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/.travis.yml b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/.travis.yml deleted file mode 100644 index 57d2b8a..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/.travis.yml +++ /dev/null @@ -1,46 +0,0 @@ -# required for http2 support in curl. -dist: bionic -language: c -sudo: false -matrix: - include: - # unfortunately, gcc-4.9 is dropped in bionic - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-5 - env: - - MATRIX_EVAL="CC=gcc-5 && CXX=g++-5" - - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-6 - env: - - MATRIX_EVAL="CC=gcc-6 && CXX=g++-6" - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-7 - env: - - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" - - -script: -- script/.travis-compile.sh -- script/.travis-before-test.sh -- script/.travis-test.sh -after_success: -- killall nginx -after_failure: -- killall nginx - diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/CONTRIBUTING.md b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/CONTRIBUTING.md deleted file mode 100644 index a9eabff..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/CONTRIBUTING.md +++ /dev/null @@ -1,27 +0,0 @@ -# Contributing - -Want to contribute? Great! First, read this page (including the small print at the end). - -### Before you contribute -Before we can use your code, you must sign the -[Google Individual Contributor License Agreement](https://cla.developers.google.com/about/google-individual) -(CLA), which you can do online. The CLA is necessary mainly because you own the -copyright to your changes, even after your contribution becomes part of our -codebase, so we need your permission to use and distribute your code. We also -need to be sure of various other things—for instance that you'll tell us if you -know that your code infringes on other people's patents. You don't have to sign -the CLA until after you've submitted your code for review and a member has -approved it, but you must do it before we can put your code into our codebase. -Before you start working on a larger contribution, you should get in touch with -us first through the issue tracker with your idea so that we can help out and -possibly guide you. Coordinating up front makes it much easier to avoid -frustration later on. - -### Code reviews -All submissions, including submissions by project members, require review. We -use Github pull requests for this purpose. - -### The small print -Contributions made by corporations are covered by a different agreement than -the one above, the -[Software Grant and Corporate Contributor License Agreement](https://cla.developers.google.com/about/google-corporate). diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/LICENSE b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/LICENSE deleted file mode 100644 index db3aca7..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2002-2015 Igor Sysoev - * Copyright (C) 2011-2015 Nginx, Inc. - * Copyright (C) 2015-2019 Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * 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 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 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) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/README.md b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/README.md deleted file mode 100644 index 80428e9..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/README.md +++ /dev/null @@ -1,177 +0,0 @@ -# ngx_brotli - -Brotli is a generic-purpose lossless compression algorithm that compresses data -using a combination of a modern variant of the LZ77 algorithm, Huffman coding -and 2nd order context modeling, with a compression ratio comparable to the best -currently available general-purpose compression methods. It is similar in speed -with deflate but offers more dense compression. - -ngx_brotli is a set of two nginx modules: - -- ngx_brotli filter module - used to compress responses on-the-fly, -- ngx_brotli static module - used to serve pre-compressed files. - -[![TravisCI Build Status](https://travis-ci.org/google/ngx_brotli.svg?branch=master)](https://travis-ci.org/google/ngx_brotli) - -## Table of Contents - -- [Status](#status) -- [Installation](#installation) -- [Configuration directives](#configuration-directives) - - [`brotli_static`](#brotli_static) - - [`brotli`](#brotli) - - [`brotli_types`](#brotli_types) - - [`brotli_buffers`](#brotli_buffers) - - [`brotli_comp_level`](#brotli_comp_level) - - [`brotli_window`](#brotli_window) - - [`brotli_min_length`](#brotli_min_length) -- [Variables](#variables) - - [`$brotli_ratio`](#brotli_ratio) -- [Sample configuration](#sample-configuration) -- [Contributing](#contributing) -- [License](#license) - -## Status - -Both Brotli library and nginx module are under active development. - -## Installation - -### Dynamically loaded - - $ cd nginx-1.x.x - $ ./configure --with-compat --add-dynamic-module=/path/to/ngx_brotli - $ make modules - -You will need to use **exactly** the same `./configure` arguments as your Nginx configuration and append `--with-compat --add-dynamic-module=/path/to/ngx_brotli` to the end, otherwise you will get a "module is not binary compatible" error on startup. You can run `nginx -V` to get the configuration arguments for your Nginx installation. - -`make modules` will result in `ngx_http_brotli_filter_module.so` and `ngx_http_brotli_static_module.so` in the `objs` directory. Copy these to `/usr/lib/nginx/modules/` then add the `load_module` directives to `nginx.conf` (above the http block): -```nginx -load_module modules/ngx_http_brotli_filter_module.so; -load_module modules/ngx_http_brotli_static_module.so; -``` - -### Statically compiled - - $ cd nginx-1.x.x - $ ./configure --add-module=/path/to/ngx_brotli - $ make && make install - -This will compile the module directly into Nginx. - -## Configuration directives - -### `brotli_static` - -- **syntax**: `brotli_static on|off|always` -- **default**: `off` -- **context**: `http`, `server`, `location` - -Enables or disables checking of the existence of pre-compressed files with`.br` -extension. With the `always` value, pre-compressed file is used in all cases, -without checking if the client supports it. - -### `brotli` - -- **syntax**: `brotli on|off` -- **default**: `off` -- **context**: `http`, `server`, `location`, `if` - -Enables or disables on-the-fly compression of responses. - -### `brotli_types` - -- **syntax**: `brotli_types [..]` -- **default**: `text/html` -- **context**: `http`, `server`, `location` - -Enables on-the-fly compression of responses for the specified MIME types -in addition to `text/html`. The special value `*` matches any MIME type. -Responses with the `text/html` MIME type are always compressed. - -### `brotli_buffers` - -- **syntax**: `brotli_buffers ` -- **default**: `32 4k|16 8k` -- **context**: `http`, `server`, `location` - -**Deprecated**, ignored. - -### `brotli_comp_level` - -- **syntax**: `brotli_comp_level ` -- **default**: `6` -- **context**: `http`, `server`, `location` - -Sets on-the-fly compression Brotli quality (compression) `level`. -Acceptable values are in the range from `0` to `11`. - -### `brotli_window` - -- **syntax**: `brotli_window ` -- **default**: `512k` -- **context**: `http`, `server`, `location` - -Sets Brotli window `size`. Acceptable values are `1k`, `2k`, `4k`, `8k`, `16k`, -`32k`, `64k`, `128k`, `256k`, `512k`, `1m`, `2m`, `4m`, `8m` and `16m`. - -### `brotli_min_length` - -- **syntax**: `brotli_min_length ` -- **default**: `20` -- **context**: `http`, `server`, `location` - -Sets the minimum `length` of a response that will be compressed. -The length is determined only from the `Content-Length` response header field. - -## Variables - -### `$brotli_ratio` - -Achieved compression ratio, computed as the ratio between the original -and compressed response sizes. - -## Sample configuration - -``` -brotli on; -brotli_comp_level 6; -brotli_static on; -brotli_types application/atom+xml application/javascript application/json application/rss+xml - application/vnd.ms-fontobject application/x-font-opentype application/x-font-truetype - application/x-font-ttf application/x-javascript application/xhtml+xml application/xml - font/eot font/opentype font/otf font/truetype image/svg+xml image/vnd.microsoft.icon - image/x-icon image/x-win-bitmap text/css text/javascript text/plain text/xml; -``` - -## Contributing - -See [Contributing](CONTRIBUTING.md). - -## License - - Copyright (C) 2002-2015 Igor Sysoev - Copyright (C) 2011-2015 Nginx, Inc. - Copyright (C) 2015 Google Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - 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 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 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) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/config b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/config deleted file mode 100644 index 42162a6..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/config +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (C) 2019 Google Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# 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 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 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) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. - -# Make sure the module knows it is a submodule. -ngx_addon_name=ngx_brotli -. $ngx_addon_dir/filter/config - -# Make sure the module knows it is a submodule. -ngx_addon_name=ngx_brotli -. $ngx_addon_dir/static/config - -# The final name for reporting. -ngx_addon_name=ngx_brotli diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/changelog b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/changelog deleted file mode 100644 index c7021b7..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/changelog +++ /dev/null @@ -1,49 +0,0 @@ -libnginx-mod-http-brotli (1.0.0~rc-6) unstable; urgency=medium - - * d/control: update my email to janmojzis@debian.org - * d/copyright: update my email to janmojzis@debian.org - * d/control: bump Standards-Version: 4.7.2, no changes - * d/copyright: bump debian/* copyright year - * d/watch: use more generic template - - -- Jan Mojžíš Fri, 11 Apr 2025 14:26:55 +0200 - -libnginx-mod-http-brotli (1.0.0~rc-5) unstable; urgency=medium - - * d/control: remove Build-Depends nginx-abi-1.24.0-1 - - -- Jan Mojžíš Sat, 07 Oct 2023 15:31:24 +0200 - -libnginx-mod-http-brotli (1.0.0~rc-4) unstable; urgency=medium - - * NEW ABI: rebuild with nginx-abi-1.24.0-1 - - -- Jan Mojžíš Tue, 27 Jun 2023 23:16:35 +0200 - -libnginx-mod-http-brotli (1.0.0~rc-3) unstable; urgency=medium - - * d/watch: updated uversionmangle to be more generic - * d/copyright: reformat text to be compatible with 'cme update dpkg-copyright' - * NEW ABI: rebuild with nginx-abi-1.22.1-7 - - -- Jan Mojžíš Mon, 13 Feb 2023 12:56:11 +0100 - -libnginx-mod-http-brotli (1.0.0~rc-2) unstable; urgency=medium - - * d/t/generic rework. The test now checks module after - installation/reload/restart. - * d/control: bump Standards-Version: 4.6.2, no changes - * d/p/0001-Fix-Vary-header.patch added (Closes: 1028153) - "brotli_static on;" causes "Vary: Accept-Encoding" to be added to every - file (including images, ...) - The patch fixes the problem and adds "Vary: Accept-Encoding" only to - responses when brotli static compression is used. - * d/changelog: bump my copyright year - - -- Jan Mojžíš Fri, 13 Jan 2023 17:45:13 +0100 - -libnginx-mod-http-brotli (1.0.0~rc-1) unstable; urgency=medium - - * Initial release. (Closes: 1025515) - - -- Jan Mojžíš Tue, 06 Dec 2022 10:25:40 +0100 diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/control b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/control deleted file mode 100644 index 6e5752d..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/control +++ /dev/null @@ -1,41 +0,0 @@ -Source: libnginx-mod-http-brotli -Section: httpd -Priority: optional -Maintainer: Debian Nginx Maintainers -Uploaders: Jan Mojžíš , -Build-Depends: debhelper-compat (= 13), - dh-sequence-nginx, - libbrotli-dev, -Standards-Version: 4.7.2 -Homepage: https://github.com/google/ngx_brotli -Vcs-Git: https://salsa.debian.org/nginx-team/libnginx-mod-http-brotli.git -Vcs-Browser: https://salsa.debian.org/nginx-team/libnginx-mod-http-brotli -Rules-Requires-Root: no - -Package: libnginx-mod-http-brotli-filter -Architecture: any -Multi-Arch: foreign -Depends: ${misc:Depends}, - ${shlibs:Depends}, -Description: Brotli lossless compression support for Nginx - filter - Brotli is a generic-purpose lossless compression algorithm that compresses - data using a combination of a modern variant of the LZ77 algorithm, Huffman - coding and 2nd order context modeling, with a compression ratio comparable - to the best currently available general-purpose compression methods. It is - similar in speed with deflate but offers more dense compression. - . - ngx_brotli filter module - used to compress responses on-the-fly - -Package: libnginx-mod-http-brotli-static -Architecture: any -Multi-Arch: foreign -Depends: ${misc:Depends}, - ${shlibs:Depends}, -Description: Brotli lossless compression support for Nginx - static - Brotli is a generic-purpose lossless compression algorithm that compresses - data using a combination of a modern variant of the LZ77 algorithm, Huffman - coding and 2nd order context modeling, with a compression ratio comparable - to the best currently available general-purpose compression methods. It is - similar in speed with deflate but offers more dense compression. - . - ngx_brotli static module - used to serve pre-compressed files diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/copyright b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/copyright deleted file mode 100644 index 2ecfff5..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/copyright +++ /dev/null @@ -1,72 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: ngx-brotli -Source: https://github.com/google/ngx_brotli - -Files: * -Copyright: 2015-2019, Google Inc. - 2011-2015, Nginx, Inc. - 2002-2015, Igor Sysoev -License: BSD-2-clause - -Files: CONTRIBUTING.md -Copyright: Copyright (C) 2015 Google Inc. - Copyright (C) 2011-2015 Nginx, Inc. - Copyright (C) 2002-2015 Igor Sysoev -License: BSD-2-clause - -Files: config -Copyright: 2015-2019, Google Inc. -License: BSD-2-clause - -Files: debian/* -Copyright: 2022, Miao Wang - 2022-2025, Jan Mojzis -License: BSD-2-clause - -Files: filter/* -Copyright: 2015-2019, Google Inc. -License: BSD-2-clause - -Files: filter/ngx_http_brotli_filter_module.c -Copyright: Nginx, Inc. - Igor Sysoev - Google Inc. -License: BSD-2-clause - -Files: script/* -Copyright: Copyright (C) 2015 Google Inc. - Copyright (C) 2011-2015 Nginx, Inc. - Copyright (C) 2002-2015 Igor Sysoev -License: BSD-2-clause - -Files: static/* -Copyright: 2015-2019, Google Inc. -License: BSD-2-clause - -Files: static/ngx_http_brotli_static_module.c -Copyright: Nginx, Inc. - Igor Sysoev - Google Inc. -License: BSD-2-clause - -License: BSD-2-clause - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - 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 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 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) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/gbp.conf b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/gbp.conf deleted file mode 100644 index 38c12c1..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/gbp.conf +++ /dev/null @@ -1,9 +0,0 @@ -[DEFAULT] -debian-branch = main -upstream-branch = upstream -upstream-tag = upstream/%(version)s -pristine-tar = True -sign-tags = True - -[import-orig] -merge-mode = replace diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/libnginx-mod-http-brotli-filter.install b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/libnginx-mod-http-brotli-filter.install deleted file mode 100644 index 5fcd39d..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/libnginx-mod-http-brotli-filter.install +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/nginx/modules/ngx_http_brotli_filter_module.so diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/libnginx-mod-http-brotli-static.install b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/libnginx-mod-http-brotli-static.install deleted file mode 100644 index dd4a44e..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/libnginx-mod-http-brotli-static.install +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/nginx/modules/ngx_http_brotli_static_module.so diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/patches/0001-Fix-Vary-header.patch b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/patches/0001-Fix-Vary-header.patch deleted file mode 100644 index 09735a7..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/patches/0001-Fix-Vary-header.patch +++ /dev/null @@ -1,38 +0,0 @@ -From: Jan Mojzis -Date: Fri, 13 Jan 2023 12:59:07 +0100 -Subject: Fix 'Vary' header - -The patch fixes problem described here: -https://github.com/google/ngx_brotli/issues/97 - -"brotli_static on;" causes "Vary: Accept-Encoding" to be added to every -file (including images, ...) -The patch fixes the problem and adds "Vary: Accept-Encoding" only to -responses when brotli static compression is used. ---- - static/ngx_http_brotli_static_module.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/static/ngx_http_brotli_static_module.c b/static/ngx_http_brotli_static_module.c -index 8f96177..44f0cb0 100644 ---- a/static/ngx_http_brotli_static_module.c -+++ b/static/ngx_http_brotli_static_module.c -@@ -168,7 +168,6 @@ static ngx_int_t handler(ngx_http_request_t* req) { - /* Ignore request properties (e.g. Accept-Encoding). */ - } else { - /* NGX_HTTP_BROTLI_STATIC_ON */ -- req->gzip_vary = 1; - rc = check_eligility(req); - if (rc != NGX_OK) return NGX_DECLINED; - } -@@ -227,6 +226,10 @@ static ngx_int_t handler(ngx_http_request_t* req) { - return NGX_DECLINED; - } - -+ if (cfg->enable == NGX_HTTP_BROTLI_STATIC_ON) { -+ req->gzip_vary = 1; -+ } -+ - /* So far so good. */ - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, "http static fd: %d", - file_info.fd); diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/patches/series b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/patches/series deleted file mode 100644 index dfd7340..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/patches/series +++ /dev/null @@ -1 +0,0 @@ -0001-Fix-Vary-header.patch diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/rules b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/rules deleted file mode 100755 index d8309f6..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/rules +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/make -f - -export DEB_BUILD_MAINT_OPTIONS = hardening=+all - -%: - dh $@ diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/source/format b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/source/format deleted file mode 100644 index 163aaf8..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/tests/control b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/tests/control deleted file mode 100644 index de69689..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/tests/control +++ /dev/null @@ -1,22 +0,0 @@ -Tests: generic -Restrictions: allow-stderr isolation-container needs-root -Depends: curl, - nginx, - nginx-core, - @, - -Tests: static -Restrictions: allow-stderr isolation-container needs-root -Depends: brotli, - curl, - libnginx-mod-http-brotli-static, - nginx, - nginx-core, - -Tests: filter -Restrictions: allow-stderr isolation-container needs-root -Depends: brotli, - curl, - libnginx-mod-http-brotli-filter, - nginx, - nginx-core, diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/tests/filter b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/tests/filter deleted file mode 100644 index 16ac356..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/tests/filter +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -set -e - -cat < "/etc/nginx/sites-enabled/default" -server { - listen 80 default_server; - root /var/www/html; - - location /helloworld { - default_type text/plain; - brotli on; - brotli_types text/plain; - brotli_min_length 10; - brotli_comp_level 11; - } -} -EOF - -mkdir -p /var/www/html -echo 'hello world' > /var/www/html/helloworld - -exp="content-encoding: br -hello world -response_code: 200" - -nginx -t -invoke-rc.d nginx restart || { journalctl -n all -xu nginx.service; exit 1; } - -out=`curl --compressed --fail -D- -w "response_code: %{http_code}\n" http://127.0.0.1/helloworld` -out=`echo "${out}" | sed 's/\r//'` -out=`echo "${out}" | awk '{print tolower($0)}'` -out=`echo "${out}" | grep '^content-encoding: \|^hello world$\|response_code: '` - -if [ x"${out}" != x"${exp}" ]; then - echo "output:" - echo "=====================" - echo "${out}" - echo "=====================" - echo "expected output:" - echo "=====================" - echo "${exp}" - echo "=====================" - exit 1 -fi diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/tests/generic b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/tests/generic deleted file mode 100644 index a14fc80..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/tests/generic +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -# version 20221215 - -# generic test that only verifies that nginx is running with the given -# libnginx-... module -# - after installation -# - after nginx reload -# - after nginx restart - -EX=0 -CURL_CMD="curl --max-time 60 --silent --fail -o /dev/null" - -#change directory to $AUTOPKGTEST_TMP -cd "${AUTOPKGTEST_TMP}" - -echo -n "curl after installation: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx reload ... " -if invoke-rc.d nginx reload; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - - -echo -n "curl after reload: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx restart ... " -if invoke-rc.d nginx restart; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - -echo -n "curl after restart: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -if [ ${EX} -ne 0 ]; then - echo "=== journalctl ===" - journalctl -n all -xu nginx.service || : - - echo "=== error.log ===" - if [ `wc -l /var/log/nginx/error.log | cut -d ' ' -f1` -gt 100 ]; then - head -n 50 /var/log/nginx/error.log - echo '...' - tail -n 50 /var/log/nginx/error.log - else - cat /var/log/nginx/error.log - fi -fi - -exit ${EX} diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/tests/static b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/tests/static deleted file mode 100644 index bce1fbc..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/tests/static +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -set -e - -cat < "/etc/nginx/sites-enabled/default" -server { - listen 80 default_server; - root /var/www/html; - - location /helloworld { - brotli_static on; - } -} -EOF - -mkdir -p /var/www/html -echo 'hello world' | brotli -9 > /var/www/html/helloworld.br - -exp="hello world -response_code: 200" - -nginx -t -invoke-rc.d nginx restart || { journalctl -n all -xu nginx.service; exit 1; } - -out=`curl --compressed --fail -w "response_code: %{http_code}\n" http://127.0.0.1/helloworld` - -if [ x"${out}" != x"${exp}" ]; then - echo "output:" - echo "=====================" - echo "${out}" - echo "=====================" - echo "expected output:" - echo "=====================" - echo "${exp}" - echo "=====================" - exit 1 -fi diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/upstream/metadata b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/upstream/metadata deleted file mode 100644 index 30627c6..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/upstream/metadata +++ /dev/null @@ -1,4 +0,0 @@ ---- -Bug-Database: https://github.com/google/ngx_brotli/issues -Bug-Submit: https://github.com/google/ngx_brotli/issues/new -Repository-Browse: https://github.com/google/ngx_brotli diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/watch b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/watch deleted file mode 100644 index 08b8983..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/debian/watch +++ /dev/null @@ -1,6 +0,0 @@ -version=4 -opts="\ -uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha|a|b)\d*)$/$1~$2/,\ -" \ -https://github.com/google/ngx_brotli/tags \ -(?:.*?/)?v?@ANY_VERSION@@ARCHIVE_EXT@ diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/filter/config b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/filter/config deleted file mode 100644 index 9c27fc7..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/filter/config +++ /dev/null @@ -1,132 +0,0 @@ -# Copyright (C) 2015-2016 Google Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# 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 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 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) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. - -if [ "$ngx_addon_name" = "ngx_brotli" ]; then - BROTLI_MODULE_SRC_DIR="$ngx_addon_dir/filter" -else - BROTLI_MODULE_SRC_DIR="$ngx_addon_dir" -fi - -ngx_addon_name=ngx_brotli_filter - -if [ -z "$ngx_module_link" ]; then -cat << END - -$0: error: Brotli module requires recent version of NGINX (1.9.11+). - -END - exit 1 -fi - -ngx_module_type=HTTP_FILTER -ngx_module_name=ngx_http_brotli_filter_module - -brotli="$ngx_addon_dir/deps/brotli/c" -if [ ! -f "$brotli/include/brotli/encode.h" ]; then - brotli="/usr/local" -fi -if [ ! -f "$brotli/include/brotli/encode.h" ]; then - brotli="/usr" -fi -if [ ! -f "$brotli/include/brotli/encode.h" ]; then -cat << END - -$0: error: \ -Brotli library is missing from the $brotli directory. - -Please make sure that the git submodule has been checked out: - - cd $ngx_addon_dir && git submodule update --init && cd $PWD - -END - exit 1 -fi - -BROTLI_LISTS_FILE="$brotli/../scripts/sources.lst" - -if [ -f "$BROTLI_LISTS_FILE" ]; then - -BROTLI_LISTS=`cat "$BROTLI_LISTS_FILE" | grep -v "#" | tr '\n' '#' | \ - sed 's/\\\\#//g' | tr -s ' ' '+' | tr -s '#' ' ' | \ - sed 's/+c/+$brotli/g' | sed 's/+=+/=/g'` -for ITEM in ${BROTLI_LISTS}; do - VAR=`echo $ITEM | sed 's/=.*//'` - VAL=`echo $ITEM | sed 's/.*=//' | tr '+' ' '` - eval ${VAR}=\"$VAL\" -done - -else # BROTLI_LISTS_FILE - -BROTLI_ENC_H="$brotli/include/brotli/encode.h \ - $brotli/include/brotli/port.h \ - $brotli/include/brotli/types.h" -BROTLI_ENC_LIB="-lbrotlienc" - -fi - -ngx_module_incs="$brotli/include" -ngx_module_deps="$BROTLI_COMMON_H $BROTLI_ENC_H" -ngx_module_srcs="$BROTLI_COMMON_C $BROTLI_ENC_C \ - $BROTLI_MODULE_SRC_DIR/ngx_http_brotli_filter_module.c" -ngx_module_libs="$BROTLI_ENC_LIB -lm" -ngx_module_order="$ngx_module_name \ - ngx_pagespeed \ - ngx_http_postpone_filter_module \ - ngx_http_ssi_filter_module \ - ngx_http_charset_filter_module \ - ngx_http_xslt_filter_module \ - ngx_http_image_filter_module \ - ngx_http_sub_filter_module \ - ngx_http_addition_filter_module \ - ngx_http_gunzip_filter_module \ - ngx_http_userid_filter_module \ - ngx_http_headers_filter_module \ - ngx_http_copy_filter_module \ - ngx_http_range_body_filter_module \ - ngx_http_not_modified_filter_module \ - ngx_http_slice_filter_module" - -. auto/module - -if [ "$ngx_module_link" != DYNAMIC ]; then - # ngx_module_order doesn't work with static modules, - # so we must re-order filters here. - - if [ "$HTTP_GZIP" = YES ]; then - next=ngx_http_gzip_filter_module - elif echo $HTTP_FILTER_MODULES | grep pagespeed_etag_filter >/dev/null; then - next=ngx_pagespeed_etag_filter - else - next=ngx_http_range_header_filter_module - fi - - HTTP_FILTER_MODULES=`echo $HTTP_FILTER_MODULES \ - | sed "s/$ngx_module_name//" \ - | sed "s/$next/$next $ngx_module_name/"` -fi - -CFLAGS="$CFLAGS -Wno-deprecated-declarations" - -have=NGX_HTTP_BROTLI_FILTER . auto/have -have=NGX_HTTP_BROTLI_FILTER_MODULE . auto/have # deprecated diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/filter/ngx_http_brotli_filter_module.c b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/filter/ngx_http_brotli_filter_module.c deleted file mode 100644 index 592b767..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/filter/ngx_http_brotli_filter_module.c +++ /dev/null @@ -1,770 +0,0 @@ -/* - * Copyright (C) Igor Sysoev - * Copyright (C) Nginx, Inc. - * Copyright (C) Google Inc. - */ - -#include -#include -#include - -#if (NGX_HAVE_BROTLI_ENC_ENCODE_H) -#include -#else -#include -#endif - -/* Brotli and GZip modules never stack, i.e. when one of them sets - "Content-Encoding" the other becomes a pass-through filter. Consequently, - it is almost legal to reuse this "buffered" bit. - IIUC, buffered == some data passed to filter has not been pushed further. */ -#define NGX_HTTP_BROTLI_BUFFERED NGX_HTTP_GZIP_BUFFERED - -/* Module configuration. */ -typedef struct { - ngx_flag_t enable; - - /* Supported MIME types. */ - ngx_hash_t types; - ngx_array_t* types_keys; - - /* Minimal required length for compression (if known). */ - ssize_t min_length; - - ngx_bufs_t deprecated_unused_bufs; - - /* Brotli encoder parameter: quality */ - ngx_int_t quality; - - /* Brotli encoder parameter: (max) lg_win */ - size_t lg_win; -} ngx_http_brotli_conf_t; - -/* Instance context. */ -typedef struct { - /* Brotli encoder instance. */ - BrotliEncoderState* encoder; - - /* Payload length; -1, if unknown. */ - off_t content_length; - - /* (uncompressed) bytes pushed to encoder. */ - size_t bytes_in; - /* (compressed) bytes pulled from encoder. */ - size_t bytes_out; - - /* Input buffer chain. */ - ngx_chain_t* in; - - /* Output chain. */ - ngx_chain_t* out_chain; - - /* Output buffer. */ - ngx_buf_t* out_buf; - - /* Various state flags. */ - - /* 1 if encoder is initialized, output chain and buffer are allocated. */ - unsigned initialized : 1; - /* 1 if compression is finished / failed. */ - unsigned closed : 1; - /* 1 if compression is finished. */ - unsigned success : 1; - - /* 1 if out_chain is ready to be committed, 0 otherwise. */ - unsigned output_ready : 1; - /* 1 if output buffer is committed to the next filter and not yet fully used. - 0 otherwise. */ - unsigned output_busy : 1; - - unsigned end_of_input : 1; - unsigned end_of_block : 1; - - ngx_http_request_t* request; -} ngx_http_brotli_ctx_t; - -/* Forward declarations. */ - -/* Initializes encoder, output chain and buffer, if necessary. Returns NGX_OK - if encoder is successfully initialized (have been already initialized), - and requires objects are allocated. Returns NGX_ERROR otherwise. */ -static ngx_int_t ngx_http_brotli_filter_ensure_stream_initialized( - ngx_http_request_t* r, ngx_http_brotli_ctx_t* ctx); -/* Marks instance as closed and performs cleanup. */ -static void ngx_http_brotli_filter_close(ngx_http_brotli_ctx_t* ctx); - -static void* ngx_http_brotli_filter_alloc(void* opaque, size_t size); -static void ngx_http_brotli_filter_free(void* opaque, void* address); - -static ngx_int_t ngx_http_brotli_check_request(ngx_http_request_t* r); - -static ngx_int_t ngx_http_brotli_add_variables(ngx_conf_t* cf); -static ngx_int_t ngx_http_brotli_ratio_variable(ngx_http_request_t* r, - ngx_http_variable_value_t* v, - uintptr_t data); - -static void* ngx_http_brotli_create_conf(ngx_conf_t* cf); -static char* ngx_http_brotli_merge_conf(ngx_conf_t* cf, void* parent, - void* child); -static ngx_int_t ngx_http_brotli_filter_init(ngx_conf_t* cf); - -static char* ngx_http_brotli_parse_wbits(ngx_conf_t* cf, void* post, - void* data); - -/* Configuration literals. */ - -static ngx_conf_num_bounds_t ngx_http_brotli_comp_level_bounds = { - ngx_conf_check_num_bounds, BROTLI_MIN_QUALITY, BROTLI_MAX_QUALITY}; - -static ngx_conf_post_handler_pt ngx_http_brotli_parse_wbits_p = - ngx_http_brotli_parse_wbits; - -static ngx_command_t ngx_http_brotli_filter_commands[] = { - {ngx_string("brotli"), - NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | - NGX_HTTP_LIF_CONF | NGX_CONF_FLAG, - ngx_conf_set_flag_slot, NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_brotli_conf_t, enable), NULL}, - - /* Deprecated, unused. */ - {ngx_string("brotli_buffers"), - NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | - NGX_CONF_TAKE2, - ngx_conf_set_bufs_slot, NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_brotli_conf_t, deprecated_unused_bufs), NULL}, - - {ngx_string("brotli_types"), - NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | - NGX_CONF_1MORE, - ngx_http_types_slot, NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_brotli_conf_t, types_keys), - &ngx_http_html_default_types[0]}, - - {ngx_string("brotli_comp_level"), - NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | - NGX_CONF_TAKE1, - ngx_conf_set_num_slot, NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_brotli_conf_t, quality), - &ngx_http_brotli_comp_level_bounds}, - - {ngx_string("brotli_window"), - NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | - NGX_CONF_TAKE1, - ngx_conf_set_size_slot, NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_brotli_conf_t, lg_win), &ngx_http_brotli_parse_wbits_p}, - - {ngx_string("brotli_min_length"), - NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | - NGX_CONF_TAKE1, - ngx_conf_set_size_slot, NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_brotli_conf_t, min_length), NULL}, - - ngx_null_command}; - -/* Module context hooks. */ -static ngx_http_module_t ngx_http_brotli_filter_module_ctx = { - ngx_http_brotli_add_variables, /* pre-configuration */ - ngx_http_brotli_filter_init, /* post-configuration */ - - NULL, /* create main configuration */ - NULL, /* init main configuration */ - - NULL, /* create server configuration */ - NULL, /* merge server configuration */ - - ngx_http_brotli_create_conf, /* create location configuration */ - ngx_http_brotli_merge_conf /* merge location configuration */ -}; - -/* Module descriptor. */ -ngx_module_t ngx_http_brotli_filter_module = { - NGX_MODULE_V1, - &ngx_http_brotli_filter_module_ctx, /* module context */ - ngx_http_brotli_filter_commands, /* module directives */ - NGX_HTTP_MODULE, /* module type */ - NULL, /* init master */ - NULL, /* init module */ - NULL, /* init process */ - NULL, /* init thread */ - NULL, /* exit thread */ - NULL, /* exit process */ - NULL, /* exit master */ - NGX_MODULE_V1_PADDING}; - -/* Variable names. */ -static ngx_str_t ngx_http_brotli_ratio = ngx_string("brotli_ratio"); - -/* Next filter in the filter chain. */ -static ngx_http_output_header_filter_pt ngx_http_next_header_filter; -static ngx_http_output_body_filter_pt ngx_http_next_body_filter; - -static /* const */ char kEncoding[] = "br"; -static const size_t kEncodingLen = 2; - -static ngx_int_t check_accept_encoding(ngx_http_request_t* req) { - ngx_table_elt_t* accept_encoding_entry; - ngx_str_t* accept_encoding; - u_char* cursor; - u_char* end; - u_char before; - u_char after; - - accept_encoding_entry = req->headers_in.accept_encoding; - if (accept_encoding_entry == NULL) return NGX_DECLINED; - accept_encoding = &accept_encoding_entry->value; - - cursor = accept_encoding->data; - end = cursor + accept_encoding->len; - while (1) { - u_char digit; - /* It would be an idiotic idea to rely on compiler to produce performant - binary, that is why we just do -1 at every call site. */ - cursor = ngx_strcasestrn(cursor, kEncoding, kEncodingLen - 1); - if (cursor == NULL) return NGX_DECLINED; - before = (cursor == accept_encoding->data) ? ' ' : cursor[-1]; - cursor += kEncodingLen; - after = (cursor >= end) ? ' ' : *cursor; - if (before != ',' && before != ' ') continue; - if (after != ',' && after != ' ' && after != ';') continue; - - /* Check for ";q=0[.[0[0[0]]]]" */ - while (*cursor == ' ') cursor++; - if (*(cursor++) != ';') break; - while (*cursor == ' ') cursor++; - if (*(cursor++) != 'q') break; - while (*cursor == ' ') cursor++; - if (*(cursor++) != '=') break; - while (*cursor == ' ') cursor++; - if (*(cursor++) != '0') break; - if (*(cursor++) != '.') return NGX_DECLINED; /* ;q=0, */ - digit = *(cursor++); - if (digit < '0' || digit > '9') return NGX_DECLINED; /* ;q=0., */ - if (digit > '0') break; - digit = *(cursor++); - if (digit < '0' || digit > '9') return NGX_DECLINED; /* ;q=0.0, */ - if (digit > '0') break; - digit = *(cursor++); - if (digit < '0' || digit > '9') return NGX_DECLINED; /* ;q=0.00, */ - if (digit > '0') break; - return NGX_DECLINED; /* ;q=0.000 */ - } - return NGX_OK; -} - -/* Process headers and decide if request is eligible for brotli compression. */ -static ngx_int_t ngx_http_brotli_header_filter(ngx_http_request_t* r) { - ngx_table_elt_t* h; - ngx_http_brotli_ctx_t* ctx; - ngx_http_brotli_conf_t* conf; - - conf = ngx_http_get_module_loc_conf(r, ngx_http_brotli_filter_module); - - /* Filter only if enabled. */ - if (!conf->enable) { - return ngx_http_next_header_filter(r); - } - - /* Only compress OK / forbidden / not found responses. */ - if (r->headers_out.status != NGX_HTTP_OK && - r->headers_out.status != NGX_HTTP_FORBIDDEN && - r->headers_out.status != NGX_HTTP_NOT_FOUND) { - return ngx_http_next_header_filter(r); - } - - /* Bypass "header only" responses. */ - if (r->header_only) { - return ngx_http_next_header_filter(r); - } - - /* Bypass already compressed responses. */ - if (r->headers_out.content_encoding && - r->headers_out.content_encoding->value.len) { - return ngx_http_next_header_filter(r); - } - - /* If response size is known, do not compress tiny responses. */ - if (r->headers_out.content_length_n != -1 && - r->headers_out.content_length_n < conf->min_length) { - return ngx_http_next_header_filter(r); - } - - /* Compress only certain MIME-typed responses. */ - if (ngx_http_test_content_type(r, &conf->types) == NULL) { - return ngx_http_next_header_filter(r); - } - - r->gzip_vary = 1; - - /* Check if client support brotli encoding. */ - if (ngx_http_brotli_check_request(r) != NGX_OK) { - return ngx_http_next_header_filter(r); - } - - /* Prepare instance context. */ - ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_brotli_ctx_t)); - if (ctx == NULL) { - return NGX_ERROR; - } - ctx->request = r; - ctx->content_length = r->headers_out.content_length_n; - ngx_http_set_ctx(r, ctx, ngx_http_brotli_filter_module); - - /* Prepare response headers, so that following filters in the chain will - notice that response body is compressed. */ - h = ngx_list_push(&r->headers_out.headers); - if (h == NULL) { - return NGX_ERROR; - } - - h->hash = 1; - ngx_str_set(&h->key, "Content-Encoding"); - ngx_str_set(&h->value, "br"); - r->headers_out.content_encoding = h; - - r->main_filter_need_in_memory = 1; - - ngx_http_clear_content_length(r); - ngx_http_clear_accept_ranges(r); - ngx_http_weak_etag(r); - - return ngx_http_next_header_filter(r); -} - -/* Response body filtration (compression). */ -static ngx_int_t ngx_http_brotli_body_filter(ngx_http_request_t* r, - ngx_chain_t* in) { - int rc; - ngx_http_brotli_ctx_t* ctx; - size_t available_output; - ptrdiff_t available_busy_output; - size_t input_size; - size_t available_input; - const uint8_t* next_input_byte; - size_t consumed_input; - BROTLI_BOOL ok; - u_char* out; - ngx_chain_t* link; - - ctx = ngx_http_get_module_ctx(r, ngx_http_brotli_filter_module); - - ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "http brotli filter"); - - if (ctx == NULL || ctx->closed || r->header_only) { - return ngx_http_next_body_filter(r, in); - } - - if (ngx_http_brotli_filter_ensure_stream_initialized(r, ctx) != NGX_OK) { - ngx_http_brotli_filter_close(ctx); - return NGX_ERROR; - } - - /* If more input is provided - append it to our input chain. */ - if (in) { - if (ngx_chain_add_copy(r->pool, &ctx->in, in) != NGX_OK) { - ngx_http_brotli_filter_close(ctx); - return NGX_ERROR; - } - r->connection->buffered |= NGX_HTTP_BROTLI_BUFFERED; - } - - /* Main loop: - - if output is not yet consumed - stop; encoder should not be touched, - until all the output is consumed - - if encoder has output - wrap it and send to consumer - - if encoder is finished (and all output is consumed) - stop - - if there is more input - push it to encoder */ - for (;;) { - if (ctx->output_busy || ctx->output_ready) { - if (ctx->output_busy) { - available_busy_output = ngx_buf_size(ctx->out_buf); - } else { - available_busy_output = 0; - } - - rc = ngx_http_next_body_filter(r, - ctx->output_ready ? ctx->out_chain : NULL); - if (ctx->output_ready) { - ctx->output_ready = 0; - ctx->output_busy = 1; - } - if (ngx_buf_size(ctx->out_buf) == 0) { - ctx->output_busy = 0; - } - if (rc == NGX_OK) { - if (ctx->output_busy && - available_busy_output == ngx_buf_size(ctx->out_buf)) { - r->connection->buffered |= NGX_HTTP_BROTLI_BUFFERED; - return NGX_AGAIN; - } - continue; - } else if (rc == NGX_AGAIN) { - if (ctx->output_busy) { - /* Can't continue compression, let the outer filer decide. */ - if (ctx->in != NULL) { - r->connection->buffered |= NGX_HTTP_BROTLI_BUFFERED; - } - return NGX_AGAIN; - } else { - /* Inner filter has given up, but we can continue processing. */ - continue; - } - } else { - ngx_http_brotli_filter_close(ctx); - return NGX_ERROR; - } - } - - if (BrotliEncoderHasMoreOutput(ctx->encoder)) { - available_output = 0; - out = (u_char*)BrotliEncoderTakeOutput(ctx->encoder, &available_output); - if (out == NULL || available_output == 0) { - ngx_http_brotli_filter_close(ctx); - return NGX_ERROR; - } - ctx->out_buf->start = out; - ctx->out_buf->pos = out; - ctx->out_buf->last = out + available_output; - ctx->out_buf->end = out + available_output; - ctx->bytes_out += available_output; - ctx->out_buf->last_buf = 0; - ctx->out_buf->flush = 0; - if (ctx->end_of_input && BrotliEncoderIsFinished(ctx->encoder)) { - ctx->out_buf->last_buf = 1; - r->connection->buffered &= ~NGX_HTTP_BROTLI_BUFFERED; - } else if (ctx->end_of_block) { - ctx->out_buf->flush = 1; - r->connection->buffered &= ~NGX_HTTP_BROTLI_BUFFERED; - } - ctx->end_of_block = 0; - ctx->output_ready = 1; - ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "brotli out: %p, size:%uz", ctx->out_buf, - ngx_buf_size(ctx->out_buf)); - continue; - } - - if (BrotliEncoderIsFinished(ctx->encoder)) { - ctx->success = 1; - r->connection->buffered &= ~NGX_HTTP_BROTLI_BUFFERED; - ngx_http_brotli_filter_close(ctx); - return NGX_OK; - } - - if (ctx->end_of_input) { - // Ask the encoder to dump the leftover. - available_input = 0; - available_output = 0; - ok = BrotliEncoderCompressStream(ctx->encoder, BROTLI_OPERATION_FINISH, - &available_input, NULL, - &available_output, NULL, NULL); - r->connection->buffered |= NGX_HTTP_BROTLI_BUFFERED; - if (!ok) { - ngx_http_brotli_filter_close(ctx); - return NGX_ERROR; - } - continue; - } - - if (ctx->in == NULL) { - return NGX_OK; - } - - /* TODO: coalesce tiny inputs, if they are not last/flush. */ - input_size = ngx_buf_size(ctx->in->buf); - if (input_size == 0) { - if (!ctx->in->buf->last_buf && !ctx->in->buf->flush) { - link = ctx->in; - ctx->in = ctx->in->next; - ngx_free_chain(r->pool, link); - continue; - } - } - - available_input = input_size; - next_input_byte = (const uint8_t*)ctx->in->buf->pos; - available_output = 0; - ok = BrotliEncoderCompressStream( - ctx->encoder, - ctx->in->buf->last_buf ? BROTLI_OPERATION_FINISH - : ctx->in->buf->flush ? BROTLI_OPERATION_FLUSH - : BROTLI_OPERATION_PROCESS, - &available_input, &next_input_byte, &available_output, NULL, NULL); - r->connection->buffered |= NGX_HTTP_BROTLI_BUFFERED; - if (!ok) { - ngx_http_brotli_filter_close(ctx); - return NGX_ERROR; - } - - consumed_input = input_size - available_input; - ctx->bytes_in += consumed_input; - ctx->in->buf->pos += consumed_input; - - if (consumed_input == input_size) { - if (ctx->in->buf->last_buf) { - ctx->end_of_input = 1; - } else if (ctx->in->buf->flush) { - ctx->end_of_block = 1; - } - link = ctx->in; - ctx->in = ctx->in->next; - ngx_free_chain(r->pool, link); - continue; - } - - /* Should never happen, just to make sure we don't enter infinite loop. */ - if (consumed_input == 0) { - ngx_http_brotli_filter_close(ctx); - return NGX_ERROR; - } - } - - /* unreachable */ - ngx_http_brotli_filter_close(ctx); - return NGX_ERROR; -} - -static ngx_int_t ngx_http_brotli_filter_ensure_stream_initialized( - ngx_http_request_t* r, ngx_http_brotli_ctx_t* ctx) { - ngx_http_brotli_conf_t* conf; - BROTLI_BOOL ok; - size_t wbits; - - if (ctx->initialized) { - return NGX_OK; - } - ctx->initialized = 1; - - conf = ngx_http_get_module_loc_conf(r, ngx_http_brotli_filter_module); - - /* Tune lg_win, if size is known. */ - if (ctx->content_length > 0) { - wbits = BROTLI_MIN_WINDOW_BITS; - while ((wbits < conf->lg_win) && (ctx->content_length > (1 << wbits))) { - wbits++; - } - } else { - wbits = conf->lg_win; - } - - ctx->encoder = BrotliEncoderCreateInstance( - ngx_http_brotli_filter_alloc, ngx_http_brotli_filter_free, r->pool); - if (ctx->encoder == NULL) { - ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, - "OOM / BrotliEncoderCreateInstance"); - return NGX_ERROR; - } - - ok = BrotliEncoderSetParameter(ctx->encoder, BROTLI_PARAM_QUALITY, - (uint32_t)conf->quality); - if (!ok) { - ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, - "BrotliEncoderSetParameter(QUALITY, %uD) failed", - (uint32_t)conf->quality); - return NGX_ERROR; - } - - ok = BrotliEncoderSetParameter(ctx->encoder, BROTLI_PARAM_LGWIN, - (uint32_t)wbits); - if (!ok) { - ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, - "BrotliEncoderSetParameter(LGWIN, %uD) failed", - (uint32_t)wbits); - return NGX_ERROR; - } - - ctx->out_buf = ngx_calloc_buf(r->pool); - if (ctx->out_buf == NULL) { - return NGX_ERROR; - } - ctx->out_buf->temporary = 1; - - ctx->out_chain = ngx_alloc_chain_link(r->pool); - if (ctx->out_chain == NULL) { - return NGX_ERROR; - } - ctx->out_chain->buf = ctx->out_buf; - ctx->out_chain->next = NULL; - - ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "brotli encoder initialized: lvl:%i win:%d", conf->quality, - (1 << wbits)); - - return NGX_OK; -} - -static void* ngx_http_brotli_filter_alloc(void* opaque, size_t size) { - ngx_pool_t* pool = opaque; - void* p; - - p = ngx_palloc(pool, size); - -#if (NGX_DEBUG) - ngx_log_debug2(NGX_LOG_DEBUG_HTTP, pool->log, 0, "brotli alloc: %p, size:%uz", - p, size); -#endif - - return p; -} - -static void ngx_http_brotli_filter_free(void* opaque, void* address) { - ngx_pool_t* pool = opaque; - -#if (NGX_DEBUG) - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pool->log, 0, "brotli free: %p", address); -#endif - - ngx_pfree(pool, address); -} - -static void ngx_http_brotli_filter_close(ngx_http_brotli_ctx_t* ctx) { - ctx->closed = 1; - if (ctx->encoder) { - BrotliEncoderDestroyInstance(ctx->encoder); - ctx->encoder = NULL; - } - if (ctx->out_chain) { - ngx_free_chain(ctx->request->pool, ctx->out_chain); - ctx->out_chain = NULL; - } - if (ctx->out_buf) { - ngx_pfree(ctx->request->pool, ctx->out_buf); - ctx->out_buf = NULL; - } -} - -static ngx_int_t ngx_http_brotli_check_request(ngx_http_request_t* req) { - if (req != req->main) return NGX_DECLINED; - if (check_accept_encoding(req) != NGX_OK) return NGX_DECLINED; - req->gzip_tested = 1; - req->gzip_ok = 0; - return NGX_OK; -} - -static ngx_int_t ngx_http_brotli_add_variables(ngx_conf_t* cf) { - ngx_http_variable_t* var; - - var = ngx_http_add_variable(cf, &ngx_http_brotli_ratio, 0); - if (var == NULL) { - return NGX_ERROR; - } - - var->get_handler = ngx_http_brotli_ratio_variable; - - return NGX_OK; -} - -static ngx_int_t ngx_http_brotli_ratio_variable(ngx_http_request_t* r, - ngx_http_variable_value_t* v, - uintptr_t data) { - ngx_uint_t ratio_int; - ngx_uint_t ratio_frac; - ngx_http_brotli_ctx_t* ctx; - - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - - ctx = ngx_http_get_module_ctx(r, ngx_http_brotli_filter_module); - - /* Only report variable on non-failing streams. */ - if (ctx == NULL || !ctx->success) { - v->not_found = 1; - return NGX_OK; - } - - v->data = ngx_pnalloc(r->pool, NGX_INT32_LEN + 3); - if (v->data == NULL) { - return NGX_ERROR; - } - - ratio_int = (ngx_uint_t)(ctx->bytes_in / ctx->bytes_out); - ratio_frac = (ngx_uint_t)((ctx->bytes_in * 100 / ctx->bytes_out) % 100); - - /* Rounding; e.g. 2.125 to 2.13 */ - if ((ctx->bytes_in * 1000 / ctx->bytes_out) % 10 > 4) { - ratio_frac++; - if (ratio_frac > 99) { - ratio_int++; - ratio_frac = 0; - } - } - - v->len = ngx_sprintf(v->data, "%ui.%02ui", ratio_int, ratio_frac) - v->data; - - return NGX_OK; -} - -static void* ngx_http_brotli_create_conf(ngx_conf_t* cf) { - ngx_http_brotli_conf_t* conf; - - conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_brotli_conf_t)); - if (conf == NULL) { - return NULL; - } - - /* ngx_pcalloc fills result with zeros -> - conf->bufs.num = 0; - conf->types = { NULL }; - conf->types_keys = NULL; */ - - conf->enable = NGX_CONF_UNSET; - - conf->quality = NGX_CONF_UNSET; - conf->lg_win = NGX_CONF_UNSET_SIZE; - conf->min_length = NGX_CONF_UNSET; - - return conf; -} - -static char* ngx_http_brotli_merge_conf(ngx_conf_t* cf, void* parent, - void* child) { - ngx_http_brotli_conf_t* prev = parent; - ngx_http_brotli_conf_t* conf = child; - char* rc; - - ngx_conf_merge_value(conf->enable, prev->enable, 0); - - ngx_conf_merge_value(conf->quality, prev->quality, 6); - ngx_conf_merge_size_value(conf->lg_win, prev->lg_win, 19); - ngx_conf_merge_value(conf->min_length, prev->min_length, 20); - - rc = ngx_http_merge_types(cf, &conf->types_keys, &conf->types, - &prev->types_keys, &prev->types, - ngx_http_html_default_types); - if (rc != NGX_CONF_OK) { - return NGX_CONF_ERROR; - } - - return NGX_CONF_OK; -} - -/* Prepend to filter chain. */ -static ngx_int_t ngx_http_brotli_filter_init(ngx_conf_t* cf) { - ngx_http_next_header_filter = ngx_http_top_header_filter; - ngx_http_top_header_filter = ngx_http_brotli_header_filter; - - ngx_http_next_body_filter = ngx_http_top_body_filter; - ngx_http_top_body_filter = ngx_http_brotli_body_filter; - - return NGX_OK; -} - -/* Translate "window size" to window bits (log2), and check bounds. */ -static char* ngx_http_brotli_parse_wbits(ngx_conf_t* cf, void* post, - void* data) { - size_t* parameter = data; - size_t bits; - size_t wsize; - - for (bits = BROTLI_MIN_WINDOW_BITS; bits <= BROTLI_MAX_WINDOW_BITS; bits++) { - wsize = 1u << bits; - if (*parameter == wsize) { - *parameter = bits; - return NGX_CONF_OK; - } - } - - return "must be 1k, 2k, 4k, 8k, 16k, 32k, 64k, 128k, 256k, 512k, 1m, 2m, 4m, " - "8m or 16m"; -} diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/.travis-before-test.sh b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/.travis-before-test.sh deleted file mode 100755 index 9f69164..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/.travis-before-test.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -set -ex - -# Setup shortcuts. -ROOT=`pwd` -FILES=$ROOT/script/test - -# Setup directory structure. -cd $ROOT/script -if [ ! -d test ]; then - mkdir test -fi -cd test -if [ ! -d logs ]; then - mkdir logs -fi - -# Download sample texts. -curl --compressed -o $FILES/war-and-peace.txt http://www.gutenberg.org/files/2600/2600-0.txt -echo "Kot lomom kolol slona!" > $FILES/small.txt -echo "Kot lomom kolol slona!" > $FILES/small.html - -# Restore status-quo. -cd $ROOT diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/.travis-compile.sh b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/.travis-compile.sh deleted file mode 100755 index 2fa01d6..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/.travis-compile.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -set -ex - -# Setup shortcuts. -ROOT=`pwd` - -# Clone nginx read-only git repository. -if [ ! -d "nginx" ]; then - git clone https://github.com/nginx/nginx.git -fi - -# Build nginx + filter module. -cd $ROOT/nginx -# Pro memoria: --with-debug -./auto/configure \ - --prefix=$ROOT/script/test \ - --with-http_v2_module \ - --add-module=$ROOT -make -j 16 - -# Build brotli CLI. -cd $ROOT/deps/brotli -mkdir out -cd out -cmake .. -make -j 16 brotli - -# Restore status-quo. -cd $ROOT diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/.travis-test.sh b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/.travis-test.sh deleted file mode 100755 index 1db8d15..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/.travis-test.sh +++ /dev/null @@ -1,168 +0,0 @@ -#!/bin/bash - -# Setup shortcuts. -ROOT=`pwd` -NGINX=$ROOT/nginx/objs/nginx -BROTLI=$ROOT/deps/brotli/out/brotli -SERVER=http://localhost:8080 -FILES=$ROOT/script/test -HR="---------------------------------------------------------------------------" - -if [ ! -d tmp ]; then - mkdir tmp -fi - -rm tmp/* - -add_result() { - echo $1 >&2 - echo $1 >> tmp/results.log -} - -get_failed() { - echo `cat tmp/results.log | grep -v OK | wc -l` -} - -get_count() { - echo `cat tmp/results.log | wc -l` -} - -expect_equal() { - expected=$1 - actual=$2 - if cmp $expected $actual; then - add_result "OK" - else - add_result "FAIL (equality)" - fi -} - -expect_br_equal() { - expected=$1 - actual_br=$2 - if $BROTLI -dfk ./${actual_br}.br; then - expect_equal $expected $actual_br - else - add_result "FAIL (decompression)" - fi -} - -################################################################################ - -# Start default server. -echo "Statring NGINX" -$NGINX -c $ROOT/script/test.conf -# Fetch vanilla 404 response. -curl -s -o tmp/notfound.txt $SERVER/notfound - -CURL="curl -s" - -# Run tests. -echo $HR - -echo "Test: long file with rate limit" -$CURL -H 'Accept-encoding: br' -o tmp/war-and-peace.br --limit-rate 300K $SERVER/war-and-peace.txt -expect_br_equal $FILES/war-and-peace.txt tmp/war-and-peace - -echo "Test: compressed 404" -$CURL -H 'Accept-encoding: br' -o tmp/notfound.br $SERVER/notfound -expect_br_equal tmp/notfound.txt tmp/notfound - -echo "Test: A-E: 'gzip, br'" -$CURL -H 'Accept-encoding: gzip, br' -o tmp/ae-01.br $SERVER/small.txt -expect_br_equal $FILES/small.txt tmp/ae-01 - -echo "Test: A-E: 'gzip, br, deflate'" -$CURL -H 'Accept-encoding: gzip, br, deflate' -o tmp/ae-02.br $SERVER/small.txt -expect_br_equal $FILES/small.txt tmp/ae-02 - -echo "Test: A-E: 'gzip, br;q=1, deflate'" -$CURL -H 'Accept-encoding: gzip, br;q=1, deflate' -o tmp/ae-03.br $SERVER/small.txt -expect_br_equal $FILES/small.txt tmp/ae-03 - -echo "Test: A-E: 'br;q=0.001'" -$CURL -H 'Accept-encoding: br;q=0.001' -o tmp/ae-04.br $SERVER/small.txt -expect_br_equal $FILES/small.txt tmp/ae-04 - -echo "Test: A-E: 'bro'" -$CURL -H 'Accept-encoding: bro' -o tmp/ae-05.txt $SERVER/small.txt -expect_equal $FILES/small.txt tmp/ae-05.txt - -echo "Test: A-E: 'bo'" -$CURL -H 'Accept-encoding: bo' -o tmp/ae-06.txt $SERVER/small.txt -expect_equal $FILES/small.txt tmp/ae-06.txt - -echo "Test: A-E: 'br;q=0'" -$CURL -H 'Accept-encoding: br;q=0' -o tmp/ae-07.txt $SERVER/small.txt -expect_equal $FILES/small.txt tmp/ae-07.txt - -echo "Test: A-E: 'br;q=0.'" -$CURL -H 'Accept-encoding: br;q=0.' -o tmp/ae-08.txt $SERVER/small.txt -expect_equal $FILES/small.txt tmp/ae-08.txt - -echo "Test: A-E: 'br;q=0.0'" -$CURL -H 'Accept-encoding: br;q=0.0' -o tmp/ae-09.txt $SERVER/small.txt -expect_equal $FILES/small.txt tmp/ae-09.txt - -echo "Test: A-E: 'br;q=0.00'" -$CURL -H 'Accept-encoding: br;q=0.00' -o tmp/ae-10.txt $SERVER/small.txt -expect_equal $FILES/small.txt tmp/ae-10.txt - -echo "Test: A-E: 'br ; q = 0.000'" -$CURL -H 'Accept-encoding: br ; q = 0.000' -o tmp/ae-11.txt $SERVER/small.txt -expect_equal $FILES/small.txt tmp/ae-11.txt - -echo "Test: A-E: 'bar'" -$CURL -H 'Accept-encoding: bar' -o tmp/ae-12.txt $SERVER/small.html -expect_equal $FILES/small.html tmp/ae-12.txt - -echo "Test: A-E: 'b'" -$CURL -H 'Accept-encoding: b' -o tmp/ae-13.txt $SERVER/small.html -expect_equal $FILES/small.html tmp/ae-13.txt - -echo $HR -echo "Stopping default NGINX" -# Stop server. -$NGINX -c $ROOT/script/test.conf -s stop - -################################################################################ - -# Start default server. -echo "Statring h2 NGINX" -$NGINX -c $ROOT/script/test_h2.conf - -CURL="curl --http2-prior-knowledge -s" - -# Run tests. -echo $HR - -echo "Test: long file with rate limit" -$CURL -H 'Accept-encoding: br' -o tmp/h2-war-and-peace.br --limit-rate 300K $SERVER/war-and-peace.txt -expect_br_equal $FILES/war-and-peace.txt tmp/h2-war-and-peace - -echo "Test: A-E: 'gzip, br'" -$CURL -H 'Accept-encoding: gzip, br' -o tmp/h2-ae-01.br $SERVER/small.txt -expect_br_equal $FILES/small.txt tmp/h2-ae-01 - -echo "Test: A-E: 'b'" -$CURL -H 'Accept-encoding: b' -o tmp/h2-ae-13.txt $SERVER/small.html -expect_equal $FILES/small.html tmp/h2-ae-13.txt - -echo $HR -echo "Stopping h2 NGINX" -# Stop server. -$NGINX -c $ROOT/script/test_h2.conf -s stop - -################################################################################ - -# Report. - -FAILED=$(get_failed $STATUS) -COUNT=$(get_count $STATUS) -echo $HR -echo "Results: $FAILED of $COUNT tests failed" - -# Restore status-quo. -cd $ROOT - -exit $FAILED diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/test.conf b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/test.conf deleted file mode 100644 index 93957f9..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/test.conf +++ /dev/null @@ -1,32 +0,0 @@ -events { - worker_connections 4; -} - -daemon on; -error_log /dev/stdout info; - -http { - access_log ./access.log; - error_log ./error.log; - - gzip on; - gzip_comp_level 1; - gzip_types text/plain text/css; - - brotli on; - brotli_comp_level 1; - brotli_types text/plain text/css; - - server { - listen 8080 default_server; - listen [::]:8080 default_server; - - root ./; - - index index.html; - - location / { - try_files $uri $uri/ =404; - } - } -} diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/test_h2.conf b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/test_h2.conf deleted file mode 100644 index 0f2c791..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/script/test_h2.conf +++ /dev/null @@ -1,32 +0,0 @@ -events { - worker_connections 4; -} - -daemon on; -error_log /dev/stdout info; - -http { - access_log ./access.log; - error_log ./error.log; - - gzip on; - gzip_comp_level 1; - gzip_types text/plain text/css; - - brotli on; - brotli_comp_level 1; - brotli_types text/plain text/css; - - server { - listen 8080 http2; - listen [::]:8080 http2; - - root ./; - - index index.html; - - location / { - try_files $uri $uri/ =404; - } - } -} diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/static/config b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/static/config deleted file mode 100644 index de07d1c..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/static/config +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright (C) 2015-2019 Google Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# 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 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 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) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. - -if [ "$ngx_addon_name" = "ngx_brotli" ]; then - BROTLI_MODULE_SRC_DIR="$ngx_addon_dir/static" -else - BROTLI_MODULE_SRC_DIR="$ngx_addon_dir" -fi - -ngx_addon_name=ngx_brotli_static - -if [ -z "$ngx_module_link" ]; then -cat << END - -$0: error: Brotli module requires recent version of NGINX (1.9.11+). - -END - exit 1 -fi - -ngx_module_type=HTTP -ngx_module_name=ngx_http_brotli_static_module -ngx_module_incs= -ngx_module_deps= -ngx_module_srcs="$BROTLI_MODULE_SRC_DIR/ngx_http_brotli_static_module.c" -ngx_module_libs= -ngx_module_order= - -. auto/module - -have=NGX_HTTP_GZIP . auto/have -have=NGX_HTTP_BROTLI_STATIC . auto/have -have=NGX_HTTP_BROTLI_STATIC_MODULE . auto/have # deprecated diff --git a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/static/ngx_http_brotli_static_module.c b/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/static/ngx_http_brotli_static_module.c deleted file mode 100644 index 44f0cb0..0000000 --- a/modules_deb/libnginx-mod-http-brotli-1.0.0~rc/static/ngx_http_brotli_static_module.c +++ /dev/null @@ -1,323 +0,0 @@ - -/* - * Copyright (C) Igor Sysoev - * Copyright (C) Nginx, Inc. - * Copyright (C) Google Inc. - */ - -#include -#include -#include - -/* >> Configuration */ - -#define NGX_HTTP_BROTLI_STATIC_OFF 0 -#define NGX_HTTP_BROTLI_STATIC_ON 1 -#define NGX_HTTP_BROTLI_STATIC_ALWAYS 2 - -typedef struct { - ngx_uint_t enable; -} configuration_t; - -static ngx_conf_enum_t kBrotliStaticEnum[] = { - {ngx_string("off"), NGX_HTTP_BROTLI_STATIC_OFF}, - {ngx_string("on"), NGX_HTTP_BROTLI_STATIC_ON}, - {ngx_string("always"), NGX_HTTP_BROTLI_STATIC_ALWAYS}, - {ngx_null_string, 0}}; - -/* << Configuration */ - -/* >> Forward declarations */ - -static ngx_int_t handler(ngx_http_request_t* req); -static void* create_conf(ngx_conf_t* root_cfg); -static char* merge_conf(ngx_conf_t* root_cfg, void* parent, void* child); -static ngx_int_t init(ngx_conf_t* root_cfg); - -/* << Forward declarations*/ - -/* >> Module definition */ - -static ngx_command_t kCommands[] = { - {ngx_string("brotli_static"), - NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | - NGX_CONF_TAKE1, - ngx_conf_set_enum_slot, NGX_HTTP_LOC_CONF_OFFSET, - offsetof(configuration_t, enable), &kBrotliStaticEnum}, - ngx_null_command}; - -static ngx_http_module_t kModuleContext = { - NULL, /* preconfiguration */ - init, /* postconfiguration */ - - NULL, /* create main configuration */ - NULL, /* init main configuration */ - - NULL, /* create server configuration */ - NULL, /* merge server configuration */ - - create_conf, /* create location configuration */ - merge_conf /* merge location configuration */ -}; - -ngx_module_t ngx_http_brotli_static_module = { - NGX_MODULE_V1, - &kModuleContext, /* module context */ - kCommands, /* module directives */ - NGX_HTTP_MODULE, /* module type */ - NULL, /* init master */ - NULL, /* init module */ - NULL, /* init process */ - NULL, /* init thread */ - NULL, /* exit thread */ - NULL, /* exit process */ - NULL, /* exit master */ - NGX_MODULE_V1_PADDING}; - -/* << Module definition*/ - -static const u_char kContentEncoding[] = "Content-Encoding"; -static /* const */ char kEncoding[] = "br"; -static const size_t kEncodingLen = 2; -static /* const */ u_char kSuffix[] = ".br"; -static const size_t kSuffixLen = 3; - -static ngx_int_t check_accept_encoding(ngx_http_request_t* req) { - ngx_table_elt_t* accept_encoding_entry; - ngx_str_t* accept_encoding; - u_char* cursor; - u_char* end; - u_char before; - u_char after; - - accept_encoding_entry = req->headers_in.accept_encoding; - if (accept_encoding_entry == NULL) return NGX_DECLINED; - accept_encoding = &accept_encoding_entry->value; - - cursor = accept_encoding->data; - end = cursor + accept_encoding->len; - while (1) { - u_char digit; - /* It would be an idiotic idea to rely on compiler to produce performant - binary, that is why we just do -1 at every call site. */ - cursor = ngx_strcasestrn(cursor, kEncoding, kEncodingLen - 1); - if (cursor == NULL) return NGX_DECLINED; - before = (cursor == accept_encoding->data) ? ' ' : cursor[-1]; - cursor += kEncodingLen; - after = (cursor >= end) ? ' ' : *cursor; - if (before != ',' && before != ' ') continue; - if (after != ',' && after != ' ' && after != ';') continue; - - /* Check for ";q=0[.[0[0[0]]]]" */ - while (*cursor == ' ') cursor++; - if (*(cursor++) != ';') break; - while (*cursor == ' ') cursor++; - if (*(cursor++) != 'q') break; - while (*cursor == ' ') cursor++; - if (*(cursor++) != '=') break; - while (*cursor == ' ') cursor++; - if (*(cursor++) != '0') break; - if (*(cursor++) != '.') return NGX_DECLINED; /* ;q=0, */ - digit = *(cursor++); - if (digit < '0' || digit > '9') return NGX_DECLINED; /* ;q=0., */ - if (digit > '0') break; - digit = *(cursor++); - if (digit < '0' || digit > '9') return NGX_DECLINED; /* ;q=0.0, */ - if (digit > '0') break; - digit = *(cursor++); - if (digit < '0' || digit > '9') return NGX_DECLINED; /* ;q=0.00, */ - if (digit > '0') break; - return NGX_DECLINED; /* ;q=0.000 */ - } - return NGX_OK; -} - -/* Test if this request is allowed to have the brotli response. */ -static ngx_int_t check_eligility(ngx_http_request_t* req) { - if (req != req->main) return NGX_DECLINED; - if (check_accept_encoding(req) != NGX_OK) return NGX_DECLINED; - req->gzip_tested = 1; - req->gzip_ok = 0; - return NGX_OK; -} - -static ngx_int_t handler(ngx_http_request_t* req) { - configuration_t* cfg; - ngx_int_t rc; - u_char* last; - ngx_str_t path; - size_t root; - ngx_log_t* log; - ngx_http_core_loc_conf_t* location_cfg; - ngx_open_file_info_t file_info; - ngx_table_elt_t* content_encoding_entry; - ngx_buf_t* buf; - ngx_chain_t out; - - /* Only GET and HEAD requensts are supported. */ - if (!(req->method & (NGX_HTTP_GET | NGX_HTTP_HEAD))) return NGX_DECLINED; - - /* Only files are supported. */ - if (req->uri.data[req->uri.len - 1] == '/') return NGX_DECLINED; - - /* Get configuration and check if module is disabled. */ - cfg = ngx_http_get_module_loc_conf(req, ngx_http_brotli_static_module); - if (cfg->enable == NGX_HTTP_BROTLI_STATIC_OFF) return NGX_DECLINED; - - if (cfg->enable == NGX_HTTP_BROTLI_STATIC_ALWAYS) { - /* Ignore request properties (e.g. Accept-Encoding). */ - } else { - /* NGX_HTTP_BROTLI_STATIC_ON */ - rc = check_eligility(req); - if (rc != NGX_OK) return NGX_DECLINED; - } - - /* Get path and append the suffix. */ - last = ngx_http_map_uri_to_path(req, &path, &root, kSuffixLen); - if (last == NULL) return NGX_HTTP_INTERNAL_SERVER_ERROR; - /* +1 for reinstating the terminating 0. */ - ngx_cpystrn(last, kSuffix, kSuffixLen + 1); - path.len += kSuffixLen; - - log = req->connection->log; - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, "http filename: \"%s\"", - path.data); - - /* Prepare to read the file. */ - location_cfg = ngx_http_get_module_loc_conf(req, ngx_http_core_module); - ngx_memzero(&file_info, sizeof(ngx_open_file_info_t)); - file_info.read_ahead = location_cfg->read_ahead; - file_info.directio = location_cfg->directio; - file_info.valid = location_cfg->open_file_cache_valid; - file_info.min_uses = location_cfg->open_file_cache_min_uses; - file_info.errors = location_cfg->open_file_cache_errors; - file_info.events = location_cfg->open_file_cache_events; - rc = ngx_http_set_disable_symlinks(req, location_cfg, &path, &file_info); - if (rc != NGX_OK) return NGX_HTTP_INTERNAL_SERVER_ERROR; - - /* Try to fetch file and process errors. */ - rc = ngx_open_cached_file(location_cfg->open_file_cache, &path, &file_info, - req->pool); - if (rc != NGX_OK) { - ngx_uint_t level; - switch (file_info.err) { - case 0: - return NGX_HTTP_INTERNAL_SERVER_ERROR; - - case NGX_ENOENT: - case NGX_ENOTDIR: - case NGX_ENAMETOOLONG: - return NGX_DECLINED; - -#if (NGX_HAVE_OPENAT) - case NGX_EMLINK: - case NGX_ELOOP: -#endif - case NGX_EACCES: - level = NGX_LOG_ERR; - break; - - default: - level = NGX_LOG_CRIT; - break; - } - ngx_log_error(level, log, file_info.err, "%s \"%s\" failed", - file_info.failed, path.data); - return NGX_DECLINED; - } - - if (cfg->enable == NGX_HTTP_BROTLI_STATIC_ON) { - req->gzip_vary = 1; - } - - /* So far so good. */ - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, "http static fd: %d", - file_info.fd); - - /* Only files are supported. */ - if (file_info.is_dir) { - ngx_log_debug0(NGX_LOG_DEBUG_HTTP, log, 0, "http dir"); - return NGX_DECLINED; - } -#if !(NGX_WIN32) - if (!file_info.is_file) { - ngx_log_error(NGX_LOG_CRIT, log, 0, "\"%s\" is not a regular file", - path.data); - return NGX_HTTP_NOT_FOUND; - } -#endif - - /* Prepare request push the body. */ - req->root_tested = !req->error_page; - rc = ngx_http_discard_request_body(req); - if (rc != NGX_OK) return rc; - log->action = "sending response to client"; - req->headers_out.status = NGX_HTTP_OK; - req->headers_out.content_length_n = file_info.size; - req->headers_out.last_modified_time = file_info.mtime; - rc = ngx_http_set_etag(req); - if (rc != NGX_OK) return NGX_HTTP_INTERNAL_SERVER_ERROR; - rc = ngx_http_set_content_type(req); - if (rc != NGX_OK) return NGX_HTTP_INTERNAL_SERVER_ERROR; - - /* Set "Content-Encoding" header. */ - content_encoding_entry = ngx_list_push(&req->headers_out.headers); - if (content_encoding_entry == NULL) return NGX_HTTP_INTERNAL_SERVER_ERROR; - content_encoding_entry->hash = 1; - ngx_str_set(&content_encoding_entry->key, kContentEncoding); - ngx_str_set(&content_encoding_entry->value, kEncoding); - req->headers_out.content_encoding = content_encoding_entry; - - /* Setup response body. */ - buf = ngx_pcalloc(req->pool, sizeof(ngx_buf_t)); - if (buf == NULL) return NGX_HTTP_INTERNAL_SERVER_ERROR; - buf->file = ngx_pcalloc(req->pool, sizeof(ngx_file_t)); - if (buf->file == NULL) return NGX_HTTP_INTERNAL_SERVER_ERROR; - buf->file_pos = 0; - buf->file_last = file_info.size; - buf->in_file = buf->file_last ? 1 : 0; - buf->last_buf = (req == req->main) ? 1 : 0; - buf->last_in_chain = 1; - buf->file->fd = file_info.fd; - buf->file->name = path; - buf->file->log = log; - buf->file->directio = file_info.is_directio; - out.buf = buf; - out.next = NULL; - - /* Push the response header. */ - rc = ngx_http_send_header(req); - if (rc == NGX_ERROR || rc > NGX_OK || req->header_only) { - return rc; - } - - /* Push the response body. */ - return ngx_http_output_filter(req, &out); -} - -static void* create_conf(ngx_conf_t* root_cfg) { - configuration_t* cfg; - cfg = ngx_palloc(root_cfg->pool, sizeof(configuration_t)); - if (cfg == NULL) return NULL; - cfg->enable = NGX_CONF_UNSET_UINT; - return cfg; -} - -static char* merge_conf(ngx_conf_t* root_cfg, void* parent, void* child) { - configuration_t* prev = parent; - configuration_t* cfg = child; - ngx_conf_merge_uint_value(cfg->enable, prev->enable, - NGX_HTTP_BROTLI_STATIC_OFF); - return NGX_CONF_OK; -} - -static ngx_int_t init(ngx_conf_t* root_cfg) { - ngx_http_core_main_conf_t* core_cfg; - ngx_http_handler_pt* handler_slot; - core_cfg = ngx_http_conf_get_module_main_conf(root_cfg, ngx_http_core_module); - handler_slot = - ngx_array_push(&core_cfg->phases[NGX_HTTP_CONTENT_PHASE].handlers); - if (handler_slot == NULL) return NGX_ERROR; - *handler_slot = handler; - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/.astylerc b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/.astylerc deleted file mode 100644 index 3c009b3..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/.astylerc +++ /dev/null @@ -1,22 +0,0 @@ -# astylerc -align-pointer=name -align-reference=name -break-after-logical -#indent=spaces=2 -max-code-length=120 -style=google -suffix=none - -# Indent -indent-preproc-block - -# Padding -pad-header -unpad-paren - -# Formatting: -add-brackets -#convert-tabs - -# Output: -formatted \ No newline at end of file diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/.format.sh b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/.format.sh deleted file mode 100755 index 75209eb..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/.format.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -# Search in the script folder -pushd "$(dirname $0)" >/dev/null -CWD="$(pwd -P)" -popd >/dev/null -FILES='ngx_cache_purge_module.c' - -# The file format in accordance with the style defined in .astylerc -astyle -v --options='.astylerc' ${FILES} || (echo 'astyle failed'; exit 1); - -# To correct this, the issuance dos2unix on each file -# sometimes adds in Windows as a string-endins (\r\n). -dos2unix --quiet ${FILES} || (echo 'dos2unix failed'; exit 2); \ No newline at end of file diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/.gitattributes b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/.gitattributes deleted file mode 100644 index 9b27d9f..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.t linguist-language=Text \ No newline at end of file diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/.travis.yml b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/.travis.yml deleted file mode 100644 index 3714921..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/.travis.yml +++ /dev/null @@ -1,49 +0,0 @@ -sudo: required -os: linux -dist: trusty -language: c -compiler: - - gcc - - clang -cache: - apt: true - directories: - - download-cache -env: - global: - - JOBS=4 - - NGINX_PREFIX=/opt/nginx - matrix: - - NGINX_VERSION=1.18.0 - - NGINX_VERSION=1.19.2 - -before_install: - - mkdir --parents download-cache - - sudo apt-get update -qq - - sudo apt-get install -qq zlib1g-dev libpcre3-dev cpanminus - # Get OpenSSL 1.0.2 from Ubuntu Xenial - # https://packages.ubuntu.com/xenial-updates/libssl1.0.0 - - test -f download-cache/libssl1.0.0_1.0.2g-1ubuntu4.16_amd64.deb || wget -O download-cache/libssl1.0.0_1.0.2g-1ubuntu4.17_amd64.deb "http://de.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.0.0_1.0.2g-1ubuntu4.17_amd64.deb" - # https://packages.ubuntu.com/xenial/libssl-dev - - test -f download-cache/libssl-dev_1.0.2g-1ubuntu4.16_amd64.deb || wget -O download-cache/libssl-dev_1.0.2g-1ubuntu4.17_amd64.deb "http://de.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl-dev_1.0.2g-1ubuntu4.17_amd64.deb" - - sudo dpkg -i download-cache/libssl*_amd64.deb - # Test::Nginx - - git clone https://github.com/openresty/test-nginx.git test-nginx - - cd test-nginx/ && sudo cpanm . && cd .. - # NGINX source - - test -f download-cache/nginx-$NGINX_VERSION.tar.gz || wget -O download-cache/nginx-$NGINX_VERSION.tar.gz http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz - -install: - - tar -xzf download-cache/nginx-${NGINX_VERSION}.tar.gz - - cd nginx-${NGINX_VERSION}/ - - ./configure --prefix=${NGINX_PREFIX} --with-debug --with-http_ssl_module --add-module=${PWD}/.. - - make -j${JOBS} - - sudo make install - - cd .. - - export PATH="${NGINX_PREFIX}/sbin:$PATH" -# - export LD_LIBRARY_PATH=${LD_LIBRARY_PATH} - -script: - - nginx -V - - ldd $(which nginx) - - prove t diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/CHANGES b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/CHANGES deleted file mode 100644 index 7495742..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/CHANGES +++ /dev/null @@ -1,103 +0,0 @@ -2020-06-27 VERSION 2.5.1 - * fix: empty key check - it coredumps when cache key is empty, Tuğrul Topuz - * fix: purge report calloc fix - Report template has not cache file path but it's length is use in buffer memory allocation, Tuğrul Topuz - -2018-08-04 VERSION 2.5 - * feat/docs: cache_purge_response_type directive, selecting response type (html|json|xml|text) - * break: changed status of HTTP code 404 (Not Found) to 412 (Precondition Failed) - * fix: remove path information of response body (#4, 3a8c08a, #11) - -2020-06-27 VERSION 2.4.3 - * fix: empty key check - it coredumps when cache key is empty, Tuğrul Topuz - -2017-09-28 VERSION 2.4.2 - * fix: segfault in call to `ngx_read_file` of partial key purge, Frankie Dintino - * fix: segfault in `cplcf->conf->purge_all` with separate location syntax, Frankie Dintino - -2017-02-21 VERSION 2.4.1 - * Fix compatibility with nginx-1.11.6+, Sułowicz Paweł - -2016-11-20 VERSION 2.4 - * Fix compatibility with nginx-1.7.12+. - * explain the purge logic - * feat(purge all): Include option to purge all the cached files - This option can be slow if a lot of content is cached, or if the - storage used for the cache is slow. But you really should be using - RAM as your cache storage. - * feat(partial keys): Support partial keys to purge multiple keys. - Put an '*' at the end of your purge cache URL. - e.g: - proxy_cache_key $scheme$host$uri$is_args$args$cookie_JSESSIONID; - curl -X PURGE https://example.com/pass* - This will remove every cached page whose key cache starting with: - httpsexample.com/pass* - Be careful not passing any value for the values after the $uri, or put - it at the end of your cache key. - * Convert a config file to build a dynamic module - -2014-12-23 VERSION 2.3 - * Fix compatibility with nginx-1.7.9+. - -2014-12-02 VERSION 2.2 - * Fix compatibility with nginx-1.7.8+. - -2014-05-19 - * Fix build on Solaris with SunCC (Solaris Studio). - Reported by Jussi Sallinen. - -2013-03-19 VERSION 2.1 - * When enabled, cache purge will now catch all requests with - PURGE (or specified) method, even if cache isn't configured. - Previously, it would pass such requests to the upstream. - -2012-12-07 VERSION 2.0 - * Add alternative "same location" syntax. - From CloudFlare. - -2012-07-02 VERSION 1.6 - * Fix compatibility with nginx-1.3.2+. - Reported by MagicBear, patch from Ruslan Ermilov. - -2011-12-20 VERSION 1.5 - * Fix on-disk cache size calculation. - Since the initial release, recorded on-disk cache size was - decreased twice for purged content (once during cache purge - and once during subsequent cache update). - This resulted in recorded on-disk cache size being much - smaller than in reality, which could lead to on-disk cache - outgrowing defined "max_size" parameter. - Patch from Pyry Hakulinen. - -2011-10-05 VERSION 1.4 - * Add AIO support. - Requested by Emin Hasanov. - -2011-05-03 VERSION 1.3 - * Fix compatibility with nginx-1.0.1. - Reported by Sergey A. Osokin and Markus Linnala. - -2010-08-29 - * Fix compatibility with nginx-0.8.0 and versions older than - nginx-0.7.60. - -2010-08-11 VERSION 1.2 - * Fix various build scenarios with disabled upstream modules. - Reported by Johan Bergstroem. - - * Add ability to purge content from SCGI's cache. - Requested by Johan Bergstroem. - -2010-06-08 VERSION 1.1 - * Fix compatibility with nginx-0.8.40+. - - * Add ability to purge content from uWSGI's cache. - -2010-01-10 VERSION 1.0 - * Initial module release. - -2009-11-17 - * Fix patch compatibility with nginx-0.8.11+. - Reported by Bing Ran. - -2009-08-11 - * Initial patch release. diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/LICENSE b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/LICENSE deleted file mode 100644 index 0047538..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2009-2014, FRiCKLE -Copyright (c) 2009-2014, Piotr Sikora -All rights reserved. - -This project was fully funded by yo.se. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - 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 THE COPYRIGHT HOLDERS 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 THE COPYRIGHT -HOLDERS 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) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/README.md b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/README.md deleted file mode 100644 index e3d92b4..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/README.md +++ /dev/null @@ -1,283 +0,0 @@ -About -===== -`ngx_cache_purge` is `nginx` module which adds ability to purge content from -`FastCGI`, `proxy`, `SCGI` and `uWSGI` caches. A purge operation removes the -content with the same cache key as the purge request has. - - -Sponsors -======== -Work on the original patch was fully funded by [yo.se](http://yo.se). - - -Status -====== -This module is production-ready. - - -Configuration directives (same location syntax) -=============================================== -fastcgi_cache_purge -------------------- -* **syntax**: `fastcgi_cache_purge on|off| [purge_all] [from all| [.. ]]` -* **default**: `none` -* **context**: `http`, `server`, `location` - -Allow purging of selected pages from `FastCGI`'s cache. - - -proxy_cache_purge ------------------ -* **syntax**: `proxy_cache_purge on|off| [purge_all] [from all| [.. ]]` -* **default**: `none` -* **context**: `http`, `server`, `location` - -Allow purging of selected pages from `proxy`'s cache. - - -scgi_cache_purge ----------------- -* **syntax**: `scgi_cache_purge on|off| [purge_all] [from all| [.. ]]` -* **default**: `none` -* **context**: `http`, `server`, `location` - -Allow purging of selected pages from `SCGI`'s cache. - - -uwsgi_cache_purge ------------------ -* **syntax**: `uwsgi_cache_purge on|off| [purge_all] [from all| [.. ]]` -* **default**: `none` -* **context**: `http`, `server`, `location` - -Allow purging of selected pages from `uWSGI`'s cache. - - -Configuration directives (separate location syntax) -=================================================== -fastcgi_cache_purge -------------------- -* **syntax**: `fastcgi_cache_purge zone_name key` -* **default**: `none` -* **context**: `location` - -Sets area and key used for purging selected pages from `FastCGI`'s cache. - - -proxy_cache_purge ------------------ -* **syntax**: `proxy_cache_purge zone_name key` -* **default**: `none` -* **context**: `location` - -Sets area and key used for purging selected pages from `proxy`'s cache. - - -scgi_cache_purge ----------------- -* **syntax**: `scgi_cache_purge zone_name key` -* **default**: `none` -* **context**: `location` - -Sets area and key used for purging selected pages from `SCGI`'s cache. - - -uwsgi_cache_purge ------------------ -* **syntax**: `uwsgi_cache_purge zone_name key` -* **default**: `none` -* **context**: `location` - -Sets area and key used for purging selected pages from `uWSGI`'s cache. - -Configuration directives (Optional) -=================================================== - -cache_purge_response_type ------------------ -* **syntax**: `cache_purge_response_type html|json|xml|text` -* **default**: `html` -* **context**: `http`, `server`, `location` - -Sets a response type of purging result. - - - -Partial Keys -============ -Sometimes it's not possible to pass the exact key cache to purge a page. For example; when the content of a cookie or the params are part of the key. -You can specify a partial key adding an asterisk at the end of the URL. - - curl -X PURGE /page* - -The asterisk must be the last character of the key, so you **must** put the $uri variable at the end. - - - -Sample configuration (same location syntax) -=========================================== - http { - proxy_cache_path /tmp/cache keys_zone=tmpcache:10m; - - server { - location / { - proxy_pass http://127.0.0.1:8000; - proxy_cache tmpcache; - proxy_cache_key "$uri$is_args$args"; - proxy_cache_purge PURGE from 127.0.0.1; - } - } - } - - -Sample configuration (same location syntax - purge all cached files) -==================================================================== - http { - proxy_cache_path /tmp/cache keys_zone=tmpcache:10m; - - server { - location / { - proxy_pass http://127.0.0.1:8000; - proxy_cache tmpcache; - proxy_cache_key "$uri$is_args$args"; - proxy_cache_purge PURGE purge_all from 127.0.0.1 192.168.0.0/8; - } - } - } - - -Sample configuration (separate location syntax) -=============================================== - http { - proxy_cache_path /tmp/cache keys_zone=tmpcache:10m; - - server { - location / { - proxy_pass http://127.0.0.1:8000; - proxy_cache tmpcache; - proxy_cache_key "$uri$is_args$args"; - } - - location ~ /purge(/.*) { - allow 127.0.0.1; - deny all; - proxy_cache tmpcache; - proxy_cache_key "$1$is_args$args"; - } - } - } - -Sample configuration (Optional) -=============================================== - http { - proxy_cache_path /tmp/cache keys_zone=tmpcache:10m; - - cache_purge_response_type text; - - server { - - cache_purge_response_type json; - - location / { #json - proxy_pass http://127.0.0.1:8000; - proxy_cache tmpcache; - proxy_cache_key "$uri$is_args$args"; - } - - location ~ /purge(/.*) { #xml - allow 127.0.0.1; - deny all; - proxy_cache tmpcache; - proxy_cache_key "$1$is_args$args"; - cache_purge_response_type xml; - } - - location ~ /purge2(/.*) { # json - allow 127.0.0.1; - deny all; - proxy_cache tmpcache; - proxy_cache_key "$1$is_args$args"; - } - } - - server { - - location / { #text - proxy_pass http://127.0.0.1:8000; - proxy_cache tmpcache; - proxy_cache_key "$uri$is_args$args"; - } - - location ~ /purge(/.*) { #text - allow 127.0.0.1; - deny all; - proxy_cache tmpcache; - proxy_cache_key "$1$is_args$args"; - } - - location ~ /purge2(/.*) { #html - allow 127.0.0.1; - deny all; - proxy_cache tmpcache; - proxy_cache_key "$1$is_args$args"; - cache_purge_response_type html; - } - } - } - - - -Solve problems -============== -* Enabling [`gzip_vary`](https://nginx.org/r/gzip_vary) can lead to different results when clearing, when enabling it, you may have problems clearing the cache. For reliable operation, you can disable [`gzip_vary`](https://nginx.org/r/gzip_vary) inside the location [#20](https://github.com/nginx-modules/ngx_cache_purge/issues/20). - - -Testing -======= -`ngx_cache_purge` comes with complete test suite based on [Test::Nginx](http://github.com/agentzh/test-nginx). - -You can test it by running: - -`$ prove` - - -License -======= - Copyright (c) 2009-2014, FRiCKLE - Copyright (c) 2009-2014, Piotr Sikora - All rights reserved. - - This project was fully funded by yo.se. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - 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 THE COPYRIGHT HOLDERS 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 THE COPYRIGHT - HOLDERS 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) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -See also -======== -- [ngx_slowfs_cache](http://github.com/FRiCKLE/ngx_slowfs_cache). -- http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#purger -- http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_cache_purge -- https://github.com/wandenberg/nginx-selective-cache-purge-module -- https://github.com/wandenberg/nginx-sorted-querystring-module -- https://github.com/ledgetech/ledge -- [Faking Surrogate Cache-Keys for Nginx Plus](https://www.innoq.com/en/blog/faking-surrogate-cache-keys-for-nginx-plus/) ([gist](https://gist.github.com/titpetric/2f142e89eaa0f36ba4e4383b16d61474)) -- [Delete NGINX cached md5 items with a PURGE with wildcard support](https://gist.github.com/nosun/0cfb58d3164f829e2f027fd37b338ede) diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/config b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/config deleted file mode 100644 index b900680..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/config +++ /dev/null @@ -1,31 +0,0 @@ -if [ "$HTTP_PROXY" = "YES" ]; then - have=NGX_HTTP_PROXY . auto/have -fi - -if [ "$HTTP_FASTCGI" = "YES" ]; then - have=NGX_HTTP_FASTCGI . auto/have -fi - -if [ "$HTTP_SCGI" = "YES" ]; then - have=NGX_HTTP_SCGI . auto/have -fi - -if [ "$HTTP_UWSGI" = "YES" ]; then - have=NGX_HTTP_UWSGI . auto/have -fi - -ngx_addon_name=ngx_http_cache_purge_module -CACHE_PURGE_SRCS="$ngx_addon_dir/ngx_cache_purge_module.c" - -if [ -n "$ngx_module_link" ]; then - ngx_module_type=HTTP - ngx_module_name="$ngx_addon_name" - ngx_module_srcs="$CACHE_PURGE_SRCS" - - . auto/module -else - HTTP_MODULES="$HTTP_MODULES $ngx_addon_name" - NGX_ADDON_SRCS="$NGX_ADDON_SRCS $CACHE_PURGE_SRCS" -fi - -have=NGX_CACHE_PURGE_MODULE . auto/have diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/changelog b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/changelog deleted file mode 100644 index 9e03744..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/changelog +++ /dev/null @@ -1,74 +0,0 @@ -libnginx-mod-http-cache-purge (1:2.5.3-3) unstable; urgency=medium - - * d/control: update my email to janmojzis@debian.org - * d/copyright: update my email to janmojzis@debian.org - * d/control: bump Standards-Version: 4.7.2, no changes - * d/copyright: bump debian/* copyright year - * d/watch: use more generic template - - -- Jan Mojžíš Fri, 11 Apr 2025 14:26:56 +0200 - -libnginx-mod-http-cache-purge (1:2.5.3-2) unstable; urgency=medium - - * d/changelog fix closed bug number 1019003 -> 1055742 (Closes: 1055742) - - -- Jan Mojžíš Fri, 21 Jun 2024 19:34:05 +0200 - -libnginx-mod-http-cache-purge (1:2.5.3-1) unstable; urgency=medium - - * switch to a new upstream - https://github.com/nginx-modules/ngx_cache_purge - (Closes: 1072836) (Closes: 1055742) - * d/p/dynamic-module.patch remove, fixed in upstream - * d/p/segfault-1.11.6.patch remove, fixed in upstream - * d/t/purgetest added - * d/copyright: bump my copyright year - * d/gbp.conf: add [pull] track-missing = True - * d/control: bump Standards-Version: 4.7.0, no changes - - -- Jan Mojžíš Fri, 21 Jun 2024 13:36:53 +0200 - -libnginx-mod-http-cache-purge (1:2.3-6) unstable; urgency=medium - - * d/control: remove Build-Depends nginx-abi-1.24.0-1 - - -- Jan Mojžíš Sat, 07 Oct 2023 15:31:25 +0200 - -libnginx-mod-http-cache-purge (1:2.3-5) unstable; urgency=medium - - * NEW ABI: rebuild with nginx-abi-1.24.0-1 - - -- Jan Mojžíš Tue, 27 Jun 2023 23:16:35 +0200 - -libnginx-mod-http-cache-purge (1:2.3-4) unstable; urgency=medium - - * d/t/generic rework. The test now checks module after - installation/reload/restart. - * d/control: bump Standards-Version: 4.6.2, no changes - * d/gbb.conf: switched to debian branch main (debian-branch = main) - * d/copyright: bump my copyright year - * d/copyright: reformat text to be compatible with 'cme update dpkg-copyright' - * NEW ABI: rebuild with nginx-abi-1.22.1-7 - - -- Jan Mojžíš Mon, 13 Feb 2023 12:56:14 +0100 - -libnginx-mod-http-cache-purge (1:2.3-3) unstable; urgency=medium - - * d/copyright: fixed typo (empty line ngx_cache_purge_module.c) - - -- Jan Mojžíš Fri, 09 Dec 2022 14:50:48 +0100 - -libnginx-mod-http-cache-purge (1:2.3-2) experimental; urgency=medium - - * d/control: added Multi-Arch: foreign - * d/copyright: add Igor Sysoev + Nginx, Inc. - - -- Jan Mojžíš Mon, 05 Dec 2022 21:15:13 +0100 - -libnginx-mod-http-cache-purge (1:2.3-1) experimental; urgency=medium - - * Initial release. (Closes: 1024213) - * Additional info: The separate package libnginx-mod-http-cache-purge ships - newest version of ngx_cache_purge (Closes: 911099) - - -- Jan Mojžíš Wed, 30 Nov 2022 14:46:45 +0100 diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/control b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/control deleted file mode 100644 index 3936731..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/control +++ /dev/null @@ -1,23 +0,0 @@ -Source: libnginx-mod-http-cache-purge -Section: httpd -Priority: optional -Maintainer: Debian Nginx Maintainers -Uploaders: Jan Mojžíš , -Build-Depends: debhelper-compat (= 13), - dh-sequence-nginx, -Standards-Version: 4.7.2 -Homepage: https://github.com/FRiCKLE/ngx_cache_purge -Vcs-Git: https://salsa.debian.org/nginx-team/libnginx-mod-http-cache-purge.git -Vcs-Browser: https://salsa.debian.org/nginx-team/libnginx-mod-http-cache-purge -Rules-Requires-Root: no - -Package: libnginx-mod-http-cache-purge -Architecture: any -Multi-Arch: foreign -Depends: ${misc:Depends}, - ${shlibs:Depends}, -Recommends: nginx, -Description: Purge content from Nginx caches - Cache Purge module adds purging capabilities to Nginx. It allows purging - content from caches used by all of Nginx proxy modules, like FastCGI, Proxy, - SCGI and uWSGI. diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/copyright b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/copyright deleted file mode 100644 index a0ef36d..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/copyright +++ /dev/null @@ -1,36 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: ngx_cache_purge -Upstream-Contact: FRiCKLE -Source: https://github.com/FRiCKLE/ngx_cache_purge - -Files: * -Copyright: 2009-2014, Piotr Sikora - 2009-2014, FRiCKLE -License: BSD-2-clause - -Files: debian/* -Copyright: 2022, Miao Wang - 2022-2025, Jan Mojzis -License: BSD-2-clause - -License: BSD-2-clause - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - 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 THE COPYRIGHT HOLDERS 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 THE COPYRIGHT - HOLDERS 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) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/gbp.conf b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/gbp.conf deleted file mode 100644 index 97cd209..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/gbp.conf +++ /dev/null @@ -1,12 +0,0 @@ -[DEFAULT] -debian-branch = main -upstream-branch = upstream -upstream-tag = upstream/%(version)s -pristine-tar = True -sign-tags = True - -[import-orig] -merge-mode = replace - -[pull] -track-missing = True diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/rules b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/rules deleted file mode 100755 index d8309f6..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/rules +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/make -f - -export DEB_BUILD_MAINT_OPTIONS = hardening=+all - -%: - dh $@ diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/source/format b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/source/format deleted file mode 100644 index 163aaf8..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/tests/control b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/tests/control deleted file mode 100644 index dd4e1a3..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/tests/control +++ /dev/null @@ -1,13 +0,0 @@ -Tests: generic -Restrictions: allow-stderr isolation-container needs-root -Depends: curl, - nginx, - nginx-core, - @, - -Tests: purgetest -Restrictions: allow-stderr isolation-container needs-root -Depends: curl, - nginx, - nginx-core, - @, diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/tests/generic b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/tests/generic deleted file mode 100644 index a14fc80..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/tests/generic +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -# version 20221215 - -# generic test that only verifies that nginx is running with the given -# libnginx-... module -# - after installation -# - after nginx reload -# - after nginx restart - -EX=0 -CURL_CMD="curl --max-time 60 --silent --fail -o /dev/null" - -#change directory to $AUTOPKGTEST_TMP -cd "${AUTOPKGTEST_TMP}" - -echo -n "curl after installation: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx reload ... " -if invoke-rc.d nginx reload; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - - -echo -n "curl after reload: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx restart ... " -if invoke-rc.d nginx restart; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - -echo -n "curl after restart: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -if [ ${EX} -ne 0 ]; then - echo "=== journalctl ===" - journalctl -n all -xu nginx.service || : - - echo "=== error.log ===" - if [ `wc -l /var/log/nginx/error.log | cut -d ' ' -f1` -gt 100 ]; then - head -n 50 /var/log/nginx/error.log - echo '...' - tail -n 50 /var/log/nginx/error.log - else - cat /var/log/nginx/error.log - fi -fi - -exit ${EX} diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/tests/purgetest b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/tests/purgetest deleted file mode 100644 index 1574080..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/tests/purgetest +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -set -e - -cat < "/etc/nginx/sites-enabled/default" -proxy_cache_path /tmp/ngx_cache_purge_cache keys_zone=test_cache:10m; -proxy_temp_path /tmp/ngx_cache_purge_temp 1 2; - -server { - listen 127.0.0.1:80 default_server; - - location /proxy { - proxy_pass \$scheme://127.0.0.1:\$server_port/etc/passwd; - proxy_cache test_cache; - proxy_cache_key \$uri\$is_args\$args; - proxy_cache_valid 3m; - add_header X-Cache-Status \$upstream_cache_status; - } - - location ~ /purge(/.*) { - proxy_cache_purge test_cache \$1\$is_args\$args; - } - - location = /etc/passwd { - root /; - } -} -EOF - -nginx -t -invoke-rc.d nginx restart || { journalctl -n all -xu nginx.service; exit 1; } - -curl --fail -s -o /dev/null -w "GET key: %{http_code}\n" http://127.0.0.1/proxy/passwd -curl --fail -s -o /dev/null -w "PURGE existing key: %{http_code}\n" -X PURGE http://127.0.0.1/purge/proxy/passwd -curl -s -o /dev/null -w "PURGE non-existing key: %{http_code}\n" -X PURGE http://127.0.0.1/purge/proxy/passwd diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/upstream/metadata b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/upstream/metadata deleted file mode 100644 index ca2631c..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/upstream/metadata +++ /dev/null @@ -1,4 +0,0 @@ ---- -Bug-Database: https://github.com/FRiCKLE/ngx_cache_purge/issues -Bug-Submit: https://github.com/FRiCKLE/ngx_cache_purge/issues/new -Repository-Browse: https://github.com/FRiCKLE/ngx_cache_purge \ No newline at end of file diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/watch b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/watch deleted file mode 100644 index 11bd9bf..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/debian/watch +++ /dev/null @@ -1,6 +0,0 @@ -version=4 -opts="\ -uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha|a|b)\d*)$/$1~$2/,\ -" \ -https://github.com/nginx-modules/ngx_cache_purge/tags \ -(?:.*?/)?v?@ANY_VERSION@@ARCHIVE_EXT@ diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/ngx_cache_purge_module.c b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/ngx_cache_purge_module.c deleted file mode 100644 index 251d3fe..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/ngx_cache_purge_module.c +++ /dev/null @@ -1,2163 +0,0 @@ -/* - * Copyright (c) 2009-2014, FRiCKLE - * Copyright (c) 2009-2014, Piotr Sikora - * All rights reserved. - * - * This project was fully funded by yo.se. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * 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 THE COPYRIGHT HOLDERS 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 THE COPYRIGHT - * HOLDERS 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) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include -#include - - -#ifndef nginx_version - #error This module cannot be build against an unknown nginx version. -#endif - -#define NGX_REPONSE_TYPE_HTML 1 -#define NGX_REPONSE_TYPE_XML 2 -#define NGX_REPONSE_TYPE_JSON 3 -#define NGX_REPONSE_TYPE_TEXT 4 - -static const char ngx_http_cache_purge_content_type_json[] = "application/json"; -static const char ngx_http_cache_purge_content_type_html[] = "text/html"; -static const char ngx_http_cache_purge_content_type_xml[] = "text/xml"; -static const char ngx_http_cache_purge_content_type_text[] = "text/plain"; - -static size_t ngx_http_cache_purge_content_type_json_size = sizeof(ngx_http_cache_purge_content_type_json); -static size_t ngx_http_cache_purge_content_type_html_size = sizeof(ngx_http_cache_purge_content_type_html); -static size_t ngx_http_cache_purge_content_type_xml_size = sizeof(ngx_http_cache_purge_content_type_xml); -static size_t ngx_http_cache_purge_content_type_text_size = sizeof(ngx_http_cache_purge_content_type_text); - -static const char ngx_http_cache_purge_body_templ_json[] = "{\"Key\": \"%s\"}"; -static const char ngx_http_cache_purge_body_templ_html[] = "Successful purge

Successful purge

Key : %s

"; -static const char ngx_http_cache_purge_body_templ_xml[] = ""; -static const char ngx_http_cache_purge_body_templ_text[] = "Key:%s\n"; - -static size_t ngx_http_cache_purge_body_templ_json_size = sizeof(ngx_http_cache_purge_body_templ_json); -static size_t ngx_http_cache_purge_body_templ_html_size = sizeof(ngx_http_cache_purge_body_templ_html); -static size_t ngx_http_cache_purge_body_templ_xml_size = sizeof(ngx_http_cache_purge_body_templ_xml); -static size_t ngx_http_cache_purge_body_templ_text_size = sizeof(ngx_http_cache_purge_body_templ_text); - -#if (NGX_HTTP_CACHE) - -typedef struct { - ngx_flag_t enable; - ngx_str_t method; - ngx_flag_t purge_all; - ngx_array_t *access; /* array of ngx_in_cidr_t */ - ngx_array_t *access6; /* array of ngx_in6_cidr_t */ -} ngx_http_cache_purge_conf_t; - -typedef struct { -# if (NGX_HTTP_FASTCGI) - ngx_http_cache_purge_conf_t fastcgi; -# endif /* NGX_HTTP_FASTCGI */ -# if (NGX_HTTP_PROXY) - ngx_http_cache_purge_conf_t proxy; -# endif /* NGX_HTTP_PROXY */ -# if (NGX_HTTP_SCGI) - ngx_http_cache_purge_conf_t scgi; -# endif /* NGX_HTTP_SCGI */ -# if (NGX_HTTP_UWSGI) - ngx_http_cache_purge_conf_t uwsgi; -# endif /* NGX_HTTP_UWSGI */ - - ngx_http_cache_purge_conf_t *conf; - ngx_http_handler_pt handler; - ngx_http_handler_pt original_handler; - - ngx_uint_t resptype; /* response content-type */ -} ngx_http_cache_purge_loc_conf_t; - -# if (NGX_HTTP_FASTCGI) -char *ngx_http_fastcgi_cache_purge_conf(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -ngx_int_t ngx_http_fastcgi_cache_purge_handler(ngx_http_request_t *r); -# endif /* NGX_HTTP_FASTCGI */ - -# if (NGX_HTTP_PROXY) -char *ngx_http_proxy_cache_purge_conf(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -ngx_int_t ngx_http_proxy_cache_purge_handler(ngx_http_request_t *r); -# endif /* NGX_HTTP_PROXY */ - -# if (NGX_HTTP_SCGI) -char *ngx_http_scgi_cache_purge_conf(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -ngx_int_t ngx_http_scgi_cache_purge_handler(ngx_http_request_t *r); -# endif /* NGX_HTTP_SCGI */ - -# if (NGX_HTTP_UWSGI) -char *ngx_http_uwsgi_cache_purge_conf(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -ngx_int_t ngx_http_uwsgi_cache_purge_handler(ngx_http_request_t *r); -# endif /* NGX_HTTP_UWSGI */ - -char *ngx_http_cache_purge_response_type_conf(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static ngx_int_t -ngx_http_purge_file_cache_noop(ngx_tree_ctx_t *ctx, ngx_str_t *path); -static ngx_int_t -ngx_http_purge_file_cache_delete_file(ngx_tree_ctx_t *ctx, ngx_str_t *path); - -ngx_int_t ngx_http_cache_purge_access_handler(ngx_http_request_t *r); -ngx_int_t ngx_http_cache_purge_access(ngx_array_t *a, ngx_array_t *a6, - struct sockaddr *s); - -ngx_int_t ngx_http_cache_purge_send_response(ngx_http_request_t *r); -# if (nginx_version >= 1007009) -ngx_int_t ngx_http_cache_purge_cache_get(ngx_http_request_t *r, - ngx_http_upstream_t *u, ngx_http_file_cache_t **cache); -# endif /* nginx_version >= 1007009 */ -ngx_int_t ngx_http_cache_purge_init(ngx_http_request_t *r, - ngx_http_file_cache_t *cache, ngx_http_complex_value_t *cache_key); -void ngx_http_cache_purge_handler(ngx_http_request_t *r); - -ngx_int_t ngx_http_file_cache_purge(ngx_http_request_t *r); - - -void ngx_http_cache_purge_all(ngx_http_request_t *r, ngx_http_file_cache_t *cache); -void ngx_http_cache_purge_partial(ngx_http_request_t *r, ngx_http_file_cache_t *cache); -ngx_int_t ngx_http_cache_purge_is_partial(ngx_http_request_t *r); - -char *ngx_http_cache_purge_conf(ngx_conf_t *cf, - ngx_http_cache_purge_conf_t *cpcf); - -void *ngx_http_cache_purge_create_loc_conf(ngx_conf_t *cf); -char *ngx_http_cache_purge_merge_loc_conf(ngx_conf_t *cf, - void *parent, void *child); - -static ngx_command_t ngx_http_cache_purge_module_commands[] = { - -# if (NGX_HTTP_FASTCGI) - { - ngx_string("fastcgi_cache_purge"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, - ngx_http_fastcgi_cache_purge_conf, - NGX_HTTP_LOC_CONF_OFFSET, - 0, - NULL - }, -# endif /* NGX_HTTP_FASTCGI */ - -# if (NGX_HTTP_PROXY) - { - ngx_string("proxy_cache_purge"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, - ngx_http_proxy_cache_purge_conf, - NGX_HTTP_LOC_CONF_OFFSET, - 0, - NULL - }, -# endif /* NGX_HTTP_PROXY */ - -# if (NGX_HTTP_SCGI) - { - ngx_string("scgi_cache_purge"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, - ngx_http_scgi_cache_purge_conf, - NGX_HTTP_LOC_CONF_OFFSET, - 0, - NULL - }, -# endif /* NGX_HTTP_SCGI */ - -# if (NGX_HTTP_UWSGI) - { - ngx_string("uwsgi_cache_purge"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, - ngx_http_uwsgi_cache_purge_conf, - NGX_HTTP_LOC_CONF_OFFSET, - 0, - NULL - }, -# endif /* NGX_HTTP_UWSGI */ - - - { ngx_string("cache_purge_response_type"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, - ngx_http_cache_purge_response_type_conf, - NGX_HTTP_LOC_CONF_OFFSET, - 0, - NULL }, - - ngx_null_command -}; - -static ngx_http_module_t ngx_http_cache_purge_module_ctx = { - NULL, /* preconfiguration */ - NULL, /* postconfiguration */ - - NULL, /* create main configuration */ - NULL, /* init main configuration */ - - NULL, /* create server configuration */ - NULL, /* merge server configuration */ - - ngx_http_cache_purge_create_loc_conf, /* create location configuration */ - ngx_http_cache_purge_merge_loc_conf /* merge location configuration */ -}; - -ngx_module_t ngx_http_cache_purge_module = { - NGX_MODULE_V1, - &ngx_http_cache_purge_module_ctx, /* module context */ - ngx_http_cache_purge_module_commands, /* module directives */ - NGX_HTTP_MODULE, /* module type */ - NULL, /* init master */ - NULL, /* init module */ - NULL, /* init process */ - NULL, /* init thread */ - NULL, /* exit thread */ - NULL, /* exit process */ - NULL, /* exit master */ - NGX_MODULE_V1_PADDING -}; - -# if (NGX_HTTP_FASTCGI) -extern ngx_module_t ngx_http_fastcgi_module; - -# if (nginx_version >= 1007009) - -typedef struct { - ngx_array_t caches; /* ngx_http_file_cache_t * */ -} ngx_http_fastcgi_main_conf_t; - -# endif /* nginx_version >= 1007009 */ - -# if (nginx_version >= 1007008) - -typedef struct { - ngx_array_t *flushes; - ngx_array_t *lengths; - ngx_array_t *values; - ngx_uint_t number; - ngx_hash_t hash; -} ngx_http_fastcgi_params_t; - -# endif /* nginx_version >= 1007008 */ - -typedef struct { - ngx_http_upstream_conf_t upstream; - - ngx_str_t index; - -# if (nginx_version >= 1007008) - ngx_http_fastcgi_params_t params; - ngx_http_fastcgi_params_t params_cache; -# else - ngx_array_t *flushes; - ngx_array_t *params_len; - ngx_array_t *params; -# endif /* nginx_version >= 1007008 */ - - ngx_array_t *params_source; - ngx_array_t *catch_stderr; - - ngx_array_t *fastcgi_lengths; - ngx_array_t *fastcgi_values; - -# if (nginx_version >= 8040) && (nginx_version < 1007008) - ngx_hash_t headers_hash; - ngx_uint_t header_params; -# endif /* nginx_version >= 8040 && nginx_version < 1007008 */ - -# if (nginx_version >= 1001004) - ngx_flag_t keep_conn; -# endif /* nginx_version >= 1001004 */ - - ngx_http_complex_value_t cache_key; - -# if (NGX_PCRE) - ngx_regex_t *split_regex; - ngx_str_t split_name; -# endif /* NGX_PCRE */ -} ngx_http_fastcgi_loc_conf_t; - -char * -ngx_http_fastcgi_cache_purge_conf(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf) { - ngx_http_compile_complex_value_t ccv; - ngx_http_cache_purge_loc_conf_t *cplcf; - ngx_http_core_loc_conf_t *clcf; - ngx_http_fastcgi_loc_conf_t *flcf; - ngx_str_t *value; -# if (nginx_version >= 1007009) - ngx_http_complex_value_t cv; -# endif /* nginx_version >= 1007009 */ - - cplcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_cache_purge_module); - - /* check for duplicates / collisions */ - if (cplcf->fastcgi.enable != NGX_CONF_UNSET) { - return "is duplicate"; - } - - if (cf->args->nelts != 3) { - return ngx_http_cache_purge_conf(cf, &cplcf->fastcgi); - } - - if (cf->cmd_type & (NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF)) { - return "(separate location syntax) is not allowed here"; - } - - flcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_fastcgi_module); - -# if (nginx_version >= 1007009) - if (flcf->upstream.cache > 0) -# else - if (flcf->upstream.cache != NGX_CONF_UNSET_PTR - && flcf->upstream.cache != NULL) -# endif /* nginx_version >= 1007009 */ - { - return "is incompatible with \"fastcgi_cache\""; - } - - if (flcf->upstream.upstream || flcf->fastcgi_lengths) { - return "is incompatible with \"fastcgi_pass\""; - } - - if (flcf->upstream.store > 0 -# if (nginx_version < 1007009) - || flcf->upstream.store_lengths -# endif /* nginx_version >= 1007009 */ - ) { - return "is incompatible with \"fastcgi_store\""; - } - - value = cf->args->elts; - - /* set fastcgi_cache part */ -# if (nginx_version >= 1007009) - - flcf->upstream.cache = 1; - - ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); - - ccv.cf = cf; - ccv.value = &value[1]; - ccv.complex_value = &cv; - - if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { - return NGX_CONF_ERROR; - } - - if (cv.lengths != NULL) { - - flcf->upstream.cache_value = ngx_palloc(cf->pool, - sizeof(ngx_http_complex_value_t)); - if (flcf->upstream.cache_value == NULL) { - return NGX_CONF_ERROR; - } - - *flcf->upstream.cache_value = cv; - - } else { - - flcf->upstream.cache_zone = ngx_shared_memory_add(cf, &value[1], 0, - &ngx_http_fastcgi_module); - if (flcf->upstream.cache_zone == NULL) { - return NGX_CONF_ERROR; - } - } - -# else - - flcf->upstream.cache = ngx_shared_memory_add(cf, &value[1], 0, - &ngx_http_fastcgi_module); - if (flcf->upstream.cache == NULL) { - return NGX_CONF_ERROR; - } - -# endif /* nginx_version >= 1007009 */ - - /* set fastcgi_cache_key part */ - ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); - - ccv.cf = cf; - ccv.value = &value[2]; - ccv.complex_value = &flcf->cache_key; - - if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { - return NGX_CONF_ERROR; - } - - /* set handler */ - clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module); - - cplcf->fastcgi.enable = 0; - cplcf->conf = &cplcf->fastcgi; - clcf->handler = ngx_http_fastcgi_cache_purge_handler; - - return NGX_CONF_OK; -} - -ngx_int_t -ngx_http_fastcgi_cache_purge_handler(ngx_http_request_t *r) { - ngx_http_file_cache_t *cache; - ngx_http_fastcgi_loc_conf_t *flcf; - ngx_http_cache_purge_loc_conf_t *cplcf; -# if (nginx_version >= 1007009) - ngx_http_fastcgi_main_conf_t *fmcf; - ngx_int_t rc; -# endif /* nginx_version >= 1007009 */ - - if (ngx_http_upstream_create(r) != NGX_OK) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - flcf = ngx_http_get_module_loc_conf(r, ngx_http_fastcgi_module); - - r->upstream->conf = &flcf->upstream; - -# if (nginx_version >= 1007009) - - fmcf = ngx_http_get_module_main_conf(r, ngx_http_fastcgi_module); - - r->upstream->caches = &fmcf->caches; - - rc = ngx_http_cache_purge_cache_get(r, r->upstream, &cache); - if (rc != NGX_OK) { - return rc; - } - -# else - - cache = flcf->upstream.cache->data; - -# endif /* nginx_version >= 1007009 */ - - if (ngx_http_cache_purge_init(r, cache, &flcf->cache_key) != NGX_OK) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - /* Purge-all option */ - cplcf = ngx_http_get_module_loc_conf(r, ngx_http_cache_purge_module); - if (cplcf->conf->purge_all) { - ngx_http_cache_purge_all(r, cache); - } else { - if (ngx_http_cache_purge_is_partial(r)) { - ngx_log_debug(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "http file cache purge with partial enabled"); - - ngx_http_cache_purge_partial(r, cache); - } - } - -# if (nginx_version >= 8011) - r->main->count++; -# endif - - ngx_http_cache_purge_handler(r); - - return NGX_DONE; -} -# endif /* NGX_HTTP_FASTCGI */ - -# if (NGX_HTTP_PROXY) -extern ngx_module_t ngx_http_proxy_module; - -typedef struct { - ngx_str_t key_start; - ngx_str_t schema; - ngx_str_t host_header; - ngx_str_t port; - ngx_str_t uri; -} ngx_http_proxy_vars_t; - -# if (nginx_version >= 1007009) - -typedef struct { - ngx_array_t caches; /* ngx_http_file_cache_t * */ -} ngx_http_proxy_main_conf_t; - -# endif /* nginx_version >= 1007009 */ - -# if (nginx_version >= 1007008) - -typedef struct { - ngx_array_t *flushes; - ngx_array_t *lengths; - ngx_array_t *values; - ngx_hash_t hash; -} ngx_http_proxy_headers_t; - -# endif /* nginx_version >= 1007008 */ - -typedef struct { - ngx_http_upstream_conf_t upstream; - -# if (nginx_version >= 1007008) - ngx_array_t *body_flushes; - ngx_array_t *body_lengths; - ngx_array_t *body_values; - ngx_str_t body_source; - - ngx_http_proxy_headers_t headers; - ngx_http_proxy_headers_t headers_cache; -# else - ngx_array_t *flushes; - ngx_array_t *body_set_len; - ngx_array_t *body_set; - ngx_array_t *headers_set_len; - ngx_array_t *headers_set; - ngx_hash_t headers_set_hash; -# endif /* nginx_version >= 1007008 */ - - ngx_array_t *headers_source; -# if (nginx_version < 8040) - ngx_array_t *headers_names; -# endif /* nginx_version < 8040 */ - - ngx_array_t *proxy_lengths; - ngx_array_t *proxy_values; - - ngx_array_t *redirects; -# if (nginx_version >= 1001015) - ngx_array_t *cookie_domains; - ngx_array_t *cookie_paths; -# endif /* nginx_version >= 1001015 */ -# if (nginx_version >= 1019003) - ngx_array_t *cookie_flags; -# endif /* nginx_version >= 1019003 */ -# if (nginx_version < 1007008) - ngx_str_t body_source; -# endif /* nginx_version < 1007008 */ - -# if (nginx_version >= 1011006) - ngx_http_complex_value_t *method; -# else - ngx_str_t method; -# endif /* nginx_version >= 1011006 */ - ngx_str_t location; - ngx_str_t url; - - ngx_http_complex_value_t cache_key; - - ngx_http_proxy_vars_t vars; - - ngx_flag_t redirect; - -# if (nginx_version >= 1001004) - ngx_uint_t http_version; -# endif /* nginx_version >= 1001004 */ - - ngx_uint_t headers_hash_max_size; - ngx_uint_t headers_hash_bucket_size; - -# if (NGX_HTTP_SSL) -# if (nginx_version >= 1005006) - ngx_uint_t ssl; - ngx_uint_t ssl_protocols; - ngx_str_t ssl_ciphers; -# endif /* nginx_version >= 1005006 */ -# if (nginx_version >= 1007000) - ngx_uint_t ssl_verify_depth; - ngx_str_t ssl_trusted_certificate; - ngx_str_t ssl_crl; -# endif /* nginx_version >= 1007000 */ -# if ((nginx_version >= 1007008) && (nginx_version < 1021000)) - ngx_str_t ssl_certificate; - ngx_str_t ssl_certificate_key; - ngx_array_t *ssl_passwords; -# endif /* nginx_version >= 1007008 && nginx_version < 1021000 */ -# if (nginx_version >= 1019004) - ngx_array_t *ssl_conf_commands; -# endif /*nginx_version >= 1019004 */ -# endif -} ngx_http_proxy_loc_conf_t; - -char * -ngx_http_proxy_cache_purge_conf(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) { - ngx_http_compile_complex_value_t ccv; - ngx_http_cache_purge_loc_conf_t *cplcf; - ngx_http_core_loc_conf_t *clcf; - ngx_http_proxy_loc_conf_t *plcf; - ngx_str_t *value; -# if (nginx_version >= 1007009) - ngx_http_complex_value_t cv; -# endif /* nginx_version >= 1007009 */ - - cplcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_cache_purge_module); - - /* check for duplicates / collisions */ - if (cplcf->proxy.enable != NGX_CONF_UNSET) { - return "is duplicate"; - } - - if (cf->args->nelts != 3) { - return ngx_http_cache_purge_conf(cf, &cplcf->proxy); - } - - if (cf->cmd_type & (NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF)) { - return "(separate location syntax) is not allowed here"; - } - - plcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_proxy_module); - -# if (nginx_version >= 1007009) - if (plcf->upstream.cache > 0) -# else - if (plcf->upstream.cache != NGX_CONF_UNSET_PTR - && plcf->upstream.cache != NULL) -# endif /* nginx_version >= 1007009 */ - { - return "is incompatible with \"proxy_cache\""; - } - - if (plcf->upstream.upstream || plcf->proxy_lengths) { - return "is incompatible with \"proxy_pass\""; - } - - if (plcf->upstream.store > 0 -# if (nginx_version < 1007009) - || plcf->upstream.store_lengths -# endif /* nginx_version >= 1007009 */ - ) { - return "is incompatible with \"proxy_store\""; - } - - value = cf->args->elts; - - /* set proxy_cache part */ -# if (nginx_version >= 1007009) - - plcf->upstream.cache = 1; - - ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); - - ccv.cf = cf; - ccv.value = &value[1]; - ccv.complex_value = &cv; - - if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { - return NGX_CONF_ERROR; - } - - if (cv.lengths != NULL) { - - plcf->upstream.cache_value = ngx_palloc(cf->pool, - sizeof(ngx_http_complex_value_t)); - if (plcf->upstream.cache_value == NULL) { - return NGX_CONF_ERROR; - } - - *plcf->upstream.cache_value = cv; - - } else { - - plcf->upstream.cache_zone = ngx_shared_memory_add(cf, &value[1], 0, - &ngx_http_proxy_module); - if (plcf->upstream.cache_zone == NULL) { - return NGX_CONF_ERROR; - } - } - -# else - - plcf->upstream.cache = ngx_shared_memory_add(cf, &value[1], 0, - &ngx_http_proxy_module); - if (plcf->upstream.cache == NULL) { - return NGX_CONF_ERROR; - } - -# endif /* nginx_version >= 1007009 */ - - /* set proxy_cache_key part */ - ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); - - ccv.cf = cf; - ccv.value = &value[2]; - ccv.complex_value = &plcf->cache_key; - - if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { - return NGX_CONF_ERROR; - } - - /* set handler */ - clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module); - - cplcf->proxy.enable = 0; - cplcf->conf = &cplcf->proxy; - clcf->handler = ngx_http_proxy_cache_purge_handler; - - return NGX_CONF_OK; -} - -ngx_int_t -ngx_http_proxy_cache_purge_handler(ngx_http_request_t *r) { - ngx_http_file_cache_t *cache; - ngx_http_proxy_loc_conf_t *plcf; - ngx_http_cache_purge_loc_conf_t *cplcf; -# if (nginx_version >= 1007009) - ngx_http_proxy_main_conf_t *pmcf; - ngx_int_t rc; -# endif /* nginx_version >= 1007009 */ - - if (ngx_http_upstream_create(r) != NGX_OK) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - plcf = ngx_http_get_module_loc_conf(r, ngx_http_proxy_module); - - r->upstream->conf = &plcf->upstream; - -# if (nginx_version >= 1007009) - - pmcf = ngx_http_get_module_main_conf(r, ngx_http_proxy_module); - - r->upstream->caches = &pmcf->caches; - - rc = ngx_http_cache_purge_cache_get(r, r->upstream, &cache); - if (rc != NGX_OK) { - return rc; - } - -# else - - cache = plcf->upstream.cache->data; - -# endif /* nginx_version >= 1007009 */ - - if (ngx_http_cache_purge_init(r, cache, &plcf->cache_key) != NGX_OK) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - /* Purge-all option */ - cplcf = ngx_http_get_module_loc_conf(r, ngx_http_cache_purge_module); - if (cplcf->conf->purge_all) { - ngx_http_cache_purge_all(r, cache); - } else { - if (ngx_http_cache_purge_is_partial(r)) { - ngx_log_debug(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "http file cache purge with partial enabled"); - - ngx_http_cache_purge_partial(r, cache); - } - } - -# if (nginx_version >= 8011) - r->main->count++; -# endif - - ngx_http_cache_purge_handler(r); - - return NGX_DONE; -} -# endif /* NGX_HTTP_PROXY */ - -# if (NGX_HTTP_SCGI) -extern ngx_module_t ngx_http_scgi_module; - -# if (nginx_version >= 1007009) - -typedef struct { - ngx_array_t caches; /* ngx_http_file_cache_t * */ -} ngx_http_scgi_main_conf_t; - -# endif /* nginx_version >= 1007009 */ - -# if (nginx_version >= 1007008) - -typedef struct { - ngx_array_t *flushes; - ngx_array_t *lengths; - ngx_array_t *values; - ngx_uint_t number; - ngx_hash_t hash; -} ngx_http_scgi_params_t; - -# endif /* nginx_version >= 1007008 */ - -typedef struct { - ngx_http_upstream_conf_t upstream; - -# if (nginx_version >= 1007008) - ngx_http_scgi_params_t params; - ngx_http_scgi_params_t params_cache; - ngx_array_t *params_source; -# else - ngx_array_t *flushes; - ngx_array_t *params_len; - ngx_array_t *params; - ngx_array_t *params_source; - - ngx_hash_t headers_hash; - ngx_uint_t header_params; -# endif /* nginx_version >= 1007008 */ - - ngx_array_t *scgi_lengths; - ngx_array_t *scgi_values; - - ngx_http_complex_value_t cache_key; -} ngx_http_scgi_loc_conf_t; - -char * -ngx_http_scgi_cache_purge_conf(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) { - ngx_http_compile_complex_value_t ccv; - ngx_http_cache_purge_loc_conf_t *cplcf; - ngx_http_core_loc_conf_t *clcf; - ngx_http_scgi_loc_conf_t *slcf; - ngx_str_t *value; -# if (nginx_version >= 1007009) - ngx_http_complex_value_t cv; -# endif /* nginx_version >= 1007009 */ - - cplcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_cache_purge_module); - - /* check for duplicates / collisions */ - if (cplcf->scgi.enable != NGX_CONF_UNSET) { - return "is duplicate"; - } - - if (cf->args->nelts != 3) { - return ngx_http_cache_purge_conf(cf, &cplcf->scgi); - } - - if (cf->cmd_type & (NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF)) { - return "(separate location syntax) is not allowed here"; - } - - slcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_scgi_module); - -# if (nginx_version >= 1007009) - if (slcf->upstream.cache > 0) -# else - if (slcf->upstream.cache != NGX_CONF_UNSET_PTR - && slcf->upstream.cache != NULL) -# endif /* nginx_version >= 1007009 */ - { - return "is incompatible with \"scgi_cache\""; - } - - if (slcf->upstream.upstream || slcf->scgi_lengths) { - return "is incompatible with \"scgi_pass\""; - } - - if (slcf->upstream.store > 0 -# if (nginx_version < 1007009) - || slcf->upstream.store_lengths -# endif /* nginx_version >= 1007009 */ - ) { - return "is incompatible with \"scgi_store\""; - } - - value = cf->args->elts; - - /* set scgi_cache part */ -# if (nginx_version >= 1007009) - - slcf->upstream.cache = 1; - - ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); - - ccv.cf = cf; - ccv.value = &value[1]; - ccv.complex_value = &cv; - - if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { - return NGX_CONF_ERROR; - } - - if (cv.lengths != NULL) { - - slcf->upstream.cache_value = ngx_palloc(cf->pool, - sizeof(ngx_http_complex_value_t)); - if (slcf->upstream.cache_value == NULL) { - return NGX_CONF_ERROR; - } - - *slcf->upstream.cache_value = cv; - - } else { - - slcf->upstream.cache_zone = ngx_shared_memory_add(cf, &value[1], 0, - &ngx_http_scgi_module); - if (slcf->upstream.cache_zone == NULL) { - return NGX_CONF_ERROR; - } - } - -# else - - slcf->upstream.cache = ngx_shared_memory_add(cf, &value[1], 0, - &ngx_http_scgi_module); - if (slcf->upstream.cache == NULL) { - return NGX_CONF_ERROR; - } - -# endif /* nginx_version >= 1007009 */ - - /* set scgi_cache_key part */ - ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); - - ccv.cf = cf; - ccv.value = &value[2]; - ccv.complex_value = &slcf->cache_key; - - if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { - return NGX_CONF_ERROR; - } - - /* set handler */ - clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module); - - cplcf->scgi.enable = 0; - cplcf->conf = &cplcf->scgi; - clcf->handler = ngx_http_scgi_cache_purge_handler; - - return NGX_CONF_OK; -} - -ngx_int_t -ngx_http_scgi_cache_purge_handler(ngx_http_request_t *r) { - ngx_http_file_cache_t *cache; - ngx_http_scgi_loc_conf_t *slcf; - ngx_http_cache_purge_loc_conf_t *cplcf; -# if (nginx_version >= 1007009) - ngx_http_scgi_main_conf_t *smcf; - ngx_int_t rc; -# endif /* nginx_version >= 1007009 */ - - if (ngx_http_upstream_create(r) != NGX_OK) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - slcf = ngx_http_get_module_loc_conf(r, ngx_http_scgi_module); - - r->upstream->conf = &slcf->upstream; - -# if (nginx_version >= 1007009) - - smcf = ngx_http_get_module_main_conf(r, ngx_http_scgi_module); - - r->upstream->caches = &smcf->caches; - - rc = ngx_http_cache_purge_cache_get(r, r->upstream, &cache); - if (rc != NGX_OK) { - return rc; - } - -# else - - cache = slcf->upstream.cache->data; - -# endif /* nginx_version >= 1007009 */ - - if (ngx_http_cache_purge_init(r, cache, &slcf->cache_key) != NGX_OK) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - /* Purge-all option */ - cplcf = ngx_http_get_module_loc_conf(r, ngx_http_cache_purge_module); - if (cplcf->conf->purge_all) { - ngx_http_cache_purge_all(r, cache); - } else { - if (ngx_http_cache_purge_is_partial(r)) { - ngx_log_debug(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "http file cache purge with partial enabled"); - - ngx_http_cache_purge_partial(r, cache); - } - } - -# if (nginx_version >= 8011) - r->main->count++; -# endif - - ngx_http_cache_purge_handler(r); - - return NGX_DONE; -} -# endif /* NGX_HTTP_SCGI */ - -# if (NGX_HTTP_UWSGI) -extern ngx_module_t ngx_http_uwsgi_module; - -# if (nginx_version >= 1007009) - -typedef struct { - ngx_array_t caches; /* ngx_http_file_cache_t * */ -} ngx_http_uwsgi_main_conf_t; - -# endif /* nginx_version >= 1007009 */ - -# if (nginx_version >= 1007008) - -typedef struct { - ngx_array_t *flushes; - ngx_array_t *lengths; - ngx_array_t *values; - ngx_uint_t number; - ngx_hash_t hash; -} ngx_http_uwsgi_params_t; - -# endif /* nginx_version >= 1007008 */ - -typedef struct { - ngx_http_upstream_conf_t upstream; - -# if (nginx_version >= 1007008) - ngx_http_uwsgi_params_t params; - ngx_http_uwsgi_params_t params_cache; - ngx_array_t *params_source; -# else - ngx_array_t *flushes; - ngx_array_t *params_len; - ngx_array_t *params; - ngx_array_t *params_source; - - ngx_hash_t headers_hash; - ngx_uint_t header_params; -# endif /* nginx_version >= 1007008 */ - - ngx_array_t *uwsgi_lengths; - ngx_array_t *uwsgi_values; - - ngx_http_complex_value_t cache_key; - - ngx_str_t uwsgi_string; - - ngx_uint_t modifier1; - ngx_uint_t modifier2; - -# if (NGX_HTTP_SSL) -# if (nginx_version >= 1005008) - ngx_uint_t ssl; - ngx_uint_t ssl_protocols; - ngx_str_t ssl_ciphers; -# endif /* nginx_version >= 1005008 */ -# if (nginx_version >= 1007000) - ngx_uint_t ssl_verify_depth; - ngx_str_t ssl_trusted_certificate; - ngx_str_t ssl_crl; -# endif /* nginx_version >= 1007000 */ -# if ((nginx_version >= 1007008) && (nginx_version < 1021000)) - ngx_str_t ssl_certificate; - ngx_str_t ssl_certificate_key; - ngx_array_t *ssl_passwords; -# endif /* nginx_version >= 1007008 && nginx_version < 1021000 */ -# if (nginx_version >= 1019004) - ngx_array_t *ssl_conf_commands; -# endif /*nginx_version >= 1019004 */ -# endif -} ngx_http_uwsgi_loc_conf_t; - -char * -ngx_http_uwsgi_cache_purge_conf(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) { - ngx_http_compile_complex_value_t ccv; - ngx_http_cache_purge_loc_conf_t *cplcf; - ngx_http_core_loc_conf_t *clcf; - ngx_http_uwsgi_loc_conf_t *ulcf; - ngx_str_t *value; -# if (nginx_version >= 1007009) - ngx_http_complex_value_t cv; -# endif /* nginx_version >= 1007009 */ - - cplcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_cache_purge_module); - - /* check for duplicates / collisions */ - if (cplcf->uwsgi.enable != NGX_CONF_UNSET) { - return "is duplicate"; - } - - if (cf->args->nelts != 3) { - return ngx_http_cache_purge_conf(cf, &cplcf->uwsgi); - } - - if (cf->cmd_type & (NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF)) { - return "(separate location syntax) is not allowed here"; - } - - ulcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_uwsgi_module); - -# if (nginx_version >= 1007009) - if (ulcf->upstream.cache > 0) -# else - if (ulcf->upstream.cache != NGX_CONF_UNSET_PTR - && ulcf->upstream.cache != NULL) -# endif /* nginx_version >= 1007009 */ - { - return "is incompatible with \"uwsgi_cache\""; - } - - if (ulcf->upstream.upstream || ulcf->uwsgi_lengths) { - return "is incompatible with \"uwsgi_pass\""; - } - - if (ulcf->upstream.store > 0 -# if (nginx_version < 1007009) - || ulcf->upstream.store_lengths -# endif /* nginx_version >= 1007009 */ - ) { - return "is incompatible with \"uwsgi_store\""; - } - - value = cf->args->elts; - - /* set uwsgi_cache part */ -# if (nginx_version >= 1007009) - - ulcf->upstream.cache = 1; - - ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); - - ccv.cf = cf; - ccv.value = &value[1]; - ccv.complex_value = &cv; - - if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { - return NGX_CONF_ERROR; - } - - if (cv.lengths != NULL) { - - ulcf->upstream.cache_value = ngx_palloc(cf->pool, - sizeof(ngx_http_complex_value_t)); - if (ulcf->upstream.cache_value == NULL) { - return NGX_CONF_ERROR; - } - - *ulcf->upstream.cache_value = cv; - - } else { - - ulcf->upstream.cache_zone = ngx_shared_memory_add(cf, &value[1], 0, - &ngx_http_uwsgi_module); - if (ulcf->upstream.cache_zone == NULL) { - return NGX_CONF_ERROR; - } - } - -# else - - ulcf->upstream.cache = ngx_shared_memory_add(cf, &value[1], 0, - &ngx_http_uwsgi_module); - if (ulcf->upstream.cache == NULL) { - return NGX_CONF_ERROR; - } - -# endif /* nginx_version >= 1007009 */ - - /* set uwsgi_cache_key part */ - ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); - - ccv.cf = cf; - ccv.value = &value[2]; - ccv.complex_value = &ulcf->cache_key; - - if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { - return NGX_CONF_ERROR; - } - - /* set handler */ - clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module); - - cplcf->uwsgi.enable = 0; - cplcf->conf = &cplcf->uwsgi; - clcf->handler = ngx_http_uwsgi_cache_purge_handler; - - return NGX_CONF_OK; -} - - -ngx_int_t -ngx_http_uwsgi_cache_purge_handler(ngx_http_request_t *r) { - ngx_http_file_cache_t *cache; - ngx_http_uwsgi_loc_conf_t *ulcf; - ngx_http_cache_purge_loc_conf_t *cplcf; -# if (nginx_version >= 1007009) - ngx_http_uwsgi_main_conf_t *umcf; - ngx_int_t rc; -# endif /* nginx_version >= 1007009 */ - - if (ngx_http_upstream_create(r) != NGX_OK) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - ulcf = ngx_http_get_module_loc_conf(r, ngx_http_uwsgi_module); - - r->upstream->conf = &ulcf->upstream; - -# if (nginx_version >= 1007009) - - umcf = ngx_http_get_module_main_conf(r, ngx_http_uwsgi_module); - - r->upstream->caches = &umcf->caches; - - rc = ngx_http_cache_purge_cache_get(r, r->upstream, &cache); - if (rc != NGX_OK) { - return rc; - } - -# else - - cache = ulcf->upstream.cache->data; - -# endif /* nginx_version >= 1007009 */ - - if (ngx_http_cache_purge_init(r, cache, &ulcf->cache_key) != NGX_OK) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - /* Purge-all option */ - cplcf = ngx_http_get_module_loc_conf(r, ngx_http_cache_purge_module); - if (cplcf->conf->purge_all) { - ngx_http_cache_purge_all(r, cache); - } else { - if (ngx_http_cache_purge_is_partial(r)) { - ngx_log_debug(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "http file cache purge with partial enabled"); - - ngx_http_cache_purge_partial(r, cache); - } - } - -# if (nginx_version >= 8011) - r->main->count++; -# endif - - ngx_http_cache_purge_handler(r); - - return NGX_DONE; -} -# endif /* NGX_HTTP_UWSGI */ - - -char * -ngx_http_cache_purge_response_type_conf(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_http_cache_purge_loc_conf_t *cplcf; - ngx_str_t *value; - - cplcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_cache_purge_module); - - /* check for duplicates / collisions */ - if (cplcf->resptype != NGX_CONF_UNSET_UINT && cf->cmd_type == NGX_HTTP_LOC_CONF ) { - return "is duplicate"; - } - - /* sanity check */ - if (cf->args->nelts < 2) { - return "is invalid paramter, ex) cache_purge_response_type (html|json|xml|text)"; - } - - if (cf->args->nelts > 2 ) { - return "is required only 1 option, ex) cache_purge_response_type (html|json|xml|text)"; - } - - value = cf->args->elts; - - if (ngx_strcmp(value[1].data, "html") != 0 && ngx_strcmp(value[1].data, "json") != 0 - && ngx_strcmp(value[1].data, "xml") != 0 && ngx_strcmp(value[1].data, "text") != 0) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid parameter \"%V\", expected" - " \"(html|json|xml|text)\" keyword", &value[1]); - return NGX_CONF_ERROR; - } - - if (cf->cmd_type == NGX_HTTP_MODULE) { - return "(separate server or location syntax) is not allowed here"; - } - - if (ngx_strcmp(value[1].data, "html") == 0) { - cplcf->resptype = NGX_REPONSE_TYPE_HTML; - } else if (ngx_strcmp(value[1].data, "xml") == 0) { - cplcf->resptype = NGX_REPONSE_TYPE_XML; - } else if (ngx_strcmp(value[1].data, "json") == 0) { - cplcf->resptype = NGX_REPONSE_TYPE_JSON; - } else if (ngx_strcmp(value[1].data, "text") == 0) { - cplcf->resptype = NGX_REPONSE_TYPE_TEXT; - } - - return NGX_CONF_OK; -} - -static ngx_int_t -ngx_http_purge_file_cache_noop(ngx_tree_ctx_t *ctx, ngx_str_t *path) { - return NGX_OK; -} - -static ngx_int_t -ngx_http_purge_file_cache_delete_file(ngx_tree_ctx_t *ctx, ngx_str_t *path) { - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ctx->log, 0, - "http file cache delete: \"%s\"", path->data); - - if (ngx_delete_file(path->data) == NGX_FILE_ERROR) { - ngx_log_error(NGX_LOG_CRIT, ctx->log, ngx_errno, - ngx_delete_file_n " \"%s\" failed", path->data); - } - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_purge_file_cache_delete_partial_file(ngx_tree_ctx_t *ctx, ngx_str_t *path) { - u_char *key_partial; - u_char *key_in_file; - ngx_uint_t len; - ngx_flag_t remove_file = 0; - - key_partial = ctx->data; - len = ngx_strlen(key_partial); - - /* if key_partial is empty always match, because is a '*' */ - if (len == 0) { - ngx_log_debug(NGX_LOG_DEBUG_HTTP, ctx->log, 0, - "empty key_partial, forcing deletion"); - remove_file = 1; - } else { - ngx_file_t file; - - ngx_memzero(&file, sizeof(ngx_file_t)); - file.offset = file.sys_offset = 0; - file.fd = ngx_open_file(path->data, NGX_FILE_RDONLY, NGX_FILE_OPEN, - NGX_FILE_DEFAULT_ACCESS); - if (file.fd == -1) { - return NGX_OK; - } - file.log = ctx->log; - - /* I don't know if it's a good idea to use the ngx_cycle pool for this, - but the request is not available here */ - key_in_file = ngx_pcalloc(ngx_cycle->pool, sizeof(u_char) * (len + 1)); - - /* KEY: /proxy/passwd */ - /* since we don't need the "KEY: " ignore 5 + 1 extra u_char from last - intro */ - /* Optimization: we don't need to read the full key only the n chars - included in key_partial */ - ngx_read_file(&file, key_in_file, sizeof(u_char) * len, - sizeof(ngx_http_file_cache_header_t) + sizeof(u_char) * 6); - ngx_close_file(file.fd); - - ngx_log_debug2(NGX_LOG_DEBUG_HTTP, ctx->log, 0, - "http cache file \"%s\" key read: \"%s\"", path->data, key_in_file); - - if (ngx_strncasecmp(key_in_file, key_partial, len) == 0) { - ngx_log_debug(NGX_LOG_DEBUG_HTTP, ctx->log, 0, - "match found, deleting file \"%s\"", path->data); - remove_file = 1; - } - } - - if (remove_file && ngx_delete_file(path->data) == NGX_FILE_ERROR) { - ngx_log_error(NGX_LOG_CRIT, ctx->log, ngx_errno, - ngx_delete_file_n " \"%s\" failed", path->data); - } - - return NGX_OK; -} - -ngx_int_t -ngx_http_cache_purge_access_handler(ngx_http_request_t *r) { - ngx_http_cache_purge_loc_conf_t *cplcf; - - cplcf = ngx_http_get_module_loc_conf(r, ngx_http_cache_purge_module); - - if (r->method_name.len != cplcf->conf->method.len - || (ngx_strncmp(r->method_name.data, cplcf->conf->method.data, - r->method_name.len))) { - return cplcf->original_handler(r); - } - - if ((cplcf->conf->access || cplcf->conf->access6) - && ngx_http_cache_purge_access(cplcf->conf->access, - cplcf->conf->access6, - r->connection->sockaddr) != NGX_OK) { - return NGX_HTTP_FORBIDDEN; - } - - if (cplcf->handler == NULL) { - return NGX_HTTP_NOT_FOUND; - } - - return cplcf->handler(r); -} - -ngx_int_t -ngx_http_cache_purge_access(ngx_array_t *access, ngx_array_t *access6, - struct sockaddr *s) { - in_addr_t inaddr; - ngx_in_cidr_t *a; - ngx_uint_t i; -# if (NGX_HAVE_INET6) - struct in6_addr *inaddr6; - ngx_in6_cidr_t *a6; - u_char *p; - ngx_uint_t n; -# endif /* NGX_HAVE_INET6 */ - - switch (s->sa_family) { - case AF_INET: - if (access == NULL) { - return NGX_DECLINED; - } - - inaddr = ((struct sockaddr_in *) s)->sin_addr.s_addr; - -# if (NGX_HAVE_INET6) -ipv4: -# endif /* NGX_HAVE_INET6 */ - - a = access->elts; - for (i = 0; i < access->nelts; i++) { - if ((inaddr & a[i].mask) == a[i].addr) { - return NGX_OK; - } - } - - return NGX_DECLINED; - -# if (NGX_HAVE_INET6) - case AF_INET6: - inaddr6 = &((struct sockaddr_in6 *) s)->sin6_addr; - p = inaddr6->s6_addr; - - if (access && IN6_IS_ADDR_V4MAPPED(inaddr6)) { - inaddr = p[12] << 24; - inaddr += p[13] << 16; - inaddr += p[14] << 8; - inaddr += p[15]; - inaddr = htonl(inaddr); - - goto ipv4; - } - - if (access6 == NULL) { - return NGX_DECLINED; - } - - a6 = access6->elts; - for (i = 0; i < access6->nelts; i++) { - for (n = 0; n < 16; n++) { - if ((p[n] & a6[i].mask.s6_addr[n]) != a6[i].addr.s6_addr[n]) { - goto next; - } - } - - return NGX_OK; - -next: - continue; - } - - return NGX_DECLINED; -# endif /* NGX_HAVE_INET6 */ - } - - return NGX_DECLINED; -} - -ngx_int_t -ngx_http_cache_purge_send_response(ngx_http_request_t *r) { - ngx_chain_t out; - ngx_buf_t *b; - ngx_str_t *key; - ngx_int_t rc; - size_t len; - - size_t body_len; - size_t resp_tmpl_len; - u_char *buf; - u_char *buf_keydata; - u_char *p; - const char *resp_ct; - size_t resp_ct_size; - const char *resp_body; - size_t resp_body_size; - - ngx_http_cache_purge_loc_conf_t *cplcf; - cplcf = ngx_http_get_module_loc_conf(r, ngx_http_cache_purge_module); - - key = r->cache->keys.elts; - - buf_keydata = ngx_pcalloc(r->pool, key[0].len+1); - if (buf_keydata == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - p = ngx_cpymem(buf_keydata, key[0].data, key[0].len); - if (p == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - switch(cplcf->resptype) { - - case NGX_REPONSE_TYPE_JSON: - resp_ct = ngx_http_cache_purge_content_type_json; - resp_ct_size = ngx_http_cache_purge_content_type_json_size; - resp_body = ngx_http_cache_purge_body_templ_json; - resp_body_size = ngx_http_cache_purge_body_templ_json_size; - break; - - case NGX_REPONSE_TYPE_XML: - resp_ct = ngx_http_cache_purge_content_type_xml; - resp_ct_size = ngx_http_cache_purge_content_type_xml_size; - resp_body = ngx_http_cache_purge_body_templ_xml; - resp_body_size = ngx_http_cache_purge_body_templ_xml_size; - break; - - case NGX_REPONSE_TYPE_TEXT: - resp_ct = ngx_http_cache_purge_content_type_text; - resp_ct_size = ngx_http_cache_purge_content_type_text_size; - resp_body = ngx_http_cache_purge_body_templ_text; - resp_body_size = ngx_http_cache_purge_body_templ_text_size; - break; - - default: - case NGX_REPONSE_TYPE_HTML: - resp_ct = ngx_http_cache_purge_content_type_html; - resp_ct_size = ngx_http_cache_purge_content_type_html_size; - resp_body = ngx_http_cache_purge_body_templ_html; - resp_body_size = ngx_http_cache_purge_body_templ_html_size; - break; - } - - body_len = resp_body_size - 2 - 1; - r->headers_out.content_type.len = resp_ct_size - 1; - r->headers_out.content_type.data = (u_char *) resp_ct; - - resp_tmpl_len = body_len + key[0].len ; - - buf = ngx_pcalloc(r->pool, resp_tmpl_len); - if (buf == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - p = ngx_snprintf(buf, resp_tmpl_len, resp_body , buf_keydata); - if (p == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - len = body_len + key[0].len; - - r->headers_out.status = NGX_HTTP_OK; - r->headers_out.content_length_n = len; - - if (r->method == NGX_HTTP_HEAD) { - rc = ngx_http_send_header(r); - if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) { - return rc; - } - } - - b = ngx_create_temp_buf(r->pool, len); - if (b == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - - out.buf = b; - out.next = NULL; - - b->last = ngx_cpymem(b->last, buf, resp_tmpl_len); - b->last_buf = 1; - - rc = ngx_http_send_header(r); - if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) { - return rc; - } - - return ngx_http_output_filter(r, &out); -} - -# if (nginx_version >= 1007009) - -/* - * Based on: ngx_http_upstream.c/ngx_http_upstream_cache_get - * Copyright (C) Igor Sysoev - * Copyright (C) Nginx, Inc. - */ -ngx_int_t -ngx_http_cache_purge_cache_get(ngx_http_request_t *r, ngx_http_upstream_t *u, - ngx_http_file_cache_t **cache) { - ngx_str_t *name, val; - ngx_uint_t i; - ngx_http_file_cache_t **caches; - - if (u->conf->cache_zone) { - *cache = u->conf->cache_zone->data; - return NGX_OK; - } - - if (ngx_http_complex_value(r, u->conf->cache_value, &val) != NGX_OK) { - return NGX_ERROR; - } - - if (val.len == 0 - || (val.len == 3 && ngx_strncmp(val.data, "off", 3) == 0)) { - return NGX_DECLINED; - } - - caches = u->caches->elts; - - for (i = 0; i < u->caches->nelts; i++) { - name = &caches[i]->shm_zone->shm.name; - - if (name->len == val.len - && ngx_strncmp(name->data, val.data, val.len) == 0) { - *cache = caches[i]; - return NGX_OK; - } - } - - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "cache \"%V\" not found", &val); - - return NGX_ERROR; -} - -# endif /* nginx_version >= 1007009 */ - -ngx_int_t -ngx_http_cache_purge_init(ngx_http_request_t *r, ngx_http_file_cache_t *cache, - ngx_http_complex_value_t *cache_key) { - ngx_http_cache_t *c; - ngx_str_t *key; - ngx_int_t rc; - - rc = ngx_http_discard_request_body(r); - if (rc != NGX_OK) { - return NGX_ERROR; - } - - c = ngx_pcalloc(r->pool, sizeof(ngx_http_cache_t)); - if (c == NULL) { - return NGX_ERROR; - } - - rc = ngx_array_init(&c->keys, r->pool, 1, sizeof(ngx_str_t)); - if (rc != NGX_OK) { - return NGX_ERROR; - } - - key = ngx_array_push(&c->keys); - if (key == NULL) { - return NGX_ERROR; - } - - rc = ngx_http_complex_value(r, cache_key, key); - if (rc != NGX_OK) { - return NGX_ERROR; - } - - r->cache = c; - c->body_start = ngx_pagesize; - c->file_cache = cache; - c->file.log = r->connection->log; - - ngx_http_file_cache_create_key(r); - - return NGX_OK; -} - -void -ngx_http_cache_purge_handler(ngx_http_request_t *r) { - ngx_http_cache_purge_loc_conf_t *cplcf; - ngx_int_t rc; - -# if (NGX_HAVE_FILE_AIO) - if (r->aio) { - return; - } -# endif - - cplcf = ngx_http_get_module_loc_conf(r, ngx_http_cache_purge_module); - rc = NGX_OK; - if (!cplcf->conf->purge_all && !ngx_http_cache_purge_is_partial(r)) { - rc = ngx_http_file_cache_purge(r); - - ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "http file cache purge: %i, \"%s\"", - rc, r->cache->file.name.data); - } - - switch (rc) { - case NGX_OK: - r->write_event_handler = ngx_http_request_empty_handler; - ngx_http_finalize_request(r, ngx_http_cache_purge_send_response(r)); - return; - case NGX_DECLINED: - ngx_http_finalize_request(r, NGX_HTTP_PRECONDITION_FAILED); - return; -# if (NGX_HAVE_FILE_AIO) - case NGX_AGAIN: - r->write_event_handler = ngx_http_cache_purge_handler; - return; -# endif - default: - ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); - } -} - -ngx_int_t -ngx_http_file_cache_purge(ngx_http_request_t *r) { - ngx_http_file_cache_t *cache; - ngx_http_cache_t *c; - - switch (ngx_http_file_cache_open(r)) { - case NGX_OK: - case NGX_HTTP_CACHE_STALE: -# if (nginx_version >= 8001) \ - || ((nginx_version < 8000) && (nginx_version >= 7060)) - case NGX_HTTP_CACHE_UPDATING: -# endif - break; - case NGX_DECLINED: - return NGX_DECLINED; -# if (NGX_HAVE_FILE_AIO) - case NGX_AGAIN: - return NGX_AGAIN; -# endif - default: - return NGX_ERROR; - } - - c = r->cache; - cache = c->file_cache; - - /* - * delete file from disk but *keep* in-memory node, - * because other requests might still point to it. - */ - - ngx_shmtx_lock(&cache->shpool->mutex); - - if (!c->node->exists) { - /* race between concurrent purges, backoff */ - ngx_shmtx_unlock(&cache->shpool->mutex); - return NGX_DECLINED; - } - -# if (nginx_version >= 1000001) - cache->sh->size -= c->node->fs_size; - c->node->fs_size = 0; -# else - cache->sh->size -= (c->node->length + cache->bsize - 1) / cache->bsize; - c->node->length = 0; -# endif - - c->node->exists = 0; -# if (nginx_version >= 8001) \ - || ((nginx_version < 8000) && (nginx_version >= 7060)) - c->node->updating = 0; -# endif - - ngx_shmtx_unlock(&cache->shpool->mutex); - - if (ngx_delete_file(c->file.name.data) == NGX_FILE_ERROR) { - /* entry in error log is enough, don't notice client */ - ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno, - ngx_delete_file_n " \"%s\" failed", c->file.name.data); - } - - /* file deleted from cache */ - return NGX_OK; -} - - -void -ngx_http_cache_purge_all(ngx_http_request_t *r, ngx_http_file_cache_t *cache) { - ngx_log_debug(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "purge_all http in %s", - cache->path->name.data); - - /* Walk the tree and remove all the files */ - ngx_tree_ctx_t tree; - tree.init_handler = NULL; - tree.file_handler = ngx_http_purge_file_cache_delete_file; - tree.pre_tree_handler = ngx_http_purge_file_cache_noop; - tree.post_tree_handler = ngx_http_purge_file_cache_noop; - tree.spec_handler = ngx_http_purge_file_cache_noop; - tree.data = NULL; - tree.alloc = 0; - tree.log = ngx_cycle->log; - - ngx_walk_tree(&tree, &cache->path->name); -} - -void -ngx_http_cache_purge_partial(ngx_http_request_t *r, ngx_http_file_cache_t *cache) { - ngx_log_debug(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "purge_partial http in %s", - cache->path->name.data); - - u_char *key_partial; - ngx_str_t *key; - ngx_http_cache_t *c; - ngx_uint_t len; - - c = r->cache; - key = c->keys.elts; - len = key[0].len; - - /* Only check the first key */ - key_partial = ngx_pcalloc(r->pool, sizeof(u_char) * len); - ngx_memcpy(key_partial, key[0].data, sizeof(u_char) * (len - 1)); - - /* Walk the tree and remove all the files matching key_partial */ - ngx_tree_ctx_t tree; - tree.init_handler = NULL; - tree.file_handler = ngx_http_purge_file_cache_delete_partial_file; - tree.pre_tree_handler = ngx_http_purge_file_cache_noop; - tree.post_tree_handler = ngx_http_purge_file_cache_noop; - tree.spec_handler = ngx_http_purge_file_cache_noop; - tree.data = key_partial; - tree.alloc = 0; - tree.log = ngx_cycle->log; - - ngx_walk_tree(&tree, &cache->path->name); -} - -ngx_int_t -ngx_http_cache_purge_is_partial(ngx_http_request_t *r) { - ngx_str_t *key; - ngx_http_cache_t *c; - - c = r->cache; - key = c->keys.elts; - - /* Only check the first key */ - return c->keys.nelts > 0 // number of array elements - && key[0].len > 0 // char length of the key - && key[0].data[key[0].len - 1] == '*'; // is the last char an asterix char? -} - -char * -ngx_http_cache_purge_conf(ngx_conf_t *cf, ngx_http_cache_purge_conf_t *cpcf) { - ngx_cidr_t cidr; - ngx_in_cidr_t *access; -# if (NGX_HAVE_INET6) - ngx_in6_cidr_t *access6; -# endif /* NGX_HAVE_INET6 */ - ngx_str_t *value; - ngx_int_t rc; - ngx_uint_t i; - ngx_uint_t from_position; - - from_position = 2; - - /* xxx_cache_purge on|off| [purge_all] [from all| [.. ]] */ - value = cf->args->elts; - - if (ngx_strcmp(value[1].data, "off") == 0) { - cpcf->enable = 0; - return NGX_CONF_OK; - - } else if (ngx_strcmp(value[1].data, "on") == 0) { - ngx_str_set(&cpcf->method, "PURGE"); - - } else { - cpcf->method = value[1]; - } - - if (cf->args->nelts < 4) { - cpcf->enable = 1; - return NGX_CONF_OK; - } - - /* We will purge all the keys */ - if (ngx_strcmp(value[from_position].data, "purge_all") == 0) { - cpcf->purge_all = 1; - from_position++; - } - - - /* sanity check */ - if (ngx_strcmp(value[from_position].data, "from") != 0) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid parameter \"%V\", expected" - " \"from\" keyword", &value[from_position]); - return NGX_CONF_ERROR; - } - - if (ngx_strcmp(value[from_position + 1].data, "all") == 0) { - cpcf->enable = 1; - return NGX_CONF_OK; - } - - for (i = (from_position + 1); i < cf->args->nelts; i++) { - rc = ngx_ptocidr(&value[i], &cidr); - - if (rc == NGX_ERROR) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid parameter \"%V\"", &value[i]); - return NGX_CONF_ERROR; - } - - if (rc == NGX_DONE) { - ngx_conf_log_error(NGX_LOG_WARN, cf, 0, - "low address bits of %V are meaningless", - &value[i]); - } - - switch (cidr.family) { - case AF_INET: - if (cpcf->access == NULL) { - cpcf->access = ngx_array_create(cf->pool, cf->args->nelts - (from_position + 1), - sizeof(ngx_in_cidr_t)); - if (cpcf->access == NULL) { - return NGX_CONF_ERROR; - } - } - - access = ngx_array_push(cpcf->access); - if (access == NULL) { - return NGX_CONF_ERROR; - } - - access->mask = cidr.u.in.mask; - access->addr = cidr.u.in.addr; - - break; - -# if (NGX_HAVE_INET6) - case AF_INET6: - if (cpcf->access6 == NULL) { - cpcf->access6 = ngx_array_create(cf->pool, cf->args->nelts - (from_position + 1), - sizeof(ngx_in6_cidr_t)); - if (cpcf->access6 == NULL) { - return NGX_CONF_ERROR; - } - } - - access6 = ngx_array_push(cpcf->access6); - if (access6 == NULL) { - return NGX_CONF_ERROR; - } - - access6->mask = cidr.u.in6.mask; - access6->addr = cidr.u.in6.addr; - - break; -# endif /* NGX_HAVE_INET6 */ - } - } - - cpcf->enable = 1; - - return NGX_CONF_OK; -} - -void -ngx_http_cache_purge_merge_conf(ngx_http_cache_purge_conf_t *conf, - ngx_http_cache_purge_conf_t *prev) { - if (conf->enable == NGX_CONF_UNSET) { - if (prev->enable == 1) { - conf->enable = prev->enable; - conf->method = prev->method; - conf->purge_all = prev->purge_all; - conf->access = prev->access; - conf->access6 = prev->access6; - } else { - conf->enable = 0; - } - } -} - -void * -ngx_http_cache_purge_create_loc_conf(ngx_conf_t *cf) { - ngx_http_cache_purge_loc_conf_t *conf; - - conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_cache_purge_loc_conf_t)); - if (conf == NULL) { - return NULL; - } - - /* - * set by ngx_pcalloc(): - * - * conf->*.method = { 0, NULL } - * conf->*.access = NULL - * conf->*.access6 = NULL - * conf->handler = NULL - * conf->original_handler = NULL - */ - -# if (NGX_HTTP_FASTCGI) - conf->fastcgi.enable = NGX_CONF_UNSET; -# endif /* NGX_HTTP_FASTCGI */ -# if (NGX_HTTP_PROXY) - conf->proxy.enable = NGX_CONF_UNSET; -# endif /* NGX_HTTP_PROXY */ -# if (NGX_HTTP_SCGI) - conf->scgi.enable = NGX_CONF_UNSET; -# endif /* NGX_HTTP_SCGI */ -# if (NGX_HTTP_UWSGI) - conf->uwsgi.enable = NGX_CONF_UNSET; -# endif /* NGX_HTTP_UWSGI */ - - conf->resptype = NGX_CONF_UNSET_UINT; - - conf->conf = NGX_CONF_UNSET_PTR; - - return conf; -} - -char * -ngx_http_cache_purge_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) { - ngx_http_cache_purge_loc_conf_t *prev = parent; - ngx_http_cache_purge_loc_conf_t *conf = child; - ngx_http_core_loc_conf_t *clcf; -# if (NGX_HTTP_FASTCGI) - ngx_http_fastcgi_loc_conf_t *flcf; -# endif /* NGX_HTTP_FASTCGI */ -# if (NGX_HTTP_PROXY) - ngx_http_proxy_loc_conf_t *plcf; -# endif /* NGX_HTTP_PROXY */ -# if (NGX_HTTP_SCGI) - ngx_http_scgi_loc_conf_t *slcf; -# endif /* NGX_HTTP_SCGI */ -# if (NGX_HTTP_UWSGI) - ngx_http_uwsgi_loc_conf_t *ulcf; -# endif /* NGX_HTTP_UWSGI */ - - clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module); - - ngx_conf_merge_uint_value(conf->resptype, prev->resptype, NGX_REPONSE_TYPE_HTML); - -# if (NGX_HTTP_FASTCGI) - ngx_http_cache_purge_merge_conf(&conf->fastcgi, &prev->fastcgi); - - if (conf->fastcgi.enable && clcf->handler != NULL) { - flcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_fastcgi_module); - - if (flcf->upstream.upstream || flcf->fastcgi_lengths) { - conf->conf = &conf->fastcgi; - conf->handler = flcf->upstream.cache - ? ngx_http_fastcgi_cache_purge_handler : NULL; - conf->original_handler = clcf->handler; - - clcf->handler = ngx_http_cache_purge_access_handler; - - return NGX_CONF_OK; - } - } -# endif /* NGX_HTTP_FASTCGI */ - -# if (NGX_HTTP_PROXY) - ngx_http_cache_purge_merge_conf(&conf->proxy, &prev->proxy); - - if (conf->proxy.enable && clcf->handler != NULL) { - plcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_proxy_module); - - if (plcf->upstream.upstream || plcf->proxy_lengths) { - conf->conf = &conf->proxy; - conf->handler = plcf->upstream.cache - ? ngx_http_proxy_cache_purge_handler : NULL; - conf->original_handler = clcf->handler; - - clcf->handler = ngx_http_cache_purge_access_handler; - - return NGX_CONF_OK; - } - } -# endif /* NGX_HTTP_PROXY */ - -# if (NGX_HTTP_SCGI) - ngx_http_cache_purge_merge_conf(&conf->scgi, &prev->scgi); - - if (conf->scgi.enable && clcf->handler != NULL) { - slcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_scgi_module); - - if (slcf->upstream.upstream || slcf->scgi_lengths) { - conf->conf = &conf->scgi; - conf->handler = slcf->upstream.cache - ? ngx_http_scgi_cache_purge_handler : NULL; - conf->original_handler = clcf->handler; - clcf->handler = ngx_http_cache_purge_access_handler; - - return NGX_CONF_OK; - } - } -# endif /* NGX_HTTP_SCGI */ - -# if (NGX_HTTP_UWSGI) - ngx_http_cache_purge_merge_conf(&conf->uwsgi, &prev->uwsgi); - - if (conf->uwsgi.enable && clcf->handler != NULL) { - ulcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_uwsgi_module); - - if (ulcf->upstream.upstream || ulcf->uwsgi_lengths) { - conf->conf = &conf->uwsgi; - conf->handler = ulcf->upstream.cache - ? ngx_http_uwsgi_cache_purge_handler : NULL; - conf->original_handler = clcf->handler; - - clcf->handler = ngx_http_cache_purge_access_handler; - - return NGX_CONF_OK; - } - } -# endif /* NGX_HTTP_UWSGI */ - - ngx_conf_merge_ptr_value(conf->conf, prev->conf, NULL); - - if (conf->handler == NULL) { - conf->handler = prev->handler; - } - - if (conf->original_handler == NULL) { - conf->original_handler = prev->original_handler; - } - - return NGX_CONF_OK; -} - -#else /* !NGX_HTTP_CACHE */ - -static ngx_http_module_t ngx_http_cache_purge_module_ctx = { - NULL, /* preconfiguration */ - NULL, /* postconfiguration */ - - NULL, /* create main configuration */ - NULL, /* init main configuration */ - - NULL, /* create server configuration */ - NULL, /* merge server configuration */ - - NULL, /* create location configuration */ - NULL, /* merge location configuration */ -}; - -ngx_module_t ngx_http_cache_purge_module = { - NGX_MODULE_V1, - &ngx_http_cache_purge_module_ctx, /* module context */ - NULL, /* module directives */ - NGX_HTTP_MODULE, /* module type */ - NULL, /* init master */ - NULL, /* init module */ - NULL, /* init process */ - NULL, /* init thread */ - NULL, /* exit thread */ - NULL, /* exit process */ - NULL, /* exit master */ - NGX_MODULE_V1_PADDING -}; - -#endif /* NGX_HTTP_CACHE */ diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy1.t b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy1.t deleted file mode 100644 index fefe9b8..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy1.t +++ /dev/null @@ -1,136 +0,0 @@ -# vi:filetype=perl - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(1); - -plan tests => repeat_each() * (blocks() * 4 + 3 * 1); - -our $http_config = <<'_EOC_'; - proxy_cache_path /tmp/ngx_cache_purge_cache keys_zone=test_cache:10m; - proxy_temp_path /tmp/ngx_cache_purge_temp 1 2; -_EOC_ - -our $config = <<'_EOC_'; - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - proxy_cache test_cache; - proxy_cache_key $uri$is_args$args; - proxy_cache_valid 3m; - add_header X-Cache-Status $upstream_cache_status; - } - - location ~ /purge(/.*) { - proxy_cache_purge test_cache $1$is_args$args; - } - - location = /etc/passwd { - root /; - } -_EOC_ - -worker_connections(128); -no_shuffle(); -run_tests(); - -no_diff(); - -__DATA__ - -=== TEST 1: prepare ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - - -=== TEST 2: get from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 5: < 0.8.3 or < 0.7.62 - - - -=== TEST 3: purge from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /purge/proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/html ---- response_body_like: Successful purge ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - - -=== TEST 4: purge from empty cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /purge/proxy/passwd ---- error_code: 412 ---- response_headers -Content-Type: text/html ---- response_body_like: 412 Precondition Failed ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - - -=== TEST 5: get from source ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: MISS ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 5: < 0.8.3 or < 0.7.62 - - - -=== TEST 6: get from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 5: < 0.8.3 or < 0.7.62 diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy1_vars.t b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy1_vars.t deleted file mode 100644 index b9da04b..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy1_vars.t +++ /dev/null @@ -1,138 +0,0 @@ -# vi:filetype=perl - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(1); - -plan tests => repeat_each() * (blocks() * 4 + 3 * 1); - -our $http_config = <<'_EOC_'; - proxy_cache_path /tmp/ngx_cache_purge_cache keys_zone=test_cache:10m; - proxy_temp_path /tmp/ngx_cache_purge_temp 1 2; -_EOC_ - -our $config = <<'_EOC_'; - set $cache test_cache; - - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - proxy_cache $cache; - proxy_cache_key $uri$is_args$args; - proxy_cache_valid 3m; - add_header X-Cache-Status $upstream_cache_status; - } - - location ~ /purge(/.*) { - proxy_cache_purge $cache $1$is_args$args; - } - - location = /etc/passwd { - root /; - } -_EOC_ - -worker_connections(128); -no_shuffle(); -run_tests(); - -no_diff(); - -__DATA__ - -=== TEST 1: prepare ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 4: < 1.7.9 - - - -=== TEST 2: get from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 5: < 1.7.9 - - - -=== TEST 3: purge from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /purge/proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/html ---- response_body_like: Successful purge ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 4: < 1.7.9 - - - -=== TEST 4: purge from empty cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /purge/proxy/passwd ---- error_code: 412 ---- response_headers -Content-Type: text/html ---- response_body_like: 412 Precondition Failed ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 4: < 1.7.9 - - - -=== TEST 5: get from source ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: MISS ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 5: < 1.7.9 - - - -=== TEST 6: get from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 5: < 1.7.9 diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy2.t b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy2.t deleted file mode 100644 index 4c7e19f..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy2.t +++ /dev/null @@ -1,349 +0,0 @@ -# vi:filetype=perl - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(1); - -plan tests => repeat_each() * (blocks() * 4 + 6 * 1); - -our $http_config = <<'_EOC_'; - proxy_cache_path /tmp/ngx_cache_purge_cache keys_zone=test_cache:10m; - proxy_temp_path /tmp/ngx_cache_purge_temp 1 2; -_EOC_ - -our $config = <<'_EOC_'; - proxy_cache_purge on; - - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - proxy_cache test_cache; - proxy_cache_key $uri$is_args$args; - proxy_cache_valid 3m; - add_header X-Cache-Status $upstream_cache_status; - - if ($uri) { } - } - - location = /etc/passwd { - root /; - } -_EOC_ - -our $config_allowed = <<'_EOC_'; - proxy_cache_purge PURGE from 1.0.0.0/8 127.0.0.0/8 3.0.0.0/8; - - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - proxy_cache test_cache; - proxy_cache_key $uri$is_args$args; - proxy_cache_valid 3m; - add_header X-Cache-Status $upstream_cache_status; - } - - location = /etc/passwd { - root /; - } -_EOC_ - -our $config_forbidden = <<'_EOC_'; - proxy_cache_purge PURGE from 1.0.0.0/8; - - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - proxy_cache test_cache; - proxy_cache_key $uri$is_args$args; - proxy_cache_valid 3m; - add_header X-Cache-Status $upstream_cache_status; - } - - location = /etc/passwd { - root /; - } -_EOC_ - -worker_connections(128); -no_shuffle(); -run_tests(); - -no_diff(); - -__DATA__ - -=== TEST 1: prepare ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - - -=== TEST 2: get from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 5: < 0.8.3 or < 0.7.62 - - - -=== TEST 3: purge from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/html ---- response_body_like: Successful purge ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - - -=== TEST 4: purge from empty cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /proxy/passwd ---- error_code: 412 ---- response_headers -Content-Type: text/html ---- response_body_like: 412 Precondition Failed ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - - -=== TEST 5: get from source ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: MISS ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 5: < 0.8.3 or < 0.7.62 - - - -=== TEST 6: get from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 5: < 0.8.3 or < 0.7.62 - - - -=== TEST 7: purge from cache (PURGE allowed) ---- http_config eval: $::http_config ---- config eval: $::config_allowed ---- request -PURGE /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/html ---- response_body_like: Successful purge ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - - -=== TEST 8: purge from empty cache (PURGE allowed) ---- http_config eval: $::http_config ---- config eval: $::config_allowed ---- request -PURGE /proxy/passwd ---- error_code: 412 ---- response_headers -Content-Type: text/html ---- response_body_like: 412 Precondition Failed ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - - -=== TEST 9: get from source (PURGE allowed) ---- http_config eval: $::http_config ---- config eval: $::config_allowed ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: MISS ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 5: < 0.8.3 or < 0.7.62 - - - -=== TEST 10: get from cache (PURGE allowed) ---- http_config eval: $::http_config ---- config eval: $::config_allowed ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 5: < 0.8.3 or < 0.7.62 - - - -=== TEST 11: purge from cache (PURGE not allowed) ---- http_config eval: $::http_config ---- config eval: $::config_forbidden ---- request -PURGE /proxy/passwd ---- error_code: 403 ---- response_headers -Content-Type: text/html ---- response_body_like: 403 Forbidden ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - - -=== TEST 12: get from cache (PURGE not allowed) ---- http_config eval: $::http_config ---- config eval: $::config_forbidden ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 5: < 0.8.3 or < 0.7.62 - - - -=== TEST 13: no cache (PURGE allowed) ---- http_config eval: $::http_config ---- config - proxy_cache_purge PURGE from 1.0.0.0/8 127.0.0.0/8 3.0.0.0/8; - - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - } - - location = /etc/passwd { - root /; - } ---- request -PURGE /proxy/passwd ---- error_code: 404 ---- response_headers -Content-Type: text/html ---- response_body_like: 404 Not Found ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - - -=== TEST 14: no cache (PURGE not allowed) ---- http_config eval: $::http_config ---- config - proxy_cache_purge PURGE from 1.0.0.0/8; - - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - } - - location = /etc/passwd { - root /; - } ---- request -PURGE /proxy/passwd ---- error_code: 403 ---- response_headers -Content-Type: text/html ---- response_body_like: 403 Forbidden ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - - -=== TEST 15: multiple cache purge directives ---- http_config eval: $::http_config ---- config - fastcgi_cache_purge on; - proxy_cache_purge on; - - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - proxy_cache test_cache; - proxy_cache_key $uri$is_args$args; - proxy_cache_valid 3m; - add_header X-Cache-Status $upstream_cache_status; - - if ($uri) { } - } - - location = /etc/passwd { - root /; - } ---- request -PURGE /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/html ---- response_body_like: Successful purge ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy2_vars.t b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy2_vars.t deleted file mode 100644 index 08e3e1e..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy2_vars.t +++ /dev/null @@ -1,353 +0,0 @@ -# vi:filetype=perl - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(1); - -plan tests => repeat_each() * (blocks() * 4 + 6 * 1); - -our $http_config = <<'_EOC_'; - proxy_cache_path /tmp/ngx_cache_purge_cache keys_zone=test_cache:10m; - proxy_temp_path /tmp/ngx_cache_purge_temp 1 2; -_EOC_ - -our $config = <<'_EOC_'; - proxy_cache_purge on; - set $cache test_cache; - - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - proxy_cache $cache; - proxy_cache_key $uri$is_args$args; - proxy_cache_valid 3m; - add_header X-Cache-Status $upstream_cache_status; - - if ($uri) { } - } - - location = /etc/passwd { - root /; - } -_EOC_ - -our $config_allowed = <<'_EOC_'; - proxy_cache_purge PURGE from 1.0.0.0/8 127.0.0.0/8 3.0.0.0/8; - set $cache test_cache; - - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - proxy_cache $cache; - proxy_cache_key $uri$is_args$args; - proxy_cache_valid 3m; - add_header X-Cache-Status $upstream_cache_status; - } - - location = /etc/passwd { - root /; - } -_EOC_ - -our $config_forbidden = <<'_EOC_'; - proxy_cache_purge PURGE from 1.0.0.0/8; - set $cache test_cache; - - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - proxy_cache $cache; - proxy_cache_key $uri$is_args$args; - proxy_cache_valid 3m; - add_header X-Cache-Status $upstream_cache_status; - } - - location = /etc/passwd { - root /; - } -_EOC_ - -worker_connections(128); -no_shuffle(); -run_tests(); - -no_diff(); - -__DATA__ - -=== TEST 1: prepare ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 4: < 1.7.9 - - - -=== TEST 2: get from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 5: < 1.7.9 - - - -=== TEST 3: purge from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/html ---- response_body_like: Successful purge ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 4: < 1.7.9 - - - -=== TEST 4: purge from empty cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /proxy/passwd ---- error_code: 412 ---- response_headers -Content-Type: text/html ---- response_body_like: 412 Precondition Failed ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 4: < 1.7.9 - - - -=== TEST 5: get from source ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: MISS ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 5: < 1.7.9 - - - -=== TEST 6: get from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 5: < 1.7.9 - - - -=== TEST 7: purge from cache (PURGE allowed) ---- http_config eval: $::http_config ---- config eval: $::config_allowed ---- request -PURGE /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/html ---- response_body_like: Successful purge ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 4: < 1.7.9 - - - -=== TEST 8: purge from empty cache (PURGE allowed) ---- http_config eval: $::http_config ---- config eval: $::config_allowed ---- request -PURGE /proxy/passwd ---- error_code: 412 ---- response_headers -Content-Type: text/html ---- response_body_like: 412 Precondition Failed ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 4: < 1.7.9 - - - -=== TEST 9: get from source (PURGE allowed) ---- http_config eval: $::http_config ---- config eval: $::config_allowed ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: MISS ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 5: < 1.7.9 - - - -=== TEST 10: get from cache (PURGE allowed) ---- http_config eval: $::http_config ---- config eval: $::config_allowed ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 5: < 1.7.9 - - - -=== TEST 11: purge from cache (PURGE not allowed) ---- http_config eval: $::http_config ---- config eval: $::config_forbidden ---- request -PURGE /proxy/passwd ---- error_code: 403 ---- response_headers -Content-Type: text/html ---- response_body_like: 403 Forbidden ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 4: < 1.7.9 - - - -=== TEST 12: get from cache (PURGE not allowed) ---- http_config eval: $::http_config ---- config eval: $::config_forbidden ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 5: < 1.7.9 - - - -=== TEST 13: no cache (PURGE allowed) ---- http_config eval: $::http_config ---- config - proxy_cache_purge PURGE from 1.0.0.0/8 127.0.0.0/8 3.0.0.0/8; - - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - } - - location = /etc/passwd { - root /; - } ---- request -PURGE /proxy/passwd ---- error_code: 404 ---- response_headers -Content-Type: text/html ---- response_body_like: 404 Not Found ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 4: < 1.7.9 - - - -=== TEST 14: no cache (PURGE not allowed) ---- http_config eval: $::http_config ---- config - proxy_cache_purge PURGE from 1.0.0.0/8; - - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - } - - location = /etc/passwd { - root /; - } ---- request -PURGE /proxy/passwd ---- error_code: 403 ---- response_headers -Content-Type: text/html ---- response_body_like: 403 Forbidden ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 4: < 1.7.9 - - - -=== TEST 15: multiple cache purge directives ---- http_config eval: $::http_config ---- config - fastcgi_cache_purge on; - proxy_cache_purge on; - set $cache test_cache; - - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - proxy_cache $cache; - proxy_cache_key $uri$is_args$args; - proxy_cache_valid 3m; - add_header X-Cache-Status $upstream_cache_status; - - if ($uri) { } - } - - location = /etc/passwd { - root /; - } ---- request -PURGE /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/html ---- response_body_like: Successful purge ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx: 4: < 1.7.9 diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy3.t b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy3.t deleted file mode 100644 index c8d71d9..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy3.t +++ /dev/null @@ -1,140 +0,0 @@ -# vi:filetype=perl - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(1); - -plan tests => 32; - -our $http_config = <<'_EOC_'; - proxy_cache_path /tmp/ngx_cache_purge_cache keys_zone=test_cache:10m; - proxy_temp_path /tmp/ngx_cache_purge_temp 1 2; -_EOC_ - -our $config = <<'_EOC_'; - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - proxy_cache test_cache; - proxy_cache_key $uri$is_args$args; - proxy_cache_valid 3m; - add_header X-Cache-Status $upstream_cache_status; - - proxy_cache_purge PURGE purge_all from 1.0.0.0/8 127.0.0.0/8 3.0.0.0/8; - } - - - location = /etc/passwd { - root /; - } -_EOC_ - -worker_connections(128); -no_shuffle(); -run_tests(); - -no_diff(); - -__DATA__ - -=== TEST 1: prepare passwd ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ - - -=== TEST 2: prepare shadow ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/shadow ---- error_code: 200 ---- response_headers -Content-Type: text/plain ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ - - - -=== TEST 3: get from cache passwd ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ - - -=== TEST 4: get from cache shadow ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/shadow ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ - - -=== TEST 5: purge from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /proxy/any ---- error_code: 200 ---- response_headers -Content-Type: text/html ---- response_body_like: Successful purge ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ - - -=== TEST 6: get from empty cache passwd ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: MISS ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ - - -=== TEST 7: get from empty cache shadow ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/shadow ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: MISS ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy4.t b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy4.t deleted file mode 100644 index e4d2f30..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/proxy4.t +++ /dev/null @@ -1,168 +0,0 @@ -# vi:filetype=perl - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(1); - -plan tests => 41; - -our $http_config = <<'_EOC_'; - proxy_cache_path /tmp/ngx_cache_purge_cache keys_zone=test_cache:10m; - proxy_temp_path /tmp/ngx_cache_purge_temp 1 2; -_EOC_ - -our $config = <<'_EOC_'; - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - proxy_cache test_cache; - proxy_cache_key $uri$is_args$args; - proxy_cache_valid 3m; - add_header X-Cache-Status $upstream_cache_status; - - proxy_cache_purge PURGE from 1.0.0.0/8 127.0.0.0/8 3.0.0.0/8; - } - - - location = /etc/passwd { - root /; - } -_EOC_ - -worker_connections(128); -no_shuffle(); -run_tests(); - -no_diff(); - -__DATA__ - -=== TEST 1: prepare passwd ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ - - -=== TEST 2: prepare passwd2 ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd2 ---- error_code: 200 ---- response_headers -Content-Type: text/plain ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ - - -=== TEST 3: prepare shadow ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/shadow ---- error_code: 200 ---- response_headers -Content-Type: text/plain ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ - - -=== TEST 4: get from cache passwd ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ - - -=== TEST 5: get from cache passwd2 ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd2 ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ - - -=== TEST 6: purge from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /proxy/pass* ---- error_code: 200 ---- response_headers -Content-Type: text/html ---- response_body_like: Successful purge ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ - - -=== TEST 7: get from empty cache passwd ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: MISS ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ - - -=== TEST 8: get from empty cache passwd2 ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd2 ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: MISS ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ - - -=== TEST 9: get from cache shadow ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/shadow ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ diff --git a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/resptype1.t b/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/resptype1.t deleted file mode 100644 index 816c3ff..0000000 --- a/modules_deb/libnginx-mod-http-cache-purge-2.5.3/t/resptype1.t +++ /dev/null @@ -1,245 +0,0 @@ -# vi:filetype=perl - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(1); - -plan tests => repeat_each() * (blocks() * 4 + 3 * 1); - -our $http_config = <<'_EOC_'; - proxy_cache_path /tmp/ngx_cache_purge_cache keys_zone=test_cache:10m; - proxy_temp_path /tmp/ngx_cache_purge_temp 1 2; -_EOC_ - -our $config = <<'_EOC_'; - - cache_purge_response_type json; - - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/etc/passwd; - proxy_cache test_cache; - proxy_cache_key $uri$is_args$args; - proxy_cache_valid 3m; - add_header X-Cache-Status $upstream_cache_status; - } - - location ~ /purge(/.*) { - proxy_cache_purge test_cache $1$is_args$args; - cache_purge_response_type html; - } - - location ~ /purge_json(/.*) { - proxy_cache_purge test_cache $1$is_args$args; - } - - location ~ /purge_xml(/.*) { - proxy_cache_purge test_cache $1$is_args$args; - cache_purge_response_type xml; - } - - location ~ /purge_text(/.*) { - proxy_cache_purge test_cache $1$is_args$args; - cache_purge_response_type text; - } - - - - location = /etc/passwd { - root /; - } -_EOC_ - -worker_connections(128); -no_shuffle(); -run_tests(); - -no_diff(); - -__DATA__ - -=== TEST 1: prepare ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - - -=== TEST 2: get from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 5: < 0.8.3 or < 0.7.62 - - - -=== TEST 3: purge from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /purge/proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/html ---- response_body_like: Successful purge ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - - -=== TEST 4: purge from empty cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /purge/proxy/passwd ---- error_code: 412 ---- response_headers -Content-Type: text/html ---- response_body_like: 412 Precondition Failed ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - - -=== TEST 5: get from source ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: MISS ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 5: < 0.8.3 or < 0.7.62 - - - -=== TEST 6: get from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd ---- error_code: 200 ---- response_headers -Content-Type: text/plain -X-Cache-Status: HIT ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 5: < 0.8.3 or < 0.7.62 - -=== TEST 7-prepare: prepare purge ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd?t=7 ---- error_code: 200 ---- response_headers -Content-Type: text/plain ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - -=== TEST 7: get a JSON response after purge from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /purge_json/proxy/passwd?t=7 ---- error_code: 200 ---- response_headers -Content-Type: application/json ---- response_body_like: {\"Key\": \"\/proxy\/passwd\?t=7\" ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - -=== TEST 8-prepare: prepare purge ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd?t=8 ---- error_code: 200 ---- response_headers -Content-Type: text/plain ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - -=== TEST 8: get a XML response after purge from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /purge_xml/proxy/passwd?t=8 ---- error_code: 200 ---- response_headers -Content-Type: text/xml ---- response_body_like: \<\?xml version=\"1.0\" encoding=\"UTF-8\"\?><\!\[CDATA\[\/proxy\/passwd\?t=8\]\]><\/Key> ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - -=== TEST 9-prepare: prepare purge ---- http_config eval: $::http_config ---- config eval: $::config ---- request -GET /proxy/passwd?t=9 ---- error_code: 200 ---- response_headers -Content-Type: text/plain ---- response_body_like: root ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - -=== TEST 9: get a TEXT response after purge from cache ---- http_config eval: $::http_config ---- config eval: $::config ---- request -PURGE /purge_text/proxy/passwd?t=9 ---- error_code: 200 ---- response_headers -Content-Type: text/plain ---- response_body_like: Key ---- timeout: 10 ---- no_error_log eval -qr/\[(warn|error|crit|alert|emerg)\]/ ---- skip_nginx2: 4: < 0.8.3 or < 0.7.62 - - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/.gitattributes b/modules_deb/libnginx-mod-http-echo-0.63/.gitattributes deleted file mode 100644 index 6fe6f35..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.t linguist-language=Text diff --git a/modules_deb/libnginx-mod-http-echo-0.63/.gitignore b/modules_deb/libnginx-mod-http-echo-0.63/.gitignore deleted file mode 100644 index a9948e4..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/.gitignore +++ /dev/null @@ -1,65 +0,0 @@ -.libs -*.swp -*.slo -*.la -*.swo -*.lo -*.mobi -genmobi.sh -*~ -*.o -print.txt -.rsync -*.tar.gz -dist -build[789] -build -tags -update-readme -*.tmp -test/Makefile -test/blib -test.sh -t.sh -t/t.sh -test/t/servroot/ -releng -reset -*.t_ -reindex -src/location.h -src/filter.c -src/subrequest.h -src/sleep.h -src/util.c -src/echo.c -src/info.c -src/util.h -src/var.h -src/filter.h -src/sleep.c -src/var.c -src/timer.c -src/module.h -src/echo.h -src/info.h -src/foreach.c -src/location.c -src/timer.h -src/module.c -src/subrequest.c -src/handler.h -src/foreach.h -src/handler.c -nginx -*.html -ctags -t/servroot -all -buildroot/ -go -Changes -build1[0-9] -analyze -Makefile -*.plist diff --git a/modules_deb/libnginx-mod-http-echo-0.63/.travis.yml b/modules_deb/libnginx-mod-http-echo-0.63/.travis.yml deleted file mode 100644 index 7dda358..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/.travis.yml +++ /dev/null @@ -1,48 +0,0 @@ -sudo: required -dist: bionic - -os: linux - -language: c - -compiler: - - gcc - -env: - global: - - LUAJIT_PREFIX=/opt/luajit21 - - LUAJIT_LIB=$LUAJIT_PREFIX/lib - - LUAJIT_INC=$LUAJIT_PREFIX/include/luajit-2.1 - - LD_LIBRARY_PATH=$LUAJIT_LIB:$LD_LIBRARY_PATH - matrix: - - NGINX_VERSION=1.17.8 - - NGINX_VERSION=1.19.9 - -before_install: - - sudo apt-get install -qq -y cpanminus libgd-dev ca-certificates - - sudo cpanm -v --notest Test::Nginx > build.log 2>&1 || (cat build.log && exit 1) - -install: - - wget http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && tar -xzf nginx-${NGINX_VERSION}.tar.gz - - git clone https://github.com/simpl/ngx_devel_kit.git - - git clone https://github.com/openresty/set-misc-nginx-module.git - - git clone https://github.com/openresty/xss-nginx-module.git - - git clone https://github.com/openresty/rds-json-nginx-module.git - - git clone https://github.com/openresty/headers-more-nginx-module.git - - git clone https://github.com/openresty/lua-nginx-module.git - - git clone https://github.com/openresty/lua-resty-core.git ../lua-resty-core - - git clone https://github.com/openresty/lua-resty-lrucache.git ../lua-resty-lrucache - - git clone https://github.com/openresty/nginx-eval-module.git - - git clone -b v2.1-agentzh https://github.com/openresty/luajit2.git luajit2 - -script: - - cd luajit2/ - - make -j$JOBS CCDEBUG=-g Q= PREFIX=$LUAJIT_PREFIX CC=$CC XCFLAGS='-DLUA_USE_APICHECK -DLUA_USE_ASSERT -msse4.2' > build.log 2>&1 || (cat build.log && exit 1) - - sudo make install PREFIX=$LUAJIT_PREFIX > build.log 2>&1 || (cat build.log && exit 1) - - cd .. - - cd nginx-${NGINX_VERSION}/ - - ./configure --without-http_ssi_module --with-debug --with-select_module --with-poll_module --with-http_stub_status_module --with-http_image_filter_module --add-module=../ngx_devel_kit --add-module=../set-misc-nginx-module --add-module=../nginx-eval-module --add-module=../xss-nginx-module --add-module=../rds-json-nginx-module --add-module=../headers-more-nginx-module --add-module=../lua-nginx-module --add-module=.. > build.log 2>&1 || (cat build.log && exit 1) - - make -j2 > build.log 2>&1 || (cat build.log && exit 1) - - export PATH=$PATH:`pwd`/objs - - cd .. - - prove -I. -r t diff --git a/modules_deb/libnginx-mod-http-echo-0.63/LICENSE b/modules_deb/libnginx-mod-http-echo-0.63/LICENSE deleted file mode 100644 index 6feffbf..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -Copyright (C) 2009-2014, Yichun "agentzh" Zhang . -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - 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 THE COPYRIGHT HOLDERS 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 THE COPYRIGHT -HOLDER 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) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/modules_deb/libnginx-mod-http-echo-0.63/README.markdown b/modules_deb/libnginx-mod-http-echo-0.63/README.markdown deleted file mode 100644 index a6b25e3..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/README.markdown +++ /dev/null @@ -1,1851 +0,0 @@ -Name -==== - -**ngx_echo** - Brings "echo", "sleep", "time", "exec" and more shell-style goodies to Nginx config file. - -*This module is not distributed with the Nginx source.* See [the installation instructions](#installation). - -Table of Contents -================= - -* [Name](#name) -* [Status](#status) -* [Version](#version) -* [Synopsis](#synopsis) -* [Description](#description) -* [Content Handler Directives](#content-handler-directives) - * [echo](#echo) - * [echo_duplicate](#echo_duplicate) - * [echo_flush](#echo_flush) - * [echo_sleep](#echo_sleep) - * [echo_blocking_sleep](#echo_blocking_sleep) - * [echo_reset_timer](#echo_reset_timer) - * [echo_read_request_body](#echo_read_request_body) - * [echo_location_async](#echo_location_async) - * [echo_location](#echo_location) - * [echo_subrequest_async](#echo_subrequest_async) - * [echo_subrequest](#echo_subrequest) - * [echo_foreach_split](#echo_foreach_split) - * [echo_end](#echo_end) - * [echo_request_body](#echo_request_body) - * [echo_exec](#echo_exec) - * [echo_status](#echo_status) -* [Filter Directives](#filter-directives) - * [echo_before_body](#echo_before_body) - * [echo_after_body](#echo_after_body) -* [Variables](#variables) - * [$echo_it](#echo_it) - * [$echo_timer_elapsed](#echo_timer_elapsed) - * [$echo_request_body](#echo_request_body) - * [$echo_request_method](#echo_request_method) - * [$echo_client_request_method](#echo_client_request_method) - * [$echo_client_request_headers](#echo_client_request_headers) - * [$echo_cacheable_request_uri](#echo_cacheable_request_uri) - * [$echo_request_uri](#echo_request_uri) - * [$echo_incr](#echo_incr) - * [$echo_response_status](#echo_response_status) -* [Installation](#installation) -* [Compatibility](#compatibility) -* [Modules that use this module for testing](#modules-that-use-this-module-for-testing) -* [Community](#community) - * [English Mailing List](#english-mailing-list) - * [Chinese Mailing List](#chinese-mailing-list) -* [Report Bugs](#report-bugs) -* [Source Repository](#source-repository) -* [Changes](#changes) -* [Test Suite](#test-suite) -* [TODO](#todo) -* [Getting involved](#getting-involved) -* [Author](#author) -* [Copyright & License](#copyright--license) -* [See Also](#see-also) - -Status -====== - -This module is production ready. - -Version -======= - -This document describes ngx_echo [v0.62](https://github.com/openresty/echo-nginx-module/tags) released on 2 July, 2020. - -Synopsis -======== - -```nginx - - location /hello { - echo "hello, world!"; - } -``` - -```nginx - - location /hello { - echo -n "hello, "; - echo "world!"; - } -``` - -```nginx - - location /timed_hello { - echo_reset_timer; - echo hello world; - echo "'hello world' takes about $echo_timer_elapsed sec."; - echo hiya igor; - echo "'hiya igor' takes about $echo_timer_elapsed sec."; - } -``` - -```nginx - - location /echo_with_sleep { - echo hello; - echo_flush; # ensure the client can see previous output immediately - echo_sleep 2.5; # in sec - echo world; - } -``` - -```nginx - - # in the following example, accessing /echo yields - # hello - # world - # blah - # hiya - # igor - location /echo { - echo_before_body hello; - echo_before_body world; - proxy_pass $scheme://127.0.0.1:$server_port$request_uri/more; - echo_after_body hiya; - echo_after_body igor; - } - location /echo/more { - echo blah; - } -``` - -```nginx - - # the output of /main might be - # hello - # world - # took 0.000 sec for total. - # and the whole request would take about 2 sec to complete. - location /main { - echo_reset_timer; - - # subrequests in parallel - echo_location_async /sub1; - echo_location_async /sub2; - - echo "took $echo_timer_elapsed sec for total."; - } - location /sub1 { - echo_sleep 2; - echo hello; - } - location /sub2 { - echo_sleep 1; - echo world; - } -``` - -```nginx - - # the output of /main might be - # hello - # world - # took 3.003 sec for total. - # and the whole request would take about 3 sec to complete. - location /main { - echo_reset_timer; - - # subrequests in series (chained by CPS) - echo_location /sub1; - echo_location /sub2; - - echo "took $echo_timer_elapsed sec for total."; - } - location /sub1 { - echo_sleep 2; - echo hello; - } - location /sub2 { - echo_sleep 1; - echo world; - } -``` - -```nginx - - # Accessing /dup gives - # ------ END ------ - location /dup { - echo_duplicate 3 "--"; - echo_duplicate 1 " END "; - echo_duplicate 3 "--"; - echo; - } -``` - -```nginx - - # /bighello will generate 1000,000,000 hello's. - location /bighello { - echo_duplicate 1000_000_000 'hello'; - } -``` - -```nginx - - # echo back the client request - location /echoback { - echo_duplicate 1 $echo_client_request_headers; - echo "\r"; - - echo_read_request_body; - - echo_request_body; - } -``` - -```nginx - - # GET /multi will yields - # querystring: foo=Foo - # method: POST - # body: hi - # content length: 2 - # /// - # querystring: bar=Bar - # method: PUT - # body: hello - # content length: 5 - # /// - location /multi { - echo_subrequest_async POST '/sub' -q 'foo=Foo' -b 'hi'; - echo_subrequest_async PUT '/sub' -q 'bar=Bar' -b 'hello'; - } - location /sub { - echo "querystring: $query_string"; - echo "method: $echo_request_method"; - echo "body: $echo_request_body"; - echo "content length: $http_content_length"; - echo '///'; - } -``` - -```nginx - - # GET /merge?/foo.js&/bar/blah.js&/yui/baz.js will merge the .js resources together - location /merge { - default_type 'text/javascript'; - echo_foreach_split '&' $query_string; - echo "/* JS File $echo_it */"; - echo_location_async $echo_it; - echo; - echo_end; - } -``` - -```nginx - - # accessing /if?val=abc yields the "hit" output - # while /if?val=bcd yields "miss": - location ^~ /if { - set $res miss; - if ($arg_val ~* '^a') { - set $res hit; - echo $res; - } - echo $res; - } -``` - -[Back to TOC](#table-of-contents) - -Description -=========== - -This module wraps lots of Nginx internal APIs for streaming input and output, parallel/sequential subrequests, timers and sleeping, as well as various meta data accessing. - -Basically it provides various utilities that help testing and debugging of other modules by trivially emulating different kinds of faked subrequest locations. - -People will also find it useful in real-world applications that need to - -1. serve static contents directly from memory (loading from the Nginx config file). -1. wrap the upstream response with custom header and footer (kinda like the [addition module](http://nginx.org/en/docs/http/ngx_http_addition_module.html) but with contents read directly from the config file and Nginx variables). -1. merge contents of various "Nginx locations" (i.e., subrequests) together in a single main request (using [echo_location](#echo_location) and its friends). - -This is a special dual-role module that can *lazily* serve as a content handler or register itself as an output filter only upon demand. By default, this module does not do anything at all. - -Technically, this module has also demonstrated the following techniques that might be helpful for module writers: - -1. Issue parallel subrequests directly from content handler. -1. Issue chained subrequests directly from content handler, by passing continuation along the subrequest chain. -1. Issue subrequests with all HTTP 1.1 methods and even an optional faked HTTP request body. -1. Interact with the Nginx event model directly from content handler using custom events and timers, and resume the content handler back if necessary. -1. Dual-role module that can (lazily) serve as a content handler or an output filter or both. -1. Nginx config file variable creation and interpolation. -1. Streaming output control using output_chain, flush and its friends. -1. Read client request body from the content handler, and returns back (asynchronously) to the content handler after completion. -1. Use Perl-based declarative [test suite](#test-suite) to drive the development of Nginx C modules. - -[Back to TOC](#table-of-contents) - -Content Handler Directives -========================== - -Use of the following directives register this module to the current Nginx location as a content handler. If you want to use another module, like the [standard proxy module](http://nginx.org/en/docs/http/ngx_http_proxy_module.html), as the content handler, use the [filter directives](#filter-directives) provided by this module. - -All the content handler directives can be mixed together in a single Nginx location and they're supposed to run sequentially just as in the Bash scripting language. - -Every content handler directive supports variable interpolation in its arguments (if any). - -The MIME type set by the [standard default_type directive](http://nginx.org/en/docs/http/ngx_http_core_module.html#default_type) is respected by this module, as in: - -```nginx - - location /hello { - default_type text/plain; - echo hello; - } -``` - -Then on the client side: - -```bash - - $ curl -I 'http://localhost/echo' - HTTP/1.1 200 OK - Server: nginx/0.8.20 - Date: Sat, 17 Oct 2009 03:40:19 GMT - Content-Type: text/plain - Connection: keep-alive -``` - -Since the [v0.22](#v022) release, all of the directives are allowed in the [rewrite module](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html)'s [if](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#if) directive block, for instance: - -```nginx - - location ^~ /if { - set $res miss; - if ($arg_val ~* '^a') { - set $res hit; - echo $res; - } - echo $res; - } -``` - -[Back to TOC](#table-of-contents) - -echo ----- -**syntax:** *echo \[options\] <string>...* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -Sends arguments joined by spaces, along with a trailing newline, out to the client. - -Note that the data might be buffered by Nginx's underlying buffer. To force the output data flushed immediately, use the [echo_flush](#echo_flush) command just after `echo`, as in - -```nginx - - echo hello world; - echo_flush; -``` - -When no argument is specified, *echo* emits the trailing newline alone, just like the *echo* command in shell. - -Variables may appear in the arguments. An example is - -```nginx - - echo The current request uri is $request_uri; -``` - -where [$request_uri](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_request_uri) is a variable exposed by the [ngx_http_core_module](http://nginx.org/en/docs/http/ngx_http_core_module.html). - -This command can be used multiple times in a single location configuration, as in - -```nginx - - location /echo { - echo hello; - echo world; - } -``` - -The output on the client side looks like this - -```bash - - $ curl 'http://localhost/echo' - hello - world -``` - -Special characters like newlines (`\n`) and tabs (`\t`) can be escaped using C-style escaping sequences. But a notable exception is the dollar sign (`$`). As of Nginx 0.8.20, there's still no clean way to escape this character. (A work-around might be to use a `$echo_dollor` variable that is always evaluated to the constant `$` character. This feature will possibly be introduced in a future version of this module.) - -As of the echo [v0.28](#v028) release, one can suppress the trailing newline character in the output by using the `-n` option, as in - -```nginx - - location /echo { - echo -n "hello, "; - echo "world"; - } -``` - -Accessing `/echo` gives - -```bash - - $ curl 'http://localhost/echo' - hello, world -``` - -Leading `-n` in variable values won't take effect and will be emitted literally, as in - -```nginx - - location /echo { - set $opt -n; - echo $opt "hello,"; - echo "world"; - } -``` - -This gives the following output - -```bash - - $ curl 'http://localhost/echo' - -n hello, - world -``` - -One can output leading `-n` literals and other options using the special `--` option like this - -```nginx - - location /echo { - echo -- -n is an option; - } -``` - -which yields - -```bash - - $ curl 'http://localhost/echo' - -n is an option -``` - -Use this form when you want to output anything leading with a dash (`-`). - -[Back to TOC](#table-of-contents) - -echo_duplicate --------------- -**syntax:** *echo_duplicate <count> <string>* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -Outputs duplication of a string indicated by the second argument, using the count specified in the first argument. - -For instance, - -```nginx - - location /dup { - echo_duplicate 3 "abc"; - } -``` - -will lead to the output of `"abcabcabc"`. - -Underscores are allowed in the count number, just like in Perl. For example, to emit 1000,000,000 instances of `"hello, world"`: - -```nginx - - location /many_hellos { - echo_duplicate 1000_000_000 "hello, world"; - } -``` - -The `count` argument could be zero, but not negative. The second `string` argument could be an empty string ("") likewise. - -Unlike the [echo](#echo) directive, no trailing newline is appended to the result. So it's possible to "abuse" this directive as a no-trailing-newline version of [echo](#echo) by using "count" 1, as in - -```nginx - - location /echo_art { - echo_duplicate 2 '---'; - echo_duplicate 1 ' END '; # we don't want a trailing newline here - echo_duplicate 2 '---'; - echo; # we want a trailing newline here... - } -``` - -You get - -```bash - ------ END ------ -``` - -But use of the `-n` option in [echo](#echo) is more appropriate for this purpose. - -This directive was first introduced in [version 0.11](#v011). - -[Back to TOC](#table-of-contents) - -echo_flush ----------- -**syntax:** *echo_flush* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -Forces the data potentially buffered by underlying Nginx output filters to send immediately to the client side via socket. - -Note that techically the command just emits a ngx_buf_t object with `flush` slot set to 1, so certain weird third-party output filter module could still block it before it reaches Nginx's (last) write filter. - -This directive does not take any argument. - -Consider the following example: - -```nginx - - location /flush { - echo hello; - - echo_flush; - - echo_sleep 1; - echo world; - } -``` - -Then on the client side, using curl to access `/flush`, you'll see the "hello" line immediately, but only after 1 second, the last "world" line. Without calling `echo_flush` in the example above, you'll most likely see no output until 1 second is elapsed due to the internal buffering of Nginx. - -This directive will fail to flush the output buffer in case of subrequests get involved. Consider the following example: - -```nginx - - location /main { - echo_location_async /sub; - echo hello; - echo_flush; - } - location /sub { - echo_sleep 1; - } -``` - -Then the client won't see "hello" appear even if `echo_flush` has been executed before the subrequest to `/sub` has actually started executing. The outputs of `/main` that are sent *after* [echo_location_async](#echo_location_async) will be postponed and buffered firmly. - -This does *not* apply to outputs sent before the subrequest initiated. For a modified version of the example given above: - -```nginx - - location /main { - echo hello; - echo_flush; - echo_location_async /sub; - } - location /sub { - echo_sleep 1; - } -``` - -The client will immediately see "hello" before `/sub` enters sleeping. - -See also [echo](#echo), [echo_sleep](#echo_sleep), and [echo_location_async](#echo_location_async). - -[Back to TOC](#table-of-contents) - -echo_sleep ----------- -**syntax:** *echo_sleep <seconds>* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -Sleeps for the time period specified by the argument, which is in seconds. - -This operation is non-blocking on server side, so unlike the [echo_blocking_sleep](#echo_blocking_sleep) directive, it won't block the whole Nginx worker process. - -The period might takes three digits after the decimal point and must be greater than 0.001. - -An example is - -```nginx - - location /echo_after_sleep { - echo_sleep 1.234; - echo resumed!; - } -``` - -Behind the scene, it sets up a per-request "sleep" ngx_event_t object, and adds a timer using that custom event to the Nginx event model and just waits for a timeout on that event. Because the "sleep" event is per-request, this directive can work in parallel subrequests. - -[Back to TOC](#table-of-contents) - -echo_blocking_sleep -------------------- -**syntax:** *echo_blocking_sleep <seconds>* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -This is a blocking version of the [echo_sleep](#echo_sleep) directive. - -See the documentation of [echo_sleep](#echo_sleep) for more detail. - -Behind the curtain, it calls the ngx_msleep macro provided by the Nginx core which maps to usleep on POSIX-compliant systems. - -Note that this directive will block the current Nginx worker process completely while being executed, so never use it in production environment. - -[Back to TOC](#table-of-contents) - -echo_reset_timer ----------------- -**syntax:** *echo_reset_timer* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -Reset the timer begin time to *now*, i.e., the time when this command is executed during request. - -The timer begin time is default to the starting time of the current request and can be overridden by this directive, potentially multiple times in a single location. For example: - -```nginx - - location /timed_sleep { - echo_sleep 0.03; - echo "$echo_timer_elapsed sec elapsed."; - - echo_reset_timer; - - echo_sleep 0.02; - echo "$echo_timer_elapsed sec elapsed."; - } -``` - -The output on the client side might be - -```bash - - $ curl 'http://localhost/timed_sleep' - 0.032 sec elapsed. - 0.020 sec elapsed. -``` - -The actual figures you get on your side may vary a bit due to your system's current activities. - -Invocation of this directive will force the underlying Nginx timer to get updated to the current system time (regardless the timer resolution specified elsewhere in the config file). Furthermore, references of the [$echo_timer_elapsed](#echo_timer_elapsed) variable will also trigger timer update forcibly. - -See also [echo_sleep](#echo_sleep) and [$echo_timer_elapsed](#echo_timer_elapsed). - -[Back to TOC](#table-of-contents) - -echo_read_request_body ----------------------- -**syntax:** *echo_read_request_body* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -Explicitly reads request body so that the [$request_body](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_request_body) variable will always have non-empty values (unless the body is so big that it has been saved by Nginx to a local temporary file). - -Note that this might not be the original client request body because the current request might be a subrequest with a "artificial" body specified by its parent. - -This directive does not generate any output itself, just like [echo_sleep](#echo_sleep). - -Here's an example for echo'ing back the original HTTP client request (both headers and body are included): - -```nginx - - location /echoback { - echo_duplicate 1 $echo_client_request_headers; - echo "\r"; - echo_read_request_body; - echo $request_body; - } -``` - -The content of `/echoback` looks like this on my side (I was using Perl's LWP utility to access this location on the server): - -```bash - - $ (echo hello; echo world) | lwp-request -m POST 'http://localhost/echoback' - POST /echoback HTTP/1.1 - TE: deflate,gzip;q=0.3 - Connection: TE, close - Host: localhost - User-Agent: lwp-request/5.818 libwww-perl/5.820 - Content-Length: 12 - Content-Type: application/x-www-form-urlencoded - - hello - world -``` - -Because `/echoback` is the main request, [$request_body](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_request_body) holds the original client request body. - -Before Nginx 0.7.56, it makes no sense to use this directive because [$request_body](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_request_body) was first introduced in Nginx 0.7.58. - -This directive itself was first introduced in the echo module's [v0.14 release](#v014). - -[Back to TOC](#table-of-contents) - -echo_location_async -------------------- -**syntax:** *echo_location_async <location> [<url_args>]* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -Issue GET subrequest to the location specified (first argument) with optional url arguments specified in the second argument. - -As of Nginx 0.8.20, the `location` argument does *not* support named location, due to a limitation in the `ngx_http_subrequest` function. The same is true for its brother, the [echo_location](#echo_location) directive. - -A very simple example is - -```nginx - - location /main { - echo_location_async /sub; - echo world; - } - location /sub { - echo hello; - } -``` - -Accessing `/main` gets - -```bash - - hello - world -``` - -Calling multiple locations in parallel is also possible: - -```nginx - - location /main { - echo_reset_timer; - echo_location_async /sub1; - echo_location_async /sub2; - echo "took $echo_timer_elapsed sec for total."; - } - location /sub1 { - echo_sleep 2; # sleeps 2 sec - echo hello; - } - location /sub2 { - echo_sleep 1; # sleeps 1 sec - echo world; - } -``` - -Accessing `/main` yields - -```bash - - $ time curl 'http://localhost/main' - hello - world - took 0.000 sec for total. - - real 0m2.006s - user 0m0.000s - sys 0m0.004s -``` - -You can see that the main handler `/main` does *not* wait the subrequests `/sub1` and `/sub2` to complete and quickly goes on, hence the "0.000 sec" timing result. The whole request, however takes approximately 2 sec in total to complete because `/sub1` and `/sub2` run in parallel (or "concurrently" to be more accurate). - -If you use [echo_blocking_sleep](#echo_blocking_sleep) in the previous example instead, then you'll get the same output, but with 3 sec total response time, because "blocking sleep" blocks the whole Nginx worker process. - -Locations can also take an optional querystring argument, for instance - -```nginx - - location /main { - echo_location_async /sub 'foo=Foo&bar=Bar'; - } - location /sub { - echo $arg_foo $arg_bar; - } -``` - -Accessing `/main` yields - -```bash - - $ curl 'http://localhost/main' - Foo Bar -``` - -Querystrings is *not* allowed to be concatenated onto the `location` argument with "?" directly, for example, `/sub?foo=Foo&bar=Bar` is an invalid location, and shouldn't be fed as the first argument to this directive. - -Technically speaking, this directive is an example that Nginx content handler issues one or more subrequests directly. AFAIK, the [fancyindex module](https://connectical.com/projects/ngx-fancyindex/wiki) also does such kind of things ;) - -Nginx named locations like `@foo` is *not* supported here. - -This directive is logically equivalent to the GET version of [echo_subrequest_async](#echo_subrequest_async). For example, - -```nginx - - echo_location_async /foo 'bar=Bar'; -``` - -is logically equivalent to - -```nginx - - echo_subrequest_async GET /foo -q 'bar=Bar'; -``` - -But calling this directive is slightly faster than calling [echo_subrequest_async](#echo_subrequest_async) using `GET` because we don't have to parse the HTTP method names like `GET` and options like `-q`. - -This directive is first introduced in [version 0.09](#v009) of this module and requires at least Nginx 0.7.46. - -[Back to TOC](#table-of-contents) - -echo_location -------------- -**syntax:** *echo_location <location> [<url_args>]* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -Just like the [echo_location_async](#echo_location_async) directive, but `echo_location` issues subrequests *in series* rather than in parallel. That is, the content handler directives following this directive won't be executed until the subrequest issued by this directive completes. - -The final response body is almost always equivalent to the case when [echo_location_async](#echo_location_async) is used instead, only if timing variables is used in the outputs. - -Consider the following example: - -```nginx - - location /main { - echo_reset_timer; - echo_location /sub1; - echo_location /sub2; - echo "took $echo_timer_elapsed sec for total."; - } - location /sub1 { - echo_sleep 2; - echo hello; - } - location /sub2 { - echo_sleep 1; - echo world; - } -``` - -The location `/main` above will take for total 3 sec to complete (compared to 2 sec if [echo_location_async](#echo_location_async) is used instead here). Here's the result in action on my machine: - -```bash - - $ curl 'http://localhost/main' - hello - world - took 3.003 sec for total. - - real 0m3.027s - user 0m0.020s - sys 0m0.004s -``` - -This directive is logically equivalent to the GET version of [echo_subrequest](#echo_subrequest). For example, - -```nginx - - echo_location /foo 'bar=Bar'; -``` - -is logically equivalent to - -```nginx - - echo_subrequest GET /foo -q 'bar=Bar'; -``` - -But calling this directive is slightly faster than calling [echo_subrequest](#echo_subrequest) using `GET` because we don't have to parse the HTTP method names like `GET` and options like `-q`. - -Behind the scene, it creates an `ngx_http_post_subrequest_t` object as a *continuation* and passes it into the `ngx_http_subrequest` function call. Nginx will later reopen this "continuation" in the subrequest's `ngx_http_finalize_request` function call. We resumes the execution of the parent-request's content handler and starts to run the next directive (command) if any. - -Nginx named locations like `@foo` is *not* supported here. - -This directive was first introduced in the [release v0.12](#v012). - -See also [echo_location_async](#echo_location_async) for more details about the meaning of the arguments. - -[Back to TOC](#table-of-contents) - -echo_subrequest_async ---------------------- -**syntax:** *echo_subrequest_async <HTTP_method> <location> [-q <url_args>] [-b <request_body>] [-f <request_body_path>]* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -Initiate an asynchronous subrequest using HTTP method, an optional url arguments (or querystring) and an optional request body which can be defined as a string or as a path to a file which contains the body. - -This directive is very much like a generalized version of the [echo_location_async](#echo_location_async) directive. - -Here's a small example demonstrating its usage: - -```nginx - - location /multi { - # body defined as string - echo_subrequest_async POST '/sub' -q 'foo=Foo' -b 'hi'; - # body defined as path to a file, relative to nginx prefix path if not absolute - echo_subrequest_async PUT '/sub' -q 'bar=Bar' -f '/tmp/hello.txt'; - } - location /sub { - echo "querystring: $query_string"; - echo "method: $echo_request_method"; - echo "body: $echo_request_body"; - echo "content length: $http_content_length"; - echo '///'; - } -``` - -Then on the client side: - -```bash - - $ echo -n hello > /tmp/hello.txt - $ curl 'http://localhost/multi' - querystring: foo=Foo - method: POST - body: hi - content length: 2 - /// - querystring: bar=Bar - method: PUT - body: hello - content length: 5 - /// -``` - -Here's more funny example using the standard [proxy module](#httpproxymodule) to handle the subrequest: - -```nginx - - location /main { - echo_subrequest_async POST /sub -b 'hello, world'; - } - location /sub { - proxy_pass $scheme://127.0.0.1:$server_port/proxied; - } - location /proxied { - echo "method: $echo_request_method."; - - # we need to read body explicitly here...or $echo_request_body - # will evaluate to empty ("") - echo_read_request_body; - - echo "body: $echo_request_body."; - } -``` - -Then on the client side, we can see that - -```bash - - $ curl 'http://localhost/main' - method: POST. - body: hello, world. -``` - -Nginx named locations like `@foo` is *not* supported here. - -This directive takes several options: - - - -q Specify the URL arguments (or URL querystring) for the subrequest. - - -f Specify the path for the file whose content will be serve as the - subrequest's request body. - - -b Specify the request body data - - -This directive was first introduced in the [release v0.15](#v015). - -The `-f` option to define a file path for the body was introduced in the [release v0.35](#v035). - -See also the [echo_subrequest](#echo_subrequest) and [echo_location_async](#echo_location_async) directives. - -[Back to TOC](#table-of-contents) - -echo_subrequest ---------------- -**syntax:** *echo_subrequest <HTTP_method> <location> [-q <url_args>] [-b <request_body>] [-f <request_body_path>]* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -This is the synchronous version of the [echo_subrequest_async](#echo_subrequest_async) directive. And just like [echo_location](#echo_location), it does not block the Nginx worker process (while [echo_blocking_sleep](#echo_blocking_sleep) does), rather, it uses continuation to pass control along the subrequest chain. - -See [echo_subrequest_async](#echo_subrequest_async) for more details. - -Nginx named locations like `@foo` is *not* supported here. - -This directive was first introduced in the [release v0.15](#v015). - -[Back to TOC](#table-of-contents) - -echo_foreach_split ------------------- -**syntax:** *echo_foreach_split <delimiter> <string>* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -Split the second argument `string` using the delimiter specified in the first argument, and then iterate through the resulting items. For instance: - -```nginx - - location /loop { - echo_foreach_split ',' $arg_list; - echo "item: $echo_it"; - echo_end; - } -``` - -Accessing /main yields - -```bash - - $ curl 'http://localhost/loop?list=cat,dog,mouse' - item: cat - item: dog - item: mouse -``` - -As seen in the previous example, this directive should always be accompanied by an [echo_end](#echo_end) directive. - -Parallel `echo_foreach_split` loops are allowed, but nested ones are currently forbidden. - -The `delimiter` argument could contain *multiple* arbitrary characters, like - -```nginx - - # this outputs "cat\ndog\nmouse\n" - echo_foreach_split -- '-a-' 'cat-a-dog-a-mouse'; - echo $echo_it; - echo_end; -``` - -Logically speaking, this looping structure is just the `foreach` loop combined with a `split` function call in Perl (using the previous example): - -```perl - - foreach (split ',', $arg_list) { - print "item $_\n"; - } -``` - -People will also find it useful in merging multiple `.js` or `.css` resources into a whole. Here's an example: - -```nginx - - location /merge { - default_type 'text/javascript'; - - echo_foreach_split '&' $query_string; - echo "/* JS File $echo_it */"; - echo_location_async $echo_it; - echo; - echo_end; - } -``` - -Then accessing /merge to merge the `.js` resources specified in the query string: - -```bash - - $ curl 'http://localhost/merge?/foo/bar.js&/yui/blah.js&/baz.js' -``` - -One can also use third-party Nginx cache module to cache the merged response generated by the `/merge` location in the previous example. - -This directive was first introduced in the [release v0.17](#v017). - -[Back to TOC](#table-of-contents) - -echo_end --------- -**syntax:** *echo_end* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -This directive is used to terminate the body of looping and conditional control structures like [echo_foreach_split](#echo_foreach_split). - -This directive was first introduced in the [release v0.17](#v017). - -[Back to TOC](#table-of-contents) - -echo_request_body ------------------ -**syntax:** *echo_request_body* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -Outputs the contents of the request body previous read. - -Behind the scene, it's implemented roughly like this: - -```C - - if (r->request_body && r->request_body->bufs) { - return ngx_http_output_filter(r, r->request_body->bufs); - } -``` - -Unlike the [$echo_request_body](#echo_request_body) and $request_body variables, this directive will show the whole request body even if some parts or all parts of it are saved in temporary files on the disk. - -It is a "no-op" if no request body has been read yet. - -This directive was first introduced in the [release v0.18](#v018). - -See also [echo_read_request_body](#echo_read_request_body) and the [chunkin module](http://github.com/agentzh/chunkin-nginx-module). - -[Back to TOC](#table-of-contents) - -echo_exec ---------- -**syntax:** *echo_exec <location> [<query_string>]* - -**syntax:** *echo_exec <named_location>* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *content* - -Does an internal redirect to the location specified. An optional query string can be specified for normal locations, as in - -```nginx - - location /foo { - echo_exec /bar weight=5; - } - location /bar { - echo $arg_weight; - } -``` - -Or equivalently - -```nginx - - location /foo { - echo_exec /bar?weight=5; - } - location /bar { - echo $arg_weight; - } -``` - -Named locations are also supported. Here's an example: - -```nginx - - location /foo { - echo_exec @bar; - } - location @bar { - # you'll get /foo rather than @bar - # due to a potential bug in nginx. - echo $echo_request_uri; - } -``` - -But query string (if any) will always be ignored for named location redirects due to a limitation in the `ngx_http_named_location` function. - -Never try to echo things before the `echo_exec` directive or you won't see the proper response of the location you want to redirect to. Because any echoing will cause the original location handler to send HTTP headers before the redirection happens. - -Technically speaking, this directive exposes the Nginx internal API functions `ngx_http_internal_redirect` and `ngx_http_named_location`. - -This directive was first introduced in the [v0.21 release](#v021). - -[Back to TOC](#table-of-contents) - -echo_status ------------ -**syntax:** *echo_status <status-num>* - -**default:** *echo_status 200* - -**context:** *location, location if* - -**phase:** *content* - -Specify the default response status code. Default to `200`. This directive is declarative and the relative order with other echo-like directives is not important. - -Here is an example, - -```nginx - - location = /bad { - echo_status 404; - echo "Something is missing..."; - } -``` - -then we get a response like this: - - - HTTP/1.1 404 Not Found - Server: nginx/1.2.1 - Date: Sun, 24 Jun 2012 03:58:18 GMT - Content-Type: text/plain - Transfer-Encoding: chunked - Connection: keep-alive - - Something is missing... - - -This directive was first introduced in the `v0.40` release. - -[Back to TOC](#table-of-contents) - -Filter Directives -================= - -Use of the following directives trigger the filter registration of this module. By default, no filter will be registered by this module. - -Every filter directive supports variable interpolation in its arguments (if any). - -[Back to TOC](#table-of-contents) - -echo_before_body ----------------- -**syntax:** *echo_before_body \[options\] \[argument\]...* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *output filter* - -It's the filter version of the [echo](#echo) directive, and prepends its output to the beginning of the original outputs generated by the underlying content handler. - -An example is - -```nginx - - location /echo { - echo_before_body hello; - proxy_pass $scheme://127.0.0.1:$server_port$request_uri/more; - } - location /echo/more { - echo world - } -``` - -Accessing `/echo` from the client side yields - -```bash - - hello - world -``` - -In the previous sample, we borrow the [standard proxy module](http://nginx.org/en/docs/http/ngx_http_proxy_module.html) to serve as the underlying content handler that generates the "main contents". - -Multiple instances of this filter directive are also allowed, as in: - -```nginx - - location /echo { - echo_before_body hello; - echo_before_body world; - echo !; - } -``` - -On the client side, the output is like - -```bash - - $ curl 'http://localhost/echo' - hello - world - ! -``` - -In this example, we also use the [content handler directives](#content-handler-directives) provided by this module as the underlying content handler. - -This directive also supports the `-n` and `--` options like the [echo](#echo) directive. - -This directive can be mixed with its brother directive [echo_after_body](#echo_after_body). - -[Back to TOC](#table-of-contents) - -echo_after_body ---------------- -**syntax:** *echo_after_body \[argument\]...* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *output filter* - -It's very much like the [echo_before_body](#echo_before_body) directive, but *appends* its output to the end of the original outputs generated by the underlying content handler. - -Here's a simple example: - -```nginx - - location /echo { - echo_after_body hello; - proxy_pass http://127.0.0.1:$server_port$request_uri/more; - } - location /echo/more { - echo world - } -``` - -Accessing `/echo` from the client side yields - - - world - hello - - -Multiple instances are allowed, as in: - -```nginx - - location /echo { - echo_after_body hello; - echo_after_body world; - echo i; - echo say; - } -``` - -The output on the client side while accessing the `/echo` location looks like - - - i - say - hello - world - - -This directive also supports the `-n` and `--` options like the [echo](#echo) directive. - -This directive can be mixed with its brother directive [echo_before_body](#echo_before_body). - -[Back to TOC](#table-of-contents) - -Variables -========= - -[Back to TOC](#table-of-contents) - -$echo_it --------- - -This is a "topic variable" used by [echo_foreach_split](#echo_foreach_split), just like the `$_` variable in Perl. - -[Back to TOC](#table-of-contents) - -$echo_timer_elapsed -------------------- - -This variable holds the seconds elapsed since the start of the current request (might be a subrequest though) or the last invocation of the [echo_reset_timer](#echo_reset_timer) command. - -The timing result takes three digits after the decimal point. - -References of this variable will force the underlying Nginx timer to update to the current system time, regardless the timer resolution settings elsewhere in the config file, just like the [echo_reset_timer](#echo_reset_timer) directive. - -[Back to TOC](#table-of-contents) - -$echo_request_body ------------------- - -Evaluates to the current (sub)request's request body previously read if no part of the body has been saved to a temporary file. To always show the request body even if it's very large, use the [echo_request_body](#echo_request_body) directive. - -[Back to TOC](#table-of-contents) - -$echo_request_method --------------------- - -Evaluates to the HTTP request method of the current request (it can be a subrequest). - -Behind the scene, it just takes the string data stored in `r->method_name`. - -Compare it to the [$echo_client_request_method](#echo_client_request_method) variable. - -At least for Nginx 0.8.20 and older, the [$request_method](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_request_method) variable provided by the [http core module](http://nginx.org/en/docs/http/ngx_http_core_module.html) is actually doing what our [$echo_client_request_method](#echo_client_request_method) is doing. - -This variable was first introduced in our [v0.15 release](#v015). - -[Back to TOC](#table-of-contents) - -$echo_client_request_method ---------------------------- - -Always evaluates to the main request's HTTP method even if the current request is a subrequest. - -Behind the scene, it just takes the string data stored in `r->main->method_name`. - -Compare it to the [$echo_request_method](#echo_request_method) variable. - -This variable was first introduced in our [v0.15 release](#v015). - -[Back to TOC](#table-of-contents) - -$echo_client_request_headers ----------------------------- - -Evaluates to the original client request's headers. - -Just as the name suggests, it will always take the main request (or the client request) even if it's currently executed in a subrequest. - -A simple example is below: - -```nginx - - location /echoback { - echo "headers are:" - echo $echo_client_request_headers; - } -``` - -Accessing `/echoback` yields - -```bash - - $ curl 'http://localhost/echoback' - headers are - GET /echoback HTTP/1.1 - User-Agent: curl/7.18.2 (i486-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.8g - Host: localhost:1984 - Accept: */* -``` - -Behind the scene, it recovers `r->main->header_in` (or the large header buffers, if any) on the C level and does not construct the headers itself by traversing parsed results in the request object. - -This varible is always evaluated to an empty value in HTTP/2 requests for now due to the current implementation. - -This variable was first introduced in [version 0.15](#v015). - -[Back to TOC](#table-of-contents) - -$echo_cacheable_request_uri ---------------------------- - -Evaluates to the parsed form of the URI (usually led by `/`) of the current (sub-)request. Unlike the [$echo_request_uri](#echo_request_uri) variable, it is cacheable. - -See [$echo_request_uri](#echo_request_uri) for more details. - -This variable was first introduced in [version 0.17](#v017). - -[Back to TOC](#table-of-contents) - -$echo_request_uri ------------------ - -Evaluates to the parsed form of the URI (usually led by `/`) of the current (sub-)request. Unlike the [$echo_cacheable_request_uri](#echo_cacheable_request_uri) variable, it is *not* cacheable. - -This is quite different from the [$request_uri](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_request_uri) variable exported by the [ngx_http_core_module](http://nginx.org/en/docs/http/ngx_http_core_module.html), because `$request_uri` is the *unparsed* form of the current request's URI. - -This variable was first introduced in [version 0.17](#v017). - -[Back to TOC](#table-of-contents) - -$echo_incr ----------- - -It is a counter that always generate the current counting number, starting from 1. The counter is always associated with the main request even if it is accessed within a subrequest. - -Consider the following example - -```Nginx - - location /main { - echo "main pre: $echo_incr"; - echo_location_async /sub; - echo_location_async /sub; - echo "main post: $echo_incr"; - } - location /sub { - echo "sub: $echo_incr"; - } -``` - -Accessing `/main` yields - - main pre: 1 - sub: 3 - sub: 4 - main post: 2 - -This directive was first introduced in the [v0.18 release](#v018). - -[Back to TOC](#table-of-contents) - -$echo_response_status ---------------------- - -Evaluates to the status code of the current (sub)request, null if not any. - -Behind the scene, it's just the textual representation of `r->headers_out->status`. - -This directive was first introduced in the [v0.23 release](#v023). - -[Back to TOC](#table-of-contents) - -Installation -============ - -You're recommended to install this module (as well as the Nginx core and many other goodies) via the [OpenResty bundle](http://openresty.org). See [the detailed instructions](http://openresty.org/#Installation) for downloading and installing OpenResty into your system. This is the easiest and most safe way to set things up. - -Alternatively, you can install this module manually with the Nginx source: - -Grab the nginx source code from [nginx.org](http://nginx.org/), for example, -the version 1.11.2 (see [nginx compatibility](#compatibility)), and then build the source with this module: - -```bash - - $ wget 'http://nginx.org/download/nginx-1.11.2.tar.gz' - $ tar -xzvf nginx-1.11.2.tar.gz - $ cd nginx-1.11.2/ - - # Here we assume you would install you nginx under /opt/nginx/. - $ ./configure --prefix=/opt/nginx \ - --add-module=/path/to/echo-nginx-module - - $ make -j2 - $ make install -``` - -Download the latest version of the release tarball of this module from [echo-nginx-module file list](https://github.com/openresty/echo-nginx-module/tags). - -Starting from NGINX 1.9.11, you can also compile this module as a dynamic module, by using the `--add-dynamic-module=PATH` option instead of `--add-module=PATH` on the -`./configure` command line above. And then you can explicitly load the module in your `nginx.conf` via the [load_module](http://nginx.org/en/docs/ngx_core_module.html#load_module) -directive, for example, - -```nginx -load_module /path/to/modules/ngx_http_echo_module.so; -``` - -Also, this module is included and enabled by default in the [OpenResty bundle](http://openresty.org). - -[Back to TOC](#table-of-contents) - -Compatibility -============= - -The following versions of Nginx should work with this module: - -* **1.16.x** -* **1.15.x** (last tested: 1.15.8) -* **1.14.x** -* **1.13.x** (last tested: 1.13.6) -* **1.12.x** -* **1.11.x** (last tested: 1.11.2) -* **1.10.x** -* **1.9.x** (last tested: 1.9.15) -* **1.8.x** -* **1.7.x** (last tested: 1.7.10) -* **1.6.x** -* **1.5.x** (last tested: 1.5.12) -* **1.4.x** (last tested: 1.4.4) -* **1.3.x** (last tested: 1.3.7) -* **1.2.x** (last tested: 1.2.9) -* **1.1.x** (last tested: 1.1.5) -* **1.0.x** (last tested: 1.0.11) -* **0.9.x** (last tested: 0.9.4) -* **0.8.x** (last tested: 0.8.54) -* **0.7.x >= 0.7.21** (last tested: 0.7.68) - -In particular, - -* the directive [echo_location_async](#echo_location_async) and its brother [echo_subrequest_async](#echo_subrequest_async) do *not* work with **0.7.x < 0.7.46**. -* the [echo_after_body](#echo_after_body) directive does *not* work at all with nginx **< 0.8.7**. -* the [echo_sleep](#echo_sleep) directive cannot be used after [echo_location](#echo_location) or [echo_subrequest](#echo_subrequest) for nginx **< 0.8.11**. - -Earlier versions of Nginx like 0.6.x and 0.5.x will *not* work at all. - -If you find that any particular version of Nginx above 0.7.21 does not work with this module, please consider [reporting a bug](#report-bugs). - -[Back to TOC](#table-of-contents) - -Modules that use this module for testing -======================================== - -The following modules take advantage of this `echo` module in their test suite: - -* The [memc](http://github.com/openresty/memc-nginx-module) module that supports almost the whole memcached TCP protocol. -* The [chunkin](http://github.com/agentzh/chunkin-nginx-module) module that adds HTTP 1.1 chunked input support to Nginx. -* The [headers_more](http://github.com/openresty/headers-more-nginx-module) module that allows you to add, set, and clear input and output headers under the conditions that you specify. -* The `echo` module itself. - -Please mail me other modules that use `echo` in any form and I'll add them to the list above :) - -[Back to TOC](#table-of-contents) - -Community -========= - -[Back to TOC](#table-of-contents) - -English Mailing List --------------------- - -The [openresty-en](https://groups.google.com/group/openresty-en) mailing list is for English speakers. - -[Back to TOC](#table-of-contents) - -Chinese Mailing List --------------------- - -The [openresty](https://groups.google.com/group/openresty) mailing list is for Chinese speakers. - -[Back to TOC](#table-of-contents) - -Report Bugs -=========== - -Although a lot of effort has been put into testing and code tuning, there must be some serious bugs lurking somewhere in this module. So whenever you are bitten by any quirks, please don't hesitate to - -1. create a ticket on the [issue tracking interface](https://github.com/openresty/echo-nginx-module/issues) provided by GitHub, -1. or send a bug report, questions, or even patches to the [OpenResty Community](#community). - -[Back to TOC](#table-of-contents) - -Source Repository -================= - -Available on github at [openresty/echo-nginx-module](https://github.com/openresty/echo-nginx-module). - -[Back to TOC](#table-of-contents) - -Changes -======= - -The changes of every release of this module can be obtained from the OpenResty bundle's change logs: - - - -[Back to TOC](#table-of-contents) - -Test Suite -========== - -This module comes with a Perl-driven test suite. The [test cases](https://github.com/openresty/echo-nginx-module/tree/master/t/) are -[declarative](https://github.com/openresty/echo-nginx-module/blob/master/t/echo.t) too. Thanks to the [Test::Nginx](http://search.cpan.org/perldoc?Test::Nginx) module in the Perl world. - -To run it on your side: - -```bash - - $ PATH=/path/to/your/nginx-with-echo-module:$PATH prove -r t -``` - -You need to terminate any Nginx processes before running the test suite if you have changed the Nginx server binary. - -Because a single nginx server (by default, `localhost:1984`) is used across all the test scripts (`.t` files), it's meaningless to run the test suite in parallel by specifying `-jN` when invoking the `prove` utility. - -Some parts of the test suite requires standard modules [proxy](http://nginx.org/en/docs/http/ngx_http_proxy_module.html), [rewrite](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html) and [SSI](http://nginx.org/en/docs/http/ngx_http_ssi_module.html) to be enabled as well when building Nginx. - -[Back to TOC](#table-of-contents) - -TODO -==== - -* Fix the [echo_after_body](#echo_after_body) directive in subrequests. -* Add directives *echo_read_client_request_body* and *echo_request_headers*. -* Add new directive *echo_log* to use Nginx's logging facility directly from the config file and specific loglevel can be specified, as in - -```nginx - - echo_log debug "I am being called."; -``` - -* Add support for options `-h` and `-t` to [echo_subrequest_async](#echo_subrequest_async) and [echo_subrequest](#echo_subrequest). For example - -```nginx - - echo_subrequest POST /sub -q 'foo=Foo&bar=Bar' -b 'hello' -t 'text/plan' -h 'X-My-Header: blah blah' -``` - -* Add options to control whether a subrequest should inherit cached variables from its parent request (i.e. the current request that is calling the subrequest in question). Currently none of the subrequests issued by this module inherit the cached variables from the parent request. -* Add new variable *$echo_active_subrequests* to show `r->main->count - 1`. -* Add the *echo_file* and *echo_cached_file* directives. -* Add new varaible *$echo_request_headers* to accompany the existing [$echo_client_request_headers](#echo_client_request_headers) variable. -* Add new directive *echo_foreach*, as in - -```nginx - - echo_foreach 'cat' 'dog' 'mouse'; - echo_location_async "/animals/$echo_it"; - echo_end; -``` - -* Add new directive *echo_foreach_range*, as in - -```nginx - - echo_foreach_range '[1..100]' '[a-zA-z0-9]'; - echo_location_async "/item/$echo_it"; - echo_end; -``` - -* Add new directive *echo_repeat*, as in - -```nginx - - echo_repeat 10 $i { - echo "Page $i"; - echo_location "/path/to/page/$i"; - } -``` - -This is just another way of saying - -```nginx - - echo_foreach_range $i [1..10]; - echo "Page $i"; - echo_location "/path/to/page/$i"; - echo_end; -``` - -Thanks Marcus Clyne for providing this idea. - -* Add new variable $echo_random which always returns a random non-negative integer with the lower/upper limit specified by the new directives `echo_random_min` and `echo_random_max`. For example, - -```nginx - - echo_random_min 10 - echo_random_max 200 - echo "random number: $echo_random"; -``` - -Thanks Marcus Clyne for providing this idea. - -[Back to TOC](#table-of-contents) - -Getting involved -================ - -You'll be very welcomed to submit patches to the [author](#author) or just ask for a commit bit to the [source repository](#source-repository) on GitHub. - -[Back to TOC](#table-of-contents) - -Author -====== - -Yichun "agentzh" Zhang (章亦春) *<agentzh@gmail.com>*, OpenResty Inc. - -This wiki page is also maintained by the author himself, and everybody is encouraged to improve this page as well. - -[Back to TOC](#table-of-contents) - -Copyright & License -=================== - -Copyright (c) 2009-2018, Yichun "agentzh" Zhang (章亦春) , OpenResty Inc. - -This module is licensed under the terms of the BSD license. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright 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 THE COPYRIGHT HOLDERS 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 THE COPYRIGHT -HOLDER 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) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -[Back to TOC](#table-of-contents) - -See Also -======== - -* The original [blog post](http://agentzh.blogspot.com/2009/10/hacking-on-nginx-echo-module.html) about this module's initial development. -* The standard [addition filter module](http://nginx.org/en/docs/http/ngx_http_addition_module.html). -* The standard [proxy module](http://nginx.org/en/docs/http/ngx_http_proxy_module.html). -* The [OpenResty](http://openresty.org) bundle. - -[Back to TOC](#table-of-contents) - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/config b/modules_deb/libnginx-mod-http-echo-0.63/config deleted file mode 100644 index 4bf0f00..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/config +++ /dev/null @@ -1,63 +0,0 @@ -ngx_addon_name=ngx_http_echo_module - -ECHO_SRCS=" \ - $ngx_addon_dir/src/ngx_http_echo_module.c \ - $ngx_addon_dir/src/ngx_http_echo_util.c \ - $ngx_addon_dir/src/ngx_http_echo_timer.c \ - $ngx_addon_dir/src/ngx_http_echo_var.c \ - $ngx_addon_dir/src/ngx_http_echo_handler.c \ - $ngx_addon_dir/src/ngx_http_echo_filter.c \ - $ngx_addon_dir/src/ngx_http_echo_sleep.c \ - $ngx_addon_dir/src/ngx_http_echo_location.c \ - $ngx_addon_dir/src/ngx_http_echo_echo.c \ - $ngx_addon_dir/src/ngx_http_echo_request_info.c \ - $ngx_addon_dir/src/ngx_http_echo_subrequest.c \ - $ngx_addon_dir/src/ngx_http_echo_foreach.c \ - " - -ECHO_DEPS=" \ - $ngx_addon_dir/src/ddebug.h \ - $ngx_addon_dir/src/ngx_http_echo_module.h \ - $ngx_addon_dir/src/ngx_http_echo_handler.h \ - $ngx_addon_dir/src/ngx_http_echo_util.h \ - $ngx_addon_dir/src/ngx_http_echo_sleep.h \ - $ngx_addon_dir/src/ngx_http_echo_filter.h \ - $ngx_addon_dir/src/ngx_http_echo_var.h \ - $ngx_addon_dir/src/ngx_http_echo_location.h \ - $ngx_addon_dir/src/ngx_http_echo_echo.h \ - $ngx_addon_dir/src/ngx_http_echo_request_info.h \ - $ngx_addon_dir/src/ngx_http_echo_subrequest.h \ - $ngx_addon_dir/src/ngx_http_echo_foreach.h \ - " - -# nginx 1.17.0+ unconditionally enables the postpone filter -if [ ! -z "$HTTP_POSTPONE" ]; then - # nginx won't have HTTP_POSTPONE_FILTER_MODULE & HTTP_POSTPONE_FILTER_SRCS - # defined since 1.9.11 - if [ -z "$HTTP_POSTPONE_FILTER_MODULE" ]; then - HTTP_POSTPONE_FILTER_MODULE=ngx_http_postpone_filter_module - HTTP_POSTPONE_FILTER_SRCS=src/http/ngx_http_postpone_filter_module.c - fi - - # This module depends upon the postpone filter being activated - if [ "$HTTP_POSTPONE" != YES ]; then - HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_POSTPONE_FILTER_MODULE" - HTTP_SRCS="$HTTP_SRCS $HTTP_POSTPONE_FILTER_SRCS" - HTTP_POSTPONE=YES - fi -fi - -if [ -n "$ngx_module_link" ]; then - ngx_module_type=HTTP_AUX_FILTER - ngx_module_name=$ngx_addon_name - ngx_module_incs= - ngx_module_deps="$ECHO_DEPS" - ngx_module_srcs="$ECHO_SRCS" - ngx_module_libs= - - . auto/module -else - HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES $ngx_addon_name" - NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ECHO_SRCS" - NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ECHO_DEPS" -fi diff --git a/modules_deb/libnginx-mod-http-echo-0.63/debian/changelog b/modules_deb/libnginx-mod-http-echo-0.63/debian/changelog deleted file mode 100644 index 1e6c923..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/debian/changelog +++ /dev/null @@ -1,53 +0,0 @@ -libnginx-mod-http-echo (1:0.63-7) unstable; urgency=medium - - * d/control: update my email to janmojzis@debian.org - * d/copyright: update my email to janmojzis@debian.org - * d/control: bump Standards-Version: 4.7.2, no changes - * d/copyright: bump debian/* copyright year - * d/watch: use more generic template - - -- Jan Mojžíš Fri, 11 Apr 2025 14:26:58 +0200 - -libnginx-mod-http-echo (1:0.63-6) unstable; urgency=medium - - * d/control: remove Build-Depends nginx-abi-1.24.0-1 - - -- Jan Mojžíš Sat, 07 Oct 2023 15:31:26 +0200 - -libnginx-mod-http-echo (1:0.63-5) unstable; urgency=medium - - * NEW ABI: rebuild with nginx-abi-1.24.0-1 - - -- Jan Mojžíš Tue, 27 Jun 2023 23:16:36 +0200 - -libnginx-mod-http-echo (1:0.63-4) unstable; urgency=medium - - * d/t/generic rework. The test now checks module after - installation/reload/restart. - * d/control: bump Standards-Version: 4.6.2, no changes - * d/gbb.conf: added - * d/copyright: bump my copyright year - * d/copyright: reformat text to be compatible with 'cme update dpkg-copyright' - * d/fix.scanned.copyright: added, fixes upstream author name parsing - * NEW ABI: rebuild with nginx-abi-1.22.1-7 - - -- Jan Mojžíš Mon, 13 Feb 2023 15:03:42 +0100 - -libnginx-mod-http-echo (1:0.63-3) unstable; urgency=medium - - * No source change upload to unstable. - - -- Jan Mojžíš Fri, 09 Dec 2022 14:36:45 +0100 - -libnginx-mod-http-echo (1:0.63-2) experimental; urgency=medium - - * d/control: added Multi-Arch: foreign - * d/copyright: update, add Igor Sysoev - - -- Jan Mojžíš Mon, 05 Dec 2022 21:14:02 +0100 - -libnginx-mod-http-echo (1:0.63-1) experimental; urgency=medium - - * Initial release. (Closes: 1024153) - - -- Jan Mojžíš Wed, 30 Nov 2022 14:46:48 +0100 diff --git a/modules_deb/libnginx-mod-http-echo-0.63/debian/control b/modules_deb/libnginx-mod-http-echo-0.63/debian/control deleted file mode 100644 index e7cfde3..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/debian/control +++ /dev/null @@ -1,36 +0,0 @@ -Source: libnginx-mod-http-echo -Section: httpd -Priority: optional -Maintainer: Debian Nginx Maintainers -Uploaders: Jan Mojžíš , -Build-Depends: debhelper-compat (= 13), - dh-sequence-nginx, -Standards-Version: 4.7.2 -Homepage: https://github.com/agentzh/echo-nginx-module -Vcs-Git: https://salsa.debian.org/nginx-team/libnginx-mod-http-echo.git -Vcs-Browser: https://salsa.debian.org/nginx-team/libnginx-mod-http-echo -Rules-Requires-Root: no - -Package: libnginx-mod-http-echo -Architecture: any -Multi-Arch: foreign -Depends: ${misc:Depends}, - ${shlibs:Depends}, -Recommends: nginx, -Description: Bring echo and more shell style goodies to Nginx - Echo module wraps lots of Nginx internal APIs for streaming input and output, - parallel/sequential subrequests, timers and sleeping, as well as various meta - data accessing. - . - Basically it provides various utilities that help testing and debugging of - other modules by trivially emulating different kinds of faked subrequest - locations. - . - People will also find it useful in real-world applications that need to: - . - 1. Serve static contents directly from memory. - 2. Wrap the upstream response with custom header and footer (kinda like the - addition module but with contents read directly from the config file and - Nginx variables). - 3. Merge contents of various "Nginx locations" (i.e., subrequests) together in - a single main request (using echo_location and its friends). diff --git a/modules_deb/libnginx-mod-http-echo-0.63/debian/copyright b/modules_deb/libnginx-mod-http-echo-0.63/debian/copyright deleted file mode 100644 index 061d047..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/debian/copyright +++ /dev/null @@ -1,71 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: echo-nginx-module -Upstream-Contact: Yichun "agentzh" Zhang -Source: https://github.com/agentzh/echo-nginx-module - -Files: * -Copyright: 2009-2018, Yichun "agentzh" Zhang (章亦春) , OpenResty Inc. - 2009-2014, Yichun "agentzh" Zhang . -License: BSD-2-clause - -Files: README.markdown -Copyright: 2009-2018, Yichun "agentzh" Zhang (章亦春) , OpenResty Inc. -License: BSD-2-clause - -Files: config -Copyright: 2009-2018, Yichun "agentzh" Zhang . -License: BSD-2-clause - -Files: debian/* -Copyright: 2022, Miao Wang - 2022-2025, Jan Mojzis -License: BSD-2-clause - -Files: src/* -Copyright: 2009-2018, Yichun "agentzh" Zhang . -License: BSD-2-clause - -Files: src/ngx_http_echo_handler.c - src/ngx_http_echo_module.c - src/ngx_http_echo_module.h - src/ngx_http_echo_request_info.c - src/ngx_http_echo_sleep.c - src/ngx_http_echo_subrequest.c - src/ngx_http_echo_util.c - src/ngx_http_echo_util.h -Copyright: Yichun Zhang (agentzh) -License: BSD-2-clause - -Files: t/* -Copyright: 2009-2018, Yichun "agentzh" Zhang . -License: BSD-2-clause - -Files: util/* -Copyright: 2009-2018, Yichun "agentzh" Zhang . -License: BSD-2-clause - -License: BSD-2-clause - All rights reserved. - . - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - . - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - . - * Redistributions in binary form must reproduce the above copyright - 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 THE COPYRIGHT HOLDERS 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 THE COPYRIGHT - HOLDER 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) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/modules_deb/libnginx-mod-http-echo-0.63/debian/fix.scanned.copyright b/modules_deb/libnginx-mod-http-echo-0.63/debian/fix.scanned.copyright deleted file mode 100644 index b25e244..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/debian/fix.scanned.copyright +++ /dev/null @@ -1,2 +0,0 @@ -# fixes upstream author name parsing -! copyright Files:~/.*/ Copyright=~"s/(Zhang)\s\(.*x\{6625\}\)/$1\ (章亦春)/" diff --git a/modules_deb/libnginx-mod-http-echo-0.63/debian/gbp.conf b/modules_deb/libnginx-mod-http-echo-0.63/debian/gbp.conf deleted file mode 100644 index d9f01a6..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/debian/gbp.conf +++ /dev/null @@ -1,9 +0,0 @@ -[DEFAULT] -debian-branch = main -upstream-branch = upstream -upstream-tag = upstream/%(version)s -pristine-tar = False -sign-tags = True - -[import-orig] -merge-mode = replace diff --git a/modules_deb/libnginx-mod-http-echo-0.63/debian/rules b/modules_deb/libnginx-mod-http-echo-0.63/debian/rules deleted file mode 100755 index d8309f6..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/debian/rules +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/make -f - -export DEB_BUILD_MAINT_OPTIONS = hardening=+all - -%: - dh $@ diff --git a/modules_deb/libnginx-mod-http-echo-0.63/debian/source/format b/modules_deb/libnginx-mod-http-echo-0.63/debian/source/format deleted file mode 100644 index 163aaf8..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/modules_deb/libnginx-mod-http-echo-0.63/debian/tests/control b/modules_deb/libnginx-mod-http-echo-0.63/debian/tests/control deleted file mode 100644 index b95c6ff..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/debian/tests/control +++ /dev/null @@ -1,13 +0,0 @@ -Tests: generic -Restrictions: allow-stderr isolation-container needs-root -Depends: curl, - nginx, - nginx-core, - @, - -Tests: helloworld -Restrictions: allow-stderr isolation-container needs-root -Depends: curl, - nginx, - nginx-core, - @, diff --git a/modules_deb/libnginx-mod-http-echo-0.63/debian/tests/generic b/modules_deb/libnginx-mod-http-echo-0.63/debian/tests/generic deleted file mode 100644 index a14fc80..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/debian/tests/generic +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -# version 20221215 - -# generic test that only verifies that nginx is running with the given -# libnginx-... module -# - after installation -# - after nginx reload -# - after nginx restart - -EX=0 -CURL_CMD="curl --max-time 60 --silent --fail -o /dev/null" - -#change directory to $AUTOPKGTEST_TMP -cd "${AUTOPKGTEST_TMP}" - -echo -n "curl after installation: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx reload ... " -if invoke-rc.d nginx reload; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - - -echo -n "curl after reload: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx restart ... " -if invoke-rc.d nginx restart; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - -echo -n "curl after restart: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -if [ ${EX} -ne 0 ]; then - echo "=== journalctl ===" - journalctl -n all -xu nginx.service || : - - echo "=== error.log ===" - if [ `wc -l /var/log/nginx/error.log | cut -d ' ' -f1` -gt 100 ]; then - head -n 50 /var/log/nginx/error.log - echo '...' - tail -n 50 /var/log/nginx/error.log - else - cat /var/log/nginx/error.log - fi -fi - -exit ${EX} diff --git a/modules_deb/libnginx-mod-http-echo-0.63/debian/tests/helloworld b/modules_deb/libnginx-mod-http-echo-0.63/debian/tests/helloworld deleted file mode 100644 index c66b2dc..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/debian/tests/helloworld +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -set -e - -cat < "/etc/nginx/sites-enabled/default" -server { - listen 80 default_server; - - location /helloworld { - echo "hello world"; - } -} -EOF - -exp="hello world -response_code: 200" - -nginx -t -invoke-rc.d nginx restart || { journalctl -n all -xu nginx.service; exit 1; } - -out=`curl --fail -w "response_code: %{http_code}\n" http://127.0.0.1/helloworld` - -if [ x"${out}" != x"${exp}" ]; then - echo "output:" - echo "=====================" - echo "${out}" - echo "=====================" - echo "expected output:" - echo "=====================" - echo "${exp}" - echo "=====================" - exit 1 -fi diff --git a/modules_deb/libnginx-mod-http-echo-0.63/debian/upstream/metadata b/modules_deb/libnginx-mod-http-echo-0.63/debian/upstream/metadata deleted file mode 100644 index 81ba6ec..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/debian/upstream/metadata +++ /dev/null @@ -1,4 +0,0 @@ ---- -Bug-Database: https://github.com/agentzh/echo-nginx-module/issues -Bug-Submit: https://github.com/agentzh/echo-nginx-module/issues/new -Repository-Browse: https://github.com/agentzh/echo-nginx-module \ No newline at end of file diff --git a/modules_deb/libnginx-mod-http-echo-0.63/debian/watch b/modules_deb/libnginx-mod-http-echo-0.63/debian/watch deleted file mode 100644 index 55febdb..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/debian/watch +++ /dev/null @@ -1,6 +0,0 @@ -version=4 -opts="\ -uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha|a|b)\d*)$/$1~$2/,\ -" \ -https://github.com/agentzh/echo-nginx-module/tags \ -(?:.*?/)?v?@ANY_VERSION@@ARCHIVE_EXT@ diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ddebug.h b/modules_deb/libnginx-mod-http-echo-0.63/src/ddebug.h deleted file mode 100644 index a92d7a7..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ddebug.h +++ /dev/null @@ -1,114 +0,0 @@ -#ifndef DDEBUG_H -#define DDEBUG_H - -#include -#include -#include - -#if defined(DDEBUG) && (DDEBUG) - -# if (NGX_HAVE_VARIADIC_MACROS) - -# define dd(...) fprintf(stderr, "echo *** %s: ", __func__); \ - fprintf(stderr, __VA_ARGS__); \ - fprintf(stderr, " at %s line %d.\n", __FILE__, __LINE__) - -# else - -#include -#include - -#include - -static ngx_inline void -dd(const char * fmt, ...) { -} - -# endif - -# if DDEBUG > 1 - -# define dd_enter() dd_enter_helper(r, __func__) - -static ngx_inline void -dd_enter_helper(ngx_http_request_t *r, const char *func) { - ngx_http_posted_request_t *pr; - - fprintf(stderr, ">enter %s %.*s %.*s?%.*s c:%d m:%p r:%p ar:%p pr:%p", - func, - (int) r->method_name.len, r->method_name.data, - (int) r->uri.len, r->uri.data, - (int) r->args.len, r->args.data, - 0/*(int) r->main->count*/, r->main, - r, r->connection->data, r->parent); - - if (r->posted_requests) { - fprintf(stderr, " posted:"); - - for (pr = r->posted_requests; pr; pr = pr->next) { - fprintf(stderr, "%p,", pr); - } - } - - fprintf(stderr, "\n"); -} - -# else - -# define dd_enter() - -# endif - -#else - -# if (NGX_HAVE_VARIADIC_MACROS) - -# define dd(...) - -# define dd_enter() - -# else - -#include - -static ngx_inline void -dd(const char * fmt, ...) { -} - -static ngx_inline void -dd_enter() { -} - -# endif - -#endif - -#if defined(DDEBUG) && (DDEBUG) - -#define dd_check_read_event_handler(r) \ - dd("r->read_event_handler = %s", \ - r->read_event_handler == ngx_http_block_reading ? \ - "ngx_http_block_reading" : \ - r->read_event_handler == ngx_http_test_reading ? \ - "ngx_http_test_reading" : \ - r->read_event_handler == ngx_http_request_empty_handler ? \ - "ngx_http_request_empty_handler" : "UNKNOWN") - -#define dd_check_write_event_handler(r) \ - dd("r->write_event_handler = %s", \ - r->write_event_handler == ngx_http_handler ? \ - "ngx_http_handler" : \ - r->write_event_handler == ngx_http_core_run_phases ? \ - "ngx_http_core_run_phases" : \ - r->write_event_handler == ngx_http_request_empty_handler ? \ - "ngx_http_request_empty_handler" : "UNKNOWN") - -#else - -#define dd_check_read_event_handler(r) -#define dd_check_write_event_handler(r) - -#endif - -#endif /* DDEBUG_H */ - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_echo.c b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_echo.c deleted file mode 100644 index f5789f5..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_echo.c +++ /dev/null @@ -1,342 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include "ngx_http_echo_echo.h" -#include "ngx_http_echo_util.h" -#include "ngx_http_echo_filter.h" - -#include - -static ngx_buf_t ngx_http_echo_space_buf; - -static ngx_buf_t ngx_http_echo_newline_buf; - - -ngx_int_t -ngx_http_echo_echo_init(ngx_conf_t *cf) -{ - static u_char space_str[] = " "; - static u_char newline_str[] = "\n"; - - dd("global init..."); - - ngx_memzero(&ngx_http_echo_space_buf, sizeof(ngx_buf_t)); - - ngx_http_echo_space_buf.memory = 1; - - ngx_http_echo_space_buf.start = - ngx_http_echo_space_buf.pos = - space_str; - - ngx_http_echo_space_buf.end = - ngx_http_echo_space_buf.last = - space_str + sizeof(space_str) - 1; - - ngx_memzero(&ngx_http_echo_newline_buf, sizeof(ngx_buf_t)); - - ngx_http_echo_newline_buf.memory = 1; - - ngx_http_echo_newline_buf.start = - ngx_http_echo_newline_buf.pos = - newline_str; - - ngx_http_echo_newline_buf.end = - ngx_http_echo_newline_buf.last = - newline_str + sizeof(newline_str) - 1; - - return NGX_OK; -} - - -ngx_int_t -ngx_http_echo_exec_echo_sync(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx) -{ - ngx_buf_t *buf; - ngx_chain_t *cl = NULL; /* the head of the chain link */ - - buf = ngx_calloc_buf(r->pool); - if (buf == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - buf->sync = 1; - - cl = ngx_alloc_chain_link(r->pool); - if (cl == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - cl->buf = buf; - cl->next = NULL; - - return ngx_http_echo_send_chain_link(r, ctx, cl); -} - - -ngx_int_t -ngx_http_echo_exec_echo(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args, - ngx_flag_t in_filter, ngx_array_t *opts) -{ - ngx_uint_t i; - - ngx_buf_t *space_buf; - ngx_buf_t *newline_buf; - ngx_buf_t *buf; - - ngx_str_t *computed_arg; - ngx_str_t *computed_arg_elts; - ngx_str_t *opt; - - ngx_chain_t *cl = NULL; /* the head of the chain link */ - ngx_chain_t **ll = &cl; /* always point to the address of the last link */ - - dd_enter(); - - if (computed_args == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - computed_arg_elts = computed_args->elts; - for (i = 0; i < computed_args->nelts; i++) { - computed_arg = &computed_arg_elts[i]; - - if (computed_arg->len == 0) { - buf = NULL; - - } else { - buf = ngx_calloc_buf(r->pool); - if (buf == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - buf->start = buf->pos = computed_arg->data; - buf->last = buf->end = computed_arg->data + - computed_arg->len; - - buf->memory = 1; - } - - if (cl == NULL) { - cl = ngx_alloc_chain_link(r->pool); - if (cl == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - cl->buf = buf; - cl->next = NULL; - ll = &cl->next; - - } else { - /* append a space first */ - *ll = ngx_alloc_chain_link(r->pool); - - if (*ll == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - space_buf = ngx_calloc_buf(r->pool); - - if (space_buf == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - /* nginx clears buf flags at the end of each request handling, - * so we have to make a clone here. */ - *space_buf = ngx_http_echo_space_buf; - - (*ll)->buf = space_buf; - (*ll)->next = NULL; - - ll = &(*ll)->next; - - /* then append the buf only if it's non-empty */ - if (buf) { - *ll = ngx_alloc_chain_link(r->pool); - if (*ll == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - (*ll)->buf = buf; - (*ll)->next = NULL; - - ll = &(*ll)->next; - } - } - } /* end for */ - - if (cl && cl->buf == NULL) { - cl = cl->next; - } - - if (opts && opts->nelts > 0) { - opt = opts->elts; - /* FIXME handle other unrecognized options here */ - if (opt[0].len == 1 && opt[0].data[0] == 'n') { - goto done; - } - } - - /* append the newline character */ - - newline_buf = ngx_calloc_buf(r->pool); - - if (newline_buf == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - *newline_buf = ngx_http_echo_newline_buf; - - if (cl == NULL) { - cl = ngx_alloc_chain_link(r->pool); - - if (cl == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - cl->buf = newline_buf; - cl->next = NULL; - /* ll = &cl->next; */ - - } else { - *ll = ngx_alloc_chain_link(r->pool); - - if (*ll == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - (*ll)->buf = newline_buf; - (*ll)->next = NULL; - /* ll = &(*ll)->next; */ - } - -done: - - if (cl == NULL || cl->buf == NULL) { - return NGX_OK; - } - - if (in_filter) { - return ngx_http_echo_next_body_filter(r, cl); - } - - return ngx_http_echo_send_chain_link(r, ctx, cl); -} - - -ngx_int_t -ngx_http_echo_exec_echo_flush(ngx_http_request_t *r, ngx_http_echo_ctx_t *ctx) -{ - return ngx_http_send_special(r, NGX_HTTP_FLUSH); -} - - -ngx_int_t -ngx_http_echo_exec_echo_request_body(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx) -{ - ngx_buf_t *b; - ngx_chain_t *out, *cl, **ll; - - if (r->request_body == NULL || r->request_body->bufs == NULL) { - return NGX_OK; - } - - out = NULL; - ll = &out; - - for (cl = r->request_body->bufs; cl; cl = cl->next) { - if (ngx_buf_special(cl->buf)) { - /* we do not want to create zero-size bufs */ - continue; - } - - *ll = ngx_alloc_chain_link(r->pool); - if (*ll == NULL) { - return NGX_ERROR; - } - - b = ngx_alloc_buf(r->pool); - if (b == NULL) { - return NGX_ERROR; - } - - (*ll)->buf = b; - (*ll)->next = NULL; - - ngx_memcpy(b, cl->buf, sizeof(ngx_buf_t)); - b->tag = (ngx_buf_tag_t) &ngx_http_echo_exec_echo_request_body; - b->last_buf = 0; - b->last_in_chain = 0; - - ll = &(*ll)->next; - } - - if (out == NULL) { - return NGX_OK; - } - - return ngx_http_echo_send_chain_link(r, ctx, out); -} - - -ngx_int_t -ngx_http_echo_exec_echo_duplicate(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args) -{ - ngx_str_t *computed_arg; - ngx_str_t *computed_arg_elts; - ssize_t i, count; - ngx_str_t *str; - u_char *p; - ngx_int_t rc; - ngx_buf_t *buf; - ngx_chain_t *cl; - - dd_enter(); - - computed_arg_elts = computed_args->elts; - - computed_arg = &computed_arg_elts[0]; - - count = ngx_http_echo_atosz(computed_arg->data, computed_arg->len); - - if (count == NGX_ERROR) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "invalid size specified: \"%V\"", computed_arg); - - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - str = &computed_arg_elts[1]; - - if (count == 0 || str->len == 0) { - rc = ngx_http_echo_send_header_if_needed(r, ctx); - if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) { - return rc; - } - - return NGX_OK; - } - - buf = ngx_create_temp_buf(r->pool, count * str->len); - if (buf == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - p = buf->pos; - for (i = 0; i < count; i++) { - p = ngx_copy(p, str->data, str->len); - } - buf->last = p; - - cl = ngx_alloc_chain_link(r->pool); - if (cl == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - cl->next = NULL; - cl->buf = buf; - - return ngx_http_echo_send_chain_link(r, ctx, cl); -} diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_echo.h b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_echo.h deleted file mode 100644 index 896f1ed..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_echo.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef ECHO_ECHO_H -#define ECHO_ECHO_H - -#include "ngx_http_echo_module.h" - -ngx_int_t ngx_http_echo_echo_init(ngx_conf_t *cf); - -ngx_int_t ngx_http_echo_exec_echo_sync(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx); - -ngx_int_t ngx_http_echo_exec_echo(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args, - ngx_flag_t in_filter, ngx_array_t *opts); - -ngx_int_t ngx_http_echo_exec_echo_request_body(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx); - -ngx_int_t ngx_http_echo_exec_echo_flush(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx); - -ngx_int_t ngx_http_echo_exec_echo_duplicate(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args); - -#endif /* ECHO_ECHO_H */ - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_filter.c b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_filter.c deleted file mode 100644 index 689b52e..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_filter.c +++ /dev/null @@ -1,282 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include "ngx_http_echo_filter.h" -#include "ngx_http_echo_util.h" -#include "ngx_http_echo_echo.h" - -#include - - - -ngx_http_output_header_filter_pt ngx_http_echo_next_header_filter; - -ngx_http_output_body_filter_pt ngx_http_echo_next_body_filter; - -static ngx_int_t ngx_http_echo_header_filter(ngx_http_request_t *r); - -static ngx_int_t ngx_http_echo_body_filter(ngx_http_request_t *r, - ngx_chain_t *in); - -/* filter handlers */ -static ngx_int_t ngx_http_echo_exec_filter_cmds(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *cmds, ngx_uint_t *iterator); - - -static volatile ngx_cycle_t *ngx_http_echo_prev_cycle = NULL; - - -ngx_int_t -ngx_http_echo_filter_init(ngx_conf_t *cf) -{ - int multi_http_blocks; - ngx_http_echo_main_conf_t *emcf; - - emcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_echo_module); - - if (ngx_http_echo_prev_cycle != ngx_cycle) { - ngx_http_echo_prev_cycle = ngx_cycle; - multi_http_blocks = 0; - - } else { - multi_http_blocks = 1; - } - - if (multi_http_blocks || emcf->requires_filter) { - dd("top header filter: %ld", - (unsigned long) ngx_http_top_header_filter); - - ngx_http_echo_next_header_filter = ngx_http_top_header_filter; - ngx_http_top_header_filter = ngx_http_echo_header_filter; - - dd("top body filter: %ld", (unsigned long) ngx_http_top_body_filter); - - ngx_http_echo_next_body_filter = ngx_http_top_body_filter; - ngx_http_top_body_filter = ngx_http_echo_body_filter; - } - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_echo_header_filter(ngx_http_request_t *r) -{ - ngx_http_echo_loc_conf_t *conf; - ngx_http_echo_ctx_t *ctx; - - ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "echo header filter, uri \"%V?%V\"", &r->uri, &r->args); - - ctx = ngx_http_get_module_ctx(r, ngx_http_echo_module); - - /* XXX we should add option to insert contents for responses - * of non-200 status code here... */ - /* - if (r->headers_out.status != NGX_HTTP_OK) { - if (ctx != NULL) { - ctx->skip_filter = 1; - } - return ngx_http_echo_next_header_filter(r); - } - */ - - conf = ngx_http_get_module_loc_conf(r, ngx_http_echo_module); - if (conf->before_body_cmds == NULL && conf->after_body_cmds == NULL) { - if (ctx != NULL) { - ctx->skip_filter = 1; - } - return ngx_http_echo_next_header_filter(r); - } - - if (ctx == NULL) { - ctx = ngx_http_echo_create_ctx(r); - if (ctx == NULL) { - return NGX_ERROR; - } - - ngx_http_set_ctx(r, ctx, ngx_http_echo_module); - } - - /* enable streaming here (use chunked encoding) */ - ngx_http_clear_content_length(r); - ngx_http_clear_accept_ranges(r); - - return ngx_http_echo_next_header_filter(r); -} - - -static ngx_int_t -ngx_http_echo_body_filter(ngx_http_request_t *r, ngx_chain_t *in) -{ - ngx_http_echo_ctx_t *ctx; - ngx_int_t rc; - ngx_http_echo_loc_conf_t *conf; - unsigned last; - ngx_chain_t *cl; - ngx_buf_t *b; - - ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "echo body filter, uri \"%V?%V\"", &r->uri, &r->args); - - if (in == NULL || r->header_only) { - return ngx_http_echo_next_body_filter(r, in); - } - - ctx = ngx_http_get_module_ctx(r, ngx_http_echo_module); - - if (ctx == NULL || ctx->skip_filter) { - return ngx_http_echo_next_body_filter(r, in); - } - - conf = ngx_http_get_module_loc_conf(r, ngx_http_echo_module); - - if (!ctx->before_body_sent) { - ctx->before_body_sent = 1; - - if (conf->before_body_cmds != NULL) { - rc = ngx_http_echo_exec_filter_cmds(r, ctx, conf->before_body_cmds, - &ctx->next_before_body_cmd); - if (rc != NGX_OK) { - return NGX_ERROR; - } - } - } - - if (conf->after_body_cmds == NULL) { - ctx->skip_filter = 1; - return ngx_http_echo_next_body_filter(r, in); - } - - last = 0; - - for (cl = in; cl; cl = cl->next) { - dd("cl %p, special %d", cl, ngx_buf_special(cl->buf)); - - if (cl->buf->last_buf || cl->buf->last_in_chain) { - cl->buf->last_buf = 0; - cl->buf->last_in_chain = 0; - cl->buf->sync = 1; - last = 1; - } - } - - dd("in %p, last %d", in, (int) last); - - if (in) { - rc = ngx_http_echo_next_body_filter(r, in); - -#if 0 - if (rc == NGX_AGAIN) { - return NGX_ERROR; - } -#endif - - dd("next filter returns %d, last %d", (int) rc, (int) last); - - if (rc == NGX_ERROR || rc > NGX_OK || !last) { - return rc; - } - } - - dd("exec filter cmds for after body cmds"); - - rc = ngx_http_echo_exec_filter_cmds(r, ctx, conf->after_body_cmds, - &ctx->next_after_body_cmd); - if (rc == NGX_ERROR || rc > NGX_OK) { - dd("FAILED: exec filter cmds for after body cmds"); - return NGX_ERROR; - } - - ctx->skip_filter = 1; - - dd("after body cmds executed...terminating..."); - - /* XXX we can NOT use - * ngx_http_send_special(r, NGX_HTTP_LAST) here - * because we should bypass the upstream filters. */ - - b = ngx_calloc_buf(r->pool); - if (b == NULL) { - return NGX_ERROR; - } - - if (r == r->main && !r->post_action) { - b->last_buf = 1; - - } else { - b->sync = 1; - b->last_in_chain = 1; - } - - cl = ngx_alloc_chain_link(r->pool); - if (cl == NULL) { - return NGX_ERROR; - } - - cl->next = NULL; - cl->buf = b; - - return ngx_http_echo_next_body_filter(r, cl); -} - - -static ngx_int_t -ngx_http_echo_exec_filter_cmds(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *cmds, ngx_uint_t *iterator) -{ - ngx_int_t rc; - ngx_array_t *opts = NULL; - ngx_array_t *computed_args = NULL; - ngx_http_echo_cmd_t *cmd; - ngx_http_echo_cmd_t *cmd_elts; - - for (cmd_elts = cmds->elts; *iterator < cmds->nelts; (*iterator)++) { - cmd = &cmd_elts[*iterator]; - - /* evaluate arguments for the current cmd (if any) */ - if (cmd->args) { - computed_args = ngx_array_create(r->pool, cmd->args->nelts, - sizeof(ngx_str_t)); - if (computed_args == NULL) { - return NGX_ERROR; - } - - opts = ngx_array_create(r->pool, 1, sizeof(ngx_str_t)); - if (opts == NULL) { - return NGX_ERROR; - } - - rc = ngx_http_echo_eval_cmd_args(r, cmd, computed_args, opts); - - if (rc != NGX_OK) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "Failed to evaluate arguments for " - "the directive."); - return rc; - } - } - - /* do command dispatch based on the opcode */ - switch (cmd->opcode) { - case echo_opcode_echo_before_body: - case echo_opcode_echo_after_body: - dd("exec echo_before_body or echo_after_body..."); - - rc = ngx_http_echo_exec_echo(r, ctx, computed_args, - 1 /* in filter */, opts); - - if (rc == NGX_ERROR || rc > NGX_OK) { - return rc; - } - - break; - default: - break; - } - } - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_filter.h b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_filter.h deleted file mode 100644 index ea5115d..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_filter.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef ECHO_FILTER_H -#define ECHO_FILTER_H - -#include "ngx_http_echo_module.h" - - -extern ngx_http_output_header_filter_pt ngx_http_echo_next_header_filter; - -extern ngx_http_output_body_filter_pt ngx_http_echo_next_body_filter; - - -ngx_int_t ngx_http_echo_filter_init (ngx_conf_t *cf); - -#endif /* ECHO_FILTER_H */ - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_foreach.c b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_foreach.c deleted file mode 100644 index a4a2b54..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_foreach.c +++ /dev/null @@ -1,183 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include "ngx_http_echo_foreach.h" -#include "ngx_http_echo_util.h" - -#include - - -ngx_int_t -ngx_http_echo_it_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data) -{ - ngx_http_echo_ctx_t *ctx; - ngx_uint_t i; - ngx_array_t *choices; - ngx_str_t *choice_elts, *choice; - - ctx = ngx_http_get_module_ctx(r, ngx_http_echo_module); - - if (ctx && ctx->foreach != NULL) { - - choices = ctx->foreach->choices; - i = ctx->foreach->next_choice; - - if (i < choices->nelts) { - choice_elts = choices->elts; - choice = &choice_elts[i]; - - v->len = choice->len; - v->data = choice->data; - v->valid = 1; - v->no_cacheable = 1; - v->not_found = 0; - - return NGX_OK; - } - } - - v->not_found = 1; - - return NGX_OK; -} - - -ngx_int_t -ngx_http_echo_exec_echo_foreach_split(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args) -{ - ngx_http_echo_loc_conf_t *elcf; - ngx_str_t *delimiter, *compound; - u_char *pos, *last, *end; - ngx_str_t *choice; - ngx_str_t *computed_arg_elts; - ngx_array_t *cmds; - ngx_http_echo_cmd_t *cmd; - ngx_http_echo_cmd_t *cmd_elts; - - if (ctx->foreach != NULL) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "Nested echo_foreach not supported yet."); - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - if (computed_args->nelts < 2) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "echo_foreach should take at least two arguments. " - "(if your delimiter starts with \"-\", preceding it " - "with a \"--\".)"); - - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - computed_arg_elts = computed_args->elts; - - compound = &computed_arg_elts[1]; - - dd("HEY coumpound len: %u", (int) compound->len); - - ctx->foreach = ngx_palloc(r->pool, sizeof(ngx_http_echo_foreach_ctx_t)); - - if (ctx->foreach == NULL) { - return NGX_ERROR; - } - - ctx->foreach->cmd_index = ctx->next_handler_cmd; - - ctx->foreach->next_choice = 0; - - ctx->foreach->choices = ngx_array_create(r->pool, 10, sizeof(ngx_str_t)); - if (ctx->foreach->choices == NULL) { - return NGX_ERROR; - } - - delimiter = &computed_arg_elts[0]; - - pos = compound->data; - end = compound->data + compound->len; - - while ((last = ngx_http_echo_strlstrn(pos, end, delimiter->data, - delimiter->len - 1)) != NULL) - { - dd("entered the loop"); - - if (last == pos) { - dd("!!! len == 0"); - pos = last + delimiter->len; - continue; - } - - choice = ngx_array_push(ctx->foreach->choices); - if (choice == NULL) { - return NGX_ERROR; - } - - choice->data = pos; - choice->len = last - pos; - pos = last + delimiter->len; - } - - if (pos < end) { - choice = ngx_array_push(ctx->foreach->choices); - if (choice == NULL) { - return NGX_ERROR; - } - - choice->data = pos; - choice->len = end - pos; - } - - if (ctx->foreach->choices->nelts == 0) { - /* skip the foreach body entirely */ - elcf = ngx_http_get_module_loc_conf(r, ngx_http_echo_module); - cmds = elcf->handler_cmds; - cmd_elts = cmds->elts; - for (/* void */; ctx->next_handler_cmd < cmds->nelts; - ctx->next_handler_cmd++) - { - cmd = &cmd_elts[ctx->next_handler_cmd + 1]; - if (cmd->opcode == echo_opcode_echo_end) { - return NGX_OK; - } - } - - } - - return NGX_OK; -} - - -ngx_int_t -ngx_http_echo_exec_echo_end(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx) -{ - if (ctx->foreach == NULL) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "Found a echo_end that has no corresponding echo_foreach " - "before it."); - return NGX_ERROR; - } - - ctx->foreach->next_choice++; - - if (ctx->foreach->next_choice >= ctx->foreach->choices->nelts) { - /* TODO We need to explicitly free the foreach ctx from - * the pool */ - ctx->foreach = NULL; - - return NGX_OK; - } - - dd("echo_end: ++ next_choice (total: %u): %u", - (unsigned) ctx->foreach->choices->nelts, - (unsigned) ctx->foreach->next_choice); - - /* the main handler dispatcher loop will increment - * ctx->next_handler_cmd for us anyway. */ - ctx->next_handler_cmd = ctx->foreach->cmd_index; - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_foreach.h b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_foreach.h deleted file mode 100644 index 49592f4..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_foreach.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef ECHO_FOREACH_H -#define ECHO_FOREACH_H - -#include "ngx_http_echo_module.h" - -ngx_int_t ngx_http_echo_exec_echo_foreach_split(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args); - -ngx_int_t ngx_http_echo_exec_echo_end(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx); - -ngx_int_t ngx_http_echo_it_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data); - -#endif /* ECHO_FOREACH_H */ - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_handler.c b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_handler.c deleted file mode 100644 index 120c8b0..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_handler.c +++ /dev/null @@ -1,433 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include "ngx_http_echo_filter.h" -#include "ngx_http_echo_handler.h" -#include "ngx_http_echo_echo.h" -#include "ngx_http_echo_util.h" -#include "ngx_http_echo_sleep.h" -#include "ngx_http_echo_var.h" -#include "ngx_http_echo_timer.h" -#include "ngx_http_echo_location.h" -#include "ngx_http_echo_subrequest.h" -#include "ngx_http_echo_request_info.h" -#include "ngx_http_echo_foreach.h" - -#include -#include - - -void -ngx_http_echo_wev_handler(ngx_http_request_t *r) -{ - ngx_int_t rc; - ngx_http_echo_ctx_t *ctx; - - dd("wev handler"); - - ctx = ngx_http_get_module_ctx(r, ngx_http_echo_module); - - if (ctx == NULL) { - ngx_http_finalize_request(r, NGX_ERROR); - return; - } - - dd("waiting: %d, done: %d", (int) ctx->waiting, (int) ctx->done); - - if (ctx->waiting && ! ctx->done) { - - if (r == r->connection->data && r->postponed) { - - if (r->postponed->request) { - r->connection->data = r->postponed->request; - -#if defined(nginx_version) && nginx_version >= 8012 - ngx_http_post_request(r->postponed->request, NULL); -#else - ngx_http_post_request(r->postponed->request); -#endif - - } else { - ngx_http_echo_flush_postponed_outputs(r); - } - } - - return; - } - - ctx->done = 0; - - ctx->next_handler_cmd++; - - rc = ngx_http_echo_run_cmds(r); - - dd("rc: %d", (int) rc); - - if (rc == NGX_ERROR || rc == NGX_DONE) { - ngx_http_finalize_request(r, rc); - return; - } - - if (rc == NGX_AGAIN) { - dd("mark busy %d for %.*s", (int) ctx->next_handler_cmd, - (int) r->uri.len, - r->uri.data); - - ctx->waiting = 1; - ctx->done = 0; - - } else { - dd("mark ready %d", (int) ctx->next_handler_cmd); - ctx->waiting = 0; - ctx->done = 1; - - dd("finalizing with rc %d", (int) rc); - - dd("finalize request %.*s with %d", (int) r->uri.len, r->uri.data, - (int) rc); - - ngx_http_finalize_request(r, rc); - } -} - - -ngx_int_t -ngx_http_echo_handler(ngx_http_request_t *r) -{ - ngx_int_t rc; - ngx_http_echo_ctx_t *ctx; - - dd("subrequest in memory: %d", (int) r->subrequest_in_memory); - - rc = ngx_http_echo_run_cmds(r); - - dd("run cmds returned %d", (int) rc); - - if (rc == NGX_ERROR - || rc == NGX_OK - || rc == NGX_DONE - || rc == NGX_DECLINED) - { - return rc; - } - - ctx = ngx_http_get_module_ctx(r, ngx_http_echo_module); - - if (rc >= NGX_HTTP_SPECIAL_RESPONSE) { - if (ctx && r->header_sent) { - return NGX_ERROR; - } - - return rc; - } - - /* rc == NGX_AGAIN */ - -#if defined(nginx_version) && nginx_version >= 8011 - r->main->count++; -#endif - - dd("%d", r->connection->destroyed); - dd("%d", r->done); - - if (ctx) { - dd("mark busy %d for %.*s", (int) ctx->next_handler_cmd, - (int) r->uri.len, - r->uri.data); - - ctx->waiting = 1; - ctx->done = 0; - } - - return NGX_DONE; -} - - -ngx_int_t -ngx_http_echo_run_cmds(ngx_http_request_t *r) -{ - ngx_http_echo_loc_conf_t *elcf; - ngx_http_echo_ctx_t *ctx; - ngx_int_t rc; - ngx_array_t *cmds; - ngx_array_t *computed_args = NULL; - ngx_http_echo_cmd_t *cmd; - ngx_http_echo_cmd_t *cmd_elts; - ngx_array_t *opts = NULL; - - elcf = ngx_http_get_module_loc_conf(r, ngx_http_echo_module); - cmds = elcf->handler_cmds; - if (cmds == NULL) { - return NGX_DECLINED; - } - - ctx = ngx_http_get_module_ctx(r, ngx_http_echo_module); - if (ctx == NULL) { - ctx = ngx_http_echo_create_ctx(r); - if (ctx == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - ngx_http_set_ctx(r, ctx, ngx_http_echo_module); - } - - dd("exec handler: %.*s: %i", (int) r->uri.len, r->uri.data, - (int) ctx->next_handler_cmd); - - cmd_elts = cmds->elts; - - for (; ctx->next_handler_cmd < cmds->nelts; ctx->next_handler_cmd++) { - - cmd = &cmd_elts[ctx->next_handler_cmd]; - - /* evaluate arguments for the current cmd (if any) */ - if (cmd->args) { - computed_args = ngx_array_create(r->pool, cmd->args->nelts, - sizeof(ngx_str_t)); - - if (computed_args == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - opts = ngx_array_create(r->pool, 1, sizeof(ngx_str_t)); - - if (opts == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - rc = ngx_http_echo_eval_cmd_args(r, cmd, computed_args, opts); - if (rc != NGX_OK) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "Failed to evaluate arguments for " - "the directive."); - return rc; - } - } - - if (computed_args == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - /* do command dispatch based on the opcode */ - - switch (cmd->opcode) { - - case echo_opcode_echo_sync: - rc = ngx_http_echo_exec_echo_sync(r, ctx); - break; - - case echo_opcode_echo: - /* XXX moved the following code to a separate - * function */ - dd("found echo opcode"); - rc = ngx_http_echo_exec_echo(r, ctx, computed_args, - 0 /* in filter */, opts); - break; - - case echo_opcode_echo_request_body: - rc = ngx_http_echo_exec_echo_request_body(r, ctx); - break; - - case echo_opcode_echo_location_async: - if (!r->request_body) { - /* we require reading the request body before doing - * subrequests */ - - ctx->next_handler_cmd--; /* re-run the current cmd */ - goto read_request_body; - } - - dd("found opcode echo location async..."); - rc = ngx_http_echo_exec_echo_location_async(r, ctx, - computed_args); - break; - - case echo_opcode_echo_location: - if (!r->request_body) { - /* we require reading the request body before doing - * subrequests */ - - ctx->next_handler_cmd--; /* re-run the current cmd */ - goto read_request_body; - } - - return ngx_http_echo_exec_echo_location(r, ctx, computed_args); - - case echo_opcode_echo_subrequest_async: - if (!r->request_body) { - /* we require reading the request body before doing - * subrequests */ - - ctx->next_handler_cmd--; /* re-run the current cmd */ - goto read_request_body; - } - - dd("found opcode echo subrequest async..."); - rc = ngx_http_echo_exec_echo_subrequest_async(r, ctx, - computed_args); - break; - - case echo_opcode_echo_subrequest: - if (!r->request_body) { - /* we require reading the request body before doing - * subrequests */ - - ctx->next_handler_cmd--; /* re-run the current cmd */ - goto read_request_body; - } - - return ngx_http_echo_exec_echo_subrequest(r, ctx, computed_args); - - case echo_opcode_echo_sleep: - return ngx_http_echo_exec_echo_sleep(r, ctx, computed_args); - - case echo_opcode_echo_flush: - rc = ngx_http_echo_exec_echo_flush(r, ctx); - break; - - case echo_opcode_echo_blocking_sleep: - rc = ngx_http_echo_exec_echo_blocking_sleep(r, ctx, - computed_args); - break; - - case echo_opcode_echo_reset_timer: - rc = ngx_http_echo_exec_echo_reset_timer(r, ctx); - break; - - case echo_opcode_echo_duplicate: - rc = ngx_http_echo_exec_echo_duplicate(r, ctx, computed_args); - break; - - case echo_opcode_echo_read_request_body: - -read_request_body: - - ctx->wait_read_request_body = 0; - - rc = ngx_http_echo_exec_echo_read_request_body(r, ctx); - - if (rc == NGX_ERROR) { - return NGX_ERROR; - } - - if (rc >= NGX_HTTP_SPECIAL_RESPONSE) { -#if (nginx_version >= 8011 && nginx_version < 1002006) \ - || (nginx_version >= 1003000 && nginx_version < 1003009) - r->main->count--; -#endif - return rc; - } - -#if nginx_version >= 8011 - r->main->count--; -#endif - dd("read request body: %d", (int) rc); - - if (rc == NGX_OK) { - continue; - } - - /* rc == NGX_AGAIN */ - ctx->wait_read_request_body = 1; - return NGX_AGAIN; - - case echo_opcode_echo_foreach_split: - rc = ngx_http_echo_exec_echo_foreach_split(r, ctx, computed_args); - break; - - case echo_opcode_echo_end: - rc = ngx_http_echo_exec_echo_end(r, ctx); - break; - - case echo_opcode_echo_exec: - dd("echo_exec"); - return ngx_http_echo_exec_exec(r, ctx, computed_args); - - default: - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "unknown opcode: %d", cmd->opcode); - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - if (rc == NGX_ERROR || rc >= NGX_HTTP_SPECIAL_RESPONSE) { - return rc; - } - } - - rc = ngx_http_echo_send_chain_link(r, ctx, NULL /* indicate LAST */); - - if (rc == NGX_ERROR || rc >= NGX_HTTP_SPECIAL_RESPONSE) { - return rc; - } - - if (!r->request_body) { - if (ngx_http_discard_request_body(r) != NGX_OK) { - return NGX_ERROR; - } - } - - return NGX_OK; -} - - -ngx_int_t -ngx_http_echo_post_subrequest(ngx_http_request_t *r, - void *data, ngx_int_t rc) -{ - ngx_http_echo_ctx_t *ctx = data; - ngx_http_request_t *pr; - ngx_http_echo_ctx_t *pr_ctx; - - dd("echo post_subrequest: %.*s", (int) r->uri.len, r->uri.data); - - if (ctx->run_post_subrequest) { - dd("already run post_subrequest: %p: %.*s", ctx, - (int) r->uri.len, r->uri.data); - - return rc; - } - - dd("setting run_post_subrequest to 1 for %p for %.*s", ctx, - (int) r->uri.len, r->uri.data); - - ctx->run_post_subrequest = 1; - - pr = r->parent; - - pr_ctx = ngx_http_get_module_ctx(pr, ngx_http_echo_module); - if (pr_ctx == NULL) { - return NGX_ERROR; - } - - dd("mark ready %d", (int) pr_ctx->next_handler_cmd); - - pr_ctx->waiting = 0; - pr_ctx->done = 1; - - pr->write_event_handler = ngx_http_echo_wev_handler; - - /* work-around issues in nginx's event module */ - - if (r != r->connection->data - && r->postponed - && (r->main->posted_requests == NULL - || r->main->posted_requests->request != pr)) - { -#if defined(nginx_version) && nginx_version >= 8012 - ngx_http_post_request(pr, NULL); -#else - ngx_http_post_request(pr); -#endif - } - - return rc; -} diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_handler.h b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_handler.h deleted file mode 100644 index afc0666..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_handler.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ECHO_HANDLER_H -#define ECHO_HANDLER_H - -#include "ngx_http_echo_module.h" - - -void ngx_http_echo_wev_handler(ngx_http_request_t *r); - -ngx_int_t ngx_http_echo_handler(ngx_http_request_t *r); - -ngx_int_t ngx_http_echo_run_cmds(ngx_http_request_t *r); - -ngx_int_t ngx_http_echo_post_subrequest(ngx_http_request_t *r, - void *data, ngx_int_t rc); - - -#endif /* ECHO_HANDLER_H */ - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_location.c b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_location.c deleted file mode 100644 index 820e504..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_location.c +++ /dev/null @@ -1,182 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include "ngx_http_echo_util.h" -#include "ngx_http_echo_location.h" -#include "ngx_http_echo_handler.h" - -#include - - -static ngx_int_t ngx_http_echo_adjust_subrequest(ngx_http_request_t *sr); - - -ngx_int_t -ngx_http_echo_exec_echo_location_async(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args) -{ - ngx_int_t rc; - ngx_http_request_t *sr; /* subrequest object */ - ngx_str_t *computed_arg_elts; - ngx_str_t location; - ngx_str_t *url_args; - ngx_str_t args; - ngx_uint_t flags = 0; - - dd_enter(); - - computed_arg_elts = computed_args->elts; - - location = computed_arg_elts[0]; - - if (location.len == 0) { - return NGX_ERROR; - } - - if (computed_args->nelts > 1) { - url_args = &computed_arg_elts[1]; - } else { - url_args = NULL; - } - - args.data = NULL; - args.len = 0; - - if (ngx_http_parse_unsafe_uri(r, &location, &args, &flags) != NGX_OK) { - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "echo_location_async sees unsafe uri: \"%V\"", - &location); - return NGX_ERROR; - } - - if (args.len > 0 && url_args == NULL) { - url_args = &args; - } - - rc = ngx_http_echo_send_header_if_needed(r, ctx); - if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) { - return rc; - } - - rc = ngx_http_subrequest(r, &location, url_args, &sr, NULL, 0); - - if (rc != NGX_OK) { - return NGX_ERROR; - } - - rc = ngx_http_echo_adjust_subrequest(sr); - if (rc != NGX_OK) { - return NGX_ERROR; - } - - return NGX_OK; -} - - -ngx_int_t -ngx_http_echo_exec_echo_location(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args) -{ - ngx_int_t rc; - ngx_http_request_t *sr; /* subrequest object */ - ngx_str_t *computed_arg_elts; - ngx_str_t location; - ngx_str_t *url_args; - ngx_http_post_subrequest_t *psr; - ngx_str_t args; - ngx_uint_t flags = 0; - ngx_http_echo_ctx_t *sr_ctx; - - if (computed_args == NULL) { - return NGX_ERROR; - } - - computed_arg_elts = computed_args->elts; - - location = computed_arg_elts[0]; - - if (location.len == 0) { - return NGX_ERROR; - } - - if (computed_args->nelts > 1) { - url_args = &computed_arg_elts[1]; - - } else { - url_args = NULL; - } - - args.data = NULL; - args.len = 0; - - if (ngx_http_parse_unsafe_uri(r, &location, &args, &flags) != NGX_OK) { - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "echo_location sees unsafe uri: \"%V\"", - &location); - return NGX_ERROR; - } - - if (args.len > 0 && url_args == NULL) { - url_args = &args; - } - - rc = ngx_http_echo_send_header_if_needed(r, ctx); - if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) { - return rc; - } - - sr_ctx = ngx_http_echo_create_ctx(r); - - psr = ngx_palloc(r->pool, sizeof(ngx_http_post_subrequest_t)); - if (psr == NULL) { - return NGX_ERROR; - } - - psr->handler = ngx_http_echo_post_subrequest; - psr->data = sr_ctx; - - rc = ngx_http_subrequest(r, &location, url_args, &sr, psr, 0); - - if (rc != NGX_OK) { - return NGX_ERROR; - } - - rc = ngx_http_echo_adjust_subrequest(sr); - - if (rc != NGX_OK) { - return NGX_ERROR; - } - - return NGX_AGAIN; -} - - -static ngx_int_t -ngx_http_echo_adjust_subrequest(ngx_http_request_t *sr) -{ - ngx_http_core_main_conf_t *cmcf; - ngx_http_request_t *r; - - /* we do not inherit the parent request's variables */ - cmcf = ngx_http_get_module_main_conf(sr, ngx_http_core_module); - - r = sr->parent; - - sr->header_in = r->header_in; - - /* XXX work-around a bug in ngx_http_subrequest */ - if (r->headers_in.headers.last == &r->headers_in.headers.part) { - sr->headers_in.headers.last = &sr->headers_in.headers.part; - } - - sr->variables = ngx_pcalloc(sr->pool, cmcf->variables.nelts - * sizeof(ngx_http_variable_value_t)); - - if (sr->variables == NULL) { - return NGX_ERROR; - } - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_location.h b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_location.h deleted file mode 100644 index 6bc0e03..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_location.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef ECHO_LOCATION_H -#define ECHO_LOCATION_H - -#include "ngx_http_echo_module.h" - -ngx_int_t ngx_http_echo_exec_echo_location_async(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args); - -ngx_int_t ngx_http_echo_exec_echo_location(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args); - -#endif /* ECHO_LOCATION_H */ - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_module.c b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_module.c deleted file mode 100644 index 8d736d7..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_module.c +++ /dev/null @@ -1,682 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include "ngx_http_echo_handler.h" -#include "ngx_http_echo_filter.h" -#include "ngx_http_echo_echo.h" -#include "ngx_http_echo_request_info.h" -#include "ngx_http_echo_var.h" -#include "ngx_http_echo_util.h" - - -#include -#include -#include - - -/* config init handler */ -static void *ngx_http_echo_create_loc_conf(ngx_conf_t *cf); -static char *ngx_http_echo_merge_loc_conf(ngx_conf_t *cf, void *parent, - void *child); -static void *ngx_http_echo_create_main_conf(ngx_conf_t *cf); -static ngx_int_t ngx_http_echo_post_config(ngx_conf_t *cf); - -/* config directive handlers */ -static char *ngx_http_echo_echo(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); -static char *ngx_http_echo_echo_request_body(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_echo_sleep(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); -static char *ngx_http_echo_echo_flush(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); -static char *ngx_http_echo_echo_blocking_sleep(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_echo_reset_timer(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_echo_before_body(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_echo_after_body(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_echo_location_async(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_echo_location(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_echo_subrequest_async(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_echo_subrequest(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_echo_duplicate(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_echo_read_request_body(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_echo_foreach_split(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_echo_end(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_echo_abort_parent(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_echo_exec(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_echo_helper(ngx_http_echo_opcode_t opcode, - ngx_http_echo_cmd_category_t cat, - ngx_conf_t *cf, ngx_command_t *cmd, void *conf); - - -static ngx_http_module_t ngx_http_echo_module_ctx = { - NULL, /* preconfiguration */ - ngx_http_echo_post_config, /* postconfiguration */ - - ngx_http_echo_create_main_conf, /* create main configuration */ - NULL, /* init main configuration */ - - NULL, /* create server configuration */ - NULL, /* merge server configuration */ - - ngx_http_echo_create_loc_conf, /* create location configuration */ - ngx_http_echo_merge_loc_conf /* merge location configuration */ -}; - - -static ngx_command_t ngx_http_echo_commands[] = { - - { ngx_string("echo"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_ANY, - ngx_http_echo_echo, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_request_body"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_NOARGS, - ngx_http_echo_echo_request_body, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_sleep"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE1, - ngx_http_echo_echo_sleep, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_flush"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_NOARGS, - ngx_http_echo_echo_flush, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_blocking_sleep"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE1, - ngx_http_echo_echo_blocking_sleep, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_reset_timer"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_NOARGS, - ngx_http_echo_echo_reset_timer, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_before_body"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_ANY, - ngx_http_echo_echo_before_body, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, before_body_cmds), - NULL }, - - { ngx_string("echo_after_body"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_ANY, - ngx_http_echo_echo_after_body, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, after_body_cmds), - NULL }, - - { ngx_string("echo_location_async"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ngx_http_echo_echo_location_async, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_location"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ngx_http_echo_echo_location, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_subrequest_async"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_2MORE, - ngx_http_echo_echo_subrequest_async, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_subrequest"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_2MORE, - ngx_http_echo_echo_subrequest, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_duplicate"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_2MORE, - ngx_http_echo_echo_duplicate, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_read_request_body"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_NOARGS, - ngx_http_echo_echo_read_request_body, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_foreach_split"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_2MORE, - ngx_http_echo_echo_foreach_split, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_end"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_NOARGS, - ngx_http_echo_echo_end, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_abort_parent"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_NOARGS, - ngx_http_echo_echo_abort_parent, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_exec"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ngx_http_echo_echo_exec, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, handler_cmds), - NULL }, - - { ngx_string("echo_status"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE1, - ngx_conf_set_num_slot, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_echo_loc_conf_t, status), - NULL }, - - ngx_null_command -}; - - -ngx_module_t ngx_http_echo_module = { - NGX_MODULE_V1, - &ngx_http_echo_module_ctx, /* module context */ - ngx_http_echo_commands, /* module directives */ - NGX_HTTP_MODULE, /* module type */ - NULL, /* init master */ - NULL, /* init module */ - NULL, /* init process */ - NULL, /* init thread */ - NULL, /* exit thread */ - NULL, /* exit process */ - NULL, /* exit master */ - NGX_MODULE_V1_PADDING -}; - - -static void * -ngx_http_echo_create_loc_conf(ngx_conf_t *cf) -{ - ngx_http_echo_loc_conf_t *conf; - - conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_echo_loc_conf_t)); - if (conf == NULL) { - return NULL; - } - - /* set by ngx_pcalloc - * conf->handler_cmds = NULL - * conf->before_body_cmds = NULL - * conf->after_body_cmds = NULL - * conf->seen_leading_output = 0 - * conf->seen_trailing_output = 0 - */ - - conf->status = NGX_CONF_UNSET; - - return conf; -} - - -static char * -ngx_http_echo_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) -{ - ngx_http_echo_loc_conf_t *prev = parent; - ngx_http_echo_loc_conf_t *conf = child; - - if (conf->handler_cmds == NULL) { - conf->handler_cmds = prev->handler_cmds; - conf->seen_leading_output = prev->seen_leading_output; - } - - if (conf->before_body_cmds == NULL) { - conf->before_body_cmds = prev->before_body_cmds; - } - - if (conf->after_body_cmds == NULL) { - conf->after_body_cmds = prev->after_body_cmds; - } - - ngx_conf_merge_value(conf->status, prev->status, 200); - - return NGX_CONF_OK; -} - - -static char * -ngx_http_echo_helper(ngx_http_echo_opcode_t opcode, - ngx_http_echo_cmd_category_t cat, - ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_str_t *raw_args; - ngx_uint_t i, n; - ngx_array_t **args_ptr; - ngx_array_t **cmds_ptr; - ngx_http_echo_cmd_t *echo_cmd; - ngx_http_core_loc_conf_t *clcf; - ngx_http_script_compile_t sc; - ngx_http_echo_main_conf_t *emcf; - ngx_http_echo_arg_template_t *arg; - - emcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_echo_module); - - /* cmds_ptr points to ngx_http_echo_loc_conf_t's - * handler_cmds, before_body_cmds, or after_body_cmds - * array, depending on the actual offset */ - cmds_ptr = (ngx_array_t **) (((u_char *) conf) + cmd->offset); - - if (*cmds_ptr == NULL) { - *cmds_ptr = ngx_array_create(cf->pool, 1, - sizeof(ngx_http_echo_cmd_t)); - - if (*cmds_ptr == NULL) { - return NGX_CONF_ERROR; - } - - if (cat == echo_handler_cmd) { - dd("registering the content handler"); - /* register the content handler */ - clcf = ngx_http_conf_get_module_loc_conf(cf, - ngx_http_core_module); - - dd("registering the content handler (2)"); - clcf->handler = ngx_http_echo_handler; - - } else { - dd("filter used = 1"); - emcf->requires_filter = 1; - } - } - - echo_cmd = ngx_array_push(*cmds_ptr); - - if (echo_cmd == NULL) { - return NGX_CONF_ERROR; - } - - echo_cmd->opcode = opcode; - - args_ptr = &echo_cmd->args; - *args_ptr = ngx_array_create(cf->pool, 1, - sizeof(ngx_http_echo_arg_template_t)); - - if (*args_ptr == NULL) { - return NGX_CONF_ERROR; - } - - raw_args = cf->args->elts; - - /* we skip the first arg and start from the second */ - - for (i = 1 ; i < cf->args->nelts; i++) { - arg = ngx_array_push(*args_ptr); - - if (arg == NULL) { - return NGX_CONF_ERROR; - } - - arg->raw_value = raw_args[i]; - - dd("found raw arg %s", raw_args[i].data); - - arg->lengths = NULL; - arg->values = NULL; - - n = ngx_http_script_variables_count(&arg->raw_value); - - if (n > 0) { - ngx_memzero(&sc, sizeof(ngx_http_script_compile_t)); - - sc.cf = cf; - sc.source = &arg->raw_value; - sc.lengths = &arg->lengths; - sc.values = &arg->values; - sc.variables = n; - sc.complete_lengths = 1; - sc.complete_values = 1; - - if (ngx_http_script_compile(&sc) != NGX_OK) { - return NGX_CONF_ERROR; - } - } - } /* end for */ - - return NGX_CONF_OK; -} - - -static char * -ngx_http_echo_echo(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_http_echo_loc_conf_t *elcf = conf; - - if (!elcf->seen_leading_output) { - elcf->seen_leading_output = 1; - } - - dd("in echo_echo..."); - return ngx_http_echo_helper(echo_opcode_echo, echo_handler_cmd, - cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_request_body(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf) -{ - ngx_http_echo_loc_conf_t *elcf = conf; - - if (!elcf->seen_leading_output) { - elcf->seen_leading_output = 1; - } - - dd("in echo_echo_request_body..."); - return ngx_http_echo_helper(echo_opcode_echo_request_body, echo_handler_cmd, - cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_sleep(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - dd("in echo_sleep..."); - return ngx_http_echo_helper(echo_opcode_echo_sleep, echo_handler_cmd, - cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_flush(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_http_echo_loc_conf_t *elcf = conf; - - if (!elcf->seen_leading_output) { - elcf->seen_leading_output = 1; - } - - dd("in echo_flush..."); - return ngx_http_echo_helper(echo_opcode_echo_flush, echo_handler_cmd, - cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_blocking_sleep(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf) -{ - dd("in echo_blocking_sleep..."); - return ngx_http_echo_helper(echo_opcode_echo_blocking_sleep, - echo_handler_cmd, cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_reset_timer(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - return ngx_http_echo_helper(echo_opcode_echo_reset_timer, echo_handler_cmd, - cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_before_body(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - dd("processing echo_before_body directive..."); - return ngx_http_echo_helper(echo_opcode_echo_before_body, echo_filter_cmd, - cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_after_body(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - return ngx_http_echo_helper(echo_opcode_echo_after_body, echo_filter_cmd, - cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_location_async(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf) -{ - ngx_http_echo_loc_conf_t *elcf = conf; - char *ret; - - if (!elcf->seen_leading_output) { - elcf->seen_leading_output = 1; - - ret = ngx_http_echo_helper(echo_opcode_echo_sync, echo_handler_cmd, - cf, cmd, conf); - - if (ret != NGX_CONF_OK) { - return ret; - } - } - - return ngx_http_echo_helper(echo_opcode_echo_location_async, - echo_handler_cmd, cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_location(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_http_echo_loc_conf_t *elcf = conf; - char *ret; - - if (!elcf->seen_leading_output) { - elcf->seen_leading_output = 1; - - ret = ngx_http_echo_helper(echo_opcode_echo_sync, echo_handler_cmd, - cf, cmd, conf); - - if (ret != NGX_CONF_OK) { - return ret; - } - } - - return ngx_http_echo_helper(echo_opcode_echo_location, echo_handler_cmd, - cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_subrequest_async(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf) -{ - char *ret; - ngx_http_echo_loc_conf_t *elcf = conf; - - if (!elcf->seen_leading_output) { - elcf->seen_leading_output = 1; - - ret = ngx_http_echo_helper(echo_opcode_echo_sync, echo_handler_cmd, - cf, cmd, conf); - - if (ret != NGX_CONF_OK) { - return ret; - } - } - - return ngx_http_echo_helper(echo_opcode_echo_subrequest_async, - echo_handler_cmd, cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_subrequest(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf) -{ - ngx_http_echo_loc_conf_t *elcf = conf; - char *ret; - - if (!elcf->seen_leading_output) { - elcf->seen_leading_output = 1; - - ret = ngx_http_echo_helper(echo_opcode_echo_sync, echo_handler_cmd, - cf, cmd, conf); - - if (ret != NGX_CONF_OK) { - return ret; - } - } - - return ngx_http_echo_helper(echo_opcode_echo_subrequest, echo_handler_cmd, - cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_duplicate(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_http_echo_loc_conf_t *elcf = conf; - - if (!elcf->seen_leading_output) { - elcf->seen_leading_output = 1; - } - - return ngx_http_echo_helper(echo_opcode_echo_duplicate, echo_handler_cmd, - cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_read_request_body(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf) -{ - return ngx_http_echo_helper(echo_opcode_echo_read_request_body, - echo_handler_cmd, cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_foreach_split(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - return ngx_http_echo_helper(echo_opcode_echo_foreach_split, - echo_handler_cmd, cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_end(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - return ngx_http_echo_helper(echo_opcode_echo_end, echo_handler_cmd, cf, - cmd, conf); -} - - -static char * -ngx_http_echo_echo_abort_parent(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - return ngx_http_echo_helper(echo_opcode_echo_abort_parent, echo_handler_cmd, - cf, cmd, conf); -} - - -static char * -ngx_http_echo_echo_exec(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - return ngx_http_echo_helper(echo_opcode_echo_exec, echo_handler_cmd, - cf, cmd, conf); -} - - -static void * -ngx_http_echo_create_main_conf(ngx_conf_t *cf) -{ -#if nginx_version >= 1011011 - ngx_pool_cleanup_t *cln; -#endif - ngx_http_echo_main_conf_t *emcf; - - emcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_echo_main_conf_t)); - if (emcf == NULL) { - return NULL; - } - - /* set by ngx_pcalloc: - * hmcf->requires_filter = 0; - */ - -#if nginx_version >= 1011011 - cln = ngx_pool_cleanup_add(cf->pool, 0); - if (cln == NULL) { - return NULL; - } - - cln->data = emcf; - cln->handler = ngx_http_echo_request_headers_cleanup; -#endif - - return emcf; -} - - -static ngx_int_t -ngx_http_echo_post_config(ngx_conf_t *cf) -{ - ngx_int_t rc; - - rc = ngx_http_echo_filter_init(cf); - if (rc != NGX_OK) { - return rc; - } - - rc = ngx_http_echo_echo_init(cf); - if (rc != NGX_OK) { - return rc; - } - - ngx_http_echo_content_length_hash = - ngx_http_echo_hash_literal("content-length"); - - return ngx_http_echo_add_variables(cf); -} diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_module.h b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_module.h deleted file mode 100644 index ce0a305..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_module.h +++ /dev/null @@ -1,151 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef NGX_HTTP_ECHO_MODULE_H -#define NGX_HTTP_ECHO_MODULE_H - - -#include -#include -#include - - -extern ngx_module_t ngx_http_echo_module; - - -/* config directive's opcode */ -typedef enum { - echo_opcode_echo_sync, - echo_opcode_echo, - echo_opcode_echo_request_body, - echo_opcode_echo_sleep, - echo_opcode_echo_flush, - echo_opcode_echo_blocking_sleep, - echo_opcode_echo_reset_timer, - echo_opcode_echo_before_body, - echo_opcode_echo_after_body, - echo_opcode_echo_location_async, - echo_opcode_echo_location, - echo_opcode_echo_subrequest_async, - echo_opcode_echo_subrequest, - echo_opcode_echo_duplicate, - echo_opcode_echo_read_request_body, - echo_opcode_echo_foreach_split, - echo_opcode_echo_end, - echo_opcode_echo_abort_parent, - echo_opcode_echo_exec -} ngx_http_echo_opcode_t; - - -/* all the various config directives (or commands) are - * divided into two categories: "handler commands", - * and "filter commands". For instance, the "echo" - * directive is a handler command while - * "echo_before_body" is a filter one. */ -typedef enum { - echo_handler_cmd, - echo_filter_cmd - -} ngx_http_echo_cmd_category_t; - - -/* compiled form of a config directive argument's value */ -typedef struct { - /* holds the raw string of the argument value */ - ngx_str_t raw_value; - - /* fields "lengths" and "values" are set by - * the function ngx_http_script_compile, - * iff the argument value indeed contains - * nginx variables like "$foo" */ - ngx_array_t *lengths; - ngx_array_t *values; - -} ngx_http_echo_arg_template_t; - - -/* represent a config directive (or command) like "echo". */ -typedef struct { - ngx_http_echo_opcode_t opcode; - - /* each argument is of type echo_arg_template_t: */ - ngx_array_t *args; -} ngx_http_echo_cmd_t; - - -/* location config struct */ -typedef struct { - /* elements of the following arrays are of type - * ngx_http_echo_cmd_t */ - ngx_array_t *handler_cmds; - ngx_array_t *before_body_cmds; - ngx_array_t *after_body_cmds; - - unsigned seen_leading_output; - - ngx_int_t status; -} ngx_http_echo_loc_conf_t; - - -typedef struct { - ngx_int_t requires_filter; -#if nginx_version >= 1011011 - ngx_buf_t **busy_buf_ptrs; - ngx_int_t busy_buf_ptr_count; -#endif -} ngx_http_echo_main_conf_t; - - -typedef struct { - ngx_array_t *choices; /* items after splitting */ - ngx_uint_t next_choice; /* current item index */ - ngx_uint_t cmd_index; /* cmd index for the echo_foreach direcitve */ -} ngx_http_echo_foreach_ctx_t; - - -/* context struct in the request handling cycle, holding - * the current states of the command evaluator */ -typedef struct { - /* index of the next handler command in - * ngx_http_echo_loc_conf_t's "handler_cmds" array. */ - ngx_uint_t next_handler_cmd; - - /* index of the next before-body filter command in - * ngx_http_echo_loc_conf_t's "before_body_cmds" array. */ - ngx_uint_t next_before_body_cmd; - - /* index of the next after-body filter command in - * ngx_http_echo_loc_conf_t's "after_body_cmds" array. */ - ngx_uint_t next_after_body_cmd; - - ngx_http_echo_foreach_ctx_t *foreach; - - ngx_time_t timer_begin; - - ngx_event_t sleep; - - ngx_uint_t counter; - - unsigned before_body_sent:1; - unsigned skip_filter:1; - - unsigned wait_read_request_body:1; - - unsigned waiting:1; - unsigned done:1; - - unsigned run_post_subrequest:1; - unsigned header_sent:1; /* r->header_sent is not sufficient - * because special header filters like - * ngx_http_image_filter_module's may - * intercept the whole header filter chain - * leaving r->header_sent unset. So we - * should always test both flags. */ - -} ngx_http_echo_ctx_t; - - -#endif /* NGX_HTTP_ECHO_MODULE_H */ diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_request_info.c b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_request_info.c deleted file mode 100644 index 7dd3683..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_request_info.c +++ /dev/null @@ -1,522 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include "ngx_http_echo_request_info.h" -#include "ngx_http_echo_util.h" -#include "ngx_http_echo_handler.h" - -#include - - -static void ngx_http_echo_post_read_request_body(ngx_http_request_t *r); -#if nginx_version >= 1011011 -void ngx_http_echo_request_headers_cleanup(void *data); -#endif - - -ngx_int_t -ngx_http_echo_exec_echo_read_request_body(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx) -{ - return ngx_http_read_client_request_body(r, - ngx_http_echo_post_read_request_body); -} - - -static void -ngx_http_echo_post_read_request_body(ngx_http_request_t *r) -{ - ngx_http_echo_ctx_t *ctx; - - ctx = ngx_http_get_module_ctx(r, ngx_http_echo_module); - - dd("wait read request body %d", (int) ctx->wait_read_request_body); - - if (ctx->wait_read_request_body) { - ctx->waiting = 0; - ctx->done = 1; - - r->write_event_handler = ngx_http_echo_wev_handler; - - ngx_http_echo_wev_handler(r); - } -} - - -/* this function's implementation is borrowed from nginx 0.8.20 - * and modified a bit to work with subrequests. - * Copyrighted (C) by Igor Sysoev */ -ngx_int_t -ngx_http_echo_request_method_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data) -{ - if (r->method_name.data) { - v->len = r->method_name.len; - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - v->data = r->method_name.data; - - } else { - v->not_found = 1; - } - - return NGX_OK; -} - - -/* this function's implementation is borrowed from nginx 0.8.20 - * and modified a bit to work with subrequests. - * Copyrighted (C) by Igor Sysoev */ -ngx_int_t -ngx_http_echo_client_request_method_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data) -{ - if (r->main->method_name.data) { - v->len = r->main->method_name.len; - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - v->data = r->main->method_name.data; - - } else { - v->not_found = 1; - } - - return NGX_OK; -} - - -/* this function's implementation is borrowed from nginx 0.8.20 - * and modified a bit to work with subrequests. - * Copyrighted (C) by Igor Sysoev */ -ngx_int_t -ngx_http_echo_request_body_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data) -{ - u_char *p; - size_t len; - ngx_buf_t *b; - ngx_chain_t *cl; - ngx_chain_t *in; - - if (r->request_body == NULL - || r->request_body->bufs == NULL - || r->request_body->temp_file) - { - v->not_found = 1; - - return NGX_OK; - } - - in = r->request_body->bufs; - - len = 0; - for (cl = in; cl; cl = cl->next) { - b = cl->buf; - - if (!ngx_buf_in_memory(b)) { - if (b->in_file) { - ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "variable echo_request_body sees in-file only " - "buffers and discard the whole body data"); - - v->not_found = 1; - - return NGX_OK; - } - - } else { - len += b->last - b->pos; - } - } - - p = ngx_pnalloc(r->pool, len); - if (p == NULL) { - return NGX_ERROR; - } - - v->data = p; - - for (cl = in; cl; cl = cl->next) { - b = cl->buf; - - if (ngx_buf_in_memory(b)) { - p = ngx_copy(p, b->pos, b->last - b->pos); - } - } - - if (p - v->data != (ssize_t) len) { - ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "variable echo_request_body: buffer error"); - - v->not_found = 1; - - return NGX_OK; - } - - v->len = len; - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - - return NGX_OK; -} - - -ngx_int_t -ngx_http_echo_client_request_headers_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data) -{ - int line_break_len; - size_t size; - u_char *p, *last, *pos; - ngx_int_t i, j; - ngx_buf_t *b, *first = NULL; - unsigned found; -#if nginx_version >= 1011011 - ngx_buf_t **bb; - ngx_chain_t *cl; - ngx_http_echo_main_conf_t *emcf; -#endif - ngx_connection_t *c; - ngx_http_request_t *mr; - ngx_http_connection_t *hc; - - mr = r->main; - hc = r->main->http_connection; - c = mr->connection; - -#if (NGX_HTTP_V2) - /* TODO */ - if (mr->stream) { - v->not_found = 1; - return NGX_OK; - } -#endif - -#if nginx_version >= 1011011 - emcf = ngx_http_get_module_main_conf(r, ngx_http_echo_module); -#endif - - size = 0; - b = c->buffer; - - if (mr->request_line.data[mr->request_line.len] == CR) { - line_break_len = 2; - - } else { - line_break_len = 1; - } - - if (mr->request_line.data >= b->start - && mr->request_line.data + mr->request_line.len + line_break_len - <= b->pos) - { - first = b; - size += b->pos - mr->request_line.data; - } - - if (hc->nbusy) { - b = NULL; - -#if nginx_version >= 1011011 - if (hc->nbusy > emcf->busy_buf_ptr_count) { - if (emcf->busy_buf_ptrs) { - ngx_free(emcf->busy_buf_ptrs); - } - - emcf->busy_buf_ptrs = ngx_alloc(hc->nbusy * sizeof(ngx_buf_t *), - r->connection->log); - - if (emcf->busy_buf_ptrs == NULL) { - return NGX_ERROR; - } - - emcf->busy_buf_ptr_count = hc->nbusy; - } - - bb = emcf->busy_buf_ptrs; - for (cl = hc->busy; cl; cl = cl->next) { - *bb++ = cl->buf; - } - - bb = emcf->busy_buf_ptrs; - for (i = hc->nbusy; i > 0; i--) { - b = bb[i - 1]; -#else - for (i = 0; i < hc->nbusy; i++) { - b = hc->busy[i]; -#endif - - if (first == NULL) { - if (mr->request_line.data >= b->pos - || mr->request_line.data + mr->request_line.len - + line_break_len <= b->start) - { - continue; - } - - dd("found first at %d", (int) i); - first = b; - } - - size += b->pos - b->start; - } - } - - - size++; /* plus the null terminator, as required by the later - ngx_strstr() call */ - - v->data = ngx_palloc(r->pool, size); - if (v->data == NULL) { - return NGX_ERROR; - } - - last = v->data; - - b = c->buffer; - found = 0; - - if (first == b) { - found = 1; - pos = b->pos; - - last = ngx_copy(v->data, mr->request_line.data, - pos - mr->request_line.data); - - if (b != mr->header_in) { - /* skip truncated header entries (if any) */ - while (last > v->data && last[-1] != LF) { - last--; - } - } - - i = 0; - for (p = v->data; p != last; p++) { - if (*p == '\0') { - i++; - if (p + 1 != last && *(p + 1) == LF) { - *p = CR; - - } else if (i % 2 == 1) { - *p = ':'; - - } else { - *p = LF; - } - } - } - } - - if (hc->nbusy) { - -#if nginx_version >= 1011011 - bb = emcf->busy_buf_ptrs; - for (i = hc->nbusy; i > 0; i--) { - b = bb[i - 1]; -#else - for (i = 0; i < hc->nbusy; i++) { - b = hc->busy[i]; -#endif - - if (!found) { - if (b != first) { - continue; - } - - dd("found first"); - found = 1; - } - - p = last; - - pos = b->pos; - - if (b == first) { - dd("request line: %.*s", (int) mr->request_line.len, - mr->request_line.data); - - last = ngx_copy(last, - mr->request_line.data, - pos - mr->request_line.data); - - } else { - last = ngx_copy(last, b->start, pos - b->start); - } - -#if 1 - /* skip truncated header entries (if any) */ - while (last > p && last[-1] != LF) { - last--; - } -#endif - - j = 0; - for (; p != last; p++) { - if (*p == '\0') { - j++; - if (p + 1 == last) { - /* XXX this should not happen */ - dd("found string end!!"); - - } else if (*(p + 1) == LF) { - *p = CR; - - } else if (j % 2 == 1) { - *p = ':'; - - } else { - *p = LF; - } - } - } - - if (b == mr->header_in) { - break; - } - } - } - - *last++ = '\0'; - - if (last - v->data > (ssize_t) size) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "buffer error when evaluating " - "$echo_client__request_headers: \"%V\"", - (ngx_int_t) (last - v->data - size)); - - return NGX_ERROR; - } - - /* strip the leading part (if any) of the request body in our header. - * the first part of the request body could slip in because nginx core's - * ngx_http_request_body_length_filter and etc can move r->header_in->pos - * in case that some of the body data has been preread into r->header_in. - */ - - if ((p = (u_char *) ngx_strstr(v->data, CRLF CRLF)) != NULL) { - last = p + sizeof(CRLF CRLF) - 1; - - } else if ((p = (u_char *) ngx_strstr(v->data, CRLF "\n")) != NULL) { - last = p + sizeof(CRLF "\n") - 1; - - } else if ((p = (u_char *) ngx_strstr(v->data, "\n" CRLF)) != NULL) { - last = p + sizeof("\n" CRLF) - 1; - - } else { - for (p = last - 1; p - v->data >= 2; p--) { - if (p[0] == LF && p[-1] == CR) { - p[-1] = LF; - last = p + 1; - break; - } - - if (p[0] == LF && p[-1] == LF) { - last = p + 1; - break; - } - } - } - - v->len = last - v->data; - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - - return NGX_OK; -} - - -ngx_int_t -ngx_http_echo_cacheable_request_uri_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data) -{ - if (r->uri.len) { - v->len = r->uri.len; - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - v->data = r->uri.data; - - } else { - v->not_found = 1; - } - - return NGX_OK; -} - - -ngx_int_t -ngx_http_echo_request_uri_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data) -{ - if (r->uri.len) { - v->len = r->uri.len; - v->valid = 1; - v->no_cacheable = 1; - v->not_found = 0; - v->data = r->uri.data; - - } else { - v->not_found = 1; - } - - return NGX_OK; -} - - -ngx_int_t -ngx_http_echo_response_status_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data) -{ - u_char *p; - - if (r->headers_out.status) { - dd("headers out status: %d", (int) r->headers_out.status); - - p = ngx_palloc(r->pool, NGX_INT_T_LEN); - if (p == NULL) { - return NGX_ERROR; - } - - v->len = ngx_sprintf(p, "%ui", r->headers_out.status) - p; - v->data = p; - - v->valid = 1; - v->no_cacheable = 1; - v->not_found = 0; - - } else { - v->not_found = 1; - } - - return NGX_OK; -} - - -#if nginx_version >= 1011011 -void -ngx_http_echo_request_headers_cleanup(void *data) -{ - ngx_http_echo_main_conf_t *emcf; - - emcf = (ngx_http_echo_main_conf_t *) data; - - if (emcf->busy_buf_ptrs) { - ngx_free(emcf->busy_buf_ptrs); - emcf->busy_buf_ptrs = NULL; - } -} -#endif - -/* vi:set ft=c ts=4 sw=4 et fdm=marker: */ diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_request_info.h b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_request_info.h deleted file mode 100644 index aa5730b..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_request_info.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef ECHO_REQUEST_INFO_H -#define ECHO_REQUEST_INFO_H - - -#include "ngx_http_echo_module.h" - - -ngx_int_t ngx_http_echo_exec_echo_read_request_body( - ngx_http_request_t *r, ngx_http_echo_ctx_t *ctx); - -ngx_int_t ngx_http_echo_request_method_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data); - -ngx_int_t ngx_http_echo_client_request_method_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data); - -ngx_int_t ngx_http_echo_request_body_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data); - -ngx_int_t ngx_http_echo_client_request_headers_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data); - -ngx_int_t ngx_http_echo_cacheable_request_uri_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data); - -ngx_int_t ngx_http_echo_request_uri_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data); - -ngx_int_t ngx_http_echo_response_status_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data); - -#if nginx_version >= 1011011 -void ngx_http_echo_request_headers_cleanup(void *data); -#endif - -#endif /* ECHO_REQUEST_INFO_H */ diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_sleep.c b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_sleep.c deleted file mode 100644 index c96fa5a..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_sleep.c +++ /dev/null @@ -1,208 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include "ngx_http_echo_sleep.h" -#include "ngx_http_echo_handler.h" - -#include -#include - - -/* event handler for echo_sleep */ - -static void ngx_http_echo_post_sleep(ngx_http_request_t *r); -static void ngx_http_echo_sleep_cleanup(void *data); - - -ngx_int_t -ngx_http_echo_exec_echo_sleep(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args) -{ - ngx_str_t *computed_arg; - ngx_str_t *computed_arg_elts; - ngx_int_t delay; /* in msec */ - ngx_http_cleanup_t *cln; - - computed_arg_elts = computed_args->elts; - computed_arg = &computed_arg_elts[0]; - - delay = ngx_atofp(computed_arg->data, computed_arg->len, 3); - - if (delay == NGX_ERROR) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "invalid sleep duration \"%V\"", &computed_arg_elts[0]); - - return NGX_HTTP_BAD_REQUEST; - } - - dd("adding timer with delay %lu ms, r:%.*s", (unsigned long) delay, - (int) r->uri.len, r->uri.data); - - ngx_add_timer(&ctx->sleep, (ngx_msec_t) delay); - - /* we don't check broken downstream connections - * ourselves so even if the client shuts down - * the connection prematurely, nginx will still - * go on waiting for our timers to get properly - * expired. However, we'd still register a - * cleanup handler for completeness. */ - - cln = ngx_http_cleanup_add(r, 0); - if (cln == NULL) { - return NGX_ERROR; - } - - cln->handler = ngx_http_echo_sleep_cleanup; - cln->data = r; - - return NGX_AGAIN; -} - - -static void -ngx_http_echo_post_sleep(ngx_http_request_t *r) -{ - ngx_http_echo_ctx_t *ctx; - /* ngx_int_t rc; */ - - dd("post sleep, r:%.*s", (int) r->uri.len, r->uri.data); - - ctx = ngx_http_get_module_ctx(r, ngx_http_echo_module); - - if (ctx == NULL) { - return; - } - - ctx->waiting = 0; - ctx->done = 1; - - dd("sleep: after get module ctx"); - - dd("timed out? %d", ctx->sleep.timedout); - dd("timer set? %d", ctx->sleep.timer_set); - - if (!ctx->sleep.timedout) { - dd("HERE reached!"); - return; - } - - ctx->sleep.timedout = 0; - - if (ctx->sleep.timer_set) { - dd("deleting timer for echo_sleep"); - - ngx_del_timer(&ctx->sleep); - } - - /* r->write_event_handler = ngx_http_request_empty_handler; */ - - ngx_http_echo_wev_handler(r); -} - - -void -ngx_http_echo_sleep_event_handler(ngx_event_t *ev) -{ - ngx_connection_t *c; - ngx_http_request_t *r; - ngx_http_log_ctx_t *ctx; - - r = ev->data; - c = r->connection; - - if (c->destroyed) { - return; - } - - if (c->error) { - ngx_http_finalize_request(r, NGX_ERROR); - return; - } - - ctx = c->log->data; - ctx->current_request = r; - - /* XXX when r->done == 1 we should do cleaning immediately - * and delete our timer and then quit. */ - - ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, - "echo sleep event handler: \"%V?%V\"", &r->uri, &r->args); - - /* - if (r->done) { - return; - } - */ - - ngx_http_echo_post_sleep(r); - -#if defined(nginx_version) - - dd("before run posted requests"); - - ngx_http_run_posted_requests(c); - - dd("after run posted requests"); - -#endif -} - - -ngx_int_t -ngx_http_echo_exec_echo_blocking_sleep(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args) -{ - ngx_str_t *computed_arg; - ngx_str_t *computed_arg_elts; - ngx_int_t delay; /* in msec */ - - computed_arg_elts = computed_args->elts; - computed_arg = &computed_arg_elts[0]; - - delay = ngx_atofp(computed_arg->data, computed_arg->len, 3); - - if (delay == NGX_ERROR) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "invalid sleep duration \"%V\"", &computed_arg_elts[0]); - return NGX_HTTP_BAD_REQUEST; - } - - dd("blocking delay: %lu ms", (unsigned long) delay); - - ngx_msleep((ngx_msec_t) delay); - - return NGX_OK; -} - - -static void -ngx_http_echo_sleep_cleanup(void *data) -{ - ngx_http_request_t *r = data; - ngx_http_echo_ctx_t *ctx; - - dd("echo sleep cleanup"); - - ctx = ngx_http_get_module_ctx(r, ngx_http_echo_module); - if (ctx == NULL) { - return; - } - - if (ctx->sleep.timer_set) { - dd("cleanup: deleting timer for echo_sleep"); - - ngx_del_timer(&ctx->sleep); - return; - } - - dd("cleanup: timer not set"); -} diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_sleep.h b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_sleep.h deleted file mode 100644 index 8bb70c3..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_sleep.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef ECHO_SLEEP_H -#define ECHO_SLEEP_H - -#include "ngx_http_echo_module.h" - -ngx_int_t ngx_http_echo_exec_echo_sleep( - ngx_http_request_t *r, ngx_http_echo_ctx_t *ctx, - ngx_array_t *computed_args); - -ngx_int_t ngx_http_echo_exec_echo_blocking_sleep(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args); - -void ngx_http_echo_sleep_event_handler(ngx_event_t *ev); - -#endif /* ECHO_SLEEP_H */ - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_subrequest.c b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_subrequest.c deleted file mode 100644 index 0980d58..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_subrequest.c +++ /dev/null @@ -1,791 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include "ngx_http_echo_util.h" -#include "ngx_http_echo_subrequest.h" -#include "ngx_http_echo_handler.h" -#include - - -#define ngx_http_echo_method_name(m) { sizeof(m) - 1, (u_char *) m " " } - - -ngx_str_t ngx_http_echo_content_length_header_key = - ngx_string("Content-Length"); - -ngx_str_t ngx_http_echo_get_method = ngx_http_echo_method_name("GET"); -ngx_str_t ngx_http_echo_put_method = ngx_http_echo_method_name("PUT"); -ngx_str_t ngx_http_echo_post_method = ngx_http_echo_method_name("POST"); -ngx_str_t ngx_http_echo_head_method = ngx_http_echo_method_name("HEAD"); -ngx_str_t ngx_http_echo_copy_method = ngx_http_echo_method_name("COPY"); -ngx_str_t ngx_http_echo_move_method = ngx_http_echo_method_name("MOVE"); -ngx_str_t ngx_http_echo_lock_method = ngx_http_echo_method_name("LOCK"); -ngx_str_t ngx_http_echo_mkcol_method = ngx_http_echo_method_name("MKCOL"); -ngx_str_t ngx_http_echo_trace_method = ngx_http_echo_method_name("TRACE"); -ngx_str_t ngx_http_echo_delete_method = ngx_http_echo_method_name("DELETE"); -ngx_str_t ngx_http_echo_unlock_method = ngx_http_echo_method_name("UNLOCK"); -ngx_str_t ngx_http_echo_options_method = ngx_http_echo_method_name("OPTIONS"); -ngx_str_t ngx_http_echo_propfind_method = - ngx_http_echo_method_name("PROPFIND"); -ngx_str_t ngx_http_echo_proppatch_method = - ngx_http_echo_method_name("PROPPATCH"); - - -typedef struct ngx_http_echo_subrequest_s { - ngx_uint_t method; - ngx_str_t *method_name; - ngx_str_t *location; - ngx_str_t *query_string; - ssize_t content_length_n; - ngx_http_request_body_t *request_body; -} ngx_http_echo_subrequest_t; - - -static ngx_int_t ngx_http_echo_parse_method_name(ngx_str_t **method_name_ptr); -static ngx_int_t ngx_http_echo_adjust_subrequest(ngx_http_request_t *sr, - ngx_http_echo_subrequest_t *parsed_sr); -static ngx_int_t ngx_http_echo_parse_subrequest_spec(ngx_http_request_t *r, - ngx_array_t *computed_args, ngx_http_echo_subrequest_t **parsed_sr_ptr); -static ngx_int_t ngx_http_echo_set_content_length_header(ngx_http_request_t *r, - off_t len); - - -ngx_int_t -ngx_http_echo_exec_echo_subrequest_async(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args) -{ - ngx_int_t rc; - ngx_http_echo_subrequest_t *parsed_sr; - ngx_http_request_t *sr; /* subrequest object */ - ngx_str_t args; - ngx_uint_t flags = 0; - - dd_enter(); - - rc = ngx_http_echo_parse_subrequest_spec(r, computed_args, &parsed_sr); - if (rc != NGX_OK) { - return rc; - } - - dd("location: %.*s", - (int) parsed_sr->location->len, - parsed_sr->location->data); - - args.data = NULL; - args.len = 0; - - if (ngx_http_parse_unsafe_uri(r, parsed_sr->location, &args, &flags) - != NGX_OK) - { - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "echo_subrequest_async sees unsafe uri: \"%V\"", - parsed_sr->location); - return NGX_ERROR; - } - - if (args.len > 0 && parsed_sr->query_string == NULL) { - parsed_sr->query_string = &args; - } - - rc = ngx_http_echo_send_header_if_needed(r, ctx); - if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) { - return rc; - } - - rc = ngx_http_subrequest(r, parsed_sr->location, parsed_sr->query_string, - &sr, NULL, 0); - - if (rc != NGX_OK) { - return NGX_ERROR; - } - - rc = ngx_http_echo_adjust_subrequest(sr, parsed_sr); - - if (rc != NGX_OK) { - return rc; - } - - return NGX_OK; -} - - -ngx_int_t -ngx_http_echo_exec_echo_subrequest(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args) -{ - ngx_int_t rc; - ngx_http_request_t *sr; /* subrequest object */ - ngx_http_post_subrequest_t *psr; - ngx_http_echo_subrequest_t *parsed_sr; - ngx_str_t args; - ngx_uint_t flags = 0; - ngx_http_echo_ctx_t *sr_ctx; - - dd_enter(); - - rc = ngx_http_echo_parse_subrequest_spec(r, computed_args, &parsed_sr); - if (rc != NGX_OK) { - return rc; - } - - args.data = NULL; - args.len = 0; - - if (ngx_http_parse_unsafe_uri(r, parsed_sr->location, &args, &flags) - != NGX_OK) - { - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "echo_subrequest sees unsafe uri: \"%V\"", - parsed_sr->location); - return NGX_ERROR; - } - - if (args.len > 0 && parsed_sr->query_string == NULL) { - parsed_sr->query_string = &args; - } - - rc = ngx_http_echo_send_header_if_needed(r, ctx); - if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) { - return rc; - } - - sr_ctx = ngx_http_echo_create_ctx(r); - - /* set by ngx_http_echo_create_ctx - * sr_ctx->run_post_subrequest = 0 - */ - - dd("creating sr ctx for %.*s: %p", (int) parsed_sr->location->len, - parsed_sr->location->data, sr_ctx); - - psr = ngx_palloc(r->pool, sizeof(ngx_http_post_subrequest_t)); - - if (psr == NULL) { - return NGX_ERROR; - } - - psr->handler = ngx_http_echo_post_subrequest; - psr->data = sr_ctx; - - rc = ngx_http_subrequest(r, parsed_sr->location, parsed_sr->query_string, - &sr, psr, 0); - - if (rc != NGX_OK) { - return NGX_ERROR; - } - - sr_ctx->sleep.data = sr; - - ngx_http_set_ctx(sr, sr_ctx, ngx_http_echo_module); - - rc = ngx_http_echo_adjust_subrequest(sr, parsed_sr); - - if (rc != NGX_OK) { - return NGX_ERROR; - } - - return NGX_AGAIN; -} - - -static ngx_int_t -ngx_http_echo_parse_subrequest_spec(ngx_http_request_t *r, - ngx_array_t *computed_args, ngx_http_echo_subrequest_t **parsed_sr_ptr) -{ - ngx_str_t *computed_arg_elts, *arg; - ngx_str_t **to_write = NULL; - ngx_str_t *method_name; - ngx_str_t *body_str = NULL; - ngx_str_t *body_file = NULL; - ngx_uint_t i; - ngx_flag_t expecting_opt; - ngx_http_request_body_t *rb = NULL; - ngx_buf_t *b; - ngx_http_echo_subrequest_t *parsed_sr; - ngx_open_file_info_t of; - ngx_http_core_loc_conf_t *clcf; - size_t len; - - *parsed_sr_ptr = ngx_pcalloc(r->pool, sizeof(ngx_http_echo_subrequest_t)); - if (*parsed_sr_ptr == NULL) { - return NGX_ERROR; - } - - parsed_sr = *parsed_sr_ptr; - computed_arg_elts = computed_args->elts; - method_name = &computed_arg_elts[0]; - parsed_sr->location = &computed_arg_elts[1]; - - if (parsed_sr->location->len == 0) { - return NGX_ERROR; - } - - expecting_opt = 1; - - for (i = 2; i < computed_args->nelts; i++) { - arg = &computed_arg_elts[i]; - - if (!expecting_opt) { - if (to_write == NULL) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "echo_subrequest_async: to_write should NOT be NULL"); - return NGX_ERROR; - } - - *to_write = arg; - to_write = NULL; - - expecting_opt = 1; - - continue; - } - - if (arg->len == 2) { - if (ngx_strncmp("-q", arg->data, arg->len) == 0) { - to_write = &parsed_sr->query_string; - expecting_opt = 0; - continue; - } - - if (ngx_strncmp("-b", arg->data, arg->len) == 0) { - to_write = &body_str; - expecting_opt = 0; - continue; - } - - if (ngx_strncmp("-f", arg->data, arg->len) == 0) { - dd("found option -f"); - to_write = &body_file; - expecting_opt = 0; - continue; - } - } - - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "unknown option for echo_subrequest*: %V", arg); - - return NGX_ERROR; - } - - if (body_str != NULL && body_str->len) { - rb = ngx_pcalloc(r->pool, sizeof(ngx_http_request_body_t)); - - if (rb == NULL) { - return NGX_ERROR; - } - - parsed_sr->content_length_n = body_str->len; - - b = ngx_calloc_buf(r->pool); - if (b == NULL) { - return NGX_ERROR; - } - - b->temporary = 1; - /* b->memory = 1; */ - b->start = b->pos = body_str->data; - b->end = b->last = body_str->data + body_str->len; - - rb->bufs = ngx_alloc_chain_link(r->pool); - if (rb->bufs == NULL) { - return NGX_ERROR; - } - - rb->bufs->buf = b; - rb->bufs->next = NULL; - - rb->buf = b; - - } else if (body_file != NULL && body_file->len) { - - dd("body_file defined %.*s", (int) body_file->len, body_file->data); - - body_file->data = ngx_http_echo_rebase_path(r->pool, body_file->data, - body_file->len, &len); - - if (body_file->data == NULL) { - return NGX_ERROR; - } - - body_file->len = len; - - dd("after rebase, the path becomes %.*s", (int) body_file->len, - body_file->data); - - rb = ngx_pcalloc(r->pool, sizeof(ngx_http_request_body_t)); - if (rb == NULL) { - return NGX_ERROR; - } - - clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); - ngx_memzero(&of, sizeof(ngx_open_file_info_t)); - -#if defined(nginx_version) && nginx_version >= 8018 - of.read_ahead = clcf->read_ahead; -#endif - - of.directio = clcf->directio; - of.valid = clcf->open_file_cache_valid; - of.min_uses = clcf->open_file_cache_min_uses; - of.errors = clcf->open_file_cache_errors; - of.events = clcf->open_file_cache_events; - - if (ngx_open_cached_file(clcf->open_file_cache, body_file, &of, r->pool) - != NGX_OK) - { - ngx_log_error(NGX_LOG_ERR, r->connection->log, of.err, - "%s \"%V\" failed", - of.failed, body_file); - - return NGX_ERROR; - } - - dd("file content size: %d", (int) of.size); - - parsed_sr->content_length_n = (ssize_t) of.size; - - b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t)); - if (b == NULL) { - return NGX_ERROR; - } - - b->file = ngx_pcalloc(r->pool, sizeof(ngx_file_t)); - if (b->file == NULL) { - return NGX_ERROR; - } - - b->file_pos = 0; - b->file_last = of.size; - - b->in_file = b->file_last ? 1: 0; - -#if 0 - b->last_buf = (r == r->main) ? 1: 0; - b->last_in_chain = 1; -#endif - - b->file->fd = of.fd; - b->file->name = *body_file; - b->file->log = r->connection->log; - b->file->directio = of.is_directio; - - rb->bufs = ngx_alloc_chain_link(r->pool); - if (rb->bufs == NULL) { - return NGX_ERROR; - } - - rb->bufs->buf = b; - rb->bufs->next = NULL; - rb->buf = b; - } - - parsed_sr->request_body = rb; - - parsed_sr->method = ngx_http_echo_parse_method_name(&method_name); - parsed_sr->method_name = method_name; - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_echo_adjust_subrequest(ngx_http_request_t *sr, - ngx_http_echo_subrequest_t *parsed_sr) -{ - ngx_http_core_main_conf_t *cmcf; - ngx_http_request_t *r; - ngx_http_request_body_t *body; - ngx_int_t rc; - - sr->method = parsed_sr->method; - sr->method_name = *(parsed_sr->method_name); - - if (sr->method == NGX_HTTP_HEAD) { - sr->header_only = 1; - } - - r = sr->parent; - - sr->header_in = r->header_in; - - /* XXX work-around a bug in ngx_http_subrequest */ - if (r->headers_in.headers.last == &r->headers_in.headers.part) { - sr->headers_in.headers.last = &sr->headers_in.headers.part; - } - - /* we do not inherit the parent request's variables */ - cmcf = ngx_http_get_module_main_conf(sr, ngx_http_core_module); - sr->variables = ngx_pcalloc(sr->pool, cmcf->variables.nelts - * sizeof(ngx_http_variable_value_t)); - - if (sr->variables == NULL) { - return NGX_ERROR; - } - - body = parsed_sr->request_body; - if (body) { - sr->request_body = body; - - rc = ngx_http_echo_set_content_length_header(sr, body->buf ? - ngx_buf_size(body->buf) - : 0); - - if (rc != NGX_OK) { - return NGX_ERROR; - } - } - - dd("subrequest body: %p", sr->request_body); - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_echo_parse_method_name(ngx_str_t **method_name_ptr) -{ - const ngx_str_t *method_name = *method_name_ptr; - - switch (method_name->len) { - case 3: - if (ngx_http_echo_strcmp_const(method_name->data, "GET") == 0) { - *method_name_ptr = &ngx_http_echo_get_method; - return NGX_HTTP_GET; - } - - if (ngx_http_echo_strcmp_const(method_name->data, "PUT") == 0) { - *method_name_ptr = &ngx_http_echo_put_method; - return NGX_HTTP_PUT; - } - - return NGX_HTTP_UNKNOWN; - - case 4: - if (ngx_http_echo_strcmp_const(method_name->data, "POST") == 0) { - *method_name_ptr = &ngx_http_echo_post_method; - return NGX_HTTP_POST; - } - - if (ngx_http_echo_strcmp_const(method_name->data, "HEAD") == 0) { - *method_name_ptr = &ngx_http_echo_head_method; - return NGX_HTTP_HEAD; - } - - if (ngx_http_echo_strcmp_const(method_name->data, "COPY") == 0) { - *method_name_ptr = &ngx_http_echo_copy_method; - return NGX_HTTP_COPY; - } - - if (ngx_http_echo_strcmp_const(method_name->data, "MOVE") == 0) { - *method_name_ptr = &ngx_http_echo_move_method; - return NGX_HTTP_MOVE; - } - - if (ngx_http_echo_strcmp_const(method_name->data, "LOCK") == 0) { - *method_name_ptr = &ngx_http_echo_lock_method; - return NGX_HTTP_LOCK; - } - - return NGX_HTTP_UNKNOWN; - - case 5: - if (ngx_http_echo_strcmp_const(method_name->data, "MKCOL") == 0) { - *method_name_ptr = &ngx_http_echo_mkcol_method; - return NGX_HTTP_MKCOL; - } - - if (ngx_http_echo_strcmp_const(method_name->data, "TRACE") == 0) { - *method_name_ptr = &ngx_http_echo_trace_method; - return NGX_HTTP_TRACE; - } - - return NGX_HTTP_UNKNOWN; - - case 6: - if (ngx_http_echo_strcmp_const(method_name->data, "DELETE") == 0) { - *method_name_ptr = &ngx_http_echo_delete_method; - return NGX_HTTP_DELETE; - } - - if (ngx_http_echo_strcmp_const(method_name->data, "UNLOCK") == 0) { - *method_name_ptr = &ngx_http_echo_unlock_method; - return NGX_HTTP_UNLOCK; - } - - return NGX_HTTP_UNKNOWN; - - case 7: - if (ngx_http_echo_strcmp_const(method_name->data, "OPTIONS") == 0) { - *method_name_ptr = &ngx_http_echo_options_method; - return NGX_HTTP_OPTIONS; - } - - return NGX_HTTP_UNKNOWN; - - case 8: - if (ngx_http_echo_strcmp_const(method_name->data, "PROPFIND") == 0) { - *method_name_ptr = &ngx_http_echo_propfind_method; - return NGX_HTTP_PROPFIND; - } - - return NGX_HTTP_UNKNOWN; - - case 9: - if (ngx_http_echo_strcmp_const(method_name->data, "PROPPATCH") == 0) { - *method_name_ptr = &ngx_http_echo_proppatch_method; - return NGX_HTTP_PROPPATCH; - } - - return NGX_HTTP_UNKNOWN; - - default: - return NGX_HTTP_UNKNOWN; - } -} - - -/* XXX extermely evil and not working yet */ -ngx_int_t -ngx_http_echo_exec_abort_parent(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx) -{ -#if 0 - ngx_http_postponed_request_t *pr, *ppr; - ngx_http_request_t *saved_data = NULL; - ngx_chain_t *out = NULL; - /* ngx_int_t rc; */ - - dd("aborting parent..."); - - if (r == r->main || r->parent == NULL) { - return NGX_OK; - } - - if (r->parent->postponed) { - dd("Found parent->postponed..."); - - saved_data = r->connection->data; - ppr = NULL; - for (pr = r->parent->postponed; pr->next; pr = pr->next) { - if (pr->request == NULL) { - continue; - } - - if (pr->request == r) { - /* r->parent->postponed->next = pr; */ - dd("found the current subrequest"); - out = pr->out; - continue; - } - - /* r->connection->data = pr->request; */ - dd("finalizing the subrequest..."); - ngx_http_upstream_create(pr->request); - pr->request->upstream = NULL; - - if (ppr == NULL) { - r->parent->postponed = pr->next; - ppr = pr->next; - } else { - ppr->next = pr->next; - ppr = pr->next; - } - } - } - - r->parent->postponed->next = NULL; - - /* - r->connection->data = r->parent; - r->connection->buffered = 0; - - if (out != NULL) { - dd("trying to send more stuffs for the parent"); - ngx_http_output_filter(r->parent, out); - } - */ - - /* ngx_http_send_special(r->parent, NGX_HTTP_LAST); */ - - if (saved_data) { - r->connection->data = saved_data; - } - - dd("terminating the parent request"); - - return ngx_http_echo_send_chain_link(r, ctx, NULL /* indicate LAST */); - - /* ngx_http_upstream_create(r); */ - - /* ngx_http_finalize_request(r->parent, NGX_ERROR); */ -#endif - - return NGX_OK; -} - - -ngx_int_t -ngx_http_echo_exec_exec(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args) -{ - ngx_str_t *uri; - ngx_str_t *user_args; - ngx_str_t args; - ngx_uint_t flags = 0; - ngx_str_t *computed_arg; - - computed_arg = computed_args->elts; - - uri = &computed_arg[0]; - - if (uri->len == 0) { - return NGX_HTTP_BAD_REQUEST; - } - - if (computed_args->nelts > 1) { - user_args = &computed_arg[1]; - - } else { - user_args = NULL; - } - - args.data = NULL; - args.len = 0; - - if (ngx_http_parse_unsafe_uri(r, uri, &args, &flags) != NGX_OK) { - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "echo_exec sees unsafe uri: \"%V\"", - uri); - return NGX_ERROR; - } - - if (args.len > 0 && user_args == NULL) { - user_args = &args; - } - - r->write_event_handler = ngx_http_request_empty_handler; - - if (uri->data[0] == '@') { - - if (user_args && user_args->len > 0) { - ngx_log_error(NGX_LOG_WARN, r->connection->log, 0, - "querystring %V ignored when exec'ing named " - "location %V", user_args, uri); - } - -#if 1 - /* clear the modules contexts */ - ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module); -#endif - - dd("named location: %.*s, c:%d", (int) uri->len, uri->data, - (int) r->main->count); - - return ngx_http_named_location(r, uri); - } - - return ngx_http_internal_redirect(r, uri, user_args); -} - - -static ngx_int_t -ngx_http_echo_set_content_length_header(ngx_http_request_t *r, off_t len) -{ - ngx_table_elt_t *h, *header; - u_char *p; - ngx_list_part_t *part; - ngx_http_request_t *pr; - ngx_uint_t i; - - r->headers_in.content_length_n = len; - - if (ngx_list_init(&r->headers_in.headers, r->pool, 20, - sizeof(ngx_table_elt_t)) - != NGX_OK) - { - return NGX_ERROR; - } - - h = ngx_list_push(&r->headers_in.headers); - if (h == NULL) { - return NGX_ERROR; - } - - h->key = ngx_http_echo_content_length_header_key; - h->lowcase_key = ngx_pnalloc(r->pool, h->key.len); - if (h->lowcase_key == NULL) { - return NGX_ERROR; - } - - ngx_strlow(h->lowcase_key, h->key.data, h->key.len); - - r->headers_in.content_length = h; - - p = ngx_palloc(r->pool, NGX_OFF_T_LEN); - if (p == NULL) { - return NGX_ERROR; - } - - h->value.data = p; - - h->value.len = ngx_sprintf(h->value.data, "%O", len) - h->value.data; - - h->hash = ngx_http_echo_content_length_hash; - - dd("r content length: %.*s", - (int) r->headers_in.content_length->value.len, - r->headers_in.content_length->value.data); - - pr = r->parent; - - if (pr == NULL) { - return NGX_OK; - } - - /* forward the parent request's all other request headers */ - - part = &pr->headers_in.headers.part; - header = part->elts; - - for (i = 0; /* void */; i++) { - - if (i >= part->nelts) { - if (part->next == NULL) { - break; - } - - part = part->next; - header = part->elts; - i = 0; - } - - if (header[i].key.len == sizeof("Content-Length") - 1 - && ngx_strncasecmp(header[i].key.data, (u_char *) "Content-Length", - sizeof("Content-Length") - 1) - == 0) - { - continue; - } - - h = ngx_list_push(&r->headers_in.headers); - if (h == NULL) { - return NGX_ERROR; - } - - *h = header[i]; - } - - /* XXX maybe we should set those built-in header slot in - * ngx_http_headers_in_t too? */ - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_subrequest.h b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_subrequest.h deleted file mode 100644 index 61c0a04..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_subrequest.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef ECHO_SUBREQUEST_H -#define ECHO_SUBREQUEST_H - -#include "ngx_http_echo_module.h" - -ngx_int_t ngx_http_echo_exec_echo_subrequest(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args); - -ngx_int_t ngx_http_echo_exec_echo_subrequest_async(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args); - -ngx_int_t ngx_http_echo_exec_abort_parent(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx); - -ngx_int_t ngx_http_echo_exec_exec(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_array_t *computed_args); - -#endif /* ECHO_SUBREQUEST_H */ - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_timer.c b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_timer.c deleted file mode 100644 index e2777ee..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_timer.c +++ /dev/null @@ -1,95 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif - -#include "ddebug.h" - -#include "ngx_http_echo_timer.h" -#include "ngx_http_echo_util.h" - -#include -#include -#include - - -ngx_int_t -ngx_http_echo_timer_elapsed_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data) -{ - ngx_http_echo_ctx_t *ctx; - ngx_msec_int_t ms; - u_char *p; - ngx_time_t *tp; - size_t size; - - ctx = ngx_http_get_module_ctx(r, ngx_http_echo_module); - if (ctx == NULL) { - ctx = ngx_http_echo_create_ctx(r); - if (ctx == NULL) { - return NGX_ERROR; - } - - ngx_http_set_ctx(r, ctx, ngx_http_echo_module); - } - - if (ctx->timer_begin.sec == 0) { - ctx->timer_begin.sec = r->start_sec; - ctx->timer_begin.msec = (ngx_msec_t) r->start_msec; - } - - /* force the ngx timer to update */ - -#if (nginx_version >= 8035) || (nginx_version < 8000 && nginx_version >= 7066) - ngx_time_update(); -#else - ngx_time_update(0, 0); -#endif - - tp = ngx_timeofday(); - - dd("old sec msec: %ld %d\n", (long) ctx->timer_begin.sec, - (int) ctx->timer_begin.msec); - - dd("new sec msec: %ld %d\n", (long) tp->sec, (int) tp->msec); - - ms = (ngx_msec_int_t) - ((tp->sec - ctx->timer_begin.sec) * 1000 + - (tp->msec - ctx->timer_begin.msec)); - ms = (ms >= 0) ? ms : 0; - - size = sizeof("-9223372036854775808.000") - 1; - - p = ngx_palloc(r->pool, size); - if (p == NULL) { - return NGX_ERROR; - } - - v->len = ngx_snprintf(p, size, "%T.%03M", ms / 1000, ms % 1000) - p; - v->data = p; - - v->valid = 1; - v->no_cacheable = 1; - v->not_found = 0; - - return NGX_OK; -} - - -ngx_int_t -ngx_http_echo_exec_echo_reset_timer(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx) -{ - dd("Exec timer..."); - - /* force the ngx timer to update */ - -#if (nginx_version >= 8035) || (nginx_version < 8000 && nginx_version >= 7066) - ngx_time_update(); -#else - ngx_time_update(0, 0); -#endif - - ctx->timer_begin = *ngx_timeofday(); - return NGX_OK; -} - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_timer.h b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_timer.h deleted file mode 100644 index b6e7ff3..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_timer.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef ECHO_TIMER_H -#define ECHO_TIMER_H - -#include "ngx_http_echo_module.h" - -ngx_int_t ngx_http_echo_timer_elapsed_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data); - -ngx_int_t ngx_http_echo_exec_echo_reset_timer(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx); - -#endif /* ECHO_TIMER_H */ - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_util.c b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_util.c deleted file mode 100644 index fed0587..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_util.c +++ /dev/null @@ -1,302 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include "ngx_http_echo_util.h" -#include "ngx_http_echo_sleep.h" - - -ngx_uint_t ngx_http_echo_content_length_hash = 0; - - -ngx_http_echo_ctx_t * -ngx_http_echo_create_ctx(ngx_http_request_t *r) -{ - ngx_http_echo_ctx_t *ctx; - - ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_echo_ctx_t)); - if (ctx == NULL) { - return NULL; - } - - ctx->sleep.handler = ngx_http_echo_sleep_event_handler; - ctx->sleep.data = r; - ctx->sleep.log = r->connection->log; - - return ctx; -} - - -ngx_int_t -ngx_http_echo_eval_cmd_args(ngx_http_request_t *r, - ngx_http_echo_cmd_t *cmd, ngx_array_t *computed_args, - ngx_array_t *opts) -{ - unsigned expecting_opts = 1; - ngx_uint_t i; - ngx_array_t *args = cmd->args; - ngx_str_t *arg, *raw, *opt; - ngx_http_echo_arg_template_t *value; - - value = args->elts; - - for (i = 0; i < args->nelts; i++) { - raw = &value[i].raw_value; - - if (value[i].lengths == NULL && raw->len > 0) { - if (expecting_opts) { - if (raw->len == 1 || raw->data[0] != '-') { - expecting_opts = 0; - - } else if (raw->data[1] == '-') { - expecting_opts = 0; - continue; - - } else { - opt = ngx_array_push(opts); - if (opt == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - opt->len = raw->len - 1; - opt->data = raw->data + 1; - - dd("pushing opt: %.*s", (int) opt->len, opt->data); - - continue; - } - } - - } else { - expecting_opts = 0; - } - - arg = ngx_array_push(computed_args); - if (arg == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - if (value[i].lengths == NULL) { /* does not contain vars */ - dd("Using raw value \"%.*s\"", (int) raw->len, raw->data); - *arg = *raw; - - } else { - if (ngx_http_script_run(r, arg, value[i].lengths->elts, - 0, value[i].values->elts) - == NULL) - { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - } - - dd("pushed arg: %.*s", (int) arg->len, arg->data); - } - - return NGX_OK; -} - - -ngx_int_t -ngx_http_echo_send_chain_link(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_chain_t *in) -{ - ngx_int_t rc; - - rc = ngx_http_echo_send_header_if_needed(r, ctx); - - if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) { - return rc; - } - - if (in == NULL) { - -#if defined(nginx_version) && nginx_version <= 8004 - - /* earlier versions of nginx does not allow subrequests - to send last_buf themselves */ - if (r != r->main) { - return NGX_OK; - } - -#endif - - rc = ngx_http_send_special(r, NGX_HTTP_LAST); - if (rc >= NGX_HTTP_SPECIAL_RESPONSE) { - return rc; - } - - return NGX_OK; - } - - /* FIXME we should udpate chains to recycle chain links and bufs */ - return ngx_http_output_filter(r, in); -} - - -ngx_int_t -ngx_http_echo_send_header_if_needed(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx) -{ - ngx_int_t rc; - ngx_http_echo_loc_conf_t *elcf; - - if (!r->header_sent && !ctx->header_sent) { - elcf = ngx_http_get_module_loc_conf(r, ngx_http_echo_module); - - r->headers_out.status = (ngx_uint_t) elcf->status; - - if (ngx_http_set_content_type(r) != NGX_OK) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - ngx_http_clear_content_length(r); - ngx_http_clear_accept_ranges(r); - - rc = ngx_http_send_header(r); - ctx->header_sent = 1; - return rc; - } - - return NGX_OK; -} - - -ssize_t -ngx_http_echo_atosz(u_char *line, size_t n) -{ - ssize_t value; - - if (n == 0) { - return NGX_ERROR; - } - - for (value = 0; n--; line++) { - if (*line == '_') { /* we ignore undercores */ - continue; - } - - if (*line < '0' || *line > '9') { - return NGX_ERROR; - } - - value = value * 10 + (*line - '0'); - } - - if (value < 0) { - return NGX_ERROR; - } - - return value; -} - - -/* Modified from the ngx_strlcasestrn function in ngx_string.h - * Copyright (C) by Igor Sysoev */ -u_char * -ngx_http_echo_strlstrn(u_char *s1, u_char *last, u_char *s2, size_t n) -{ - ngx_uint_t c1, c2; - - c2 = (ngx_uint_t) *s2++; - last -= n; - - do { - do { - if (s1 >= last) { - return NULL; - } - - c1 = (ngx_uint_t) *s1++; - - } while (c1 != c2); - - } while (ngx_strncmp(s1, s2, n) != 0); - - return --s1; -} - - -ngx_int_t -ngx_http_echo_post_request_at_head(ngx_http_request_t *r, - ngx_http_posted_request_t *pr) -{ - dd_enter(); - - if (pr == NULL) { - pr = ngx_palloc(r->pool, sizeof(ngx_http_posted_request_t)); - if (pr == NULL) { - return NGX_ERROR; - } - } - - pr->request = r; - pr->next = r->main->posted_requests; - r->main->posted_requests = pr; - - return NGX_OK; -} - - -u_char * -ngx_http_echo_rebase_path(ngx_pool_t *pool, u_char *src, size_t osize, - size_t *nsize) -{ - u_char *p, *dst; - - if (osize == 0) { - return NULL; - } - - if (src[0] == '/') { - /* being an absolute path already, just add a trailing '\0' */ - *nsize = osize; - - dst = ngx_palloc(pool, *nsize + 1); - if (dst == NULL) { - *nsize = 0; - return NULL; - } - - p = ngx_copy(dst, src, osize); - *p = '\0'; - - return dst; - } - - *nsize = ngx_cycle->prefix.len + osize; - - dst = ngx_palloc(pool, *nsize + 1); - if (dst == NULL) { - *nsize = 0; - return NULL; - } - - p = ngx_copy(dst, ngx_cycle->prefix.data, ngx_cycle->prefix.len); - p = ngx_copy(p, src, osize); - - *p = '\0'; - - return dst; -} - - -ngx_int_t -ngx_http_echo_flush_postponed_outputs(ngx_http_request_t *r) -{ - if (r == r->connection->data && r->postponed) { - /* notify the downstream postpone filter to flush the postponed - * outputs of the current request */ - return ngx_http_output_filter(r, NULL); - } - - /* do nothing */ - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_util.h b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_util.h deleted file mode 100644 index d620d09..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_util.h +++ /dev/null @@ -1,58 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef NGX_HTTP_ECHO_UTIL_H -#define NGX_HTTP_ECHO_UTIL_H - - -#include "ngx_http_echo_module.h" - - -#define ngx_http_echo_strcmp_const(a, b) \ - ngx_strncmp(a, b, sizeof(b) - 1) - - -#define ngx_http_echo_hash_literal(s) \ - ngx_http_echo_hash_str((u_char *) s, sizeof(s) - 1) - - -static ngx_inline ngx_uint_t -ngx_http_echo_hash_str(u_char *src, size_t n) -{ - ngx_uint_t key; - - key = 0; - - while (n--) { - key = ngx_hash(key, *src); - src++; - } - - return key; -} - - -extern ngx_uint_t ngx_http_echo_content_length_hash; - - -ngx_http_echo_ctx_t *ngx_http_echo_create_ctx(ngx_http_request_t *r); -ngx_int_t ngx_http_echo_eval_cmd_args(ngx_http_request_t *r, - ngx_http_echo_cmd_t *cmd, ngx_array_t *computed_args, - ngx_array_t *opts); -ngx_int_t ngx_http_echo_send_header_if_needed(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx); -ngx_int_t ngx_http_echo_send_chain_link(ngx_http_request_t *r, - ngx_http_echo_ctx_t *ctx, ngx_chain_t *cl); -ssize_t ngx_http_echo_atosz(u_char *line, size_t n); -u_char *ngx_http_echo_strlstrn(u_char *s1, u_char *last, u_char *s2, size_t n); -ngx_int_t ngx_http_echo_post_request_at_head(ngx_http_request_t *r, - ngx_http_posted_request_t *pr); -u_char *ngx_http_echo_rebase_path(ngx_pool_t *pool, u_char *src, size_t osize, - size_t *nsize); -ngx_int_t ngx_http_echo_flush_postponed_outputs(ngx_http_request_t *r); - - -#endif /* NGX_HTTP_ECHO_UTIL_H */ diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_var.c b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_var.c deleted file mode 100644 index 138a510..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_var.c +++ /dev/null @@ -1,110 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include "ngx_http_echo_var.h" -#include "ngx_http_echo_timer.h" -#include "ngx_http_echo_request_info.h" -#include "ngx_http_echo_foreach.h" - - -static ngx_int_t ngx_http_echo_incr_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data); - - -static ngx_http_variable_t ngx_http_echo_variables[] = { - - { ngx_string("echo_timer_elapsed"), NULL, - ngx_http_echo_timer_elapsed_variable, 0, - NGX_HTTP_VAR_NOCACHEABLE, 0 }, - - { ngx_string("echo_request_method"), NULL, - ngx_http_echo_request_method_variable, 0, - NGX_HTTP_VAR_NOCACHEABLE, 0 }, - - { ngx_string("echo_cacheable_request_uri"), NULL, - ngx_http_echo_cacheable_request_uri_variable, 0, - 0, 0 }, - - { ngx_string("echo_request_uri"), NULL, - ngx_http_echo_request_uri_variable, 0, - 0, 0 }, - - { ngx_string("echo_client_request_method"), NULL, - ngx_http_echo_client_request_method_variable, 0, - NGX_HTTP_VAR_NOCACHEABLE, 0 }, - - { ngx_string("echo_request_body"), NULL, - ngx_http_echo_request_body_variable, 0, - NGX_HTTP_VAR_NOCACHEABLE, 0 }, - - { ngx_string("echo_client_request_headers"), NULL, - ngx_http_echo_client_request_headers_variable, 0, - NGX_HTTP_VAR_NOCACHEABLE, 0 }, - - { ngx_string("echo_it"), NULL, - ngx_http_echo_it_variable, 0, - NGX_HTTP_VAR_NOCACHEABLE, 0 }, - - { ngx_string("echo_incr"), NULL, - ngx_http_echo_incr_variable, 0, - NGX_HTTP_VAR_NOCACHEABLE, 0 }, - - { ngx_string("echo_response_status"), NULL, - ngx_http_echo_response_status_variable, 0, - NGX_HTTP_VAR_NOCACHEABLE, 0 }, - - { ngx_null_string, NULL, NULL, 0, 0, 0 } -}; - - -ngx_int_t -ngx_http_echo_add_variables(ngx_conf_t *cf) -{ - ngx_http_variable_t *var, *v; - - for (v = ngx_http_echo_variables; v->name.len; v++) { - var = ngx_http_add_variable(cf, &v->name, v->flags); - if (var == NULL) { - return NGX_ERROR; - } - - var->get_handler = v->get_handler; - var->data = v->data; - } - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_echo_incr_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data) -{ - ngx_http_echo_ctx_t *ctx; - u_char *p; - - ctx = ngx_http_get_module_ctx(r->main, ngx_http_echo_module); - - if (ctx == NULL) { - return NGX_ERROR; - } - - ctx->counter++; - - p = ngx_palloc(r->pool, NGX_INT_T_LEN); - if (p == NULL) { - return NGX_ERROR; - } - - v->len = ngx_sprintf(p, "%ui", ctx->counter) - p; - v->data = p; - - v->valid = 1; - v->not_found = 0; - v->no_cacheable = 1; - - return NGX_OK; -} - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_var.h b/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_var.h deleted file mode 100644 index 8b24e02..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/src/ngx_http_echo_var.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef ECHO_VAR_H -#define ECHO_VAR_H - -#include "ngx_http_echo_module.h" - -ngx_int_t ngx_http_echo_add_variables(ngx_conf_t *cf); - -#endif /* ECHO_VAR_H */ - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/abort-parent.t b/modules_deb/libnginx-mod-http-echo-0.63/t/abort-parent.t deleted file mode 100644 index 6137607..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/abort-parent.t +++ /dev/null @@ -1,63 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::LWP skip_all => - 'not working at all'; - -plan tests => 2 * blocks(); - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /abort { - echo hello; - echo_flush; - echo_location_async '/foo'; - echo_location_async '/bar'; - echo_location_async '/baz'; - echo world; - echo_flush; - } - - location /proxy { - proxy_pass "http://127.0.0.1:$server_port/sleep?$query_string"; - } - - location /sleep { - echo_sleep $arg_sleep; - echo $arg_echo; - echo_flush; - } - - location /foo { - echo_location '/proxy?sleep=1&echo=foo'; - #echo_flush; - echo_abort_parent; - } - - location /bar { - proxy_pass 'http://127.0.0.1:$server_port/sleep_bar'; - } - - location /baz { - proxy_pass 'http://127.0.0.1:$server_port/sleep_baz'; - } - - location /sleep_bar { - echo_sleep 2; - echo bar; - } - - location /sleep_baz { - echo_sleep 3; - echo baz; - } ---- request - GET /abort ---- response_body -hello -bar - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/blocking-sleep.t b/modules_deb/libnginx-mod-http-echo-0.63/t/blocking-sleep.t deleted file mode 100644 index 0bdc6cc..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/blocking-sleep.t +++ /dev/null @@ -1,156 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => 2 * blocks(); - -#$Test::Nginx::LWP::LogLevel = 'debug'; - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /echo { - echo_blocking_sleep 1; - } ---- request - GET /echo ---- response_body - - - -=== TEST 2: fractional delay ---- config - location /echo { - echo_blocking_sleep 0.01; - } ---- request - GET /echo ---- response_body - - - -=== TEST 3: leading echo ---- config - location /echo { - echo before...; - echo_blocking_sleep 0.01; - } ---- request - GET /echo ---- response_body -before... - - - -=== TEST 4: trailing echo ---- config - location /echo { - echo_blocking_sleep 0.01; - echo after...; - } ---- request - GET /echo ---- response_body -after... - - - -=== TEST 5: two echos around sleep ---- config - location /echo { - echo before...; - echo_blocking_sleep 0.01; - echo after...; - } ---- request - GET /echo ---- response_body -before... -after... - - - -=== TEST 6: interleaving sleep and echo ---- config - location /echo { - echo 1; - echo_blocking_sleep 0.01; - echo 2; - echo_blocking_sleep 0.01; - } ---- request - GET /echo ---- response_body -1 -2 - - - -=== TEST 7: interleaving sleep and echo with echo at the end... ---- config - location /echo { - echo 1; - echo_blocking_sleep 0.01; - echo 2; - echo_blocking_sleep 0.01; - echo 3; - } ---- request - GET /echo ---- response_body -1 -2 -3 - - - -=== TEST 8: flush before sleep -we didn't really test the actual effect of "echo_flush" here... -merely checks if it croaks if appears. ---- config - location /flush { - echo hi; - echo_flush; - echo_blocking_sleep 0.01; - echo trees; - } ---- request - GET /flush ---- response_body -hi -trees - - - -=== TEST 9: flush does not increment opcode pointer itself ---- config - location /flush { - echo hi; - echo_flush; - echo trees; - } ---- request - GET /flush ---- response_body -hi -trees - - - -=== TEST 10: blocking sleep by variable ---- config - location ~ ^/sleep/(.+) { - echo before...; - echo_blocking_sleep $1; - echo after...; - } ---- request - GET /sleep/0.01 ---- response_body -before... -after... - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/echo-after-body.t b/modules_deb/libnginx-mod-http-echo-0.63/t/echo-after-body.t deleted file mode 100644 index 44c4c72..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/echo-after-body.t +++ /dev/null @@ -1,261 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (2 * blocks() + 1); - -no_long_string(); -log_level('warn'); - -#master_on(); -#workers(1); - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- http_config - postpone_output 1; ---- config - location /echo { - echo_after_body hello; - echo world; - } ---- request - GET /echo ---- response_body -world -hello - - - -=== TEST 2: echo after proxy ---- config - location /echo { - echo_after_body hello; - proxy_pass http://127.0.0.1:$server_port$request_uri/more; - } - location /echo/more { - echo world; - } ---- request - GET /echo ---- response_body -world -hello - - - -=== TEST 3: with variables ---- config - location /echo { - echo_after_body $request_method; - echo world; - } ---- request - GET /echo ---- response_body -world -GET - - - -=== TEST 4: w/o args ---- config - location /echo { - echo_after_body; - echo world; - } ---- request - GET /echo ---- response_body eval -"world\n\n" - - - -=== TEST 5: order is not important ---- config - location /reversed { - echo world; - echo_after_body hello; - } ---- request - GET /reversed ---- response_body -world -hello - - - -=== TEST 6: multiple echo_after_body instances ---- config - location /echo { - echo_after_body hello; - echo_after_body world; - echo !; - } ---- request - GET /echo ---- response_body -! -hello -world - - - -=== TEST 7: multiple echo_after_body instances with multiple echo cmds ---- config - location /echo { - echo_after_body hello; - echo_after_body world; - echo i; - echo say; - } ---- request - GET /echo ---- response_body -i -say -hello -world - - - -=== TEST 8: echo-after-body & echo-before-body ---- config - location /mixed { - echo_before_body hello; - echo_after_body world; - echo_before_body hiya; - echo_after_body igor; - echo ////////; - } ---- request - GET /mixed ---- response_body -hello -hiya -//////// -world -igor - - - -=== TEST 9: echo around proxy ---- config - location /echo { - echo_before_body hello; - echo_before_body world; - #echo $scheme://$host:$server_port$request_uri/more; - proxy_pass $scheme://127.0.0.1:$server_port$request_uri/more; - echo_after_body hiya; - echo_after_body igor; - } - location /echo/more { - echo blah; - } ---- request - GET /echo ---- response_body -hello -world -blah -hiya -igor - - - -=== TEST 10: with $echo_response_status ---- config - location /status { - echo_after_body "status: $echo_response_status"; - return 404; - } ---- request - GET /status ---- response_body_like -.*404 Not Found.* -status: 404$ ---- error_code: 404 - - - -=== TEST 11: in subrequests ---- config - location /main { - echo_location_async /hello; - } - location /hello { - echo_after_body 'world!'; - echo 'hello'; - } ---- request - GET /main ---- response_body -hello -world! - - - -=== TEST 12: echo_after_body + gzip ---- config - gzip on; - gzip_min_length 1; - location /main { - echo_after_body 'world!'; - echo_duplicate 1024 'hello'; - } ---- request - GET /main ---- response_body_like -hello ---- SKIP - - - -=== TEST 13: echo_after_body + proxy output ---- config - #gzip on; - #gzip_min_length 1; - location /main { - echo_after_body 'world'; - proxy_pass http://127.0.0.1:$server_port/foo; - } - location /foo { - echo_duplicate 10 hello; - } ---- request - GET /main ---- response_body_like -^(?:hello){10}world$ - - - -=== TEST 14: in subrequests (we get last_in_chain set properly) ---- config - location /main { - echo_location_async /hello; - } - location /hello { - echo 'hello'; - echo_after_body 'world!'; - body_filter_by_lua ' - local eof = ngx.arg[2] - if eof then - print("lua: eof found in body") - end - '; - } ---- request - GET /main ---- response_body -hello -world! ---- log_level: notice ---- error_log -lua: eof found in body - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/echo-before-body.t b/modules_deb/libnginx-mod-http-echo-0.63/t/echo-before-body.t deleted file mode 100644 index 1513184..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/echo-before-body.t +++ /dev/null @@ -1,278 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => 2 * blocks(); - -#$Test::Nginx::LWP::LogLevel = 'debug'; - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /echo { - echo_before_body hello; - echo world; - } ---- request - GET /echo ---- response_body -hello -world - - - -=== TEST 2: echo before proxy ---- config - location /echo { - echo_before_body hello; - proxy_pass $scheme://127.0.0.1:$server_port$request_uri/more; - } - location /echo/more { - echo world; - } ---- request - GET /echo ---- response_body -hello -world - - - -=== TEST 3: with variables ---- config - location /echo { - echo_before_body $request_method; - echo world; - } ---- request - GET /echo ---- response_body -GET -world - - - -=== TEST 4: w/o args ---- config - location /echo { - echo_before_body; - echo world; - } ---- request - GET /echo ---- response_body eval -"\nworld\n" - - - -=== TEST 5: order is not important ---- config - location /reversed { - echo world; - echo_before_body hello; - } ---- request - GET /reversed ---- response_body -hello -world - - - -=== TEST 6: multiple echo_before_body instances ---- config - location /echo { - echo_before_body hello; - echo_before_body world; - echo !; - } ---- request - GET /echo ---- response_body -hello -world -! - - - -=== TEST 7: multiple echo_before_body instances with multiple echo cmds ---- config - location /echo { - echo_before_body hello; - echo_before_body world; - echo i; - echo say; - } ---- request - GET /echo ---- response_body -hello -world -i -say - - - -=== TEST 8: with $echo_response_status ---- config - location /status { - echo_before_body "status: $echo_response_status"; - return 404; - } ---- request - GET /status ---- response_body_like -status: 404 -.*404 Not Found.*$ ---- error_code: 404 - - - -=== TEST 9: $echo_response_status in echo_before_body in subrequests ---- config - location /main { - echo_location '/status?val=403'; - echo_location '/status?val=500'; - } - location /status { - if ($arg_val = 500) { - echo_before_body "status: $echo_response_status"; - return 500; - break; - } - if ($arg_val = 403) { - echo_before_body "status: $echo_response_status"; - return 403; - break; - } - return 200; - } ---- request - GET /main ---- response_body_like -^status: 403.*?status: 500.*$ - - - -=== TEST 10: echo -n ---- config - location /echo { - echo_before_body -n hello; - echo_before_body -n world; - echo ==; - } ---- request - GET /echo ---- response_body -helloworld== - - - -=== TEST 11: echo a -n ---- config - location /echo { - echo_before_body a -n hello; - echo_before_body b -n world; - echo ==; - } ---- request - GET /echo ---- response_body -a -n hello -b -n world -== - - - -=== TEST 12: -n in a var ---- config - location /echo { - set $opt -n; - echo_before_body $opt hello; - echo_before_body $opt world; - echo ==; - } ---- request - GET /echo ---- response_body --n hello --n world -== - - - -=== TEST 13: -n only ---- config - location /echo { - echo_before_body -n; - echo_before_body -n; - echo ==; - } ---- request - GET /echo ---- response_body -== - - - -=== TEST 14: -n with an empty string ---- config - location /echo { - echo_before_body -n ""; - set $empty ""; - echo_before_body -n $empty; - echo ==; - } ---- request - GET /echo ---- response_body -== - - - -=== TEST 15: -- -n ---- config - location /echo { - echo_before_body -- -n hello; - echo_before_body -- -n world; - echo ==; - } ---- request - GET /echo ---- response_body --n hello --n world -== - - - -=== TEST 16: -n -n ---- config - location /echo { - echo_before_body -n -n hello; - echo_before_body -n -n world; - echo ==; - } ---- request - GET /echo ---- response_body -helloworld== - - - -=== TEST 17: -n -- -n ---- config - location /echo { - echo_before_body -n -- -n hello; - echo_before_body -n -- -n world; - echo ==; - } ---- request - GET /echo ---- response_body --n hello-n world== - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/echo-duplicate.t b/modules_deb/libnginx-mod-http-echo-0.63/t/echo-duplicate.t deleted file mode 100644 index 82b6725..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/echo-duplicate.t +++ /dev/null @@ -1,89 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => 2 * blocks(); - -#$Test::Nginx::LWP::LogLevel = 'debug'; - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /dup { - echo_duplicate 3 a; - } ---- request - GET /dup ---- response_body: aaa - - - -=== TEST 2: abc abc ---- config - location /dup { - echo_duplicate 2 abc; - } ---- request - GET /dup ---- response_body: abcabc - - - -=== TEST 3: big size with underscores ---- config - location /dup { - echo_duplicate 10_000 A; - } ---- request - GET /dup ---- response_body eval -'A' x 10_000 - - - -=== TEST 4: 0 duplicate 0 empty strings ---- config - location /dup { - echo_duplicate 0 ""; - } ---- request - GET /dup ---- response_body - - - -=== TEST 5: 0 duplicate non-empty strings ---- config - location /dup { - echo_duplicate 0 "abc"; - } ---- request - GET /dup ---- response_body - - - -=== TEST 6: duplication of empty strings ---- config - location /dup { - echo_duplicate 2 ""; - } ---- request - GET /dup ---- response_body - - - -=== TEST 7: sanity (HEAD) ---- config - location /dup { - echo_duplicate 3 a; - } ---- request - HEAD /dup ---- response_body - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/echo-timer.t b/modules_deb/libnginx-mod-http-echo-0.63/t/echo-timer.t deleted file mode 100644 index 712524d..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/echo-timer.t +++ /dev/null @@ -1,107 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => 2 * blocks(); - -run_tests(); - -__DATA__ - -=== TEST 1: timer without explicit reset ---- config - location /timer { - echo_sleep 0.03; - echo "elapsed $echo_timer_elapsed sec."; - } ---- request - GET /timer ---- response_body_like -^elapsed 0\.0(2[6-9]|3[0-6]) sec\.$ - - - -=== TEST 2: timer without explicit reset and sleep ---- config - location /timer { - echo "elapsed $echo_timer_elapsed sec."; - } ---- request - GET /timer ---- response_body_like -^elapsed 0\.00[0-5] sec\.$ - - - -=== TEST 3: timing accumulated sleeps ---- config - location /timer { - echo_sleep 0.03; - echo_sleep 0.02; - echo "elapsed $echo_timer_elapsed sec."; - } ---- request - GET /timer ---- response_body_like -^elapsed 0\.0(4[6-9]|5[0-6]) sec\.$ - - - -=== TEST 4: timer with explicit reset but without sleep ---- config - location /timer { - echo_reset_timer; - echo "elapsed $echo_timer_elapsed sec."; - } ---- request - GET /timer ---- response_body_like -^elapsed 0\.00[0-5] sec\.$ - - - -=== TEST 5: reset timer between sleeps ---- config - location /timer { - echo_sleep 0.02; - echo "elapsed $echo_timer_elapsed sec."; - echo_reset_timer; - echo_sleep 0.03; - echo "elapsed $echo_timer_elapsed sec."; - } ---- request - GET /timer ---- response_body_like -^elapsed 0\.0(1[6-9]|2[0-6]) sec\. -elapsed 0\.0(2[6-9]|3[0-6]) sec\.$ - - - -=== TEST 6: reset timer between blocking sleeps ---- config - location /timer { - echo_blocking_sleep 0.02; - echo "elapsed $echo_timer_elapsed sec."; - echo_reset_timer; - echo_blocking_sleep 0.03; - echo "elapsed $echo_timer_elapsed sec."; - } ---- request - GET /timer ---- response_body_like -^elapsed 0\.0(1[6-9]|2[0-9]) sec\. -elapsed 0\.0(2[6-9]|3[0-6]) sec\.$ - - - -=== TEST 7: timer without explicit reset ---- config - location = /timer { - return 200 "$echo_timer_elapsed"; - } ---- request - GET /timer ---- response_body_like chop -^0(\.0\d*)$ - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/echo.t b/modules_deb/libnginx-mod-http-echo-0.63/t/echo.t deleted file mode 100644 index b181259..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/echo.t +++ /dev/null @@ -1,416 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (2 * blocks() + 6); - -#$Test::Nginx::LWP::LogLevel = 'debug'; - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /echo { - echo hello; - } ---- request - GET /echo ---- response_body -hello - - - -=== TEST 2: multiple args ---- config - location /echo { - echo say hello world; - } ---- request - GET /echo ---- response_body -say hello world - - - -=== TEST 3: multiple directive instances ---- config - location /echo { - echo say that; - echo hello; - echo world !; - } ---- request - GET /echo ---- response_body -say that -hello -world ! - - - -=== TEST 4: echo without arguments ---- config - location /echo { - echo; - echo; - } ---- request - GET /echo ---- response_body eval -"\n\n" - - - -=== TEST 5: escaped newline ---- config - location /echo { - echo "hello\nworld"; - } ---- request - GET /echo ---- response_body -hello -world - - - -=== TEST 6: escaped tabs and \r and " wihtin "..." ---- config - location /echo { - echo "i say \"hello\tworld\"\r"; - } ---- request - GET /echo ---- response_body eval: "i say \"hello\tworld\"\r\n" - - - -=== TEST 7: escaped tabs and \r and " in single quotes ---- config - location /echo { - echo 'i say \"hello\tworld\"\r'; - } ---- request - GET /echo ---- response_body eval: "i say \"hello\tworld\"\r\n" - - - -=== TEST 8: escaped tabs and \r and " w/o any quotes ---- config - location /echo { - echo i say \"hello\tworld\"\r; - } ---- request - GET /echo ---- response_body eval: "i say \"hello\tworld\"\r\n" - - - -=== TEST 9: escaping $ -As of Nginx 0.8.20, there's still no way to escape the '$' character. ---- config - location /echo { - echo \$; - } ---- request - GET /echo ---- response_body -$ ---- SKIP - - - -=== TEST 10: XSS ---- config - location /blah { - echo_duplicate 1 "$arg_callback("; - echo_location_async "/data?$uri"; - echo_duplicate 1 ")"; - } - location /data { - echo_duplicate 1 '{"dog":"$query_string"}'; - } ---- request - GET /blah/9999999.json?callback=ding1111111 ---- response_body chomp -ding1111111({"dog":"/blah/9999999.json"}) - - - -=== TEST 11: XSS - filter version ---- config - location /blah { - echo_before_body "$arg_callback("; - - echo_duplicate 1 '{"dog":"$uri"}'; - - echo_after_body ")"; - } ---- request - GET /blah/9999999.json?callback=ding1111111 ---- response_body -ding1111111( -{"dog":"/blah/9999999.json"}) - - - -=== TEST 12: if ---- config -location /first { - echo "before"; - echo_location_async /second $request_uri; - echo "after"; -} - -location = /second { - if ($query_string ~ '([^?]+)') { - set $memcached_key $1; # needing this to be keyed on the request_path, not the entire uri - echo $memcached_key; - } -} ---- request - GET /first/9999999.json?callback=ding1111111 ---- response_body -before -/first/9999999.json -after - - - -=== TEST 13: echo -n ---- config - location /echo { - echo -n hello; - echo -n world; - } ---- request - GET /echo ---- response_body chop -helloworld - - - -=== TEST 14: echo a -n ---- config - location /echo { - echo a -n hello; - echo b -n world; - } ---- request - GET /echo ---- response_body -a -n hello -b -n world - - - -=== TEST 15: -n in a var ---- config - location /echo { - set $opt -n; - echo $opt hello; - echo $opt world; - } ---- request - GET /echo ---- response_body --n hello --n world - - - -=== TEST 16: -n only ---- config - location /echo { - echo -n; - echo -n; - } ---- request - GET /echo ---- response_body chop - - - -=== TEST 17: -n with an empty string ---- config - location /echo { - echo -n ""; - set $empty ""; - echo -n $empty; - } ---- request - GET /echo ---- response_body chop - - - -=== TEST 18: -- -n ---- config - location /echo { - echo -- -n hello; - echo -- -n world; - } ---- request - GET /echo ---- response_body --n hello --n world - - - -=== TEST 19: -n -n ---- config - location /echo { - echo -n -n hello; - echo -n -n world; - } ---- request - GET /echo ---- response_body chop -helloworld - - - -=== TEST 20: -n -- -n ---- config - location /echo { - echo -n -- -n hello; - echo -n -- -n world; - } ---- request - GET /echo ---- response_body chop --n hello-n world - - - -=== TEST 21: proxy ---- config - location /main { - proxy_pass http://127.0.0.1:$server_port/echo; - } - location /echo { - echo hello; - echo world; - } ---- request - GET /main ---- response_headers -!Content-Length ---- response_body -hello -world - - - -=== TEST 22: if is evil ---- config - location /test { - set $a 3; - set_by_lua $a ' - if ngx.var.a == "3" then - return 4 - end - '; - echo $a; - } ---- request - GET /test ---- response_body -4 ---- SKIP - - - -=== TEST 23: HEAD ---- config - location /echo { - echo hello; - echo world; - } ---- request - HEAD /echo ---- response_body - - - -=== TEST 24: POST ---- config - location /echo { - echo hello; - echo world; - } ---- pipelined_requests eval -["POST /echo -blah blah", "POST /echo -foo bar baz"] ---- response_body eval -["hello\nworld\n","hello\nworld\n"] - - - -=== TEST 25: POST ---- config - location /echo { - echo_sleep 0.001; - echo hello; - echo world; - } ---- pipelined_requests eval -["POST /echo -blah blah", "POST /echo -foo bar baz"] ---- response_body eval -["hello\nworld\n","hello\nworld\n"] - - - -=== TEST 26: empty arg after -n (github issue #33) ---- config - location = /t { - set $empty ""; - echo -n $empty hello world; - } ---- request - GET /t ---- response_body chop - hello world - - - -=== TEST 27: image filter ---- config - location = /gif { - empty_gif; - } - - location = /t { - default_type image/gif; - image_filter resize 10 10; - set $gif1 ''; - set $gif2 ''; - rewrite_by_lua ' - local res = ngx.location.capture("/gif") - local data = res.body - ngx.var.gif1 = string.sub(data, 1, #data - 1) - ngx.var.gif2 = string.sub(data, #data) - '; - echo -n $gif1; - echo -n $gif2; - } ---- request - GET /t ---- stap -F(ngx_http_image_header_filter) { - println("image header filter") -} ---- stap_out -image header filter ---- response_body_like: . - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/exec.t b/modules_deb/libnginx-mod-http-echo-0.63/t/exec.t deleted file mode 100644 index b7c1308..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/exec.t +++ /dev/null @@ -1,228 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (2 * blocks() + 1); - -#$Test::Nginx::LWP::LogLevel = 'debug'; - -run_tests(); - -__DATA__ - -=== TEST 1: exec normal location ---- config - location /main { - echo_exec /bar; - echo end; - } - location = /bar { - echo "$echo_request_uri:"; - echo bar; - } ---- request - GET /main ---- response_body -/bar: -bar - - - -=== TEST 2: location with args (inlined in uri) ---- config - location /main { - echo_exec /bar?a=32; - echo end; - } - location /bar { - echo "a: [$arg_a]"; - } ---- request - GET /main ---- response_body -a: [32] - - - -=== TEST 3: location with args (in separate arg) ---- config - location /main { - echo_exec /bar a=56; - echo end; - } - location /bar { - echo "a: [$arg_a]"; - } ---- request - GET /main ---- response_body -a: [56] - - - -=== TEST 4: exec named location ---- config - location /main { - echo_exec @bar; - echo end; - } - location @bar { - echo bar; - } ---- request - GET /main ---- response_body -bar - - - -=== TEST 5: query string ignored for named locations ---- config - location /main { - echo_exec @bar?a=32; - echo end; - } - location @bar { - echo "a: [$arg_a]"; - } ---- request - GET /main ---- response_body -a: [] ---- error_log -querystring a=32 ignored when exec'ing named location @bar - - - -=== TEST 6: query string ignored for named locations ---- config - location /foo { - echo_exec @bar; - } - location @bar { - echo "uri: [$echo_request_uri]"; - } ---- request - GET /foo ---- response_body -uri: [/foo] - - - -=== TEST 7: exec(named location) in subrequests ---- config - location /entry { - echo_location /foo; - echo_sleep 0.001; - echo_location /foo2; - } - location /foo { - echo_exec @bar; - } - location /foo2 { - echo_exec @bar; - } - - location @bar { - proxy_pass http://127.0.0.1:$server_port/bar; - } - location /bar { - echo_sleep 0.01; - echo hello; - } ---- request - GET /entry ---- response_body -hello -hello - - - -=== TEST 8: exec(normal loctions) in subrequests ---- config - location /entry { - echo_location /foo; - echo_sleep 0.001; - echo_location /foo2; - } - location /foo { - echo_exec /baz; - } - location /foo2 { - echo_exec /baz; - } - - location /baz { - proxy_pass http://127.0.0.1:$server_port/bar; - } - location /bar { - echo_sleep 0.01; - echo hello; - } ---- request - GET /entry ---- response_body -hello -hello - - - -=== TEST 9: exec should clear ctx ---- config - location @bar { - echo hello; - echo world; - echo heh; - } - location /foo { - #echo_sleep 0.001; - echo_reset_timer; - echo_exec @bar; - } ---- request - GET /foo ---- response_body -hello -world -heh - - - -=== TEST 10: reset ctx ---- config - location @proxy { - rewrite_by_lua return; - echo hello; - } - location /main { - rewrite_by_lua return; - echo_exec @proxy; - } ---- request - GET /main ---- response_body -hello - - - -=== TEST 11: yield before exec ---- config - location @bar { - echo hello; - echo world; - echo heh; - } - location /foo { - echo_sleep 0.001; - echo_exec @bar; - } ---- request - GET /foo ---- response_body -hello -world -heh - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/filter-used.t b/modules_deb/libnginx-mod-http-echo-0.63/t/filter-used.t deleted file mode 100644 index 2835270..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/filter-used.t +++ /dev/null @@ -1,59 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (3 * blocks()); - -no_long_string(); -log_level('warn'); - -#master_on(); -#workers(1); - -run_tests(); - -__DATA__ - -=== TEST 1: filter indeed used ---- http_config - postpone_output 1; ---- config - location /echo { - echo_after_body hello; - echo world; - } ---- request - GET /echo ---- stap -F(ngx_http_echo_header_filter) { - println("echo header filter called") -} ---- stap_out -echo header filter called ---- response_body -world -hello - - - -=== TEST 2: filter not used ---- http_config - postpone_output 1; ---- config - location /echo { - #echo_after_body hello; - echo world; - } ---- request - GET /echo ---- stap -F(ngx_http_echo_header_filter) { - println("echo header filter called") -} ---- stap_out ---- response_body -world - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/foreach-split.t b/modules_deb/libnginx-mod-http-echo-0.63/t/foreach-split.t deleted file mode 100644 index 266a701..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/foreach-split.t +++ /dev/null @@ -1,283 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * 2 * blocks(); - -#$Test::Nginx::LWP::LogLevel = 'debug'; - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /main { - echo_foreach_split '&' $query_string; - echo_location_async $echo_it; - echo '/* end */'; - echo_end; - } - location /sub/1.css { - echo "body { font-size: 12pt; }"; - } - location /sub/2.css { - echo "table { color: 'red'; }"; - } ---- request - GET /main?/sub/1.css&/sub/2.css ---- response_body -body { font-size: 12pt; } -/* end */ -table { color: 'red'; } -/* end */ - - - -=== TEST 2: split in a url argument (echo_location_async) ---- config - location /main_async { - echo_foreach_split ',' $arg_cssfiles; - echo_location_async $echo_it; - echo_end; - } - location /foo.css { - echo foo; - } - location /bar.css { - echo bar; - } - location /baz.css { - echo baz; - } ---- request - GET /main_async?cssfiles=/foo.css,/bar.css,/baz.css ---- response_body -foo -bar -baz - - - -=== TEST 3: split in a url argument (echo_location) ---- config - location /main_sync { - echo_foreach_split ',' $arg_cssfiles; - echo_location $echo_it; - echo_end; - } - location /foo.css { - echo foo; - } - location /bar.css { - echo bar; - } - location /baz.css { - echo baz; - } ---- request - GET /main_sync?cssfiles=/foo.css,/bar.css,/baz.css ---- response_body -foo -bar -baz ---- SKIP - - - -=== TEST 4: empty loop ---- config - location /main { - echo "start"; - echo_foreach_split ',' $arg_cssfiles; - echo_end; - echo "end"; - } ---- request - GET /main?cssfiles=/foo.css,/bar.css,/baz.css ---- response_body -start -end - - - -=== TEST 5: trailing delimiter ---- config - location /main_t { - echo_foreach_split ',' $arg_cssfiles; - echo_location_async $echo_it; - echo_end; - } - location /foo.css { - echo foo; - } ---- request - GET /main_t?cssfiles=/foo.css, ---- response_body -foo - - - -=== TEST 6: multi-char delimiter ---- config - location /main_sleep { - echo_foreach_split '-a-' $arg_list; - echo $echo_it; - echo_end; - } ---- request - GET /main_sleep?list=foo-a-bar-a-baz ---- error_code: 500 ---- response_body_like: 500 Internal Server Error - - - -=== TEST 7: multi-char delimiter (the right way) ---- config - location /main_sleep { - echo_foreach_split -- '-a-' $arg_list; - echo $echo_it; - echo_end; - } ---- request - GET /main_sleep?list=foo-a-bar-a-baz ---- response_body -foo -bar -baz - - - -=== TEST 8: loop with sleep ---- config - location /main_sleep { - echo_foreach_split '-' $arg_list; - echo_sleep 0.001; - echo $echo_it; - echo_end; - } ---- request - GET /main_sleep?list=foo-a-bar-A-baz ---- response_body -foo -a -bar -A -baz - - - -=== TEST 9: empty ---- config - location /merge { - default_type 'text/javascript'; - echo_foreach_split '&' $query_string; - echo "/* JS File $echo_it */"; - echo_location_async $echo_it; - echo; - echo_end; - } ---- request - GET /merge ---- response_body - - - -=== TEST 10: single & ---- config - location /merge { - default_type 'text/javascript'; - echo_foreach_split '&' $query_string; - echo "/* JS File $echo_it */"; - echo_location_async $echo_it; - echo; - echo_end; - } ---- request - GET /merge?& ---- response_body - - - -=== TEST 11: pure &'s ---- config - location /merge { - default_type 'text/javascript'; - echo_foreach_split '&' $query_string; - echo "/* JS File $echo_it */"; - echo_location_async $echo_it; - echo; - echo_end; - } ---- request - GET /merge?&&& ---- response_body - - - -=== TEST 12: pure & and spaces -TODO: needs to uri_decode $echo_it... ---- config - location /merge { - default_type 'text/javascript'; - echo_foreach_split '&' $query_string; - echo "/* JS File $echo_it */"; - echo_location_async $echo_it; - echo; - echo_end; - } ---- request - GET /merge?&%20&%20& ---- response_body ---- SKIP - - - -=== TEST 13: multiple foreach_split ---- config - location /multi { - echo_foreach_split '&' $query_string; - echo [$echo_it]; - echo_end; - - echo '...'; - - echo_foreach_split '-' $query_string; - echo [$echo_it]; - echo_end; - } ---- request - GET /multi?a-b&c-d ---- response_body -[a-b] -[c-d] -... -[a] -[b&c] -[d] - - - -=== TEST 14: github issue #2: setting a variable from $echo_it results to crashing ---- config -location = /getFile { - set $filelist "a,b,c"; - echo_foreach_split ',' $filelist; - set $file $echo_it; - echo_subrequest GET '/getFile2' -q 'sha256=$file'; - echo_end; -} - -location = /getFile2 { - echo "sha256: $arg_sha256"; -} ---- request - GET /getFile ---- response_body -sha256: -sha256: -sha256: - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/gzip.t b/modules_deb/libnginx-mod-http-echo-0.63/t/gzip.t deleted file mode 100644 index 61eb4f6..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/gzip.t +++ /dev/null @@ -1,31 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(1); - -plan tests => repeat_each() * 2 * blocks(); - -#$Test::Nginx::LWP::LogLevel = 'debug'; - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /gzip { - gzip on; - gzip_min_length 10; - gzip_types text/plain; - - echo_duplicate 1000 hello; - } ---- request - GET /gzip ---- more_headers -Accept-Encoding: gzip ---- response_headers -Content-Encoding: gzip ---- timeout: 20 diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/if.t b/modules_deb/libnginx-mod-http-echo-0.63/t/if.t deleted file mode 100644 index 054ec43..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/if.t +++ /dev/null @@ -1,150 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => 2 * blocks(); - -#$Test::Nginx::LWP::LogLevel = 'debug'; - -run_tests(); - -__DATA__ - -=== TEST 1: sanity (hit) ---- config - location ^~ /if { - set $res miss; - if ($arg_val ~* '^a') { - set $res hit; - echo $res; - } - echo $res; - } ---- request - GET /if?val=abc ---- response_body -hit - - - -=== TEST 2: sanity (miss) ---- config - location ^~ /if { - set $res miss; - if ($arg_val ~* '^a') { - set $res hit; - echo $res; - } - echo $res; - } ---- request - GET /if?val=bcd ---- response_body -miss - - - -=== TEST 3: proxy in if (hit) ---- config - location ^~ /if { - set $res miss; - if ($arg_val ~* '^a') { - set $res hit; - proxy_pass $scheme://127.0.0.1:$server_port/foo?res=$res; - } - proxy_pass $scheme://127.0.0.1:$server_port/foo?res=$res; - } - location /foo { - echo "res = $arg_res"; - } ---- request - GET /if?val=abc ---- response_body -res = hit - - - -=== TEST 4: proxy in if (miss) ---- config - location ^~ /if { - set $res miss; - if ($arg_val ~* '^a') { - set $res hit; - proxy_pass $scheme://127.0.0.1:$server_port/foo?res=$res; - } - proxy_pass $scheme://127.0.0.1:$server_port/foo?res=$res; - } - location /foo { - echo "res = $arg_res"; - } ---- request - GET /if?val=bcd ---- response_body -res = miss - - - -=== TEST 5: if too long url (hit) ---- config - location /foo { - if ($request_uri ~ '.{20,}') { - echo too long; - } - echo ok; - } ---- request - GET /foo?a=12345678901234567890 ---- response_body -too long - - - -=== TEST 6: if too long url (miss) ---- config - location /foo { - if ($request_uri ~ '.{20,}') { - echo too long; - } - echo ok; - } ---- request - GET /foo?a=1234567890 ---- response_body -ok - - - -=== TEST 7: echo should be inherited by if blocks ---- config - location /foo { - if ($uri ~ 'foo') { - } - echo ok; - } ---- request - GET /foo ---- response_body -ok - - - -=== TEST 8: echo_after_body and echo_before_body should be inherited by if blocks ---- config - location /foo { - if ($uri ~ 'foo') { - } - echo_before_body -n 'hello'; - echo_location /comma; - echo_after_body 'world'; - } - - location = /comma { - internal; - echo -n ', '; - } ---- request - GET /foo ---- response_body -hello, world - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/incr.t b/modules_deb/libnginx-mod-http-echo-0.63/t/incr.t deleted file mode 100644 index 8ad6d98..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/incr.t +++ /dev/null @@ -1,32 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => 2 * blocks(); - -#$Test::Nginx::LWP::LogLevel = 'debug'; - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /main { - echo "main pre: $echo_incr"; - echo_location_async /sub; - echo_location_async /sub; - echo "main post: $echo_incr"; - } - location /sub { - echo "sub: $echo_incr"; - } ---- request - GET /main ---- response_body -main pre: 1 -sub: 3 -sub: 4 -main post: 2 - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/location-async.t b/modules_deb/libnginx-mod-http-echo-0.63/t/location-async.t deleted file mode 100644 index 3494516..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/location-async.t +++ /dev/null @@ -1,439 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (2 * blocks() + 1); - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /main { - echo_location_async /sub; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -hello - - - -=== TEST 2: trailing echo ---- config - location /main { - echo_location_async /sub; - echo after subrequest; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -hello -after subrequest - - - -=== TEST 3: leading echo ---- config - location /main { - echo before subrequest; - echo_location_async /sub; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -before subrequest -hello - - - -=== TEST 4: leading & trailing echo ---- config - location /main { - echo before subrequest; - echo_location_async /sub; - echo after subrequest; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -before subrequest -hello -after subrequest - - - -=== TEST 5: multiple subrequests ---- config - location /main { - echo before sr 1; - echo_location_async /sub; - echo after sr 1; - echo before sr 2; - echo_location_async /sub; - echo after sr 2; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -before sr 1 -hello -after sr 1 -before sr 2 -hello -after sr 2 - - - -=== TEST 6: timed multiple subrequests (blocking sleep) ---- config - location /main { - echo_reset_timer; - echo_location_async /sub1; - echo_location_async /sub2; - echo "took $echo_timer_elapsed sec for total."; - } - location /sub1 { - echo_blocking_sleep 0.02; - echo hello; - } - location /sub2 { - echo_blocking_sleep 0.01; - echo world; - } - ---- request - GET /main ---- response_body_like -^hello -world -took 0\.00[0-5] sec for total\.$ - - - -=== TEST 7: timed multiple subrequests (non-blocking sleep) ---- config - location /main { - echo_reset_timer; - echo_location_async /sub1; - echo_location_async /sub2; - echo "took $echo_timer_elapsed sec for total."; - } - location /sub1 { - echo_sleep 0.02; - echo hello; - } - location /sub2 { - echo_sleep 0.01; - echo world; - } - ---- request - GET /main ---- response_body_like -^hello -world -took 0\.00[0-5] sec for total\.$ - - - -=== TEST 8: location with args ---- config - location /main { - echo_location_async /sub 'foo=Foo&bar=Bar'; - } - location /sub { - echo $arg_foo $arg_bar; - } ---- request - GET /main ---- response_body -Foo Bar - - - -=== TEST 9: encoded chars in query strings ---- config - location /main { - echo_location_async /sub 'foo=a%20b&bar=Bar'; - } - location /sub { - echo $arg_foo $arg_bar; - } ---- request - GET /main ---- response_body -a%20b Bar - - - -=== TEST 10: UTF-8 chars in query strings ---- config - location /main { - echo_location_async /sub 'foo=你好'; - } - location /sub { - echo $arg_foo; - } ---- request - GET /main ---- response_body -你好 - - - -=== TEST 11: encoded chars in location url ---- config - location /main { - echo_location_async /sub%31 'foo=Foo&bar=Bar'; - } - location /sub%31 { - echo 'sub%31'; - } - location /sub1 { - echo 'sub1'; - } ---- request - GET /main ---- response_body -sub1 - - - -=== TEST 12: querystring in url ---- config - location /main { - echo_location_async /sub?foo=Foo&bar=Bar; - } - location /sub { - echo $arg_foo $arg_bar; - } ---- request - GET /main ---- response_body -Foo Bar - - - -=== TEST 13: querystring in url *AND* an explicit querystring ---- config - location /main { - echo_location_async /sub?foo=Foo&bar=Bar blah=Blah; - } - location /sub { - echo $arg_foo $arg_bar $arg_blah; - } ---- request - GET /main ---- response_body - Blah - - - -=== TEST 14: explicit flush in main request -flush won't really flush the buffer... ---- config - location /main_flush { - echo 'pre main'; - echo_location_async /sub; - echo 'post main'; - echo_flush; - } - - location /sub { - echo_sleep 0.02; - echo 'sub'; - } ---- request - GET /main_flush ---- response_body -pre main -sub -post main - - - -=== TEST 15: no varaiable inheritance ---- config - location /main { - echo $echo_cacheable_request_uri; - echo_location_async /sub; - echo_location_async /sub2; - } - location /sub { - echo $echo_cacheable_request_uri; - } - location /sub2 { - echo $echo_cacheable_request_uri; - } - ---- request - GET /main ---- response_body -/main -/sub -/sub2 - - - -=== TEST 16: unsafe uri ---- config - location /unsafe { - echo_location_async '/../foo'; - } ---- request - GET /unsafe ---- stap2 -F(ngx_http_send_header) { - printf("send header on req %p (header sent: %d)\n", $r, $r->header_sent) - print_ubacktrace() -} ---- ignore_response ---- error_log -echo_location_async sees unsafe uri: "/../foo" ---- no_error_log -[error] -[alert] - - - -=== TEST 17: access/deny (access phase handlers skipped in subrequests) ---- config - location /main { - echo_location_async /denied; - } - location /denied { - deny all; - echo No no no; - } ---- request - GET /main ---- error_code: 200 ---- response_body -No no no - - - -=== TEST 18: rewrite is honored. ---- config - location /main { - echo_location_async /rewrite; - } - location /rewrite { - rewrite ^ /foo break; - echo $uri; - } ---- request - GET /main ---- response_body -/foo - - - -=== TEST 19: let subrequest to read the main request's request body ---- SKIP ---- config - location /main { - echo_location_async /sub; - } - location /sub { - echo_read_request_body; - echo_request_body; - } ---- request -POST /main -hello, body! ---- response_body chomp -hello, body! - - - -=== TEST 20: leading subrequest & echo_before_body ---- config - location /main { - echo_before_body hello; - echo_location_async /foo; - } - location /foo { - echo world; - } ---- request - GET /main ---- response_body -hello -world - - - -=== TEST 21: leading subrequest & xss ---- config - location /main { - default_type 'application/json'; - xss_get on; - xss_callback_arg c; - echo_location_async /foo; - } - location /foo { - echo -n world; - } ---- request - GET /main?c=hi ---- response_body chop -hi(world); - - - -=== TEST 22: multiple leading subrequest & xss ---- config - location /main { - default_type 'application/json'; - xss_get on; - xss_callback_arg c; - echo_location_async /foo; - echo_location_async /bar; - } - location /foo { - echo -n world; - } - location /bar { - echo -n ' people'; - } ---- request - GET /main?c=hi ---- response_body chop -hi(world people); - - - -=== TEST 23: sanity (HEAD) ---- config - location /main { - echo_location_async /sub; - echo_location_async /sub; - } - location /sub { - echo hello; - } ---- request - HEAD /main ---- response_body - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/location.t b/modules_deb/libnginx-mod-http-echo-0.63/t/location.t deleted file mode 100644 index 48c851e..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/location.t +++ /dev/null @@ -1,567 +0,0 @@ -# vi:filetype= - -use lib 'lib'; - -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (2 * blocks() + 2); - -#$Test::Nginx::LWP::LogLevel = 'debug'; - -#no_diff(); - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /main { - echo_location /sub; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -hello - - - -=== TEST 2: sanity with proxy in the middle ---- config - location /main { - echo_location /proxy; - } - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/sub; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -hello - - - -=== TEST 3: trailing echo ---- config - location /main { - echo_location /sub; - echo after subrequest; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -hello -after subrequest - - - -=== TEST 4: leading echo ---- config - location /main { - echo before subrequest; - echo_location /sub; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -before subrequest -hello - - - -=== TEST 5: leading & trailing echo ---- config - location /main { - echo before subrequest; - echo_location /sub; - echo after subrequest; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -before subrequest -hello -after subrequest - - - -=== TEST 6: multiple subrequests ---- config - location /main { - echo before sr 1; - echo_location /sub; - echo after sr 1; - echo before sr 2; - echo_location /sub; - echo after sr 2; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -before sr 1 -hello -after sr 1 -before sr 2 -hello -after sr 2 - - - -=== TEST 7: timed multiple subrequests (blocking sleep) ---- config - location /main { - echo_reset_timer; - echo_location /sub1; - echo_location /sub2; - echo "took $echo_timer_elapsed sec for total."; - } - location /sub1 { - echo_blocking_sleep 0.02; - echo hello; - } - location /sub2 { - echo_blocking_sleep 0.01; - echo world; - } - ---- request - GET /main ---- response_body_like -^hello -world -took 0\.0(?:2[5-9]|3[0-6]) sec for total\.$ - - - -=== TEST 8: timed multiple subrequests (non-blocking sleep) ---- config - location /main { - echo_reset_timer; - echo_location /sub1; - echo_location /sub2; - echo "took $echo_timer_elapsed sec for total."; - } - location /sub1 { - echo_sleep 0.02; - echo hello; - } - location /sub2 { - echo_sleep 0.01; - echo world; - } - ---- request - GET /main ---- response_body_like -^hello -world -took 0\.0(?:2[5-9]|3[0-6]) sec for total\.$ - - - -=== TEST 9: location with args ---- config - location /main { - echo_location /sub 'foo=Foo&bar=Bar'; - } - location /sub { - echo $arg_foo $arg_bar; - } ---- request - GET /main ---- response_body -Foo Bar - - - -=== TEST 10: chained subrequests ---- config - location /main { - echo 'pre main'; - echo_location /sub; - echo 'post main'; - } - - location /sub { - echo 'pre sub'; - echo_location /subsub; - echo 'post sub'; - } - - location /subsub { - echo 'subsub'; - } ---- request - GET /main ---- response_body -pre main -pre sub -subsub -post sub -post main - - - -=== TEST 11: chained subrequests using named locations -as of 0.8.20, ngx_http_subrequest still does not support -named location. sigh. this case is a TODO. ---- config - location /main { - echo 'pre main'; - echo_location @sub; - echo 'post main'; - } - - location @sub { - echo 'pre sub'; - echo_location @subsub; - echo 'post sub'; - } - - location @subsub { - echo 'subsub'; - } ---- request - GET /main ---- response_body -pre main -pre sub -subsub -post sub -post main ---- SKIP - - - -=== TEST 12: explicit flush in main request ---- config - location /main { - echo 'pre main'; - echo_location /sub; - echo 'post main'; - echo_flush; - } - - location /sub { - echo_sleep 0.02; - echo 'sub'; - } ---- request - GET /main ---- response_body -pre main -sub -post main - - - -=== TEST 13: no varaiable inheritance ---- config - location /main { - echo $echo_cacheable_request_uri; - echo_location /sub; - echo_location /sub2; - } - location /sub { - echo $echo_cacheable_request_uri; - } - location /sub2 { - echo $echo_cacheable_request_uri; - } - ---- request - GET /main ---- response_body -/main -/sub -/sub2 - - - -=== TEST 14: unsafe uri ---- config - location /unsafe { - echo_location '/../foo'; - } ---- request - GET /unsafe ---- ignore_response ---- error_log -echo_location sees unsafe uri: "/../foo" ---- no_error_log -[error] -[alert] - - - -=== TEST 15: querystring in url ---- config - location /main { - echo_location /sub?foo=Foo&bar=Bar; - } - location /sub { - echo $arg_foo $arg_bar; - } ---- request - GET /main ---- response_body -Foo Bar - - - -=== TEST 16: querystring in url *AND* an explicit querystring ---- config - location /main { - echo_location /sub?foo=Foo&bar=Bar blah=Blah; - } - location /sub { - echo $arg_foo $arg_bar $arg_blah; - } ---- request - GET /main ---- response_body - Blah - - - -=== TEST 17: let subrequest to read the main request's request body ---- SKIP ---- config - location /main { - echo_location /sub; - } - location /sub { - echo_read_request_body; - echo_request_body; - } ---- request -POST /main -hello, body! ---- response_body chomp -hello, body! - - - -=== TEST 18: sleep after location ---- config - location /main { - echo_location /sub; - echo_sleep 0.001; - echo_location /sub; - } - location /sub { - echo_sleep 0.001; - echo sub; - } ---- request - GET /main ---- response_body -sub -sub ---- skip_nginx: 2: < 0.8.11 - - - -=== TEST 19: deep nested echo_location/echo_location_async ---- config - location /main { - echo_location /bar; - echo_location_async /bar; - echo_location_async /bar; - echo_location /group; - echo_location_async /group; - } - - location /group { - echo_location /bar; - echo_location_async /bar; - } - - location /bar { - #echo_sleep 0.001; - echo $echo_incr; - } ---- request -GET /main ---- response_body -1 -2 -3 -4 -5 -6 -7 ---- timeout: 2 - - - -=== TEST 20: deep nested echo_location/echo_location_async (with sleep) ---- config - location /main { - echo_location /bar; - echo_location_async /bar; - echo_location_async /bar; - echo_location /group; - echo_location_async /group; - } - - location /group { - echo_location /baz; - echo_location_async /bah; - } - - location ~ '^/ba[rzh]' { - echo_sleep 0.001; - echo $echo_incr; - } ---- request -GET /main ---- response_body -1 -2 -3 -4 -5 -6 -7 ---- timeout: 2 - - - -=== TEST 21: deep nested echo_location (with sleep) ---- config - location /main { - echo_location /bar; - echo_location /bar; - echo_location /bar; - echo_location /group; - echo_location /group; - } - - location /group { - echo_location /bar; - echo_location /bar; - } - - location /incr { - echo_sleep 0.001; - echo $echo_incr; - } - - location /bar { - proxy_pass $scheme://127.0.0.1:$server_port/incr; - } ---- request -GET /main ---- response_body -1 -1 -1 -1 -1 -1 -1 ---- timeout: 5 ---- no_error_log -[error] - - - -=== TEST 22: leading subrequest & echo_before_body ---- config - location /main { - echo_before_body hello; - echo_location /foo; - } - location /foo { - echo world; - } ---- request - GET /main ---- response_body -hello -world - - - -=== TEST 23: leading subrequest & xss ---- config - location /main { - default_type 'application/json'; - xss_get on; - xss_callback_arg c; - echo_location /foo; - } - location /foo { - echo -n world; - } ---- request - GET /main?c=hi ---- response_body chop -hi(world); - - - -=== TEST 24: multiple leading subrequest & xss ---- config - location /main { - default_type 'application/json'; - xss_get on; - xss_callback_arg c; - echo_location /foo; - echo_location /bar; - } - location /main2 { - content_by_lua ' - local res = ngx.location.capture("/foo") - local res2 = ngx.location.capture("/bar") - ngx.say(res.body) - ngx.say(res2.body) - '; - } - location /foo { - echo -n world; - } - location /bar { - echo -n ' people'; - } ---- request - GET /main?c=hi ---- response_body chop -hi(world people); - - - -=== TEST 25: sanity (HEAD) ---- config - location /main { - echo_location /sub; - echo_location /sub; - } - location /sub { - echo hello; - } ---- request - HEAD /main ---- response_body - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/mixed.t b/modules_deb/libnginx-mod-http-echo-0.63/t/mixed.t deleted file mode 100644 index abf2599..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/mixed.t +++ /dev/null @@ -1,82 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => 2 * blocks(); - -run_tests(); - -__DATA__ - -=== TEST 1: echo before echo_client_request_headers ---- config - location /echo { - echo "headers:"; - echo -n $echo_client_request_headers; - } ---- request - GET /echo ---- response_body eval -"headers: -GET /echo HTTP/1.1\r -Host: localhost\r -Connection: close\r -\r -" - - - -=== TEST 2: echo_client_request_headers before echo ---- config - location /echo { - echo -n $echo_client_request_headers; - echo "...these are the headers"; - } ---- request - GET /echo ---- response_body eval -"GET /echo HTTP/1.1\r -Host: localhost\r -Connection: close\r -\r -...these are the headers -" - - - -=== TEST 3: echo & headers & echo ---- config - location /echo { - echo "headers are"; - echo -n $echo_client_request_headers; - echo "...these are the headers"; - } ---- request - GET /echo ---- response_body eval -"headers are -GET /echo HTTP/1.1\r -Host: localhost\r -Connection: close\r -\r -...these are the headers -" - - - -=== TEST 4: mixed with echo_duplicate ---- config - location /mixed { - echo hello; - echo_duplicate 2 ---; - echo_duplicate 1 ' END '; - echo_duplicate 2 ---; - echo; - } ---- request - GET /mixed ---- response_body -hello ------- END ------ - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/request-body.t b/modules_deb/libnginx-mod-http-echo-0.63/t/request-body.t deleted file mode 100644 index d467b2e..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/request-body.t +++ /dev/null @@ -1,58 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * 2 * blocks(); - -run_tests(); - -__DATA__ - -=== TEST 1: big client body buffered into temp files ---- config - location /echo { - client_body_buffer_size 1k; - echo_read_request_body; - echo_request_body; - } ---- request eval -"POST /echo -" . 'a' x 4096 . 'end'; ---- response_body eval -'a' x 4096 . 'end' - - - -=== TEST 2: in memory request body (trailing echo) ---- config - location /echo { - client_body_buffer_size 1k; - echo_read_request_body; - echo_request_body; - echo done; - } ---- request -POST /echo -hello world ---- response_body -hello worlddone - - - -=== TEST 3: big client body buffered into temp files (trailing echo) ---- config - location /echo { - client_body_buffer_size 1k; - echo_read_request_body; - echo_request_body; - echo done; - } ---- request eval -"POST /echo -" . 'a' x 4096 . "end\n"; ---- response_body eval -'a' x 4096 . "enddone\n" - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/request-info.t b/modules_deb/libnginx-mod-http-echo-0.63/t/request-info.t deleted file mode 100644 index dd34da4..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/request-info.t +++ /dev/null @@ -1,870 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (3 * blocks() + 14); - -run_tests(); - -__DATA__ - -=== TEST 1: standalone directive ---- config - location /echo { - echo -n $echo_client_request_headers; - } ---- request - GET /echo ---- response_body eval -"GET /echo HTTP/1.1\r -Host: localhost\r -Connection: close\r -\r -" ---- no_error_log -[error] - - - -=== TEST 2: multiple instances ---- config - location /echo { - echo -n $echo_client_request_headers; - echo -n $echo_client_request_headers; - } ---- request - GET /echo ---- response_body eval -"GET /echo HTTP/1.1\r -Host: localhost\r -Connection: close\r -\r -GET /echo HTTP/1.1\r -Host: localhost\r -Connection: close\r -\r -" ---- no_error_log -[error] - - - -=== TEST 3: does not explicitly request_body ---- config - location /echo { - echo [$echo_request_body]; - } ---- request -POST /echo -body here -heh ---- response_body -[] ---- no_error_log -[error] - - - -=== TEST 4: let proxy read request_body ---- config - location /echo { - echo_before_body [$echo_request_body]; - proxy_pass $scheme://127.0.0.1:$server_port/blah; - } - location /blah { echo_duplicate 0 ''; } ---- request -POST /echo -body here -heh ---- response_body -[body here -heh] ---- no_error_log -[error] - - - -=== TEST 5: use echo_read_request_body to read it! ---- config - location /echo { - echo_read_request_body; - echo [$echo_request_body]; - } ---- request -POST /echo -body here -heh ---- response_body -[body here -heh] ---- no_error_log -[error] - - - -=== TEST 6: how about sleep after that? ---- config - location /echo { - echo_read_request_body; - echo_sleep 0.002; - echo [$echo_request_body]; - } ---- request -POST /echo -body here -heh ---- response_body -[body here -heh] ---- no_error_log -[error] - - - -=== TEST 7: echo back the whole client request ---- config - # echo back the client request - location /echoback { - echo -n $echo_client_request_headers; - echo_read_request_body; - echo $echo_request_body; - } ---- request -POST /echoback -body here -haha ---- response_body eval -"POST /echoback HTTP/1.1\r -Host: localhost\r -Connection: close\r -Content-Length: 14\r -\r -body here -haha -" ---- no_error_log -[error] - - - -=== TEST 8: echo_request_body ---- config - location /body { - client_body_buffer_size 5; - echo_read_request_body; - echo "[$echo_request_body]"; - echo_request_body; - } ---- request eval -"POST /body -" . ('a' x 2048) . "b" ---- response_body eval -"[]\n" . -('a' x 2048) . "b" ---- no_error_log -[error] - - - -=== TEST 9: $echo_response_status in content handler ---- config - location /status { - echo "status: $echo_response_status"; - } ---- request - GET /status ---- response_body -status: ---- no_error_log -[error] - - - -=== TEST 10: echo_request_body (empty body) ---- config - location /body { - echo_read_request_body; - echo_request_body; - } - location /main { - proxy_pass http://127.0.0.1:$server_port/body; - } ---- request eval -"POST /main" ---- response_body eval -"" ---- no_error_log -[error] - - - -=== TEST 11: small header ---- config - location /t { - echo -n $echo_client_request_headers; - } ---- request -GET /t ---- response_body eval -qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -\r -} ---- no_error_log -[error] ---- no_error_log -[error] - - - -=== TEST 12: large header ---- config - client_header_buffer_size 10; - large_client_header_buffers 30 561; - location /t { - echo -n $echo_client_request_headers; - } ---- request -GET /t ---- more_headers eval -CORE::join "\n", map { "Header$_: value-$_" } 1..512 - ---- response_body eval -qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -} -.(CORE::join "\r\n", map { "Header$_: value-$_" } 1..512) . "\r\n\r\n" - ---- no_error_log -[error] - - - -=== TEST 13: small header, with leading CRLF ---- config - location /t { - echo -n $echo_client_request_headers; - } ---- raw_request eval -"\r\nGET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -\r -" ---- response_body eval -qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -\r -} ---- no_error_log -[error] - - - -=== TEST 14: large header, with leading CRLF ---- config - client_header_buffer_size 10; - large_client_header_buffers 30 561; - location /t { - echo -n $echo_client_request_headers; - } - ---- raw_request eval -"\r\nGET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -". -(CORE::join "\r\n", map { "Header$_: value-$_" } 1..512) . "\r\n\r\n" - ---- response_body eval -qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -} -.(CORE::join "\r\n", map { "Header$_: value-$_" } 1..512) . "\r\n\r\n" - ---- no_error_log -[error] - - - -=== TEST 15: small header, pipelined ---- config - location /t { - echo -n $echo_client_request_headers; - } ---- pipelined_requests eval -["GET /t", "GET /th"] - ---- more_headers -Foo: bar - ---- response_body eval -[qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: keep-alive\r -Foo: bar\r -\r -}, qq{GET /th HTTP/1.1\r -Host: localhost\r -Connection: close\r -Foo: bar\r -\r -}] ---- no_error_log -[error] - - - -=== TEST 16: large header, pipelined ---- config - client_header_buffer_size 10; - large_client_header_buffers 30 561; - location /t { - echo -n $echo_client_request_headers; - } ---- pipelined_requests eval -["GET /t", "GET /t"] - ---- more_headers eval -CORE::join "\n", map { "Header$_: value-$_" } 1..512 - ---- response_body eval -my $headers = (CORE::join "\r\n", map { "Header$_: value-$_" } 1..512) . "\r\n\r\n"; - -[qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: keep-alive\r -$headers}, -qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -$headers}] - ---- no_error_log -[error] - - - -=== TEST 17: small header, multi-line header -multi-line header is not supported since 1.21 ---- config - location /t { - echo -n $echo_client_request_headers; - } ---- raw_request eval -"GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -Foo: bar baz\r - blah\r -\r -" ---- response_body eval -qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -Foo: bar baz\r - blah\r -\r -} ---- no_error_log -[error] ---- skip_nginx -3: >= 1.21.1 - - - -=== TEST 18: large header, multi-line header -multi-line header is not supported since 1.21 ---- config - client_header_buffer_size 10; - large_client_header_buffers 50 567; - location /t { - echo -n $echo_client_request_headers; - } - ---- raw_request eval -my $headers = (CORE::join "\r\n", map { "Header$_: value-$_\r\n hello $_ world blah blah" } 1..512) . "\r\n\r\n"; - -qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -$headers} - ---- response_body eval -qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -} -.(CORE::join "\r\n", map { "Header$_: value-$_\r\n hello $_ world blah blah" } 1..512) . "\r\n\r\n" - ---- no_error_log -[error] ---- skip_nginx -3: >= 1.21.1 - - - -=== TEST 19: small header (POST body) ---- config - location /t { - echo_read_request_body; - echo -n $echo_client_request_headers; - } ---- request -POST /t -hello ---- response_body eval -qq{POST /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -Content-Length: 5\r -\r -} ---- no_error_log -[error] - - - -=== TEST 20: small header (POST body) - in subrequests (location) ---- config - location /t { - echo -n $echo_client_request_headers; - } - location /main { - echo_location /t; - } - ---- request -POST /main -hello ---- response_body eval -qq{POST /main HTTP/1.1\r -Host: localhost\r -Connection: close\r -Content-Length: 5\r -\r -} ---- no_error_log -[error] - - - -=== TEST 21: large header (POST body) ---- config - client_header_buffer_size 10; - large_client_header_buffers 30 561; - location /t { - echo_read_request_body; - echo -n $echo_client_request_headers; - } ---- request -POST /t -hello - ---- more_headers eval -CORE::join"\n", map { "Header$_: value-$_" } 1..512 - ---- response_body eval -qq{POST /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -} -.(CORE::join "\r\n", map { "Header$_: value-$_" } 1..512) . "\r\nContent-Length: 5\r\n\r\n" - ---- no_error_log -[error] ---- timeout: 5 - - - -=== TEST 22: large header (POST body) - in subrequests ---- config - client_header_buffer_size 10; - large_client_header_buffers 30 561; - location /t { - echo_read_request_body; - echo -n $echo_client_request_headers; - } - - location /main { - echo_location /t; - } ---- request -POST /main -hello ---- more_headers eval -CORE::join"\n", map { "Header$_: value-$_" } 1..512 - ---- response_body eval -qq{POST /main HTTP/1.1\r -Host: localhost\r -Connection: close\r -} -.(CORE::join "\r\n", map { "Header$_: value-$_" } 1..512) . "\r\nContent-Length: 5\r\n\r\n" - ---- no_error_log -[error] ---- timeout: 5 - - - -=== TEST 23: raw headers - the default header buffer can hold the request line, but not the header entries ---- config - location /t { - echo_read_request_body; - echo -n $echo_client_request_headers; - } ---- request -GET /t ---- more_headers eval -my $s = "User-Agent: curl\nBah: bah\n"; -$s .= "Accept: */*\n"; -$s .= "Cookie: " . "C" x 1200 . "\n"; -$s ---- response_body eval -"GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -User-Agent: curl\r -Bah: bah\r -Accept: */*\r -Cookie: " . ("C" x 1200) . "\r\n\r\n" ---- no_error_log -[error] - - - -=== TEST 24: small header (POST body) - in subrequests (location_async) ---- config - location /t { - echo -n $echo_client_request_headers; - } - location /main { - echo_location_async /t; - } - ---- request -POST /main -hello ---- response_body eval -qq{POST /main HTTP/1.1\r -Host: localhost\r -Connection: close\r -Content-Length: 5\r -\r -} ---- no_error_log -[error] - - - -=== TEST 25: small header (POST body) - in subrequests (subrequest) ---- config - location /t { - echo -n $echo_client_request_headers; - } - location /main { - echo_subrequest GET /t; - } - ---- request -POST /main -hello ---- response_body eval -qq{POST /main HTTP/1.1\r -Host: localhost\r -Connection: close\r -Content-Length: 5\r -\r -} ---- no_error_log -[error] - - - -=== TEST 26: small header (POST body) - in subrequests (subrequest_async) ---- config - location /t { - echo -n $echo_client_request_headers; - } - location /main { - echo_subrequest_async GET /t; - } - ---- request -POST /main -hello ---- response_body eval -qq{POST /main HTTP/1.1\r -Host: localhost\r -Connection: close\r -Content-Length: 5\r -\r -} ---- no_error_log -[error] - - - -=== TEST 27: ngx_proxy/ngx_fastcgi/etc change r->header_end to point to their own buffers ---- config - location = /t { - proxy_buffering off; - proxy_pass http://127.0.0.1:$server_port/bad; - proxy_intercept_errors on; - error_page 500 = /500; - } - - location = /bad { - return 500; - } - - location = /500 { - echo -n $echo_client_request_headers; - } ---- request -GET /t ---- response_body eval -"GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -\r -" ---- no_error_log -[error] - - - -=== TEST 28: ngx_proxy/ngx_fastcgi/etc change r->header_end to point to their own buffers (exclusive LF in the request data) ---- config - location = /t { - proxy_buffering off; - proxy_pass http://127.0.0.1:$server_port/bad; - proxy_intercept_errors on; - error_page 500 = /500; - } - - location = /bad { - return 500; - } - - location = /500 { - internal; - echo -n $echo_client_request_headers; - } ---- raw_request eval -"GET /t HTTP/1.1 -Host: localhost -Connection: close -Content-Length: 5 - -hello" ---- response_body eval -"GET /t HTTP/1.1 -Host: localhost -Connection: close -Content-Length: 5 - -" ---- no_error_log -[error] - - - -=== TEST 29: ngx_proxy/ngx_fastcgi/etc change r->header_end to point to their own buffers (mixed LF and CRLF in the request data) ---- config - location = /t { - proxy_buffering off; - proxy_pass http://127.0.0.1:$server_port/bad; - proxy_intercept_errors on; - error_page 500 = /500; - } - - location = /bad { - return 500; - } - - location = /500 { - internal; - echo -n $echo_client_request_headers; - } ---- raw_request eval -"GET /t HTTP/1.1\r -Host: localhost -Connection: close\r -Content-Length: 5\r - -hello" ---- response_body eval -"GET /t HTTP/1.1\r -Host: localhost -Connection: close\r -Content-Length: 5\r - -" ---- no_error_log -[error] - - - -=== TEST 30: ngx_proxy/ngx_fastcgi/etc change r->header_end to point to their own buffers (another way of mixing LF and CRLF in the request data) ---- config - location = /t { - proxy_buffering off; - proxy_pass http://127.0.0.1:$server_port/bad; - proxy_intercept_errors on; - error_page 500 = /500; - } - - location = /bad { - return 500; - } - - location = /500 { - internal; - echo -n $echo_client_request_headers; - } ---- raw_request eval -"GET /t HTTP/1.1\r -Host: localhost -Connection: close\r -Content-Length: 5 -\r -hello" ---- response_body eval -"GET /t HTTP/1.1\r -Host: localhost -Connection: close\r -Content-Length: 5 -\r -" ---- no_error_log -[error] - - - -=== TEST 31: two pipelined requests with large headers ---- config - client_header_buffer_size 10; - large_client_header_buffers 3 5610; - location /t { - echo -n $echo_client_request_headers; - } ---- pipelined_requests eval -["GET /t", "GET /t"] ---- more_headers eval -CORE::join "\n", map { "Header$_: value-$_" } 1..585 - ---- response_body eval -[qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: keep-alive\r -} -.(CORE::join "\r\n", map { "Header$_: value-$_" } 1..585) . "\r\n\r\n", -qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -} -.(CORE::join "\r\n", map { "Header$_: value-$_" } 1..585) . "\r\n\r\n", -, -] - ---- no_error_log -[error] ---- timeout: 5 - - - -=== TEST 32: a request with large header and a smaller pipelined request following ---- config - client_header_buffer_size 10; - large_client_header_buffers 2 1921; - location /t { - echo -n $echo_client_request_headers; - } ---- pipelined_requests eval -["GET /t", "GET /t"] ---- more_headers eval -[CORE::join("\n", map { "Header$_: value-$_" } 1..170), "Foo: bar\n"] - ---- response_body eval -[qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: keep-alive\r -} -.(CORE::join "\r\n", map { "Header$_: value-$_" } 1..170) . "\r\n\r\n", -qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -Foo: bar\r -\r -}, -] - ---- no_error_log -[error] ---- timeout: 5 - - - -=== TEST 33: a request with large header and a smaller pipelined request following ---- config - client_header_buffer_size 10; - large_client_header_buffers 2 1921; - location /t { - echo -n $echo_client_request_headers; - } ---- pipelined_requests eval -["GET /t", "GET /t" . ("a" x 512)] ---- more_headers eval -[CORE::join("\n", map { "Header$_: value-$_" } 1..170), "Foo: bar\n"] - ---- response_body eval -[qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: keep-alive\r -} -.(CORE::join "\r\n", map { "Header$_: value-$_" } 1..170) . "\r\n\r\n", -qq{GET /t} . ("a" x 512) . qq{ HTTP/1.1\r -Host: localhost\r -Connection: close\r -Foo: bar\r -\r -}, -] - ---- no_error_log -[error] ---- timeout: 5 - - - -=== TEST 34: invalid header line started with whitespace since nginx 1.21.1 ---- config - client_header_buffer_size 10; - large_client_header_buffers 50 567; - location /t { - echo -n $echo_client_request_headers; - } - ---- raw_request eval -my $headers = (CORE::join "\r\n", map { "Header$_: value-$_\r\n hello $_ world blah blah" } 1..512) . "\r\n\r\n"; - -qq{GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -$headers} - ---- error_code: 400 ---- no_error_log -[error] ---- skip_nginx -2: < 1.21.1 diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/sleep.t b/modules_deb/libnginx-mod-http-echo-0.63/t/sleep.t deleted file mode 100644 index f8e741e..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/sleep.t +++ /dev/null @@ -1,200 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => 2 * blocks(); - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /echo { - echo_sleep 1; - } ---- request - GET /echo ---- response_body - - - -=== TEST 2: fractional delay ---- config - location /echo { - echo_sleep 0.01; - } ---- request - GET /echo ---- response_body - - - -=== TEST 3: leading echo ---- config - location /echo { - echo before...; - echo_sleep 0.01; - } ---- request - GET /echo ---- response_body -before... - - - -=== TEST 4: trailing echo ---- config - location /echo { - echo_sleep 0.01; - echo after...; - } ---- request - GET /echo ---- response_body -after... - - - -=== TEST 5: two echos around sleep ---- config - location /echo { - echo before...; - echo_sleep 0.01; - echo after...; - } ---- request - GET /echo ---- response_body -before... -after... - - - -=== TEST 6: interleaving sleep and echo ---- config - location /echo { - echo 1; - echo_sleep 0.01; - echo 2; - echo_sleep 0.01; - } ---- request - GET /echo ---- response_body -1 -2 - - - -=== TEST 7: interleaving sleep and echo with echo at the end... ---- config - location /echo { - echo 1; - echo_sleep 0.01; - echo 2; - echo_sleep 0.01; - echo 3; - } ---- request - GET /echo ---- response_body -1 -2 -3 - - - -=== TEST 8: flush before sleep -we didn't really test the actual effect of "echo_flush" here... -merely checks if it croaks if appears. ---- config - location /flush { - echo hi; - echo_flush; - echo_sleep 0.01; - echo trees; - } ---- request - GET /flush ---- response_body -hi -trees - - - -=== TEST 9: flush does not increment opcode pointer itself ---- config - location /flush { - echo hi; - echo_flush; - echo trees; - } ---- request - GET /flush ---- response_body -hi -trees - - - -=== TEST 10: sleep through a proxy -this reveals a bug in v0.19 and the bug is fixed in v0.20. ---- config - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/entry'; - } - location /entry { - echo_sleep 0.001; - echo done; - } ---- request - GET /proxy ---- response_body_like -done - - - -=== TEST 11: abnormally quit ---- config - location /quit { - echo before; - echo_flush; - echo_sleep 1; - echo after; - } ---- request - GET /quit ---- response_body -before -after - - - -=== TEST 12: two echos around sleep (HEAD) ---- config - location /echo { - echo before...; - echo_sleep 0.01; - echo after...; - } ---- request - HEAD /echo ---- response_body - - - -=== TEST 13: sleep by variable ---- config - location ~ ^/sleep/(.+) { - echo before...; - echo_sleep $1; - echo after...; - } ---- request - GET /sleep/0.01 ---- response_body -before... -after... - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/status.t b/modules_deb/libnginx-mod-http-echo-0.63/t/status.t deleted file mode 100644 index d97b084..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/status.t +++ /dev/null @@ -1,142 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(1); - -plan tests => repeat_each() * (2 * blocks()); - -#$Test::Nginx::LWP::LogLevel = 'debug'; - -run_tests(); - -__DATA__ - -=== TEST 1: 200 ---- config - location /echo { - echo_status 200; - echo hello; - } ---- request - GET /echo ---- response_body -hello ---- error_code: 200 - - - -=== TEST 2: if location (200) ---- config - location /echo { - set $true 1; - if ($true) { - } - echo_status 200; - echo hello; - } ---- request - GET /echo ---- response_body -hello ---- error_code: 200 - - - -=== TEST 3: 404 ---- config - location /echo { - echo_status 404; - echo hello; - } ---- request - GET /echo ---- response_body -hello ---- error_code: 404 - - - -=== TEST 4: if location (404) ---- config - location /echo { - set $true 1; - if ($true) { - } - echo_status 404; - echo hello; - } ---- request - GET /echo ---- response_body -hello ---- error_code: 404 - - - -=== TEST 5: 500 ---- config - location /echo { - echo_status 500; - echo hello; - } ---- request - GET /echo ---- response_body -hello ---- error_code: 500 - - - -=== TEST 6: if location (500) ---- config - location /echo { - set $true 1; - if ($true) { - } - echo_status 500; - echo hello; - } ---- request - GET /echo ---- response_body -hello ---- error_code: 500 - - - -=== TEST 7: if location (500) no inherit ---- config - location /echo { - set $true 1; - if ($true) { - echo_status 503; - } - echo_status 500; - echo hello; - } ---- request - GET /echo ---- response_body -hello ---- error_code: 503 - - - -=== TEST 8: subrequest ---- config - location /echo { - echo_location /sub; - echo_status 503; - } - - location /sub { - echo blah blah; - } ---- request - GET /echo ---- response_body -blah blah ---- error_code: 503 - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/subrequest-async.t b/modules_deb/libnginx-mod-http-echo-0.63/t/subrequest-async.t deleted file mode 100644 index 882b368..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/subrequest-async.t +++ /dev/null @@ -1,604 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (blocks() * 2 + 1); - -#$Test::Nginx::LWP::LogLevel = 'debug'; - -$ENV{TEST_NGINX_HTML_DIR} = html_dir; - -run_tests(); - -__DATA__ - -=== TEST 1: sanity - GET ---- config - location /main { - echo_subrequest_async GET /sub; - } - location /sub { - echo "sub method: $echo_request_method"; - echo "main method: $echo_client_request_method"; - } ---- request - GET /main ---- response_body -sub method: GET -main method: GET - - - -=== TEST 2: sanity - DELETE ---- config - location /main { - echo_subrequest_async DELETE /sub; - } - location /sub { - echo "sub method: $echo_request_method"; - echo "main method: $echo_client_request_method"; - } ---- request - GET /main ---- response_body -sub method: DELETE -main method: GET - - - -=== TEST 3: trailing echo ---- config - location /main { - echo_subrequest_async GET /sub; - echo after subrequest; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -hello -after subrequest - - - -=== TEST 4: leading echo ---- config - location /main { - echo before subrequest; - echo_subrequest_async GET /sub; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -before subrequest -hello - - - -=== TEST 5: leading & trailing echo ---- config - location /main { - echo before subrequest; - echo_subrequest_async GET /sub; - echo after subrequest; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -before subrequest -hello -after subrequest - - - -=== TEST 6: multiple subrequests ---- config - location /main { - echo before sr 1; - echo_subrequest_async GET /sub; - echo after sr 1; - echo before sr 2; - echo_subrequest_async GET /sub; - echo after sr 2; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -before sr 1 -hello -after sr 1 -before sr 2 -hello -after sr 2 - - - -=== TEST 7: timed multiple subrequests (blocking sleep) ---- config - location /main { - echo_reset_timer; - echo_subrequest_async GET /sub1; - echo_subrequest_async GET /sub2; - echo "took $echo_timer_elapsed sec for total."; - } - location /sub1 { - echo_blocking_sleep 0.02; - echo hello; - } - location /sub2 { - echo_blocking_sleep 0.01; - echo world; - } - ---- request - GET /main ---- response_body_like -^hello -world -took 0\.00[0-5] sec for total\.$ - - - -=== TEST 8: timed multiple subrequests (non-blocking sleep) ---- config - location /main { - echo_reset_timer; - echo_subrequest_async GET /sub1; - echo_subrequest_async GET /sub2; - echo "took $echo_timer_elapsed sec for total."; - } - location /sub1 { - echo_sleep 0.02; - echo hello; - } - location /sub2 { - echo_sleep 0.01; - echo world; - } - ---- request - GET /main ---- response_body_like -^hello -world -took 0\.00[0-5] sec for total\.$ - - - -=== TEST 9: location with args ---- config - location /main { - echo_subrequest_async GET /sub -q 'foo=Foo&bar=Bar'; - } - location /sub { - echo $arg_foo $arg_bar; - } ---- request - GET /main ---- response_body -Foo Bar - - - -=== TEST 10: encoded chars in query strings ---- config - location /main { - echo_subrequest_async GET /sub -q 'foo=a%20b&bar=Bar'; - } - location /sub { - echo $arg_foo $arg_bar; - } ---- request - GET /main ---- response_body -a%20b Bar - - - -=== TEST 11: UTF-8 chars in query strings ---- config - location /main { - echo_subrequest_async GET /sub -q 'foo=你好'; - } - location /sub { - echo $arg_foo; - } ---- request - GET /main ---- response_body -你好 - - - -=== TEST 12: encoded chars in location url ---- config - location /main { - echo_subrequest_async GET /sub%31 -q 'foo=Foo&bar=Bar'; - } - location /sub%31 { - echo 'sub%31'; - } - location /sub1 { - echo 'sub1'; - } ---- request - GET /main ---- response_body -sub1 - - - -=== TEST 13: querystring in url ---- config - location /main { - echo_subrequest_async GET /sub?foo=Foo&bar=Bar; - } - location /sub { - echo $arg_foo $arg_bar; - } ---- request - GET /main ---- response_body -Foo Bar - - - -=== TEST 14: querystring in url *AND* an explicit querystring ---- config - location /main { - echo_subrequest_async GET /sub?foo=Foo&bar=Bar -q blah=Blah; - } - location /sub { - echo $arg_foo $arg_bar $arg_blah; - } ---- request - GET /main ---- response_body - Blah - - - -=== TEST 15: explicit flush in main request -flush won't really flush the buffer... ---- config - location /main_flush { - echo 'pre main'; - echo_subrequest_async GET /sub; - echo 'post main'; - echo_flush; - } - - location /sub { - echo_sleep 0.02; - echo 'sub'; - } ---- request - GET /main_flush ---- response_body -pre main -sub -post main - - - -=== TEST 16: POST subrequest with body (with proxy in the middle) and without read body explicitly ---- config - location /main { - echo_subrequest_async POST /proxy -b 'hello, world'; - } - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/sub; - } - location /sub { - echo "sub method: $echo_request_method."; - # we need to read body explicitly here...or $echo_request_body - # will evaluate to empty ("") - echo "sub body: $echo_request_body."; - } ---- request - GET /main ---- response_body -sub method: POST. -sub body: . - - - -=== TEST 17: POST subrequest with body (with proxy in the middle) and read body explicitly ---- config - location /main { - echo_subrequest_async POST /proxy -b 'hello, world'; - } - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/sub; - } - location /sub { - echo "sub method: $echo_request_method."; - # we need to read body explicitly here...or $echo_request_body - # will evaluate to empty ("") - echo_read_request_body; - echo "sub body: $echo_request_body."; - } ---- request - GET /main ---- response_body -sub method: POST. -sub body: hello, world. - - - -=== TEST 18: multiple subrequests ---- config - location /multi { - echo_subrequest_async POST '/sub' -q 'foo=Foo' -b 'hi'; - echo_subrequest_async PUT '/sub' -q 'bar=Bar' -b 'hello'; - } - location /sub { - echo "querystring: $query_string"; - echo "method: $echo_request_method"; - echo "body: $echo_request_body"; - echo "content length: $http_content_length"; - echo '///'; - } ---- request - GET /multi ---- response_body -querystring: foo=Foo -method: POST -body: hi -content length: 2 -/// -querystring: bar=Bar -method: PUT -body: hello -content length: 5 -/// - - - -=== TEST 19: no varaiable inheritance ---- config - location /main { - echo $echo_cacheable_request_uri; - echo_subrequest_async GET /sub; - echo_subrequest_async GET /sub2; - } - location /sub { - echo $echo_cacheable_request_uri; - } - location /sub2 { - echo $echo_cacheable_request_uri; - } - ---- request - GET /main ---- response_body -/main -/sub -/sub2 - - - -=== TEST 20: unsafe uri ---- config - location /unsafe { - echo_subrequest_async GET '/../foo'; - } ---- request - GET /unsafe ---- ignore_response ---- error_log -echo_subrequest_async sees unsafe uri: "/../foo" ---- no_error_log -[error] -[alert] - - - -=== TEST 21: let subrequest to read the main request's request body ---- SKIP ---- config - location /main { - echo_subrequest_async POST /sub; - } - location /sub { - echo_read_request_body; - echo_request_body; - } ---- request -POST /main -hello, body! ---- response_body chomp -hello, body! - - - -=== TEST 22: POST subrequest with file body (relative paths) ---- config - location /main { - echo_subrequest_async POST /sub -f html/blah.txt; - } - location /sub { - echo "sub method: $echo_request_method"; - # we don't need to call echo_read_client_body explicitly here - echo_request_body; - } ---- user_files ->>> blah.txt -Hello, world ---- request - GET /main ---- response_body -sub method: POST -Hello, world - - - -=== TEST 23: POST subrequest with file body (absolute paths) ---- config - location /main { - echo_subrequest_async POST /sub -f $TEST_NGINX_HTML_DIR/blah.txt; - } - location /sub { - echo "sub method: $echo_request_method"; - # we don't need to call echo_read_client_body explicitly here - echo_request_body; - } ---- user_files ->>> blah.txt -Hello, world! -Haha ---- request - GET /main ---- response_body -sub method: POST -Hello, world! -Haha - - - -=== TEST 24: POST subrequest with file body (file not found) ---- config - location /main { - echo_subrequest_async POST /sub -f html/blah/blah.txt; - } - location /sub { - echo "sub method: $echo_request_method"; - # we don't need to call echo_read_client_body explicitly here - echo_request_body; - } ---- user_files ->>> blah.txt -Hello, world ---- request - GET /main ---- ignore_response ---- error_log eval -qr/open\(\) ".*?" failed/ ---- no_error_log -[alert] - - - -=== TEST 25: POST subrequest with file body (absolute paths in vars) ---- config - location /main { - set $path $TEST_NGINX_HTML_DIR/blah.txt; - echo_subrequest_async POST /sub -f $path; - } - location /sub { - echo "sub method: $echo_request_method"; - # we don't need to call echo_read_client_body explicitly here - echo_request_body; - } ---- user_files ->>> blah.txt -Hello, world! -Haha ---- request - GET /main ---- response_body -sub method: POST -Hello, world! -Haha - - - -=== TEST 26: leading subrequest & echo_before_body ---- config - location /main { - echo_before_body hello; - echo_subrequest_async GET /foo; - } - location /foo { - echo world; - } ---- request - GET /main ---- response_body -hello -world - - - -=== TEST 27: leading subrequest & xss ---- config - location /main { - default_type 'application/json'; - xss_get on; - xss_callback_arg c; - echo_subrequest_async GET /foo; - } - location /foo { - echo -n world; - } ---- request - GET /main?c=hi ---- response_body chop -hi(world); - - - -=== TEST 28: multiple leading subrequest & xss ---- config - location /main { - default_type 'application/json'; - xss_get on; - xss_callback_arg c; - echo_subrequest_async GET /foo; - echo_subrequest_async GET /bar; - } - location /foo { - echo -n world; - } - location /bar { - echo -n ' people'; - } ---- request - GET /main?c=hi ---- response_body chop -hi(world people); - - - -=== TEST 29: sanity (HEAD) ---- config - location /main { - echo_subrequest_async GET /sub; - echo_subrequest_async GET /sub; - } - location /sub { - echo hello; - } ---- request - HEAD /main ---- response_body - - - -=== TEST 30: HEAD subrequest ---- config - location /main { - echo_subrequest_async HEAD /sub; - echo_subrequest_async HEAD /sub; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/subrequest.t b/modules_deb/libnginx-mod-http-echo-0.63/t/subrequest.t deleted file mode 100644 index 6d965d0..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/subrequest.t +++ /dev/null @@ -1,725 +0,0 @@ -# vi:filetype= - -use lib 'lib'; - -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (2 * blocks() + 1); - -$ENV{TEST_NGINX_HTML_DIR} = html_dir; -$ENV{TEST_NGINX_CLIENT_PORT} ||= server_port(); - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /main { - echo_subrequest GET /sub; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -hello - - - -=== TEST 2: trailing echo ---- config - location /main { - echo_subrequest GET /sub; - echo after subrequest; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -hello -after subrequest - - - -=== TEST 3: leading echo ---- config - location /main { - echo before subrequest; - echo_subrequest GET /sub; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -before subrequest -hello - - - -=== TEST 4: leading & trailing echo ---- config - location /main { - echo before subrequest; - echo_subrequest GET /sub; - echo after subrequest; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -before subrequest -hello -after subrequest - - - -=== TEST 5: multiple subrequests ---- config - location /main { - echo before sr 1; - echo_subrequest GET /sub; - echo after sr 1; - echo before sr 2; - echo_subrequest GET /sub; - echo after sr 2; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body -before sr 1 -hello -after sr 1 -before sr 2 -hello -after sr 2 - - - -=== TEST 6: timed multiple subrequests (blocking sleep) ---- config - location /main { - echo_reset_timer; - echo_subrequest GET /sub1; - echo_subrequest GET /sub2; - echo "took $echo_timer_elapsed sec for total."; - } - location /sub1 { - echo_blocking_sleep 0.02; - echo hello; - } - location /sub2 { - echo_blocking_sleep 0.01; - echo world; - } - ---- request - GET /main ---- response_body_like -^hello -world -took 0\.0(?:2[5-9]|3[0-6]) sec for total\.$ - - - -=== TEST 7: timed multiple subrequests (non-blocking sleep) ---- config - location /main { - echo_reset_timer; - echo_subrequest GET /sub1; - echo_subrequest GET /sub2; - echo "took $echo_timer_elapsed sec for total."; - } - location /sub1 { - echo_sleep 0.02; - echo hello; - } - location /sub2 { - echo_sleep 0.01; - echo world; - } - ---- request - GET /main ---- response_body_like -^hello -world -took 0\.0(?:2[5-9]|3[0-6]) sec for total\.$ - - - -=== TEST 8: location with args ---- config - location /main { - echo_subrequest GET /sub -q 'foo=Foo&bar=Bar'; - } - location /sub { - echo $arg_foo $arg_bar; - } ---- request - GET /main ---- response_body -Foo Bar - - - -=== TEST 9: chained subrequests ---- config - location /main { - echo 'pre main'; - echo_subrequest GET /sub; - echo 'post main'; - } - - location /sub { - echo 'pre sub'; - echo_subrequest GET /subsub; - echo 'post sub'; - } - - location /subsub { - echo 'subsub'; - } ---- request - GET /main ---- response_body -pre main -pre sub -subsub -post sub -post main - - - -=== TEST 10: chained subrequests using named locations -as of 0.8.20, ngx_http_subrequest still does not support -named location. sigh. this case is a TODO. ---- config - location /main { - echo 'pre main'; - echo_subrequest GET @sub; - echo 'post main'; - } - - location @sub { - echo 'pre sub'; - echo_subrequest GET @subsub; - echo 'post sub'; - } - - location @subsub { - echo 'subsub'; - } ---- request - GET /main ---- response_body -pre main -pre sub -subsub -post sub -post main ---- SKIP - - - -=== TEST 11: explicit flush in main request ---- config - location /main { - echo 'pre main'; - echo_subrequest GET /sub; - echo 'post main'; - echo_flush; - } - - location /sub { - echo_sleep 0.02; - echo 'sub'; - } ---- request - GET /main ---- response_body -pre main -sub -post main - - - -=== TEST 12: DELETE subrequest ---- config - location /main { - echo_subrequest DELETE /sub; - } - location /sub { - echo "sub method: $echo_request_method"; - echo "main method: $echo_client_request_method"; - } ---- request - GET /main ---- response_body -sub method: DELETE -main method: GET - - - -=== TEST 13: DELETE subrequest ---- config - location /main { - echo "main method: $echo_client_request_method"; - echo_subrequest GET /proxy; - echo_subrequest DELETE /proxy; - } - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/sub; - } - location /sub { - echo "sub method: $echo_request_method"; - } ---- request - GET /main ---- response_body -main method: GET -sub method: GET -sub method: DELETE - - - -=== TEST 14: POST subrequest with body ---- config - location /main { - echo_subrequest POST /sub -b 'hello, world'; - } - location /sub { - echo "sub method: $echo_request_method"; - # we don't need to call echo_read_client_body explicitly here - echo "sub body: $echo_request_body"; - } ---- request - GET /main ---- response_body -sub method: POST -sub body: hello, world - - - -=== TEST 15: POST subrequest with body (explicitly read the body) ---- config - location /main { - echo_subrequest POST /sub -b 'hello, world'; - } - location /sub { - echo "sub method: $echo_request_method"; - # we call echo_read_client_body explicitly here even - # though it's not necessary. - echo_read_request_body; - echo "sub body: $echo_request_body"; - } ---- request - GET /main ---- response_body -sub method: POST -sub body: hello, world - - - -=== TEST 16: POST subrequest with body (with proxy in the middle) and without read body explicitly ---- config - location /main { - echo_subrequest POST /proxy -b 'hello, world'; - } - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/sub; - } - location /sub { - echo "sub method: $echo_request_method."; - # we need to read body explicitly here...or $echo_request_body - # will evaluate to empty ("") - echo "sub body: $echo_request_body."; - } ---- request - GET /main ---- response_body -sub method: POST. -sub body: . - - - -=== TEST 17: POST subrequest with body (with proxy in the middle) and read body explicitly ---- config - location /main { - echo_subrequest POST /proxy -b 'hello, world'; - } - location /proxy { - proxy_pass $scheme://127.0.0.1:$server_port/sub; - } - location /sub { - echo "sub method: $echo_request_method."; - # we need to read body explicitly here...or $echo_request_body - # will evaluate to empty ("") - echo_read_request_body; - echo "sub body: $echo_request_body."; - } ---- request - GET /main ---- response_body -sub method: POST. -sub body: hello, world. - - - -=== TEST 18: multiple subrequests ---- config - location /multi { - echo_subrequest POST '/sub' -q 'foo=Foo' -b 'hi'; - echo_subrequest PUT '/sub' -q 'bar=Bar' -b 'hello'; - } - location /sub { - echo "querystring: $query_string"; - echo "method: $echo_request_method"; - echo "body: $echo_request_body"; - echo "content length: $http_content_length"; - echo '///'; - } ---- request - GET /multi ---- response_body -querystring: foo=Foo -method: POST -body: hi -content length: 2 -/// -querystring: bar=Bar -method: PUT -body: hello -content length: 5 -/// - - - -=== TEST 19: unsafe uri ---- config - location /unsafe { - echo_subrequest GET '/../foo'; - } ---- request - GET /unsafe ---- ignore_response ---- error_log -echo_subrequest sees unsafe uri: "/../foo" ---- no_error_log -[error] - - - -=== TEST 20: querystring in url ---- config - location /main { - echo_subrequest GET /sub?foo=Foo&bar=Bar; - } - location /sub { - echo $arg_foo $arg_bar; - } ---- request - GET /main ---- response_body -Foo Bar - - - -=== TEST 21: querystring in url *AND* an explicit querystring ---- config - location /main { - echo_subrequest GET /sub?foo=Foo&bar=Bar -q blah=Blah; - } - location /sub { - echo $arg_foo $arg_bar $arg_blah; - } ---- request - GET /main ---- response_body - Blah - - - -=== TEST 22: let subrequest to read the main request's request body ---- SKIP ---- config - location /main { - echo_subrequest POST /sub; - } - location /sub { - echo_read_request_body; - echo_request_body; - } ---- request -POST /main -hello, body! ---- response_body chomp -hello, body! - - - -=== TEST 23: deep nested echo_subrequest/echo_subrequest_async ---- config - location /main { - echo_subrequest GET /bar; - echo_subrequest_async GET /bar; - echo_subrequest_async GET /bar; - echo_subrequest GET /group; - echo_subrequest_async GET /group; - } - - location /group { - echo_subrequest GET /bar; - echo_subrequest_async GET /bar; - } - - location /bar { - echo $echo_incr; - } ---- request -GET /main ---- response_body -1 -2 -3 -4 -5 -6 -7 - - - -=== TEST 24: deep nested echo_subrequest/echo_subrequest_async ---- config - location /main { - echo_subrequest GET /bar?a; - echo_subrequest_async GET /bar?b; - echo_subrequest_async GET /bar?c; - echo_subrequest GET /group?a=d&b=e; - echo_subrequest_async GET /group?a=f&b=g; - } - - location /group { - echo_subrequest GET /bar?$arg_a; - echo_subrequest_async GET /bar?$arg_b; - } - - location /bar { - echo -n $query_string; - } ---- request -GET /main ---- response_body: abcdefg ---- timeout: 2 - - - -=== TEST 25: POST subrequest with file body (relative paths) ---- config - location /main { - echo_subrequest POST /sub -f html/blah.txt; - } - location /sub { - echo "sub method: $echo_request_method"; - # we don't need to call echo_read_client_body explicitly here - echo_request_body; - } ---- user_files ->>> blah.txt -Hello, world ---- request - GET /main ---- response_body -sub method: POST -Hello, world - - - -=== TEST 26: POST subrequest with file body (absolute paths) ---- config - location /main { - echo_subrequest POST /sub -f $TEST_NGINX_HTML_DIR/blah.txt; - } - location /sub { - echo "sub method: $echo_request_method"; - # we don't need to call echo_read_client_body explicitly here - echo_request_body; - } ---- user_files ->>> blah.txt -Hello, world! -Haha ---- request - GET /main ---- response_body -sub method: POST -Hello, world! -Haha - - - -=== TEST 27: POST subrequest with file body (file not found) ---- config - location /main { - echo_subrequest POST /sub -f html/blah/blah.txt; - } - location /sub { - echo "sub method: $echo_request_method"; - # we don't need to call echo_read_client_body explicitly here - echo_request_body; - } ---- user_files ->>> blah.txt -Hello, world ---- request - GET /main ---- ignore_response ---- error_log eval -qr/open\(\) ".*?" failed/ ---- no_error_log -[alert] - - - -=== TEST 28: leading subrequest & echo_before_body ---- config - location /main { - echo_before_body hello; - echo_subrequest GET /foo; - } - location /foo { - echo world; - } ---- request - GET /main ---- response_body -hello -world - - - -=== TEST 29: leading subrequest & xss ---- config - location /main { - default_type 'application/json'; - xss_get on; - xss_callback_arg c; - echo_subrequest GET /foo; - } - location /foo { - echo -n world; - } ---- request - GET /main?c=hi ---- response_body chop -hi(world); - - - -=== TEST 30: multiple leading subrequest & xss ---- config - location /main { - default_type 'application/json'; - xss_get on; - xss_callback_arg c; - echo_subrequest GET /foo; - echo_subrequest GET /bar; - } - location /foo { - echo -n world; - } - location /bar { - echo -n ' people'; - } ---- request - GET /main?c=hi ---- response_body chop -hi(world people); - - - -=== TEST 31: sanity (HEAD) ---- config - location /main { - echo_subrequest GET /sub; - echo_subrequest GET /sub; - } - location /sub { - echo hello; - } ---- request - HEAD /main ---- response_body - - - -=== TEST 32: POST subrequest to ngx_proxy ---- config - location /hello { - default_type text/plain; - echo_subrequest POST '/proxy' -q 'foo=Foo&bar=baz' -b 'request_body=test&test=3'; - } - - location /proxy { - proxy_pass http://127.0.0.1:$TEST_NGINX_CLIENT_PORT/sub; - #proxy_pass http://127.0.0.1:1113/sub; - } - - location /sub { - echo_read_request_body; - echo "sub method: $echo_request_method"; - # we don't need to call echo_read_client_body explicitly here - echo "sub body: $echo_request_body"; - } ---- request - GET /hello ---- response_body -sub method: POST -sub body: request_body=test&test=3 - - - -=== TEST 33: HEAD subrequest ---- config - location /main { - echo_subrequest HEAD /sub; - echo_subrequest HEAD /sub; - } - location /sub { - echo hello; - } ---- request - GET /main ---- response_body - - - -=== TEST 34: method name as an nginx variable (github issue #34) ---- config - location ~ ^/delay/(?[0-9.]+)/(?.*)$ { - # echo_blocking_sleep $delay; - echo_subrequest '$echo_request_method' '/$originalURL' -q '$args'; - } - - location /api { - echo "args: $args"; - } ---- request - GET /delay/0.343/api/?a=b ---- response_body -args: a=b ---- no_error_log -[error] - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/t/unused.t b/modules_deb/libnginx-mod-http-echo-0.63/t/unused.t deleted file mode 100644 index f3c6e9e..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/t/unused.t +++ /dev/null @@ -1,119 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (5 * blocks()); - -no_long_string(); -log_level('warn'); - -#master_on(); -#workers(1); - -run_tests(); - -__DATA__ - -=== TEST 1: filters used ---- http_config - postpone_output 1; ---- config - location /echo { - echo world; - echo_after_body hello; - } ---- request - GET /echo?blah ---- response_body -world -hello ---- error_log -echo header filter, uri "/echo?blah" -echo body filter, uri "/echo?blah" ---- no_error_log -[error] ---- log_level: debug - - - -=== TEST 2: filters not used ---- http_config - postpone_output 1; ---- config - location /echo { - echo world; - #echo_after_body hello; - } ---- request - GET /echo?blah ---- response_body -world ---- no_error_log -echo header filter, uri "/echo?blah" -echo body filter, uri "/echo?blah" -[error] ---- log_level: debug - - - -=== TEST 3: (after) filters used (multiple http {} blocks) -This test case won't run with nginx 1.9.3+ since duplicate http {} blocks -have been prohibited since then. ---- SKIP ---- http_config - postpone_output 1; ---- config - location /echo { - echo world; - echo_after_body hello; - } - ---- post_main_config - http { - } - ---- request - GET /echo?blah ---- response_body -world -hello ---- error_log -echo header filter, uri "/echo?blah" -echo body filter, uri "/echo?blah" ---- no_error_log -[error] ---- log_level: debug - - - -=== TEST 4: (before) filters used (multiple http {} blocks) -This test case won't run with nginx 1.9.3+ since duplicate http {} blocks -have been prohibited since then. ---- SKIP ---- http_config - postpone_output 1; ---- config - location /echo { - echo world; - echo_before_body hello; - } - ---- post_main_config - http { - } - ---- request - GET /echo?blah ---- response_body -hello -world ---- error_log -echo header filter, uri "/echo?blah" -echo body filter, uri "/echo?blah" ---- no_error_log -[error] ---- log_level: debug - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/util/build.sh b/modules_deb/libnginx-mod-http-echo-0.63/util/build.sh deleted file mode 100755 index 45949bb..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/util/build.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash - -# this file is mostly meant to be used by the author himself. - -root=`pwd` -version=$1 -force=$2 -home=~ - - #--with-cc=gcc46 \ - -ngx-build $force $version \ - --with-ld-opt="-L$PCRE_LIB -Wl,-rpath,$PCRE_LIB:$LIBDRIZZLE_LIB:/usr/local/lib" \ - --with-cc-opt="-DDEBUG_MALLOC" \ - --with-http_stub_status_module \ - --with-http_image_filter_module \ - --without-mail_pop3_module \ - --without-mail_imap_module \ - --without-mail_smtp_module \ - --without-http_upstream_ip_hash_module \ - --without-http_memcached_module \ - --without-http_referer_module \ - --without-http_autoindex_module \ - --without-http_auth_basic_module \ - --without-http_userid_module \ - --add-module=$root/../ndk-nginx-module \ - --add-module=$root/../set-misc-nginx-module \ - --add-module=$root/../eval-nginx-module \ - --add-module=$root/../xss-nginx-module \ - --add-module=$root/../rds-json-nginx-module \ - --add-module=$root/../headers-more-nginx-module \ - --add-module=$root/../lua-nginx-module \ - --add-module=$root $opts \ - --with-http_v2_module \ - --with-select_module \ - --with-poll_module \ - --without-http_ssi_module \ - --with-debug || exit 1 - #--add-module=$root/../lz-session-nginx-module \ - #--add-module=$home/work/ndk \ - #--add-module=$home/work/ndk/examples/http/set_var \ - #--add-module=$root/../eval-nginx-module \ - #--add-module=/home/agentz/work/nginx_eval_module-1.0.1 \ - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/util/wiki2pod.pl b/modules_deb/libnginx-mod-http-echo-0.63/util/wiki2pod.pl deleted file mode 100644 index cdd33a2..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/util/wiki2pod.pl +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env perl - -use strict; -use warnings; -use bytes; - -my @nl_counts; -my $last_nl_count_level; - -my @bl_counts; -my $last_bl_count_level; - -sub fmt_pos ($) { - (my $s = $_[0]) =~ s{\#(.*)}{/"$1"}; - $s; -} - -sub fmt_mark ($$) { - my ($tag, $s) = @_; - my $max_level = 0; - while ($s =~ /([<>])\1*/g) { - my $level = length $&; - if ($level > $max_level) { - $max_level = $level; - } - } - - my $times = $max_level + 1; - if ($times > 1) { - $s = " $s "; - } - return $tag . ('<' x $times) . $s . ('>' x $times); -} - -print "=encoding utf-8\n\n"; - -while (<>) { - if ($. == 1) { - # strip the leading U+FEFF byte in MS-DOS text files - my $first = ord(substr($_, 0, 1)); - #printf STDERR "0x%x", $first; - #my $second = ord(substr($_, 2, 1)); - #printf STDERR "0x%x", $second; - if ($first == 0xEF) { - substr($_, 0, 1, ''); - #warn "Hit!"; - } - } - s{\[(http[^ \]]+) ([^\]]*)\]}{$2 (L<$1>)}gi; - s{ \[\[ ( [^\]\|]+ ) \| ([^\]]*) \]\] }{"L<$2|" . fmt_pos($1) . ">"}gixe; - s{(.*?)}{fmt_mark('C', $1)}gie; - s{'''(.*?)'''}{fmt_mark('B', $1)}ge; - s{''(.*?)''}{fmt_mark('I', $1)}ge; - if (s{^\s*<[^>]+>\s*$}{}) { - next; - } - - if (/^\s*$/) { - print "\n"; - next; - } - -=begin cmt - - if ($. == 1) { - warn $_; - for my $i (0..length($_) - 1) { - my $chr = substr($_, $i, 1); - warn "chr ord($i): ".ord($chr)." \"$chr\"\n"; - } - } - -=end cmt -=cut - - if (/(=+) (.*) \1$/) { - #warn "HERE! $_" if $. == 1; - my ($level, $title) = (length $1, $2); - collapse_lists(); - - print "\n=head$level $title\n\n"; - } elsif (/^(\#+) (.*)/) { - my ($level, $txt) = (length($1) - 1, $2); - if (defined $last_nl_count_level && $level != $last_nl_count_level) { - print "\n=back\n\n"; - } - $last_nl_count_level = $level; - $nl_counts[$level] ||= 0; - if ($nl_counts[$level] == 0) { - print "\n=over\n\n"; - } - $nl_counts[$level]++; - print "\n=item $nl_counts[$level].\n\n"; - print "$txt\n"; - } elsif (/^(\*+) (.*)/) { - my ($level, $txt) = (length($1) - 1, $2); - if (defined $last_bl_count_level && $level != $last_bl_count_level) { - print "\n=back\n\n"; - } - $last_bl_count_level = $level; - $bl_counts[$level] ||= 0; - if ($bl_counts[$level] == 0) { - print "\n=over\n\n"; - } - $bl_counts[$level]++; - print "\n=item *\n\n"; - print "$txt\n"; - } else { - collapse_lists(); - print; - } -} - -collapse_lists(); - -sub collapse_lists { - while (defined $last_nl_count_level && $last_nl_count_level >= 0) { - print "\n=back\n\n"; - $last_nl_count_level--; - } - undef $last_nl_count_level; - undef @nl_counts; - - while (defined $last_bl_count_level && $last_bl_count_level >= 0) { - print "\n=back\n\n"; - $last_bl_count_level--; - } - undef $last_bl_count_level; - undef @bl_counts; -} - diff --git a/modules_deb/libnginx-mod-http-echo-0.63/valgrind.suppress b/modules_deb/libnginx-mod-http-echo-0.63/valgrind.suppress deleted file mode 100644 index 975415e..0000000 --- a/modules_deb/libnginx-mod-http-echo-0.63/valgrind.suppress +++ /dev/null @@ -1,53 +0,0 @@ -{ - - Memcheck:Param - epoll_ctl(event) - fun:epoll_ctl -} -{ - - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_event_process_init -} -{ - - Memcheck:Cond - fun:index - fun:expand_dynamic_string_token - fun:_dl_map_object - fun:map_doit - fun:_dl_catch_error - fun:do_preload - fun:dl_main -} -{ - - Memcheck:Leak - match-leak-kinds: definite - fun:malloc - fun:ngx_alloc - fun:ngx_set_environment - fun:ngx_single_process_cycle - fun:main -} -{ - - Memcheck:Leak - match-leak-kinds: definite - fun:malloc - fun:ngx_alloc - fun:ngx_set_environment - fun:ngx_single_process_cycle -} -{ - - Memcheck:Leak - match-leak-kinds: definite - fun:malloc - fun:ngx_alloc - fun:ngx_set_environment - fun:ngx_worker_process_init - fun:ngx_worker_process_cycle -} diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/LICENSE b/modules_deb/libnginx-mod-http-geoip2-3.4/LICENSE deleted file mode 100644 index fdc13a7..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) 2014, Lee Valentine -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright 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 THE COPYRIGHT HOLDERS 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 THE COPYRIGHT HOLDER 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) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/README.md b/modules_deb/libnginx-mod-http-geoip2-3.4/README.md deleted file mode 100644 index cea0d04..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/README.md +++ /dev/null @@ -1,153 +0,0 @@ -Description -=========== - -**ngx_http_geoip2_module** - creates variables with values from the maxmind geoip2 databases based on the client IP (default) or from a specific variable (supports both IPv4 and IPv6) - -The module now supports nginx streams and can be used in the same way the http module can be used. - -## Installing -First install [libmaxminddb](https://github.com/maxmind/libmaxminddb) as described in its [README.md -file](https://github.com/maxmind/libmaxminddb/blob/main/README.md#installing-from-a-tarball). - -#### Download nginx source -``` -wget http://nginx.org/download/nginx-VERSION.tar.gz -tar zxvf nginx-VERSION.tar.gz -cd nginx-VERSION -``` - -##### To build as a dynamic module (nginx 1.9.11+): -``` -./configure --add-dynamic-module=/path/to/ngx_http_geoip2_module -make -make install -``` - -This will produce ```objs/ngx_http_geoip2_module.so```. It can be copied to your nginx module path manually if you wish. - -Add the following line to your nginx.conf: -``` -load_module modules/ngx_http_geoip2_module.so; -``` - -##### To build as a static module: -``` -./configure --add-module=/path/to/ngx_http_geoip2_module -make -make install -``` - -##### If you need stream support, make sure to compile with stream: -``` -./configure --add-dynamic-module=/path/to/ngx_http_geoip2_module --with-stream -OR -./configure --add-module=/path/to/ngx_http_geoip2_module --with-stream -``` - - -## Download Maxmind GeoLite2 Database (optional) -The free GeoLite2 databases are available from [Maxminds website](http://dev.maxmind.com/geoip/geoip2/geolite2/) (requires signing up) - -## Example Usage: -``` -http { - ... - geoip2 /etc/maxmind-country.mmdb { - auto_reload 5m; - $geoip2_metadata_country_build metadata build_epoch; - $geoip2_data_country_code default=US source=$variable_with_ip country iso_code; - $geoip2_data_country_name country names en; - } - - geoip2 /etc/maxmind-city.mmdb { - $geoip2_data_city_name default=London city names en; - } - .... - - fastcgi_param COUNTRY_CODE $geoip2_data_country_code; - fastcgi_param COUNTRY_NAME $geoip2_data_country_name; - fastcgi_param CITY_NAME $geoip2_data_city_name; - .... -} - -stream { - ... - geoip2 /etc/maxmind-country.mmdb { - $geoip2_data_country_code default=US source=$remote_addr country iso_code; - } - ... -} -``` - -##### Metadata: -Retrieve metadata regarding the geoip database. -``` -$variable_name metadata -``` -Available fields: - - build_epoch: the build timestamp of the maxmind database. - - last_check: the last time the database was checked for changes (when using auto_reload) - - last_change: the last time the database was reloaded (when using auto_reload) - -##### Autoreload (default: disabled): -Enabling auto reload will have nginx check the modification time of the database at the specified -interval and reload it if it has changed. -``` -auto_reload -``` - -##### GeoIP: -``` -$variable_name [default= - "iso_code": - "US" - "names": - { - "de": - "USA" - "en": - "United States" - } - } - } - -$ mmdblookup --file /usr/share/GeoIP/GeoIP2-Country.mmdb --ip 8.8.8.8 country names en - - "United States" -``` - -This translates to: - -``` -$country_name "default=United States" source=$remote_addr country names en -``` - -##### Additional Commands: -These commands works the same as the original ngx_http_geoip_module documented here: http://nginx.org/en/docs/http/ngx_http_geoip_module.html#geoip_proxy. - -However, if you provide the `source=$variable_with_ip` option on a variable, these settings will be ignored for that particular variable. - -``` -geoip2_proxy < cidr > -``` -Defines trusted addresses. When a request comes from a trusted address, an address from the "X-Forwarded-For" request header field will be used instead. - -``` -geoip2_proxy_recursive < on | off > -``` -If recursive search is disabled then instead of the original client address that matches one of the trusted addresses, the last address sent in "X-Forwarded-For" will be used. If recursive search is enabled then instead of the original client address that matches one of the trusted addresses, the last non-trusted address sent in "X-Forwarded-For" will be used. diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/config b/modules_deb/libnginx-mod-http-geoip2-3.4/config deleted file mode 100644 index 48bf15d..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/config +++ /dev/null @@ -1,43 +0,0 @@ -ngx_feature="MaxmindDB library" -ngx_feature_name= -ngx_feature_run=no -ngx_feature_incs="#include " -ngx_feature_libs=-lmaxminddb -ngx_feature_test="MMDB_s mmdb" -. auto/feature - -ngx_addon_name="ngx_geoip2_module" - -if [ $ngx_found = yes ]; then - if test -n "$ngx_module_link"; then - if [ $HTTP != NO ]; then - ngx_module_type=HTTP - ngx_module_name="ngx_http_geoip2_module" - ngx_module_incs= - ngx_module_deps= - ngx_module_srcs="$ngx_addon_dir/ngx_http_geoip2_module.c" - ngx_module_libs="$ngx_feature_libs" - . auto/module - fi - - nginx_version=`awk '/^#define nginx_version / {print $3}' src/core/nginx.h` - if [ $STREAM != NO -a $nginx_version -gt 1011001 ]; then - ngx_module_type=STREAM - ngx_module_name="ngx_stream_geoip2_module" - ngx_module_incs= - ngx_module_deps= - ngx_module_srcs="$ngx_addon_dir/ngx_stream_geoip2_module.c" - ngx_module_libs="$ngx_feature_libs" - . auto/module - fi - else - HTTP_MODULES="$HTTP_MODULES ngx_http_geoip2_module" - NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_geoip2_module.c" - CORE_LIBS="$CORE_LIBS $ngx_feature_libs" - fi -else - cat << END -$0: error: the geoip2 module requires the maxminddb library. -END - exit 1 -fi diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/changelog b/modules_deb/libnginx-mod-http-geoip2-3.4/debian/changelog deleted file mode 100644 index 0c0f22e..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/changelog +++ /dev/null @@ -1,52 +0,0 @@ -libnginx-mod-http-geoip2 (1:3.4-6) unstable; urgency=medium - - * d/control: update my email to janmojzis@debian.org - * d/copyright: update my email to janmojzis@debian.org - * d/control: bump Standards-Version: 4.7.2, no changes - * d/copyright: bump debian/* copyright year - * d/watch: use more generic template - - -- Jan Mojžíš Fri, 11 Apr 2025 14:26:59 +0200 - -libnginx-mod-http-geoip2 (1:3.4-5) unstable; urgency=medium - - * Better usage of dh-sequence-nginx - * d/rules: remove override_dh_auto_configure, override_dh_auto_test - * d/control: remove Build-Depends nginx-abi-1.24.0-1 - * d/control: use Build-Depends libnginx-mod-stream instead of - libnginx-mod-stream (<<1.24.0.1~), libnginx-mod-stream (>=1.24.0) - * d/control: use Build-Depends nginx-dev (>= 1.24.0-2) - * d/control: remove Depends libnginx-mod-stream (<<1.24.0.1~), - libnginx-mod-stream (>=1.24.0) - - -- Jan Mojžíš Wed, 11 Oct 2023 07:37:12 +0200 - -libnginx-mod-http-geoip2 (1:3.4-4) unstable; urgency=medium - - * NEW ABI: rebuild with nginx-abi-1.24.0-1 - - -- Jan Mojžíš Tue, 27 Jun 2023 23:16:38 +0200 - -libnginx-mod-http-geoip2 (1:3.4-3) unstable; urgency=medium - - * d/t/generic rework. The test now checks module after - installation/reload/restart. - * d/control: bump Standards-Version: 4.6.2, no changes - * d/gbb.conf: switched to debian branch main (debian-branch = main) - * d/copyright: bump my copyright year - * d/copyright: reformat text to be compatible with 'cme update dpkg-copyright' - * NEW ABI: rebuild with nginx-abi-1.22.1-7 - - -- Jan Mojžíš Mon, 13 Feb 2023 12:56:24 +0100 - -libnginx-mod-http-geoip2 (1:3.4-2) unstable; urgency=medium - - * d/control: added Multi-Arch: foreign - - -- Jan Mojžíš Fri, 09 Dec 2022 12:50:27 +0100 - -libnginx-mod-http-geoip2 (1:3.4-1) experimental; urgency=medium - - * Initial release. (Closes: 1024843) - - -- Jan Mojžíš Wed, 30 Nov 2022 14:46:51 +0100 diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/control b/modules_deb/libnginx-mod-http-geoip2-3.4/debian/control deleted file mode 100644 index 3ccc4e3..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/control +++ /dev/null @@ -1,41 +0,0 @@ -Source: libnginx-mod-http-geoip2 -Section: httpd -Priority: optional -Maintainer: Debian Nginx Maintainers -Uploaders: Jan Mojžíš , -Build-Depends: debhelper-compat (= 13), - dh-sequence-nginx, - libmaxminddb-dev, - libnginx-mod-stream, - nginx-dev (>= 1.24.0-2), -Standards-Version: 4.7.2 -Homepage: https://github.com/leev/ngx_http_geoip2_module -Vcs-Git: https://salsa.debian.org/nginx-team/libnginx-mod-http-geoip2.git -Vcs-Browser: https://salsa.debian.org/nginx-team/libnginx-mod-http-geoip2 -Rules-Requires-Root: no - -Package: libnginx-mod-http-geoip2 -Architecture: any -Multi-Arch: foreign -Depends: ${misc:Depends}, - ${shlibs:Depends}, -Recommends: nginx, -Description: GeoIP2 HTTP module for Nginx - The ngx_http_geoip2 module creates variables with values depending on the - client IP address, using the precompiled MaxMind GeoIP2 databases. - . - Those variables include country, region, city, latitude, longitude, postal - code, etc. - -Package: libnginx-mod-stream-geoip2 -Architecture: any -Multi-Arch: foreign -Depends: ${misc:Depends}, - ${shlibs:Depends}, -Recommends: nginx, -Description: GeoIP2 Stream module for Nginx - The ngx_stream_geoip2 module creates variables with values depending on the - client IP address, using the precompiled MaxMind GeoIP2 databases. - . - Those variables include country, region, city, latitude, longitude, postal - code, etc. diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/copyright b/modules_deb/libnginx-mod-http-geoip2-3.4/debian/copyright deleted file mode 100644 index ab01158..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/copyright +++ /dev/null @@ -1,46 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: ngx_http_geoip2_module -Upstream-Contact: Lee Valentine -Source: https://github.com/leev/ngx_http_geoip2_module - -Files: * -Copyright: 2014, Lee Valentine -License: BSD-2-clause - -Files: debian/* -Copyright: 2022, Miao Wang - 2022-2025, Jan Mojzis -License: BSD-2-clause - -Files: ngx_http_geoip2_module.c -Copyright: Lee Valentine -License: BSD-2-clause - -Files: ngx_stream_geoip2_module.c -Copyright: Lee Valentine - Andrei Belov -License: BSD-2-clause - -License: BSD-2-clause - All rights reserved. - . - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - . - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - . - * Redistributions in binary form must reproduce the above copyright 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 THE COPYRIGHT HOLDERS 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 THE COPYRIGHT HOLDER 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) HOWEVER CAUSED AND ON - ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/gbp.conf b/modules_deb/libnginx-mod-http-geoip2-3.4/debian/gbp.conf deleted file mode 100644 index 38c12c1..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/gbp.conf +++ /dev/null @@ -1,9 +0,0 @@ -[DEFAULT] -debian-branch = main -upstream-branch = upstream -upstream-tag = upstream/%(version)s -pristine-tar = True -sign-tags = True - -[import-orig] -merge-mode = replace diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/libnginx-mod-http-geoip2.install b/modules_deb/libnginx-mod-http-geoip2-3.4/debian/libnginx-mod-http-geoip2.install deleted file mode 100644 index 2692817..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/libnginx-mod-http-geoip2.install +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/nginx/modules/ngx_http_geoip2_module.so diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/libnginx-mod-stream-geoip2.install b/modules_deb/libnginx-mod-http-geoip2-3.4/debian/libnginx-mod-stream-geoip2.install deleted file mode 100644 index 9f45e96..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/libnginx-mod-stream-geoip2.install +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/nginx/modules/ngx_stream_geoip2_module.so diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/rules b/modules_deb/libnginx-mod-http-geoip2-3.4/debian/rules deleted file mode 100755 index d8309f6..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/rules +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/make -f - -export DEB_BUILD_MAINT_OPTIONS = hardening=+all - -%: - dh $@ diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/source/format b/modules_deb/libnginx-mod-http-geoip2-3.4/debian/source/format deleted file mode 100644 index 163aaf8..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/tests/control b/modules_deb/libnginx-mod-http-geoip2-3.4/debian/tests/control deleted file mode 100644 index ca20b9f..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/tests/control +++ /dev/null @@ -1,6 +0,0 @@ -Tests: generic -Restrictions: allow-stderr isolation-container needs-root -Depends: curl, - nginx, - nginx-core, - @, diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/tests/generic b/modules_deb/libnginx-mod-http-geoip2-3.4/debian/tests/generic deleted file mode 100644 index a14fc80..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/tests/generic +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -# version 20221215 - -# generic test that only verifies that nginx is running with the given -# libnginx-... module -# - after installation -# - after nginx reload -# - after nginx restart - -EX=0 -CURL_CMD="curl --max-time 60 --silent --fail -o /dev/null" - -#change directory to $AUTOPKGTEST_TMP -cd "${AUTOPKGTEST_TMP}" - -echo -n "curl after installation: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx reload ... " -if invoke-rc.d nginx reload; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - - -echo -n "curl after reload: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx restart ... " -if invoke-rc.d nginx restart; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - -echo -n "curl after restart: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -if [ ${EX} -ne 0 ]; then - echo "=== journalctl ===" - journalctl -n all -xu nginx.service || : - - echo "=== error.log ===" - if [ `wc -l /var/log/nginx/error.log | cut -d ' ' -f1` -gt 100 ]; then - head -n 50 /var/log/nginx/error.log - echo '...' - tail -n 50 /var/log/nginx/error.log - else - cat /var/log/nginx/error.log - fi -fi - -exit ${EX} diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/upstream/metadata b/modules_deb/libnginx-mod-http-geoip2-3.4/debian/upstream/metadata deleted file mode 100644 index 5f50585..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/upstream/metadata +++ /dev/null @@ -1,4 +0,0 @@ ---- -Bug-Database: https://github.com/leev/ngx_http_geoip2_module/issues -Bug-Submit: https://github.com/leev/ngx_http_geoip2_module/issues/new -Repository-Browse: https://github.com/leev/ngx_http_geoip2_module \ No newline at end of file diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/watch b/modules_deb/libnginx-mod-http-geoip2-3.4/debian/watch deleted file mode 100644 index 04e3a51..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/debian/watch +++ /dev/null @@ -1,6 +0,0 @@ -version=4 -opts="\ -uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha|a|b)\d*)$/$1~$2/,\ -" \ -https://github.com/leev/ngx_http_geoip2_module/tags \ -(?:.*?/)?v?@ANY_VERSION@@ARCHIVE_EXT@ diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/ngx_http_geoip2_module.c b/modules_deb/libnginx-mod-http-geoip2-3.4/ngx_http_geoip2_module.c deleted file mode 100644 index 4b3461c..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/ngx_http_geoip2_module.c +++ /dev/null @@ -1,803 +0,0 @@ -/* - * Copyright (C) Lee Valentine - * - * Based on nginx's 'ngx_http_geoip_module.c' by Igor Sysoev - */ - - -#include -#include -#include - -#include - - -typedef struct { - MMDB_s mmdb; - MMDB_lookup_result_s result; - time_t last_check; - time_t last_change; - time_t check_interval; -#if (NGX_HAVE_INET6) - uint8_t address[16]; -#else - unsigned long address; -#endif - ngx_queue_t queue; -} ngx_http_geoip2_db_t; - -typedef struct { - ngx_queue_t databases; - ngx_array_t *proxies; - ngx_flag_t proxy_recursive; -} ngx_http_geoip2_conf_t; - -typedef struct { - ngx_http_geoip2_db_t *database; - const char **lookup; - ngx_str_t default_value; - ngx_http_complex_value_t source; -} ngx_http_geoip2_ctx_t; - -typedef struct { - ngx_http_geoip2_db_t *database; - ngx_str_t metavalue; -} ngx_http_geoip2_metadata_t; - - -static ngx_int_t ngx_http_geoip2_variable(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data); -static ngx_int_t ngx_http_geoip2_metadata(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data); -static void *ngx_http_geoip2_create_conf(ngx_conf_t *cf); -static char *ngx_http_geoip2_init_conf(ngx_conf_t *cf, void *conf); -static char *ngx_http_geoip2(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); -static char *ngx_http_geoip2_parse_config(ngx_conf_t *cf, ngx_command_t *dummy, - void *conf); -static char *ngx_http_geoip2_add_variable(ngx_conf_t *cf, ngx_command_t *dummy, - void *conf); -static char *ngx_http_geoip2_add_variable_geodata(ngx_conf_t *cf, - ngx_http_geoip2_db_t *database); -static char *ngx_http_geoip2_add_variable_metadata(ngx_conf_t *cf, - ngx_http_geoip2_db_t *database); -static char *ngx_http_geoip2_proxy(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); -static ngx_int_t ngx_http_geoip2_cidr_value(ngx_conf_t *cf, ngx_str_t *net, - ngx_cidr_t *cidr); -static void ngx_http_geoip2_cleanup(void *data); -static ngx_int_t ngx_http_geoip2_init(ngx_conf_t *cf); - - -#define FORMAT(fmt, ...) do { \ - p = ngx_palloc(r->pool, NGX_OFF_T_LEN); \ - if (p == NULL) { \ - return NGX_ERROR; \ - } \ - v->len = ngx_sprintf(p, fmt, __VA_ARGS__) - p; \ - v->data = p; \ -} while (0) - -static ngx_command_t ngx_http_geoip2_commands[] = { - - { ngx_string("geoip2"), - NGX_HTTP_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_TAKE1, - ngx_http_geoip2, - NGX_HTTP_MAIN_CONF_OFFSET, - 0, - NULL }, - - { ngx_string("geoip2_proxy"), - NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1, - ngx_http_geoip2_proxy, - NGX_HTTP_MAIN_CONF_OFFSET, - 0, - NULL }, - - { ngx_string("geoip2_proxy_recursive"), - NGX_HTTP_MAIN_CONF|NGX_CONF_FLAG, - ngx_conf_set_flag_slot, - NGX_HTTP_MAIN_CONF_OFFSET, - offsetof(ngx_http_geoip2_conf_t, proxy_recursive), - NULL }, - - ngx_null_command -}; - - -static ngx_http_module_t ngx_http_geoip2_module_ctx = { - NULL, /* preconfiguration */ - ngx_http_geoip2_init, /* postconfiguration */ - - ngx_http_geoip2_create_conf, /* create main configuration */ - ngx_http_geoip2_init_conf, /* init main configuration */ - - NULL, /* create server configuration */ - NULL, /* merge server configuration */ - - NULL, /* create location configuration */ - NULL /* merge location configuration */ -}; - - -ngx_module_t ngx_http_geoip2_module = { - NGX_MODULE_V1, - &ngx_http_geoip2_module_ctx, /* module context */ - ngx_http_geoip2_commands, /* module directives */ - NGX_HTTP_MODULE, /* module type */ - NULL, /* init master */ - NULL, /* init module */ - NULL, /* init process */ - NULL, /* init thread */ - NULL, /* exit thread */ - NULL, /* exit process */ - NULL, /* exit master */ - NGX_MODULE_V1_PADDING -}; - - -static ngx_int_t -ngx_http_geoip2_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v, - uintptr_t data) -{ - ngx_http_geoip2_ctx_t *geoip2 = (ngx_http_geoip2_ctx_t *) data; - ngx_http_geoip2_db_t *database = geoip2->database; - int mmdb_error; - MMDB_entry_data_s entry_data; - ngx_http_geoip2_conf_t *gcf; - ngx_addr_t addr; -#if defined(nginx_version) && nginx_version >= 1023000 - ngx_table_elt_t *xfwd; -#else - ngx_array_t *xfwd; -#endif - u_char *p; - ngx_str_t val; - -#if (NGX_HAVE_INET6) - uint8_t address[16], *addressp = address; -#else - unsigned long address; -#endif - - if (geoip2->source.value.len > 0) { - if (ngx_http_complex_value(r, &geoip2->source, &val) != NGX_OK) { - goto not_found; - } - - if (ngx_parse_addr(r->pool, &addr, val.data, val.len) != NGX_OK) { - goto not_found; - } - } else { - gcf = ngx_http_get_module_main_conf(r, ngx_http_geoip2_module); - addr.sockaddr = r->connection->sockaddr; - addr.socklen = r->connection->socklen; - -#if defined(nginx_version) && nginx_version >= 1023000 - xfwd = r->headers_in.x_forwarded_for; - - if (xfwd != NULL && gcf->proxies != NULL) { -#else - xfwd = &r->headers_in.x_forwarded_for; - - if (xfwd->nelts > 0 && gcf->proxies != NULL) { -#endif - (void) ngx_http_get_forwarded_addr(r, &addr, xfwd, NULL, - gcf->proxies, gcf->proxy_recursive); - } - } - - switch (addr.sockaddr->sa_family) { - case AF_INET: -#if (NGX_HAVE_INET6) - ngx_memset(addressp, 0, 12); - ngx_memcpy(addressp + 12, &((struct sockaddr_in *) - addr.sockaddr)->sin_addr.s_addr, 4); - break; - - case AF_INET6: - ngx_memcpy(addressp, &((struct sockaddr_in6 *) - addr.sockaddr)->sin6_addr.s6_addr, 16); -#else - address = ((struct sockaddr_in *)addr.sockaddr)->sin_addr.s_addr; -#endif - break; - - default: - goto not_found; - } - -#if (NGX_HAVE_INET6) - if (ngx_memcmp(&address, &database->address, sizeof(address)) - != 0) { -#else - if (address != database->address) { -#endif - memcpy(&database->address, &address, sizeof(address)); - database->result = MMDB_lookup_sockaddr(&database->mmdb, - addr.sockaddr, &mmdb_error); - - if (mmdb_error != MMDB_SUCCESS) { - goto not_found; - } - } - - if (!database->result.found_entry - || MMDB_aget_value(&database->result.entry, &entry_data, - geoip2->lookup) != MMDB_SUCCESS) { - goto not_found; - } - - if (!entry_data.has_data) { - goto not_found; - } - - switch (entry_data.type) { - case MMDB_DATA_TYPE_BOOLEAN: - FORMAT("%d", entry_data.boolean); - break; - case MMDB_DATA_TYPE_UTF8_STRING: - v->len = entry_data.data_size; - v->data = ngx_pnalloc(r->pool, v->len); - if (v->data == NULL) { - return NGX_ERROR; - } - ngx_memcpy(v->data, (u_char *) entry_data.utf8_string, v->len); - break; - case MMDB_DATA_TYPE_BYTES: - v->len = entry_data.data_size; - v->data = ngx_pnalloc(r->pool, v->len); - if (v->data == NULL) { - return NGX_ERROR; - } - ngx_memcpy(v->data, (u_char *) entry_data.bytes, v->len); - break; - case MMDB_DATA_TYPE_FLOAT: - FORMAT("%.5f", entry_data.float_value); - break; - case MMDB_DATA_TYPE_DOUBLE: - FORMAT("%.5f", entry_data.double_value); - break; - case MMDB_DATA_TYPE_UINT16: - FORMAT("%uD", entry_data.uint16); - break; - case MMDB_DATA_TYPE_UINT32: - FORMAT("%uD", entry_data.uint32); - break; - case MMDB_DATA_TYPE_INT32: - FORMAT("%D", entry_data.int32); - break; - case MMDB_DATA_TYPE_UINT64: - FORMAT("%uL", entry_data.uint64); - break; - case MMDB_DATA_TYPE_UINT128: ; -#if MMDB_UINT128_IS_BYTE_ARRAY - uint8_t *val = (uint8_t *)entry_data.uint128; - FORMAT( "0x%02x%02x%02x%02x%02x%02x%02x%02x" - "%02x%02x%02x%02x%02x%02x%02x%02x", - val[0], val[1], val[2], val[3], - val[4], val[5], val[6], val[7], - val[8], val[9], val[10], val[11], - val[12], val[13], val[14], val[15]); -#else - mmdb_uint128_t val = entry_data.uint128; - FORMAT("0x%016uxL%016uxL", - (uint64_t) (val >> 64), (uint64_t) val); -#endif - break; - default: - goto not_found; - } - - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - - return NGX_OK; - -not_found: - if (geoip2->default_value.len > 0) { - v->data = geoip2->default_value.data; - v->len = geoip2->default_value.len; - - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - } else { - v->not_found = 1; - } - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_geoip2_metadata(ngx_http_request_t *r, ngx_http_variable_value_t *v, - uintptr_t data) -{ - ngx_http_geoip2_metadata_t *metadata = (ngx_http_geoip2_metadata_t *) data; - ngx_http_geoip2_db_t *database = metadata->database; - u_char *p; - - if (ngx_strncmp(metadata->metavalue.data, "build_epoch", 11) == 0) { - FORMAT("%uL", database->mmdb.metadata.build_epoch); - } else if (ngx_strncmp(metadata->metavalue.data, "last_check", 10) == 0) { - FORMAT("%T", database->last_check); - } else if (ngx_strncmp(metadata->metavalue.data, "last_change", 11) == 0) { - FORMAT("%T", database->last_change); - } else { - v->not_found = 1; - return NGX_OK; - } - - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - - return NGX_OK; -} - - -static void * -ngx_http_geoip2_create_conf(ngx_conf_t *cf) -{ - ngx_pool_cleanup_t *cln; - ngx_http_geoip2_conf_t *conf; - - conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_geoip2_conf_t)); - if (conf == NULL) { - return NULL; - } - - conf->proxy_recursive = NGX_CONF_UNSET; - - cln = ngx_pool_cleanup_add(cf->pool, 0); - if (cln == NULL) { - return NULL; - } - - ngx_queue_init(&conf->databases); - - cln->handler = ngx_http_geoip2_cleanup; - cln->data = conf; - - return conf; -} - - -static char * -ngx_http_geoip2(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_http_geoip2_conf_t *gcf = conf; - ngx_str_t *value; - int status; - ngx_http_geoip2_db_t *database; - char *rv; - ngx_conf_t save; - ngx_queue_t *q; - - value = cf->args->elts; - - if (value[1].data && value[1].data[0] != '/') { - if (ngx_conf_full_name(cf->cycle, &value[1], 0) != NGX_OK) { - return NGX_CONF_ERROR; - } - } - - if (!ngx_queue_empty(&gcf->databases)) { - for (q = ngx_queue_head(&gcf->databases); - q != ngx_queue_sentinel(&gcf->databases); - q = ngx_queue_next(q)) - { - database = ngx_queue_data(q, ngx_http_geoip2_db_t, queue); - if (ngx_strcmp(value[1].data, database->mmdb.filename) == 0) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "Duplicate GeoIP2 mmdb - %V", &value[1]); - return NGX_CONF_ERROR; - } - } - } - - database = ngx_pcalloc(cf->pool, sizeof(ngx_http_geoip2_db_t)); - if (database == NULL) { - return NGX_CONF_ERROR; - } - - ngx_queue_insert_tail(&gcf->databases, &database->queue); - database->last_check = database->last_change = ngx_time(); - - status = MMDB_open((char *) value[1].data, MMDB_MODE_MMAP, &database->mmdb); - - if (status != MMDB_SUCCESS) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "MMDB_open(\"%V\") failed - %s", &value[1], - MMDB_strerror(status)); - return NGX_CONF_ERROR; - } - - save = *cf; - cf->handler = ngx_http_geoip2_parse_config; - cf->handler_conf = (void *) database; - - rv = ngx_conf_parse(cf, NULL); - *cf = save; - return rv; -} - - -static char * -ngx_http_geoip2_parse_config(ngx_conf_t *cf, ngx_command_t *dummy, void *conf) -{ - ngx_http_geoip2_db_t *database; - ngx_str_t *value; - time_t interval; - - value = cf->args->elts; - - if (value[0].data[0] == '$') { - return ngx_http_geoip2_add_variable(cf, dummy, conf); - } - - if (value[0].len == 11 - && ngx_strncmp(value[0].data, "auto_reload", 11) == 0) { - if ((int) cf->args->nelts != 2) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid number of arguments for auto_reload"); - return NGX_CONF_ERROR; - } - - interval = ngx_parse_time(&value[1], true); - - if (interval == (time_t) NGX_ERROR) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid interval for auto_reload \"%V\"", - value[1]); - return NGX_CONF_ERROR; - } - - - database = (ngx_http_geoip2_db_t *) conf; - database->check_interval = interval; - return NGX_CONF_OK; - } - - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid setting \"%V\"", &value[0]); - return NGX_CONF_ERROR; -} - - -static char * -ngx_http_geoip2_add_variable(ngx_conf_t *cf, ngx_command_t *dummy, void *conf) -{ - ngx_http_geoip2_db_t *database; - ngx_str_t *value; - int nelts; - - value = cf->args->elts; - - if (value[0].data[0] != '$') { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid variable name \"%V\"", &value[0]); - return NGX_CONF_ERROR; - } - - value[0].len--; - value[0].data++; - - nelts = (int) cf->args->nelts; - database = (ngx_http_geoip2_db_t *) conf; - - if (nelts > 0 && value[1].len == 8 && ngx_strncmp(value[1].data, "metadata", 8) == 0) { - return ngx_http_geoip2_add_variable_metadata(cf, database); - } - - return ngx_http_geoip2_add_variable_geodata(cf, database); -} - - -static char * -ngx_http_geoip2_add_variable_metadata(ngx_conf_t *cf, ngx_http_geoip2_db_t *database) -{ - ngx_http_geoip2_metadata_t *metadata; - ngx_str_t *value, name; - ngx_http_variable_t *var; - - metadata = ngx_pcalloc(cf->pool, sizeof(ngx_http_geoip2_metadata_t)); - if (metadata == NULL) { - return NGX_CONF_ERROR; - } - - value = cf->args->elts; - name = value[0]; - - metadata->database = database; - metadata->metavalue = value[2]; - - var = ngx_http_add_variable(cf, &name, NGX_HTTP_VAR_CHANGEABLE); - if (var == NULL) { - return NGX_CONF_ERROR; - } - - var->get_handler = ngx_http_geoip2_metadata; - var->data = (uintptr_t) metadata; - - return NGX_CONF_OK; -} - - -static char * -ngx_http_geoip2_add_variable_geodata(ngx_conf_t *cf, ngx_http_geoip2_db_t *database) -{ - ngx_http_geoip2_ctx_t *geoip2; - ngx_http_compile_complex_value_t ccv; - ngx_str_t *value, name, source; - ngx_http_variable_t *var; - int i, nelts, idx; - - geoip2 = ngx_pcalloc(cf->pool, sizeof(ngx_http_geoip2_ctx_t)); - if (geoip2 == NULL) { - return NGX_CONF_ERROR; - } - - geoip2->database = database; - ngx_str_null(&source); - - value = cf->args->elts; - name = value[0]; - - nelts = (int) cf->args->nelts; - idx = 1; - - if (nelts > idx) { - for (i = idx; i < nelts; i++) { - if (ngx_strnstr(value[idx].data, "=", value[idx].len) == NULL) { - break; - } - - if (value[idx].len > 8 && ngx_strncmp(value[idx].data, "default=", 8) == 0) { - if (geoip2->default_value.len > 0) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "default has already been declared for \"$%V\"", &name); - return NGX_CONF_ERROR; - } - - geoip2->default_value.len = value[idx].len - 8; - geoip2->default_value.data = value[idx].data + 8; - } else if (value[idx].len > 7 && ngx_strncmp(value[idx].data, "source=", 7) == 0) { - if (source.len > 0) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "source has already been declared for \"$%V\"", &name); - return NGX_CONF_ERROR; - } - - source.len = value[idx].len - 7; - source.data = value[idx].data + 7; - - if (source.data[0] != '$') { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid source variable name \"%V\"", &source); - return NGX_CONF_ERROR; - } - - ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); - ccv.cf = cf; - ccv.value = &source; - ccv.complex_value = &geoip2->source; - - if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "unable to compile \"%V\" for \"$%V\"", &source, &name); - return NGX_CONF_ERROR; - } - } else { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid setting \"%V\" for \"$%V\"", &value[idx], &name); - return NGX_CONF_ERROR; - } - - idx++; - } - } - - var = ngx_http_add_variable(cf, &name, NGX_HTTP_VAR_CHANGEABLE); - if (var == NULL) { - return NGX_CONF_ERROR; - } - - geoip2->lookup = ngx_pcalloc(cf->pool, sizeof(const char *) * - (cf->args->nelts - (idx - 1))); - - if (geoip2->lookup == NULL) { - return NGX_CONF_ERROR; - } - - for (i = idx; i < nelts; i++) { - geoip2->lookup[i - idx] = (char *) value[i].data; - } - geoip2->lookup[i - idx] = NULL; - - var->get_handler = ngx_http_geoip2_variable; - var->data = (uintptr_t) geoip2; - - return NGX_CONF_OK; -} - - -static char * -ngx_http_geoip2_init_conf(ngx_conf_t *cf, void *conf) -{ - ngx_http_geoip2_conf_t *gcf = conf; - ngx_conf_init_value(gcf->proxy_recursive, 0); - return NGX_CONF_OK; -} - - -static char * -ngx_http_geoip2_proxy(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_http_geoip2_conf_t *gcf = conf; - ngx_str_t *value; - ngx_cidr_t cidr, *c; - - value = cf->args->elts; - - if (ngx_http_geoip2_cidr_value(cf, &value[1], &cidr) != NGX_OK) { - return NGX_CONF_ERROR; - } - - if (gcf->proxies == NULL) { - gcf->proxies = ngx_array_create(cf->pool, 4, sizeof(ngx_cidr_t)); - if (gcf->proxies == NULL) { - return NGX_CONF_ERROR; - } - } - - c = ngx_array_push(gcf->proxies); - if (c == NULL) { - return NGX_CONF_ERROR; - } - - *c = cidr; - - return NGX_CONF_OK; -} - - -static ngx_int_t -ngx_http_geoip2_cidr_value(ngx_conf_t *cf, ngx_str_t *net, ngx_cidr_t *cidr) -{ - ngx_int_t rc; - - if (ngx_strcmp(net->data, "255.255.255.255") == 0) { - cidr->family = AF_INET; - cidr->u.in.addr = 0xffffffff; - cidr->u.in.mask = 0xffffffff; - - return NGX_OK; - } - - rc = ngx_ptocidr(net, cidr); - - if (rc == NGX_ERROR) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid network \"%V\"", net); - return NGX_ERROR; - } - - if (rc == NGX_DONE) { - ngx_conf_log_error(NGX_LOG_WARN, cf, 0, - "low address bits of %V are meaningless", net); - } - - return NGX_OK; -} - - -static void -ngx_http_geoip2_cleanup(void *data) -{ - ngx_http_geoip2_conf_t *gcf = data; - ngx_queue_t *q; - ngx_http_geoip2_db_t *database; - - while (!ngx_queue_empty(&gcf->databases)) { - q = ngx_queue_head(&gcf->databases); - ngx_queue_remove(q); - database = ngx_queue_data(q, ngx_http_geoip2_db_t, queue); - MMDB_close(&database->mmdb); - } -} - - -static ngx_int_t -ngx_http_geoip2_log_handler(ngx_http_request_t *r) -{ - int status; - MMDB_s tmpdb; - ngx_queue_t *q; - ngx_file_info_t fi; - ngx_http_geoip2_db_t *database; - ngx_http_geoip2_conf_t *gcf; - - ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "geoip2 http log handler"); - - gcf = ngx_http_get_module_main_conf(r, ngx_http_geoip2_module); - - if (ngx_queue_empty(&gcf->databases)) { - return NGX_OK; - } - - for (q = ngx_queue_head(&gcf->databases); - q != ngx_queue_sentinel(&gcf->databases); - q = ngx_queue_next(q)) - { - database = ngx_queue_data(q, ngx_http_geoip2_db_t, queue); - if (database->check_interval == 0) { - continue; - } - - if ((database->last_check + database->check_interval) - > ngx_time()) - { - continue; - } - - database->last_check = ngx_time(); - - if (ngx_file_info(database->mmdb.filename, &fi) == NGX_FILE_ERROR) { - ngx_log_error(NGX_LOG_EMERG, r->connection->log, ngx_errno, - ngx_file_info_n " \"%s\" failed", - database->mmdb.filename); - - continue; - } - - if (ngx_file_mtime(&fi) <= database->last_change) { - continue; - } - - /* do the reload */ - - ngx_memzero(&tmpdb, sizeof(MMDB_s)); - status = MMDB_open(database->mmdb.filename, MMDB_MODE_MMAP, &tmpdb); - - if (status != MMDB_SUCCESS) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "MMDB_open(\"%s\") failed to reload - %s", - database->mmdb.filename, MMDB_strerror(status)); - - continue; - } - - database->last_change = ngx_file_mtime(&fi); - MMDB_close(&database->mmdb); - database->mmdb = tmpdb; - - ngx_log_error(NGX_LOG_INFO, r->connection->log, 0, - "Reload MMDB \"%s\"", - database->mmdb.filename); - } - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_geoip2_init(ngx_conf_t *cf) -{ - ngx_http_handler_pt *h; - ngx_http_core_main_conf_t *cmcf; - - cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module); - - h = ngx_array_push(&cmcf->phases[NGX_HTTP_LOG_PHASE].handlers); - if (h == NULL) { - return NGX_ERROR; - } - - *h = ngx_http_geoip2_log_handler; - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-geoip2-3.4/ngx_stream_geoip2_module.c b/modules_deb/libnginx-mod-http-geoip2-3.4/ngx_stream_geoip2_module.c deleted file mode 100644 index eb59082..0000000 --- a/modules_deb/libnginx-mod-http-geoip2-3.4/ngx_stream_geoip2_module.c +++ /dev/null @@ -1,694 +0,0 @@ -/* - * Copyright (C) Lee Valentine - * Copyright (C) Andrei Belov - * - * Based on nginx's 'ngx_stream_geoip_module.c' by Igor Sysoev - */ - - -#include -#include -#include - -#include - - -typedef struct { - MMDB_s mmdb; - MMDB_lookup_result_s result; - time_t last_check; - time_t last_change; - time_t check_interval; -#if (NGX_HAVE_INET6) - uint8_t address[16]; -#else - unsigned long address; -#endif - ngx_queue_t queue; -} ngx_stream_geoip2_db_t; - -typedef struct { - ngx_queue_t databases; -} ngx_stream_geoip2_conf_t; - -typedef struct { - ngx_stream_geoip2_db_t *database; - const char **lookup; - ngx_str_t default_value; - ngx_stream_complex_value_t source; -} ngx_stream_geoip2_ctx_t; - -typedef struct { - ngx_stream_geoip2_db_t *database; - ngx_str_t metavalue; -} ngx_stream_geoip2_metadata_t; - - -static ngx_int_t ngx_stream_geoip2_variable(ngx_stream_session_t *s, - ngx_stream_variable_value_t *v, uintptr_t data); -static ngx_int_t ngx_stream_geoip2_metadata(ngx_stream_session_t *s, - ngx_stream_variable_value_t *v, uintptr_t data); -static void *ngx_stream_geoip2_create_conf(ngx_conf_t *cf); -static char *ngx_stream_geoip2(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); -static char *ngx_stream_geoip2_parse_config(ngx_conf_t *cf, ngx_command_t *dummy, - void *conf); -static char *ngx_stream_geoip2(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); -static char *ngx_stream_geoip2_add_variable(ngx_conf_t *cf, ngx_command_t *dummy, - void *conf); -static char *ngx_stream_geoip2_add_variable_geodata(ngx_conf_t *cf, - ngx_stream_geoip2_db_t *database); -static char *ngx_stream_geoip2_add_variable_metadata(ngx_conf_t *cf, - ngx_stream_geoip2_db_t *database); -static void ngx_stream_geoip2_cleanup(void *data); -static ngx_int_t ngx_stream_geoip2_init(ngx_conf_t *cf); - - -#define FORMAT(fmt, ...) do { \ - p = ngx_palloc(s->connection->pool, NGX_OFF_T_LEN); \ - if (p == NULL) { \ - return NGX_ERROR; \ - } \ - v->len = ngx_sprintf(p, fmt, __VA_ARGS__) - p; \ - v->data = p; \ -} while (0) - -static ngx_command_t ngx_stream_geoip2_commands[] = { - - { ngx_string("geoip2"), - NGX_STREAM_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_TAKE1, - ngx_stream_geoip2, - NGX_STREAM_MAIN_CONF_OFFSET, - 0, - NULL }, - - ngx_null_command -}; - - -static ngx_stream_module_t ngx_stream_geoip2_module_ctx = { - NULL, /* preconfiguration */ - ngx_stream_geoip2_init, /* postconfiguration */ - - ngx_stream_geoip2_create_conf, /* create main configuration */ - NULL, /* init main configuration */ - - NULL, /* create server configuration */ - NULL /* merge server configuration */ -}; - - -ngx_module_t ngx_stream_geoip2_module = { - NGX_MODULE_V1, - &ngx_stream_geoip2_module_ctx, /* module context */ - ngx_stream_geoip2_commands, /* module directives */ - NGX_STREAM_MODULE, /* module type */ - NULL, /* init master */ - NULL, /* init module */ - NULL, /* init process */ - NULL, /* init thread */ - NULL, /* exit thread */ - NULL, /* exit process */ - NULL, /* exit master */ - NGX_MODULE_V1_PADDING -}; - - -static ngx_int_t -ngx_stream_geoip2_variable(ngx_stream_session_t *s, ngx_stream_variable_value_t *v, - uintptr_t data) -{ - int mmdb_error; - u_char *p; - ngx_str_t val; - ngx_addr_t addr; - MMDB_entry_data_s entry_data; - ngx_stream_geoip2_ctx_t *geoip2 = (ngx_stream_geoip2_ctx_t *) data; - ngx_stream_geoip2_db_t *database = geoip2->database; - -#if (NGX_HAVE_INET6) - uint8_t address[16], *addressp = address; -#else - unsigned long address; -#endif - - if (geoip2->source.value.len > 0) { - if (ngx_stream_complex_value(s, &geoip2->source, &val) != NGX_OK) { - goto not_found; - } - - if (ngx_parse_addr(s->connection->pool, &addr, val.data, val.len) != NGX_OK) { - goto not_found; - } - } else { - addr.sockaddr = s->connection->sockaddr; - addr.socklen = s->connection->socklen; - } - - switch (addr.sockaddr->sa_family) { - case AF_INET: -#if (NGX_HAVE_INET6) - ngx_memset(addressp, 0, 12); - ngx_memcpy(addressp + 12, &((struct sockaddr_in *) - addr.sockaddr)->sin_addr.s_addr, 4); - break; - - case AF_INET6: - ngx_memcpy(addressp, &((struct sockaddr_in6 *) - addr.sockaddr)->sin6_addr.s6_addr, 16); -#else - address = ((struct sockaddr_in *)addr.sockaddr)->sin_addr.s_addr; -#endif - break; - - default: - goto not_found; - } - -#if (NGX_HAVE_INET6) - if (ngx_memcmp(&address, &database->address, sizeof(address)) != 0) { -#else - if (address != database->address) { -#endif - memcpy(&database->address, &address, sizeof(address)); - database->result = MMDB_lookup_sockaddr(&database->mmdb, - addr.sockaddr, &mmdb_error); - - if (mmdb_error != MMDB_SUCCESS) { - goto not_found; - } - } - - if (!database->result.found_entry - || MMDB_aget_value(&database->result.entry, &entry_data, geoip2->lookup) - != MMDB_SUCCESS) - { - goto not_found; - } - - if (!entry_data.has_data) { - goto not_found; - } - - switch (entry_data.type) { - case MMDB_DATA_TYPE_BOOLEAN: - FORMAT("%d", entry_data.boolean); - break; - case MMDB_DATA_TYPE_UTF8_STRING: - v->len = entry_data.data_size; - v->data = ngx_pnalloc(s->connection->pool, v->len); - if (v->data == NULL) { - return NGX_ERROR; - } - ngx_memcpy(v->data, (u_char *) entry_data.utf8_string, v->len); - break; - case MMDB_DATA_TYPE_BYTES: - v->len = entry_data.data_size; - v->data = ngx_pnalloc(s->connection->pool, v->len); - if (v->data == NULL) { - return NGX_ERROR; - } - ngx_memcpy(v->data, (u_char *) entry_data.bytes, v->len); - break; - case MMDB_DATA_TYPE_FLOAT: - FORMAT("%.5f", entry_data.float_value); - break; - case MMDB_DATA_TYPE_DOUBLE: - FORMAT("%.5f", entry_data.double_value); - break; - case MMDB_DATA_TYPE_UINT16: - FORMAT("%uD", entry_data.uint16); - break; - case MMDB_DATA_TYPE_UINT32: - FORMAT("%uD", entry_data.uint32); - break; - case MMDB_DATA_TYPE_INT32: - FORMAT("%D", entry_data.int32); - break; - case MMDB_DATA_TYPE_UINT64: - FORMAT("%uL", entry_data.uint64); - break; - case MMDB_DATA_TYPE_UINT128: ; -#if MMDB_UINT128_IS_BYTE_ARRAY - uint8_t *val = (uint8_t *) entry_data.uint128; - FORMAT("0x%02x%02x%02x%02x%02x%02x%02x%02x" - "%02x%02x%02x%02x%02x%02x%02x%02x", - val[0], val[1], val[2], val[3], - val[4], val[5], val[6], val[7], - val[8], val[9], val[10], val[11], - val[12], val[13], val[14], val[15]); -#else - mmdb_uint128_t val = entry_data.uint128; - FORMAT("0x%016uxL%016uxL", - (uint64_t) (val >> 64), (uint64_t) val); -#endif - break; - default: - goto not_found; - } - - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - - return NGX_OK; - -not_found: - if (geoip2->default_value.len > 0) { - v->data = geoip2->default_value.data; - v->len = geoip2->default_value.len; - - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - - return NGX_OK; - } - - v->not_found = 1; - - return NGX_OK; -} - - -static ngx_int_t -ngx_stream_geoip2_metadata(ngx_stream_session_t *s, ngx_stream_variable_value_t *v, - uintptr_t data) -{ - ngx_stream_geoip2_metadata_t *metadata = (ngx_stream_geoip2_metadata_t *) data; - ngx_stream_geoip2_db_t *database = metadata->database; - u_char *p; - - if (ngx_strncmp(metadata->metavalue.data, "build_epoch", 11) == 0) { - FORMAT("%uL", database->mmdb.metadata.build_epoch); - } else if (ngx_strncmp(metadata->metavalue.data, "last_check", 10) == 0) { - FORMAT("%T", database->last_check); - } else if (ngx_strncmp(metadata->metavalue.data, "last_change", 11) == 0) { - FORMAT("%T", database->last_change); - } else { - v->not_found = 1; - return NGX_OK; - } - - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - - return NGX_OK; -} - - -static void * -ngx_stream_geoip2_create_conf(ngx_conf_t *cf) -{ - ngx_pool_cleanup_t *cln; - ngx_stream_geoip2_conf_t *conf; - - conf = ngx_pcalloc(cf->pool, sizeof(ngx_stream_geoip2_conf_t)); - if (conf == NULL) { - return NULL; - } - - cln = ngx_pool_cleanup_add(cf->pool, 0); - if (cln == NULL) { - return NULL; - } - - ngx_queue_init(&conf->databases); - - cln->handler = ngx_stream_geoip2_cleanup; - cln->data = conf; - - return conf; -} - - -static char * -ngx_stream_geoip2(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - int status; - char *rv; - ngx_str_t *value; - ngx_conf_t save; - ngx_stream_geoip2_db_t *database; - ngx_stream_geoip2_conf_t *gcf = conf; - ngx_queue_t *q; - - value = cf->args->elts; - - if (value[1].data && value[1].data[0] != '/') { - if (ngx_conf_full_name(cf->cycle, &value[1], 0) != NGX_OK) { - return NGX_CONF_ERROR; - } - } - - if (!ngx_queue_empty(&gcf->databases)) { - for (q = ngx_queue_head(&gcf->databases); - q != ngx_queue_sentinel(&gcf->databases); - q = ngx_queue_next(q)) - { - database = ngx_queue_data(q, ngx_stream_geoip2_db_t, queue); - if (ngx_strcmp(value[1].data, database->mmdb.filename) == 0) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "Duplicate GeoIP2 mmdb - %V", &value[1]); - return NGX_CONF_ERROR; - } - } - } - - database = ngx_pcalloc(cf->pool, sizeof(ngx_stream_geoip2_db_t)); - if (database == NULL) { - return NGX_CONF_ERROR; - } - - ngx_queue_insert_tail(&gcf->databases, &database->queue); - database->last_check = database->last_change = ngx_time(); - - status = MMDB_open((char *) value[1].data, MMDB_MODE_MMAP, &database->mmdb); - - if (status != MMDB_SUCCESS) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "MMDB_open(\"%V\") failed - %s", &value[1], - MMDB_strerror(status)); - return NGX_CONF_ERROR; - } - - save = *cf; - cf->handler = ngx_stream_geoip2_parse_config; - cf->handler_conf = (void *) database; - - rv = ngx_conf_parse(cf, NULL); - *cf = save; - return rv; -} - - -static char * -ngx_stream_geoip2_parse_config(ngx_conf_t *cf, ngx_command_t *dummy, void *conf) -{ - ngx_stream_geoip2_db_t *database; - ngx_str_t *value; - time_t interval; - - value = cf->args->elts; - - if (value[0].data[0] == '$') { - return ngx_stream_geoip2_add_variable(cf, dummy, conf); - } - - if (value[0].len == 11 - && ngx_strncmp(value[0].data, "auto_reload", 11) == 0) { - if ((int) cf->args->nelts != 2) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid number of arguments for auto_reload"); - return NGX_CONF_ERROR; - } - - interval = ngx_parse_time(&value[1], true); - - if (interval == (time_t) NGX_ERROR) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid interval for auto_reload \"%V\"", - value[1]); - return NGX_CONF_ERROR; - } - - - database = (ngx_stream_geoip2_db_t *) conf; - database->check_interval = interval; - return NGX_CONF_OK; - } - - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid setting \"%V\"", &value[0]); - return NGX_CONF_ERROR; -} - - -static char * -ngx_stream_geoip2_add_variable(ngx_conf_t *cf, ngx_command_t *dummy, void *conf) -{ - ngx_stream_geoip2_db_t *database; - ngx_str_t *value; - int nelts; - - value = cf->args->elts; - - if (value[0].data[0] != '$') { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid variable name \"%V\"", &value[0]); - return NGX_CONF_ERROR; - } - - value[0].len--; - value[0].data++; - - nelts = (int) cf->args->nelts; - database = (ngx_stream_geoip2_db_t *) conf; - - if (nelts > 0 && value[1].len == 8 && ngx_strncmp(value[1].data, "metadata", 8) == 0) { - return ngx_stream_geoip2_add_variable_metadata(cf, database); - } - - return ngx_stream_geoip2_add_variable_geodata(cf, database); -} - - -static char * -ngx_stream_geoip2_add_variable_metadata(ngx_conf_t *cf, ngx_stream_geoip2_db_t *database) -{ - ngx_stream_geoip2_metadata_t *metadata; - ngx_str_t *value, name; - ngx_stream_variable_t *var; - - metadata = ngx_pcalloc(cf->pool, sizeof(ngx_stream_geoip2_metadata_t)); - if (metadata == NULL) { - return NGX_CONF_ERROR; - } - - value = cf->args->elts; - name = value[0]; - - metadata->database = database; - metadata->metavalue = value[2]; - - var = ngx_stream_add_variable(cf, &name, NGX_STREAM_VAR_CHANGEABLE); - if (var == NULL) { - return NGX_CONF_ERROR; - } - - var->get_handler = ngx_stream_geoip2_metadata; - var->data = (uintptr_t) metadata; - - return NGX_CONF_OK; -} - - -static char * -ngx_stream_geoip2_add_variable_geodata(ngx_conf_t *cf, ngx_stream_geoip2_db_t *database) -{ - ngx_stream_geoip2_ctx_t *geoip2; - ngx_stream_compile_complex_value_t ccv; - ngx_str_t *value, name, source; - ngx_stream_variable_t *var; - int i, nelts, idx; - - geoip2 = ngx_pcalloc(cf->pool, sizeof(ngx_stream_geoip2_ctx_t)); - if (geoip2 == NULL) { - return NGX_CONF_ERROR; - } - - geoip2->database = database; - ngx_str_null(&source); - - value = cf->args->elts; - name = value[0]; - - nelts = (int) cf->args->nelts; - idx = 1; - - if (nelts > idx) { - for (i = idx; i < nelts; i++) { - if (ngx_strnstr(value[idx].data, "=", value[idx].len) == NULL) { - break; - } - - if (value[idx].len > 8 && ngx_strncmp(value[idx].data, "default=", 8) == 0) { - if (geoip2->default_value.len > 0) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "default has already been declared for \"$%V\"", &name); - return NGX_CONF_ERROR; - } - - geoip2->default_value.len = value[idx].len - 8; - geoip2->default_value.data = value[idx].data + 8; - - } else if (value[idx].len > 7 && ngx_strncmp(value[idx].data, "source=", 7) == 0) { - if (source.len > 0) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "source has already been declared for \"$%V\"", &name); - return NGX_CONF_ERROR; - } - - source.len = value[idx].len - 7; - source.data = value[idx].data + 7; - - if (source.data[0] != '$') { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid source variable name \"%V\"", &source); - return NGX_CONF_ERROR; - } - - ngx_memzero(&ccv, sizeof(ngx_stream_compile_complex_value_t)); - ccv.cf = cf; - ccv.value = &source; - ccv.complex_value = &geoip2->source; - - if (ngx_stream_compile_complex_value(&ccv) != NGX_OK) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "unable to compile \"%V\" for \"$%V\"", &source, &name); - return NGX_CONF_ERROR; - } - - } else { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid setting \"%V\" for \"$%V\"", &value[idx], &name); - return NGX_CONF_ERROR; - } - - idx++; - } - } - - var = ngx_stream_add_variable(cf, &name, NGX_STREAM_VAR_CHANGEABLE); - if (var == NULL) { - return NGX_CONF_ERROR; - } - - geoip2->lookup = ngx_pcalloc(cf->pool, - sizeof(const char *) * (cf->args->nelts - (idx - 1))); - - if (geoip2->lookup == NULL) { - return NGX_CONF_ERROR; - } - - for (i = idx; i < nelts; i++) { - geoip2->lookup[i - idx] = (char *) value[i].data; - } - geoip2->lookup[i - idx] = NULL; - - var->get_handler = ngx_stream_geoip2_variable; - var->data = (uintptr_t) geoip2; - - return NGX_CONF_OK; -} - - -static void -ngx_stream_geoip2_cleanup(void *data) -{ - ngx_queue_t *q; - ngx_stream_geoip2_db_t *database; - ngx_stream_geoip2_conf_t *gcf = data; - - while (!ngx_queue_empty(&gcf->databases)) { - q = ngx_queue_head(&gcf->databases); - ngx_queue_remove(q); - database = ngx_queue_data(q, ngx_stream_geoip2_db_t, queue); - MMDB_close(&database->mmdb); - } -} - - -static ngx_int_t -ngx_stream_geoip2_log_handler(ngx_stream_session_t *s) -{ - int status; - MMDB_s tmpdb; - ngx_queue_t *q; - ngx_file_info_t fi; - ngx_stream_geoip2_db_t *database; - ngx_stream_geoip2_conf_t *gcf; - - ngx_log_debug0(NGX_LOG_DEBUG_STREAM, s->connection->log, 0, - "geoip2 stream log handler"); - - gcf = ngx_stream_get_module_main_conf(s, ngx_stream_geoip2_module); - - if (ngx_queue_empty(&gcf->databases)) { - return NGX_OK; - } - - for (q = ngx_queue_head(&gcf->databases); - q != ngx_queue_sentinel(&gcf->databases); - q = ngx_queue_next(q)) - { - database = ngx_queue_data(q, ngx_stream_geoip2_db_t, queue); - if (database->check_interval == 0) { - continue; - } - - if ((database->last_check + database->check_interval) - > ngx_time()) - { - continue; - } - - database->last_check = ngx_time(); - - if (ngx_file_info(database->mmdb.filename, &fi) == NGX_FILE_ERROR) { - ngx_log_error(NGX_LOG_EMERG, s->connection->log, ngx_errno, - ngx_file_info_n " \"%s\" failed", - database->mmdb.filename); - - continue; - } - - if (ngx_file_mtime(&fi) <= database->last_change) { - continue; - } - - /* do the reload */ - - ngx_memzero(&tmpdb, sizeof(MMDB_s)); - status = MMDB_open(database->mmdb.filename, MMDB_MODE_MMAP, &tmpdb); - - if (status != MMDB_SUCCESS) { - ngx_log_error(NGX_LOG_ERR, s->connection->log, 0, - "MMDB_open(\"%s\") failed to reload - %s", - database->mmdb.filename, MMDB_strerror(status)); - - continue; - } - - database->last_change = ngx_file_mtime(&fi); - MMDB_close(&database->mmdb); - database->mmdb = tmpdb; - - ngx_log_error(NGX_LOG_INFO, s->connection->log, 0, - "Reload MMDB \"%s\"", - database->mmdb.filename); - } - - return NGX_OK; -} - - -static ngx_int_t -ngx_stream_geoip2_init(ngx_conf_t *cf) -{ - ngx_stream_handler_pt *h; - ngx_stream_core_main_conf_t *cmcf; - - cmcf = ngx_stream_conf_get_module_main_conf(cf, ngx_stream_core_module); - - h = ngx_array_push(&cmcf->phases[NGX_STREAM_LOG_PHASE].handlers); - if (h == NULL) { - return NGX_ERROR; - } - - *h = ngx_stream_geoip2_log_handler; - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/.gitattributes b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/.gitattributes deleted file mode 100644 index 6fe6f35..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.t linguist-language=Text diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/.gitignore b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/.gitignore deleted file mode 100644 index 39c82fa..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/.gitignore +++ /dev/null @@ -1,54 +0,0 @@ -reindex -.libs -*.swp -*.slo -*.la -*.swo -*.lo -*~ -*.o -print.txt -.rsync -*.tar.gz -dist -build[78] -build -tags -update-readme -*.tmp -test/Makefile -test/blib -test.sh -t.sh -t/t.sh -test/t/servroot/ -releng -reset -*.t_ -genmobi.sh -*.mobi -misc/chunked -src/headers.c -src/headers.h -src/module.c -src/module.h -src/util.c -src/util.h -go -ctags -src/in.c -src/in.h -src/out.c -src/out.h -build[89] -build1[0-9] -buildroot/ -work/ -all -t/servroot -analyze -cov -nginx -*.plist -a.patch -Makefile diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/.travis.yml b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/.travis.yml deleted file mode 100644 index 6b346a8..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/.travis.yml +++ /dev/null @@ -1,58 +0,0 @@ -sudo: required -dist: focal - -branches: - only: - - "master" - -os: linux - -language: c - -compiler: - - gcc - -addons: - apt: - packages: - - axel - - cpanminus - -env: - global: - - LUAJIT_PREFIX=/opt/luajit21 - - LUAJIT_LIB=$LUAJIT_PREFIX/lib - - LUAJIT_INC=$LUAJIT_PREFIX/include/luajit-2.1 - - LD_LIBRARY_PATH=$LUAJIT_LIB:$LD_LIBRARY_PATH - matrix: - - NGINX_VERSION=1.25.3 WITHOUT_PCRE2=1 - - NGINX_VERSION=1.27.1 WITHOUT_PCRE2=1 - -before_install: - - sudo apt-get update -y - - sudo apt-get install -y ca-certificates - - sudo cpanm -v --notest Test::Nginx > build.log 2>&1 || (cat build.log && exit 1) - -install: - - git clone https://github.com/openresty/echo-nginx-module.git ../echo-nginx-module - - git clone https://github.com/openresty/lua-nginx-module.git ../lua-nginx-module - - git clone https://github.com/openresty/lua-resty-core.git ../lua-resty-core - - git clone https://github.com/openresty/lua-resty-lrucache.git ../lua-resty-lrucache - - git clone https://github.com/openresty/nginx-eval-module.git ../eval-nginx-module - - git clone https://github.com/openresty/openresty.git ../openresty - - git clone https://github.com/openresty/no-pool-nginx.git ../no-pool-nginx - - git clone https://github.com/openresty/nginx-devel-utils.git - - git clone -b v2.1-agentzh https://github.com/openresty/luajit2.git luajit2 - -before_script: - - cd luajit2/ - - make -j$JOBS CCDEBUG=-g Q= PREFIX=$LUAJIT_PREFIX CC=$CC XCFLAGS='-DLUA_USE_APICHECK -DLUA_USE_ASSERT -msse4.2' > build.log 2>&1 || (cat build.log && exit 1) - - sudo make install PREFIX=$LUAJIT_PREFIX > build.log 2>&1 || (cat build.log && exit 1) - - cd .. - -script: - - export PATH=$PWD/work/nginx/sbin:$PWD/nginx-devel-utils:$PATH - - export NGX_BUILD_CC=$CC - - sh util/build.sh $NGINX_VERSION > build.log 2>&1 || (cat build.log && exit 1) - - prove -I. -r t - diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/LICENSE b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/LICENSE deleted file mode 100644 index c14f60a..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -This module is licensed under the terms of the BSD license. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright 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 THE COPYRIGHT HOLDERS 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 THE COPYRIGHT -HOLDER 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) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/README.markdown b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/README.markdown deleted file mode 100644 index 6baea91..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/README.markdown +++ /dev/null @@ -1,538 +0,0 @@ -Name -==== - -**ngx_headers_more** - Set and clear input and output headers...more than "add"! - -*This module is not distributed with the Nginx source.* See [the installation instructions](#installation). - -Table of Contents -================= - -* [Name](#name) -* [Version](#version) -* [Synopsis](#synopsis) -* [Description](#description) -* [Directives](#directives) - * [more_set_headers](#more_set_headers) - * [more_clear_headers](#more_clear_headers) - * [more_set_input_headers](#more_set_input_headers) - * [more_clear_input_headers](#more_clear_input_headers) -* [Limitations](#limitations) -* [Installation](#installation) -* [Compatibility](#compatibility) -* [Community](#community) - * [English Mailing List](#english-mailing-list) - * [Chinese Mailing List](#chinese-mailing-list) -* [Bugs and Patches](#bugs-and-patches) -* [Source Repository](#source-repository) -* [Changes](#changes) -* [Test Suite](#test-suite) -* [TODO](#todo) -* [Getting involved](#getting-involved) -* [Authors](#authors) -* [Copyright & License](#copyright--license) -* [See Also](#see-also) - -Version -======= - -This document describes headers-more-nginx-module [v0.34](https://github.com/openresty/headers-more-nginx-module/tags) released on 17 July 2022. - -Synopsis -======== - -```nginx - - # set the Server output header - more_set_headers 'Server: my-server'; - - # set and clear output headers - location /bar { - more_set_headers 'X-MyHeader: blah' 'X-MyHeader2: foo'; - more_set_headers -t 'text/plain text/css' 'Content-Type: text/foo'; - more_set_headers -s '400 404 500 503' -s 413 'Foo: Bar'; - more_clear_headers 'Content-Type'; - - # your proxy_pass/memcached_pass/or any other config goes here... - } - - # set output headers - location /type { - more_set_headers 'Content-Type: text/plain'; - # ... - } - - # set input headers - location /foo { - set $my_host 'my dog'; - more_set_input_headers 'Host: $my_host'; - more_set_input_headers -t 'text/plain' 'X-Foo: bah'; - - # now $host and $http_host have their new values... - # ... - } - - # replace input header X-Foo *only* if it already exists - more_set_input_headers -r 'X-Foo: howdy'; -``` - -Description -=========== - -This module allows you to add, set, or clear any output -or input header that you specify. - -This is an enhanced version of the standard -[headers](http://nginx.org/en/docs/http/ngx_http_headers_module.html) module because it provides more utilities like -resetting or clearing "builtin headers" like `Content-Type`, -`Content-Length`, and `Server`. - -It also allows you to specify an optional HTTP status code -criteria using the `-s` option and an optional content -type criteria using the `-t` option while modifying the -output headers with the [more_set_headers](#more_set_headers) and -[more_clear_headers](#more_clear_headers) directives. For example, - -```nginx - more_set_headers -s 404 -t 'text/html' 'X-Foo: Bar'; -``` - -You can also specify multiple MIME types to filter out in a single `-t` option. -For example, - -```nginx -more_set_headers -t 'text/html text/plain' 'X-Foo: Bar'; -``` - -Never use other parameters like `charset=utf-8` in the `-t` option values; they will not -work as you would expect. - -Input headers can be modified as well. For example - -```nginx - location /foo { - more_set_input_headers 'Host: foo' 'User-Agent: faked'; - # now $host, $http_host, $user_agent, and - # $http_user_agent all have their new values. - } -``` - -The option `-t` is also available in the -[more_set_input_headers](#more_set_input_headers) and -[more_clear_input_headers](#more_clear_input_headers) directives (for request header filtering) while the `-s` option -is not allowed. - -Unlike the standard [headers](http://nginx.org/en/docs/http/ngx_http_headers_module.html) module, this module's directives will by -default apply to all the status codes, including `4xx` and `5xx`. - -[Back to TOC](#table-of-contents) - -Directives -========== - -[Back to TOC](#table-of-contents) - -more_set_headers ----------------- -**syntax:** *more_set_headers [-t <content-type list>]... [-s <status-code list>]... [-a] <new-header>...* - -**default:** *no* - -**context:** *http, server, location, location if* - -**phase:** *output-header-filter* - -Replaces (if any) or adds (if not any) the specified output headers when the response status code matches the codes specified by the `-s` option *AND* the response content type matches the types specified by the `-t` option. - -If the "-a" option is specified, the specified output headers can be appended directly without clearing the old fields. The behavior of builtin headers such as "Content-Type", "Content-Length", "Server", etc. cannot be changed. - -If either `-s` or `-t` is not specified or has an empty list value, then no match is required. Therefore, the following directive set the `Server` output header to the custom value for *any* status code and *any* content type: - -```nginx - - more_set_headers "Server: my_server"; -``` - -Existing response headers with the same name are always overridden. If you want to add headers incrementally, use the standard [add_header](http://nginx.org/en/docs/http/ngx_http_headers_module.html#add_header) directive instead. - -A single directive can set/add multiple output headers. For example - -```nginx - - more_set_headers 'Foo: bar' 'Baz: bah'; -``` - -Multiple occurrences of the options are allowed in a single directive. Their values will be merged together. For instance - -```nginx - - more_set_headers -s 404 -s '500 503' 'Foo: bar'; -``` - -is equivalent to - -```nginx - - more_set_headers -s '404 500 503' 'Foo: bar'; -``` - -The new header should be the one of the forms: - -1. `Name: Value` -1. `Name: ` -1. `Name` - -The last two effectively clear the value of the header `Name`. - -Nginx variables are allowed in header values. For example: - -```nginx - - set $my_var "dog"; - more_set_headers "Server: $my_var"; -``` - -But variables won't work in header keys due to performance considerations. - -Multiple set/clear header directives are allowed in a single location, and they're executed sequentially. - -Directives inherited from an upper level scope (say, http block or server blocks) are executed before the directives in the location block. - -Note that although `more_set_headers` is allowed in *location* if blocks, it is *not* allowed in the *server* if blocks, as in - -```nginx - - ? # This is NOT allowed! - ? server { - ? if ($args ~ 'download') { - ? more_set_headers 'Foo: Bar'; - ? } - ? ... - ? } -``` - -Behind the scene, use of this directive and its friend [more_clear_headers](#more_clear_headers) will (lazily) register an ouput header filter that modifies `r->headers_out` the way you specify. - -[Back to TOC](#table-of-contents) - -more_clear_headers ------------------- -**syntax:** *more_clear_headers [-t <content-type list>]... [-s <status-code list>]... <new-header>...* - -**default:** *no* - -**context:** *http, server, location, location if* - -**phase:** *output-header-filter* - -Clears the specified output headers. - -In fact, - -```nginx - - more_clear_headers -s 404 -t 'text/plain' Foo Baz; -``` - -is exactly equivalent to - -```nginx - - more_set_headers -s 404 -t 'text/plain' "Foo: " "Baz: "; -``` - -or - -```nginx - - more_set_headers -s 404 -t 'text/plain' Foo Baz -``` - -See [more_set_headers](#more_set_headers) for more details. - -The wildcard character, `*`, can also be used at the end of the header name to specify a pattern. For example, the following directive -effectively clears *any* output headers starting by "`X-Hidden-`": - -```nginx - - more_clear_headers 'X-Hidden-*'; -``` - -The `*` wildcard support was first introduced in [v0.09](#v009). - -[Back to TOC](#table-of-contents) - -more_set_input_headers ----------------------- -**syntax:** *more_set_input_headers [-r] [-t <content-type list>]... <new-header>...* - -**default:** *no* - -**context:** *http, server, location, location if* - -**phase:** *rewrite tail* - -Very much like [more_set_headers](#more_set_headers) except that it operates on input headers (or request headers) and it only supports the `-t` option. - -Note that using the `-t` option in this directive means filtering by the `Content-Type` *request* header, rather than the response header. - -Behind the scene, use of this directive and its friend [more_clear_input_headers](#more_clear_input_headers) will (lazily) -register a `rewrite phase` handler that modifies `r->headers_in` the way you specify. Note that it always run at the *end* of -the `rewrite` phase so that it runs *after* the standard [rewrite module](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html) -and works in subrequests as well. - -If the `-r` option is specified, then the headers will be replaced to the new values *only if* they already exist. - -[Back to TOC](#table-of-contents) - -more_clear_input_headers ------------------------- -**syntax:** *more_clear_input_headers [-t <content-type list>]... <new-header>...* - -**default:** *no* - -**context:** *http, server, location, location if* - -**phase:** *rewrite tail* - -Clears the specified input headers. - -In fact, - -```nginx - - more_clear_input_headers -t 'text/plain' Foo Baz; -``` - -is exactly equivalent to - -```nginx - - more_set_input_headers -t 'text/plain' "Foo: " "Baz: "; -``` - -or - -```nginx - - more_set_input_headers -t 'text/plain' Foo Baz -``` - -To remove request headers "Foo" and "Baz" for all incoming requests regardless of the content type, we can write - -```nginx - - more_clear_input_headers "Foo" "Baz"; -``` - -See [more_set_input_headers](#more_set_input_headers) for more details. - -The wildcard character, `*`, can also be used at the end of the header name to specify a pattern. For example, the following directive -effectively clears *any* input headers starting by "`X-Hidden-`": - -```nginx - - more_clear_input_headers 'X-Hidden-*'; -``` - -[Back to TOC](#table-of-contents) - -Limitations -=========== - -* Unlike the standard [headers](http://nginx.org/en/docs/http/ngx_http_headers_module.html) module, this module does not automatically take care of the constraint among the `Expires`, `Cache-Control`, and `Last-Modified` headers. You have to get them right yourself or use the [headers](http://nginx.org/en/docs/http/ngx_http_headers_module.html) module together with this module. -* You cannot remove the `Connection` response header using this module because the `Connection` response header is generated by the standard `ngx_http_header_filter_module` in the Nginx core, whose output header filter runs always *after* the filter of this module. The only way to actually remove the `Connection` header is to patch the Nginx core, that is, editing the C function `ngx_http_header_filter` in the `src/http/ngx_http_header_filter_module.c` file. - -[Back to TOC](#table-of-contents) - -Installation -============ - -Grab the nginx source code from [nginx.org](http://nginx.org/), for example, -the version 1.17.8 (see [nginx compatibility](#compatibility)), and then build the source with this module: - -```bash - - wget 'http://nginx.org/download/nginx-1.17.8.tar.gz' - tar -xzvf nginx-1.17.8.tar.gz - cd nginx-1.17.8/ - - # Here we assume you would install you nginx under /opt/nginx/. - ./configure --prefix=/opt/nginx \ - --add-module=/path/to/headers-more-nginx-module - - make - make install -``` - -Download the latest version of the release tarball of this module from [headers-more-nginx-module file list](https://github.com/openresty/headers-more-nginx-module/tags). - -Starting from NGINX 1.9.11, you can also compile this module as a dynamic module, by using the `--add-dynamic-module=PATH` option instead of `--add-module=PATH` on the -`./configure` command line above. And then you can explicitly load the module in your `nginx.conf` via the [load_module](http://nginx.org/en/docs/ngx_core_module.html#load_module) -directive, for example, - -```nginx -load_module /path/to/modules/ngx_http_headers_more_filter_module.so; -``` - -Also, this module is included and enabled by default in the [OpenResty bundle](http://openresty.org). - -[Back to TOC](#table-of-contents) - -Compatibility -============= - -The following versions of Nginx should work with this module: - -* **1.21.x** (last tested: 1.21.4) -* **1.19.x** (last tested: 1.19.9) -* **1.17.x** (last tested: 1.17.8) -* **1.16.x** -* **1.15.x** (last tested: 1.15.8) -* **1.14.x** -* **1.13.x** (last tested: 1.13.6) -* **1.12.x** -* **1.11.x** (last tested: 1.11.2) -* **1.10.x** -* **1.9.x** (last tested: 1.9.15) -* **1.8.x** -* **1.7.x** (last tested: 1.7.10) -* **1.6.x** (last tested: 1.6.2) -* **1.5.x** (last tested: 1.5.8) -* **1.4.x** (last tested: 1.4.4) -* **1.3.x** (last tested: 1.3.7) -* **1.2.x** (last tested: 1.2.9) -* **1.1.x** (last tested: 1.1.5) -* **1.0.x** (last tested: 1.0.11) -* **0.9.x** (last tested: 0.9.4) -* **0.8.x** (last tested: 0.8.54) -* **0.7.x >= 0.7.44** (last tested: 0.7.68) - -Earlier versions of Nginx like 0.6.x and 0.5.x will *not* work. - -If you find that any particular version of Nginx above 0.7.44 does not work with this module, please consider [reporting a bug](#report-bugs). - -[Back to TOC](#table-of-contents) - -Community -========= - -[Back to TOC](#table-of-contents) - -English Mailing List --------------------- - -The [openresty-en](https://groups.google.com/group/openresty-en) mailing list is for English speakers. - -[Back to TOC](#table-of-contents) - -Chinese Mailing List --------------------- - -The [openresty](https://groups.google.com/group/openresty) mailing list is for Chinese speakers. - -[Back to TOC](#table-of-contents) - -Bugs and Patches -================ - -Please submit bug reports, wishlists, or patches by - -1. creating a ticket on the [GitHub Issue Tracker](https://github.com/chaoslawful/lua-nginx-module/issues), -1. or posting to the [OpenResty community](#community). - -[Back to TOC](#table-of-contents) - -Source Repository -================= - -Available on github at [openresty/headers-more-nginx-module](https://github.com/openresty/headers-more-nginx-module). - -[Back to TOC](#table-of-contents) - -Changes -======= - -The changes of every release of this module can be obtained from the OpenResty bundle's change logs: - - - -[Back to TOC](#table-of-contents) - -Test Suite -========== - -This module comes with a Perl-driven test suite. The [test cases](https://github.com/openresty/headers-more-nginx-module/tree/master/t/) are -[declarative](https://github.com/openresty/headers-more-nginx-module/blob/master/t/sanity.t) too. Thanks to the [Test::Nginx](http://search.cpan.org/perldoc?Test::Nginx) module in the Perl world. - -To run it on your side: - -```bash - - $ PATH=/path/to/your/nginx-with-headers-more-module:$PATH prove -r t -``` - -To run the test suite with valgrind's memcheck, use the following commands: - -```bash - - $ export PATH=/path/to/your/nginx-with-headers-more-module:$PATH - $ TEST_NGINX_USE_VALGRIND=1 prove -r t -``` - -You need to terminate any Nginx processes before running the test suite if you have changed the Nginx server binary. - -Because a single nginx server (by default, `localhost:1984`) is used across all the test scripts (`.t` files), it's meaningless to run the test suite in parallel by specifying `-jN` when invoking the `prove` utility. - -Some parts of the test suite requires modules [proxy](http://nginx.org/en/docs/http/ngx_http_proxy_module.html), [rewrite](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html), and [echo](https://github.com/openresty/echo-nginx-module) to be enabled as well when building Nginx. - -[Back to TOC](#table-of-contents) - -TODO -==== - -* Support variables in new headers' keys. - -[Back to TOC](#table-of-contents) - -Getting involved -================ - -You'll be very welcomed to submit patches to the [author](#author) or just ask for a commit bit to the [source repository](#source-repository) on GitHub. - -[Back to TOC](#table-of-contents) - -Authors -======= - -* Yichun "agentzh" Zhang (章亦春) *<agentzh@gmail.com>*, OpenResty Inc. -* Bernd Dorn ( ) - -This wiki page is also maintained by the author himself, and everybody is encouraged to improve this page as well. - -[Back to TOC](#table-of-contents) - -Copyright & License -=================== - -The code base is borrowed directly from the standard [headers](http://nginx.org/en/docs/http/ngx_http_headers_module.html) module in Nginx 0.8.24. This part of code is copyrighted by Igor Sysoev. - -Copyright (c) 2009-2017, Yichun "agentzh" Zhang (章亦春) , OpenResty Inc. - -Copyright (c) 2010-2013, Bernd Dorn. - -The license text is available in the [LICENSE](LICENSE) file located in the root directory of the project. - -[Back to TOC](#table-of-contents) - -See Also -======== - -* The original thread on the Nginx mailing list that inspires this module's development: ["A question about add_header replication"](http://forum.nginx.org/read.php?2,11206,11738). -* The orginal announcement thread on the Nginx mailing list: ["The "headers_more" module: Set and clear output headers...more than 'add'!"](http://forum.nginx.org/read.php?2,23460). -* The original [blog post](http://agentzh.blogspot.com/2009/11/headers-more-module-scripting-input-and.html) about this module's initial development. -* The [echo module](https://github.com/openresty/echo-nginx-module) for Nginx module's automated testing. -* The standard [headers](http://nginx.org/en/docs/http/ngx_http_headers_module.html) module. - -[Back to TOC](#table-of-contents) - diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/config b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/config deleted file mode 100644 index 5707cc4..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/config +++ /dev/null @@ -1,32 +0,0 @@ -ngx_addon_name=ngx_http_headers_more_filter_module - -HEADERS_MORE_SRCS=" \ - $ngx_addon_dir/src/ngx_http_headers_more_filter_module.c \ - $ngx_addon_dir/src/ngx_http_headers_more_headers_out.c \ - $ngx_addon_dir/src/ngx_http_headers_more_headers_in.c \ - $ngx_addon_dir/src/ngx_http_headers_more_util.c \ - " - -HEADERS_MORE_DEPS=" \ - $ngx_addon_dir/src/ddebug.h \ - $ngx_addon_dir/src/ngx_http_headers_more_filter_module.h \ - $ngx_addon_dir/src/ngx_http_headers_more_headers_in.h \ - $ngx_addon_dir/src/ngx_http_headers_more_headers_out.h \ - $ngx_addon_dir/src/ngx_http_headers_more_headers_in.h \ - $ngx_addon_dir/src/ngx_http_headers_more_util.h \ - " - -if test -n "$ngx_module_link"; then - ngx_module_type=HTTP_AUX_FILTER - ngx_module_name=$ngx_addon_name - ngx_module_incs= - ngx_module_deps="$HEADERS_MORE_DEPS" - ngx_module_srcs="$HEADERS_MORE_SRCS" - ngx_module_libs= - - . auto/module -else - HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES $ngx_addon_name" - NGX_ADDON_SRCS="$NGX_ADDON_SRCS $HEADERS_MORE_SRCS" - NGX_ADDON_DEPS="$NGX_ADDON_DEPS $HEADERS_MORE_DEPS" -fi diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/changelog b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/changelog deleted file mode 100644 index 0fd56e3..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/changelog +++ /dev/null @@ -1,72 +0,0 @@ -libnginx-mod-http-headers-more-filter (1:0.38-2) unstable; urgency=medium - - * d/control: bump Standards-Version: 4.7.2, no changes - - -- Jan Mojžíš Fri, 11 Apr 2025 14:26:59 +0200 - -libnginx-mod-http-headers-more-filter (1:0.38-1) unstable; urgency=medium - - * New upstream version 0.38 - * d/{control,copyright}: update my email to "janmojzis@debian.org" - * d/copyright: bump debian/* copyright year - * d/watch: use more generic template - * d/control: bump Standards-Version: 4.7.0, no changes - - -- Jan Mojžíš Mon, 10 Feb 2025 19:20:06 +0100 - -libnginx-mod-http-headers-more-filter (1:0.37-2) unstable; urgency=medium - - * d/watch: use new recommended github template - - -- Jan Mojžíš Sat, 13 Jan 2024 22:22:57 +0100 - -libnginx-mod-http-headers-more-filter (1:0.37-1) unstable; urgency=medium - - * New upstream version 0.37 - * d/gbp.conf: add [pull] track-missing = True - * d/copyright: bump my copyright year - * d/watch: remove filenamemangle - - -- Jan Mojžíš Sun, 07 Jan 2024 23:40:37 +0100 - -libnginx-mod-http-headers-more-filter (1:0.36-1) unstable; urgency=medium - - * New upstream version 0.36 - - -- Jan Mojžíš Mon, 18 Dec 2023 16:55:54 +0100 - -libnginx-mod-http-headers-more-filter (1:0.34-5) unstable; urgency=medium - - * d/control: remove Build-Depends nginx-abi-1.24.0-1 - - -- Jan Mojžíš Sat, 07 Oct 2023 15:31:27 +0200 - -libnginx-mod-http-headers-more-filter (1:0.34-4) unstable; urgency=medium - - * NEW ABI: rebuild with nginx-abi-1.24.0-1 - - -- Jan Mojžíš Tue, 27 Jun 2023 23:16:38 +0200 - -libnginx-mod-http-headers-more-filter (1:0.34-3) unstable; urgency=medium - - * d/t/generic rework. The test now checks module after - installation/reload/restart. - * d/control: bump Standards-Version: 4.6.2, no changes - * d/gbb.conf: switched to debian branch main (debian-branch = main) - * d/copyright: bump my copyright year - * d/copyright: reformat text to be compatible with 'cme update dpkg-copyright' - * NEW ABI: rebuild with nginx-abi-1.22.1-7 - - -- Jan Mojžíš Mon, 13 Feb 2023 12:56:26 +0100 - -libnginx-mod-http-headers-more-filter (1:0.34-2) unstable; urgency=medium - - * d/control: added Multi-Arch: foreign - - -- Jan Mojžíš Fri, 09 Dec 2022 12:50:28 +0100 - -libnginx-mod-http-headers-more-filter (1:0.34-1) experimental; urgency=medium - - * Initial release. (Closes: 1024151) - - -- Jan Mojžíš Wed, 30 Nov 2022 14:46:53 +0100 diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/control b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/control deleted file mode 100644 index a8ebd83..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/control +++ /dev/null @@ -1,26 +0,0 @@ -Source: libnginx-mod-http-headers-more-filter -Section: httpd -Priority: optional -Maintainer: Debian Nginx Maintainers -Uploaders: Jan Mojžíš , -Build-Depends: debhelper-compat (= 13), - dh-sequence-nginx, -Standards-Version: 4.7.2 -Homepage: https://github.com/openresty/headers-more-nginx-module -Vcs-Git: https://salsa.debian.org/nginx-team/libnginx-mod-http-headers-more-filter.git -Vcs-Browser: https://salsa.debian.org/nginx-team/libnginx-mod-http-headers-more-filter -Rules-Requires-Root: no - -Package: libnginx-mod-http-headers-more-filter -Architecture: any -Multi-Arch: foreign -Depends: ${misc:Depends}, - ${shlibs:Depends}, -Recommends: nginx, -Description: Set and clear input and output headers for Nginx - The Headers More module allows you to add, set, or clear any output or input - header that you specify. - . - This is an enhanced version of the standard headers module because it provides - more utilities like resetting or clearing "builtin headers" like Content-Type, - Content-Length, and Server. diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/copyright b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/copyright deleted file mode 100644 index 251922c..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/copyright +++ /dev/null @@ -1,62 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: headers-more-nginx-module -Upstream-Contact: Yichun "agentzh" Zhang (章亦春) -Source: https://github.com/openresty/headers-more-nginx-module - -Files: * -Copyright: 2010-2013, Bernd Dorn. - 2009-2017, Yichun "agentzh" Zhang (\x{7ae0}\x{4ea6}\x{6625}) , OpenResty Inc. -License: BSD-2-clause - -Files: config -Copyright: Igor Sysoev - 2010-2013, Bernd Dorn - 2009-2017, Yichun "agentzh" Zhang (章亦春) , CloudFlare Inc. -License: BSD-2-clause - -Files: debian/* -Copyright: 2022, Miao Wang - 2022-2025, Jan Mojzis -License: BSD-2-clause - -Files: src/* -Copyright: Yichun Zhang (agentzh) -License: BSD-2-clause - -Files: src/ddebug.h -Copyright: Igor Sysoev - 2010-2013, Bernd Dorn - 2009-2017, Yichun "agentzh" Zhang (章亦春) , CloudFlare Inc. -License: BSD-2-clause - -Files: t/* -Copyright: Igor Sysoev - 2010-2013, Bernd Dorn - 2009-2017, Yichun "agentzh" Zhang (章亦春) , CloudFlare Inc. -License: BSD-2-clause - -Files: util/* -Copyright: Igor Sysoev - 2010-2013, Bernd Dorn - 2009-2017, Yichun "agentzh" Zhang (章亦春) , CloudFlare Inc. -License: BSD-2-clause - -License: BSD-2-clause - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - . - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright 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 THE COPYRIGHT HOLDERS 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 THE COPYRIGHT - HOLDER 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) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/gbp.conf b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/gbp.conf deleted file mode 100644 index 97cd209..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/gbp.conf +++ /dev/null @@ -1,12 +0,0 @@ -[DEFAULT] -debian-branch = main -upstream-branch = upstream -upstream-tag = upstream/%(version)s -pristine-tar = True -sign-tags = True - -[import-orig] -merge-mode = replace - -[pull] -track-missing = True diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/rules b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/rules deleted file mode 100755 index d8309f6..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/rules +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/make -f - -export DEB_BUILD_MAINT_OPTIONS = hardening=+all - -%: - dh $@ diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/source/format b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/source/format deleted file mode 100644 index 163aaf8..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/tests/control b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/tests/control deleted file mode 100644 index b95c6ff..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/tests/control +++ /dev/null @@ -1,13 +0,0 @@ -Tests: generic -Restrictions: allow-stderr isolation-container needs-root -Depends: curl, - nginx, - nginx-core, - @, - -Tests: helloworld -Restrictions: allow-stderr isolation-container needs-root -Depends: curl, - nginx, - nginx-core, - @, diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/tests/generic b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/tests/generic deleted file mode 100644 index a14fc80..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/tests/generic +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -# version 20221215 - -# generic test that only verifies that nginx is running with the given -# libnginx-... module -# - after installation -# - after nginx reload -# - after nginx restart - -EX=0 -CURL_CMD="curl --max-time 60 --silent --fail -o /dev/null" - -#change directory to $AUTOPKGTEST_TMP -cd "${AUTOPKGTEST_TMP}" - -echo -n "curl after installation: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx reload ... " -if invoke-rc.d nginx reload; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - - -echo -n "curl after reload: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx restart ... " -if invoke-rc.d nginx restart; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - -echo -n "curl after restart: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -if [ ${EX} -ne 0 ]; then - echo "=== journalctl ===" - journalctl -n all -xu nginx.service || : - - echo "=== error.log ===" - if [ `wc -l /var/log/nginx/error.log | cut -d ' ' -f1` -gt 100 ]; then - head -n 50 /var/log/nginx/error.log - echo '...' - tail -n 50 /var/log/nginx/error.log - else - cat /var/log/nginx/error.log - fi -fi - -exit ${EX} diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/tests/helloworld b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/tests/helloworld deleted file mode 100644 index 6a2e85b..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/tests/helloworld +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -set -e - -cat < "/etc/nginx/sites-enabled/default" -server { - listen 80 default_server; - - location /helloworld { - more_set_headers 'Content-Type: text/helloworld'; - more_set_headers -s '200' 'Content-Type: text/helloworld200'; - return 200; - } -} -EOF - -exp="content_type: text/helloworld200 -response_code: 200" - -nginx -t -invoke-rc.d nginx restart || { journalctl -n all -xu nginx.service; exit 1; } - -out=`curl --fail -w "content_type: %{content_type}\nresponse_code: %{http_code}\n" http://127.0.0.1/helloworld` - -if [ x"${out}" != x"${exp}" ]; then - echo "output:" - echo "=====================" - echo "${out}" - echo "=====================" - echo "expected output:" - echo "=====================" - echo "${exp}" - echo "=====================" - exit 1 -fi diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/upstream/metadata b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/upstream/metadata deleted file mode 100644 index 185ca21..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/upstream/metadata +++ /dev/null @@ -1,4 +0,0 @@ ---- -Bug-Database: https://github.com/openresty/headers-more-nginx-module/issues -Bug-Submit: https://github.com/openresty/headers-more-nginx-module/issues/new -Repository-Browse: https://github.com/openresty/headers-more-nginx-module diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/watch b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/watch deleted file mode 100644 index 426294e..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/debian/watch +++ /dev/null @@ -1,6 +0,0 @@ -version=4 -opts="\ -uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha|a|b)\d*)$/$1~$2/,\ -" \ -https://github.com/openresty/headers-more-nginx-module/tags \ -(?:.*?/)?v?@ANY_VERSION@@ARCHIVE_EXT@ diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ddebug.h b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ddebug.h deleted file mode 100644 index 13879af..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ddebug.h +++ /dev/null @@ -1,124 +0,0 @@ -#ifndef DDEBUG_H -#define DDEBUG_H - - -#include -#include -#include -#include - - -#if defined(DDEBUG) && (DDEBUG) - -# if (NGX_HAVE_VARIADIC_MACROS) - -# define dd(...) fprintf(stderr, "headers-more *** %s: ", __func__); \ - fprintf(stderr, __VA_ARGS__); \ - fprintf(stderr, " at %s line %d.\n", __FILE__, __LINE__) - -# else - -#include -#include - -#include - -static ngx_inline void -dd(const char * fmt, ...) { -} - -# endif - -# if DDEBUG > 1 - -# define dd_enter() dd_enter_helper(r, __func__) - -# if defined(nginx_version) && nginx_version >= 8011 -# define dd_main_req_count r->main->count -# else -# define dd_main_req_count 0 -# endif - -static ngx_inline void -dd_enter_helper(ngx_http_request_t *r, const char *func) -{ - ngx_http_posted_request_t *pr; - - fprintf(stderr, "headers-more *** enter %s %.*s %.*s?%.*s c:%d m:%p r:%p ar:%p pr:%p", - func, - (int) r->method_name.len, r->method_name.data, - (int) r->uri.len, r->uri.data, - (int) r->args.len, r->args.data, - (int) dd_main_req_count, r->main, - r, r->connection->data, r->parent); - - if (r->posted_requests) { - fprintf(stderr, " posted:"); - - for (pr = r->posted_requests; pr; pr = pr->next) { - fprintf(stderr, "%p,", pr); - } - } - - fprintf(stderr, "\n"); -} - -# else - -# define dd_enter() - -# endif - -#else - -# if (NGX_HAVE_VARIADIC_MACROS) - -# define dd(...) - -# define dd_enter() - -# else - -#include - -static ngx_inline void -dd(const char * fmt, ...) { -} - -static ngx_inline void -dd_enter() { -} - -# endif - -#endif - -#if defined(DDEBUG) && (DDEBUG) - -#define dd_check_read_event_handler(r) \ - dd("r->read_event_handler = %s", \ - r->read_event_handler == ngx_http_block_reading ? \ - "ngx_http_block_reading" : \ - r->read_event_handler == ngx_http_test_reading ? \ - "ngx_http_test_reading" : \ - r->read_event_handler == ngx_http_request_empty_handler ? \ - "ngx_http_request_empty_handler" : "UNKNOWN") - -#define dd_check_write_event_handler(r) \ - dd("r->write_event_handler = %s", \ - r->write_event_handler == ngx_http_handler ? \ - "ngx_http_handler" : \ - r->write_event_handler == ngx_http_core_run_phases ? \ - "ngx_http_core_run_phases" : \ - r->write_event_handler == ngx_http_request_empty_handler ? \ - "ngx_http_request_empty_handler" : "UNKNOWN") - -#else - -#define dd_check_read_event_handler(r) -#define dd_check_write_event_handler(r) - -#endif - -#endif /* DDEBUG_H */ - diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_filter_module.c b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_filter_module.c deleted file mode 100644 index 0bb6fec..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_filter_module.c +++ /dev/null @@ -1,348 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include "ngx_http_headers_more_filter_module.h" -#include "ngx_http_headers_more_headers_out.h" -#include "ngx_http_headers_more_headers_in.h" -#include "ngx_http_headers_more_util.h" -#include - - -/* config handlers */ - -static void *ngx_http_headers_more_create_loc_conf(ngx_conf_t *cf); -static char *ngx_http_headers_more_merge_loc_conf(ngx_conf_t *cf, - void *parent, void *child); -static void *ngx_http_headers_more_create_main_conf(ngx_conf_t *cf); -static ngx_int_t ngx_http_headers_more_post_config(ngx_conf_t *cf); - -/* post-read-phase handler */ - -static ngx_int_t ngx_http_headers_more_handler(ngx_http_request_t *r); - -/* filter handlers */ - -static ngx_int_t ngx_http_headers_more_filter_init(ngx_conf_t *cf); - -ngx_uint_t ngx_http_headers_more_location_hash = 0; - - -static ngx_command_t ngx_http_headers_more_filter_commands[] = { - - { ngx_string("more_set_headers"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF - |NGX_CONF_1MORE, - ngx_http_headers_more_set_headers, - NGX_HTTP_LOC_CONF_OFFSET, - 0, - NULL}, - - { ngx_string("more_clear_headers"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF - |NGX_CONF_1MORE, - ngx_http_headers_more_clear_headers, - NGX_HTTP_LOC_CONF_OFFSET, - 0, - NULL}, - - { ngx_string("more_set_input_headers"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF - |NGX_CONF_1MORE, - ngx_http_headers_more_set_input_headers, - NGX_HTTP_LOC_CONF_OFFSET, - 0, - NULL}, - - { ngx_string("more_clear_input_headers"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF - |NGX_CONF_1MORE, - ngx_http_headers_more_clear_input_headers, - NGX_HTTP_LOC_CONF_OFFSET, - 0, - NULL}, - - ngx_null_command -}; - - -static ngx_http_module_t ngx_http_headers_more_filter_module_ctx = { - NULL, /* preconfiguration */ - ngx_http_headers_more_post_config, /* postconfiguration */ - - ngx_http_headers_more_create_main_conf, /* create main configuration */ - NULL, /* init main configuration */ - - NULL, /* create server configuration */ - NULL, /* merge server configuration */ - - ngx_http_headers_more_create_loc_conf, /* create location configuration */ - ngx_http_headers_more_merge_loc_conf /* merge location configuration */ -}; - - -ngx_module_t ngx_http_headers_more_filter_module = { - NGX_MODULE_V1, - &ngx_http_headers_more_filter_module_ctx, /* module context */ - ngx_http_headers_more_filter_commands, /* module directives */ - NGX_HTTP_MODULE, /* module type */ - NULL, /* init master */ - NULL, /* init module */ - NULL, /* init process */ - NULL, /* init thread */ - NULL, /* exit thread */ - NULL, /* exit process */ - NULL, /* exit master */ - NGX_MODULE_V1_PADDING -}; - - -static ngx_http_output_header_filter_pt ngx_http_next_header_filter; - - -static volatile ngx_cycle_t *ngx_http_headers_more_prev_cycle = NULL; - - -static ngx_int_t -ngx_http_headers_more_filter(ngx_http_request_t *r) -{ - ngx_int_t rc; - ngx_uint_t i; - ngx_http_headers_more_loc_conf_t *conf; - ngx_http_headers_more_cmd_t *cmd; - - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "headers more header filter, uri \"%V\"", &r->uri); - - conf = ngx_http_get_module_loc_conf(r, ngx_http_headers_more_filter_module); - - if (conf->cmds) { - cmd = conf->cmds->elts; - for (i = 0; i < conf->cmds->nelts; i++) { - if (cmd[i].is_input) { - continue; - } - - rc = ngx_http_headers_more_exec_cmd(r, &cmd[i]); - - if (rc != NGX_OK) { - return rc; - } - } - } - - return ngx_http_next_header_filter(r); -} - - -static ngx_int_t -ngx_http_headers_more_filter_init(ngx_conf_t *cf) -{ - ngx_http_next_header_filter = ngx_http_top_header_filter; - ngx_http_top_header_filter = ngx_http_headers_more_filter; - - return NGX_OK; -} - - -static void * -ngx_http_headers_more_create_loc_conf(ngx_conf_t *cf) -{ - ngx_http_headers_more_loc_conf_t *conf; - - conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_headers_more_loc_conf_t)); - if (conf == NULL) { - return NULL; - } - - /* - * set by ngx_pcalloc(): - * - * conf->cmds = NULL; - */ - - return conf; -} - - -static char * -ngx_http_headers_more_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) -{ - ngx_uint_t i; - ngx_uint_t orig_len; - ngx_http_headers_more_cmd_t *prev_cmd, *cmd; - ngx_http_headers_more_loc_conf_t *prev = parent; - ngx_http_headers_more_loc_conf_t *conf = child; - - if (conf->cmds == NULL || conf->cmds->nelts == 0) { - conf->cmds = prev->cmds; - - } else if (prev->cmds && prev->cmds->nelts) { - orig_len = conf->cmds->nelts; - - (void) ngx_array_push_n(conf->cmds, prev->cmds->nelts); - - cmd = conf->cmds->elts; - - for (i = 0; i < orig_len; i++) { - cmd[conf->cmds->nelts - 1 - i] = cmd[orig_len - 1 - i]; - } - - prev_cmd = prev->cmds->elts; - - for (i = 0; i < prev->cmds->nelts; i++) { - cmd[i] = prev_cmd[i]; - } - } - - return NGX_CONF_OK; -} - - -static ngx_int_t -ngx_http_headers_more_post_config(ngx_conf_t *cf) -{ - int multi_http_blocks; - ngx_int_t rc; - ngx_http_handler_pt *h; - ngx_http_core_main_conf_t *cmcf; - - ngx_http_headers_more_main_conf_t *hmcf; - - ngx_http_headers_more_location_hash = - ngx_http_headers_more_hash_literal("location"); - - hmcf = ngx_http_conf_get_module_main_conf(cf, - ngx_http_headers_more_filter_module); - - if (ngx_http_headers_more_prev_cycle != ngx_cycle) { - ngx_http_headers_more_prev_cycle = ngx_cycle; - multi_http_blocks = 0; - - } else { - multi_http_blocks = 1; - } - - if (multi_http_blocks || hmcf->requires_filter) { - rc = ngx_http_headers_more_filter_init(cf); - if (rc != NGX_OK) { - return rc; - } - } - - if (!hmcf->requires_handler) { - return NGX_OK; - } - - cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module); - - h = ngx_array_push(&cmcf->phases[NGX_HTTP_REWRITE_PHASE].handlers); - if (h == NULL) { - return NGX_ERROR; - } - - *h = ngx_http_headers_more_handler; - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_headers_more_handler(ngx_http_request_t *r) -{ - ngx_int_t rc; - ngx_uint_t i; - ngx_http_headers_more_loc_conf_t *conf; - ngx_http_headers_more_main_conf_t *hmcf; - ngx_http_headers_more_cmd_t *cmd; - - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "headers more rewrite handler, uri \"%V\"", &r->uri); - - hmcf = ngx_http_get_module_main_conf(r, - ngx_http_headers_more_filter_module); - - if (!hmcf->postponed_to_phase_end) { - ngx_http_core_main_conf_t *cmcf; - ngx_http_phase_handler_t tmp; - ngx_http_phase_handler_t *ph; - ngx_http_phase_handler_t *cur_ph; - ngx_http_phase_handler_t *last_ph; - - hmcf->postponed_to_phase_end = 1; - - cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module); - - ph = cmcf->phase_engine.handlers; - cur_ph = &ph[r->phase_handler]; - last_ph = &ph[cur_ph->next - 1]; - - if (cur_ph < last_ph) { - dd("swaping the contents of cur_ph and last_ph..."); - - tmp = *cur_ph; - - memmove(cur_ph, cur_ph + 1, - (last_ph - cur_ph) * sizeof (ngx_http_phase_handler_t)); - - *last_ph = tmp; - - r->phase_handler--; /* redo the current ph */ - - return NGX_DECLINED; - } - } - - dd("running phase handler..."); - - conf = ngx_http_get_module_loc_conf(r, ngx_http_headers_more_filter_module); - - if (conf->cmds) { - if (r->http_version < NGX_HTTP_VERSION_10) { - return NGX_DECLINED; - } - - cmd = conf->cmds->elts; - for (i = 0; i < conf->cmds->nelts; i++) { - if (!cmd[i].is_input) { - continue; - } - - rc = ngx_http_headers_more_exec_input_cmd(r, &cmd[i]); - - if (rc != NGX_OK) { - return rc; - } - } - } - - return NGX_DECLINED; -} - - -static void * -ngx_http_headers_more_create_main_conf(ngx_conf_t *cf) -{ - ngx_http_headers_more_main_conf_t *hmcf; - - hmcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_headers_more_main_conf_t)); - if (hmcf == NULL) { - return NULL; - } - - /* set by ngx_pcalloc: - * hmcf->postponed_to_phase_end = 0; - * hmcf->requires_filter = 0; - * hmcf->requires_handler = 0; - */ - - return hmcf; -} diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_filter_module.h b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_filter_module.h deleted file mode 100644 index 5f31ab4..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_filter_module.h +++ /dev/null @@ -1,81 +0,0 @@ - -/* - * Copyright (c) Yichun Zhang (agentzh) - */ - - -#ifndef NGX_HTTP_HEADERS_MORE_FILTER_MODULE_H -#define NGX_HTTP_HEADERS_MORE_FILTER_MODULE_H - - -#include -#include -#include - - -typedef enum { - ngx_http_headers_more_opcode_set, - ngx_http_headers_more_opcode_clear -} ngx_http_headers_more_opcode_t; - - -typedef struct { - ngx_array_t *types; /* of ngx_str_t */ - ngx_array_t *statuses; /* of ngx_uint_t */ - ngx_array_t *headers; /* of ngx_http_header_val_t */ - ngx_flag_t is_input; -} ngx_http_headers_more_cmd_t; - - -typedef struct { - ngx_array_t *cmds; /* of ngx_http_headers_more_cmd_t */ -} ngx_http_headers_more_loc_conf_t; - - -typedef struct { - ngx_int_t postponed_to_phase_end; - ngx_int_t requires_filter; - ngx_int_t requires_handler; -} ngx_http_headers_more_main_conf_t; - - -typedef struct ngx_http_headers_more_header_val_s - ngx_http_headers_more_header_val_t; - - -typedef ngx_int_t (*ngx_http_headers_more_set_header_pt)(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); - - -typedef struct { - ngx_str_t name; - ngx_uint_t offset; - ngx_http_headers_more_set_header_pt handler; -} ngx_http_headers_more_set_header_t; - - -struct ngx_http_headers_more_header_val_s { - ngx_http_complex_value_t value; - ngx_uint_t hash; - ngx_str_t key; - ngx_http_headers_more_set_header_pt handler; - ngx_uint_t offset; - unsigned replace:1; - unsigned wildcard:1; - unsigned append:1; -}; - - -extern ngx_module_t ngx_http_headers_more_filter_module; - - -#ifndef ngx_str_set -#define ngx_str_set(str, text) \ - (str)->len = sizeof(text) - 1; (str)->data = (u_char *) text -#endif - - -#define ngx_http_headers_more_assert(a) assert(a) - - -#endif /* NGX_HTTP_HEADERS_MORE_FILTER_MODULE_H */ diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_headers_in.c b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_headers_in.c deleted file mode 100644 index 983be5b..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_headers_in.c +++ /dev/null @@ -1,959 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include "ngx_http_headers_more_headers_in.h" -#include "ngx_http_headers_more_util.h" -#include - - -static char *ngx_http_headers_more_parse_directive(ngx_conf_t *cf, - ngx_command_t *ngx_cmd, void *conf, - ngx_http_headers_more_opcode_t opcode); -static int ngx_http_headers_more_check_type(ngx_http_request_t *r, - ngx_array_t *types); -static ngx_int_t ngx_http_set_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_set_header_helper(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value, - ngx_table_elt_t **output_header); -static ngx_int_t ngx_http_set_builtin_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_set_user_agent_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_set_content_length_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_clear_builtin_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_clear_content_length_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_set_host_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_set_connection_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_set_builtin_multi_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_headers_more_validate_host(ngx_str_t *host, - ngx_pool_t *pool, ngx_uint_t alloc); - - -static ngx_http_headers_more_set_header_t ngx_http_headers_more_set_handlers[] - = { - - { ngx_string("Host"), - offsetof(ngx_http_headers_in_t, host), - ngx_http_set_host_header }, - - { ngx_string("Connection"), - offsetof(ngx_http_headers_in_t, connection), - ngx_http_set_connection_header }, - - { ngx_string("If-Modified-Since"), - offsetof(ngx_http_headers_in_t, if_modified_since), - ngx_http_set_builtin_header }, - -#if defined(nginx_version) && nginx_version >= 9002 - { ngx_string("If-Unmodified-Since"), - offsetof(ngx_http_headers_in_t, if_unmodified_since), - ngx_http_set_builtin_header }, -#endif - -#if defined(nginx_version) && nginx_version >= 1003003 - { ngx_string("If-Match"), - offsetof(ngx_http_headers_in_t, if_match), - ngx_http_set_builtin_header }, - - { ngx_string("If-None-Match"), - offsetof(ngx_http_headers_in_t, if_none_match), - ngx_http_set_builtin_header }, -#endif - - { ngx_string("User-Agent"), - offsetof(ngx_http_headers_in_t, user_agent), - ngx_http_set_user_agent_header }, - - { ngx_string("Referer"), - offsetof(ngx_http_headers_in_t, referer), - ngx_http_set_builtin_header }, - - { ngx_string("Content-Length"), - offsetof(ngx_http_headers_in_t, content_length), - ngx_http_set_content_length_header }, - - { ngx_string("Content-Type"), - offsetof(ngx_http_headers_in_t, content_type), - ngx_http_set_builtin_header }, - - { ngx_string("Range"), - offsetof(ngx_http_headers_in_t, range), - ngx_http_set_builtin_header }, - - { ngx_string("If-Range"), - offsetof(ngx_http_headers_in_t, if_range), - ngx_http_set_builtin_header }, - - { ngx_string("Transfer-Encoding"), - offsetof(ngx_http_headers_in_t, transfer_encoding), - ngx_http_set_builtin_header }, - - { ngx_string("Expect"), - offsetof(ngx_http_headers_in_t, expect), - ngx_http_set_builtin_header }, - -#if defined(nginx_version) && nginx_version >= 1003013 - { ngx_string("Upgrade"), - offsetof(ngx_http_headers_in_t, upgrade), - ngx_http_set_builtin_header }, -#endif - -#if (NGX_HTTP_GZIP) - { ngx_string("Accept-Encoding"), - offsetof(ngx_http_headers_in_t, accept_encoding), - ngx_http_set_builtin_header }, - - { ngx_string("Via"), offsetof(ngx_http_headers_in_t, via), - ngx_http_set_builtin_header }, -#endif - - { ngx_string("Authorization"), - offsetof(ngx_http_headers_in_t, authorization), - ngx_http_set_builtin_header }, - - { ngx_string("Keep-Alive"), - offsetof(ngx_http_headers_in_t, keep_alive), - ngx_http_set_builtin_header }, - -#if (NGX_HTTP_X_FORWARDED_FOR) - { ngx_string("X-Forwarded-For"), - offsetof(ngx_http_headers_in_t, x_forwarded_for), - ngx_http_set_builtin_multi_header }, - -#endif - -#if (NGX_HTTP_REALIP) - { ngx_string("X-Real-IP"), - offsetof(ngx_http_headers_in_t, x_real_ip), - ngx_http_set_builtin_header }, -#endif - -#if (NGX_HTTP_DAV) - { ngx_string("Depth"), offsetof(ngx_http_headers_in_t, depth), - ngx_http_set_builtin_header }, - - { ngx_string("Destination"), offsetof(ngx_http_headers_in_t, destination), - ngx_http_set_builtin_header }, - - { ngx_string("Overwrite"), offsetof(ngx_http_headers_in_t, overwrite), - ngx_http_set_builtin_header }, - - { ngx_string("Date"), offsetof(ngx_http_headers_in_t, date), - ngx_http_set_builtin_header }, -#endif - -#if defined(nginx_version) && nginx_version >= 1023000 - { ngx_string("Cookie"), - offsetof(ngx_http_headers_in_t, cookie), - ngx_http_set_builtin_multi_header }, -#else - { ngx_string("Cookie"), - offsetof(ngx_http_headers_in_t, cookies), - ngx_http_set_builtin_multi_header }, -#endif - - { ngx_null_string, 0, ngx_http_set_header } -}; - - -ngx_int_t -ngx_http_headers_more_exec_input_cmd(ngx_http_request_t *r, - ngx_http_headers_more_cmd_t *cmd) -{ - ngx_str_t value; - ngx_http_headers_more_header_val_t *h; - ngx_uint_t i; - - if (!cmd->headers) { - return NGX_OK; - } - - if (cmd->types && !ngx_http_headers_more_check_type(r, cmd->types)) { - return NGX_OK; - } - - h = cmd->headers->elts; - for (i = 0; i < cmd->headers->nelts; i++) { - - if (ngx_http_complex_value(r, &h[i].value, &value) != NGX_OK) { - return NGX_ERROR; - } - - if (value.len) { - value.len--; /* remove the trailing '\0' added by - ngx_http_headers_more_parse_header */ - } - - if (h[i].handler(r, &h[i], &value) != NGX_OK) { - return NGX_ERROR; - } - } - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_set_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - return ngx_http_set_header_helper(r, hv, value, NULL); -} - - -static ngx_int_t -ngx_http_set_header_helper(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value, - ngx_table_elt_t **output_header) -{ - ngx_table_elt_t *h, *matched; - ngx_list_part_t *part; - ngx_uint_t i; - ngx_uint_t rc; - - dd_enter(); - - matched = NULL; - -retry: - - part = &r->headers_in.headers.part; - h = part->elts; - - for (i = 0; /* void */; i++) { - dd("i: %d, part: %p", (int) i, part); - - if (i >= part->nelts) { - if (part->next == NULL) { - break; - } - - part = part->next; - h = part->elts; - i = 0; - } - - if (!hv->wildcard - && h[i].key.len == hv->key.len - && ngx_strncasecmp(h[i].key.data, hv->key.data, - h[i].key.len) == 0) - { - goto matched; - } - - if (hv->wildcard - && value->len == 0 - && h[i].key.len >= hv->key.len - 1 - && ngx_strncasecmp(h[i].key.data, hv->key.data, - hv->key.len - 1) == 0) - { - goto matched; - } - - /* not matched */ - continue; - -matched: - - if (value->len == 0 || (matched && matched != &h[i])) { - h[i].hash = 0; - - rc = ngx_http_headers_more_rm_header_helper( - &r->headers_in.headers, part, i); - - ngx_http_headers_more_assert( - !(r->headers_in.headers.part.next == NULL - && r->headers_in.headers.last - != &r->headers_in.headers.part)); - - if (rc == NGX_OK) { - if (output_header) { - *output_header = NULL; - } - - goto retry; - } - - return NGX_ERROR; - } - - h[i].value = *value; - - if (output_header) { - *output_header = &h[i]; - dd("setting existing builtin input header"); - } - - if (matched == NULL) { - matched = &h[i]; - } - } - - if (matched) { - return NGX_OK; - } - - if (value->len == 0 || hv->replace) { - return NGX_OK; - } - - if (r->headers_in.headers.last == NULL) { - /* must be 400 bad request */ - return NGX_OK; - } - - h = ngx_list_push(&r->headers_in.headers); - - if (h == NULL) { - return NGX_ERROR; - } - - dd("created new header for %.*s", (int) hv->key.len, hv->key.data); - - if (value->len == 0) { - h->hash = 0; - - } else { - h->hash = hv->hash; - } - - h->key = hv->key; - h->value = *value; -#if defined(nginx_version) && nginx_version >= 1023000 - h->next = NULL; -#endif - - h->lowcase_key = ngx_pnalloc(r->pool, h->key.len); - if (h->lowcase_key == NULL) { - return NGX_ERROR; - } - - ngx_strlow(h->lowcase_key, h->key.data, h->key.len); - - if (output_header) { - *output_header = h; - - while (r != r->main) { - r->parent->headers_in = r->headers_in; - r = r->parent; - } - } - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_set_builtin_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - ngx_table_elt_t *h, **old; - - dd("entered set_builtin_header (input)"); - - if (hv->offset) { - old = (ngx_table_elt_t **) ((char *) &r->headers_in + hv->offset); - - } else { - old = NULL; - } - - dd("old builtin ptr ptr: %p", old); - if (old) { - dd("old builtin ptr: %p", *old); - } - - if (old == NULL || *old == NULL) { - dd("set normal header"); - return ngx_http_set_header_helper(r, hv, value, old); - } - - h = *old; - - if (value->len == 0) { - h->hash = 0; - h->value = *value; - - return ngx_http_set_header_helper(r, hv, value, old); - } - - h->hash = hv->hash; - h->value = *value; - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_set_host_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - ngx_str_t host; - - if (value->len) { - host= *value; - - if (ngx_http_headers_more_validate_host(&host, r->pool, 0) != NGX_OK) { - return NGX_ERROR; - } - - r->headers_in.server = host; - - } else { - r->headers_in.server = *value; - } - - return ngx_http_set_builtin_header(r, hv, value); -} - - -static ngx_int_t -ngx_http_set_content_length_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - off_t len; - - if (value->len == 0) { - return ngx_http_clear_content_length_header(r, hv, value); - } - - len = ngx_atosz(value->data, value->len); - if (len == NGX_ERROR) { - return NGX_ERROR; - } - - dd("reset headers_in.content_length_n to %d", (int) len); - - r->headers_in.content_length_n = len; - - return ngx_http_set_builtin_header(r, hv, value); -} - - -static ngx_int_t -ngx_http_clear_content_length_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - r->headers_in.content_length_n = -1; - - return ngx_http_clear_builtin_header(r, hv, value); -} - - -static ngx_int_t -ngx_http_clear_builtin_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - value->len = 0; - return ngx_http_set_builtin_header(r, hv, value); -} - - -char * -ngx_http_headers_more_set_input_headers(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf) -{ - return ngx_http_headers_more_parse_directive(cf, cmd, conf, - ngx_http_headers_more_opcode_set); -} - - -char * -ngx_http_headers_more_clear_input_headers(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf) -{ - return ngx_http_headers_more_parse_directive(cf, cmd, conf, - ngx_http_headers_more_opcode_clear); -} - - -static int -ngx_http_headers_more_check_type(ngx_http_request_t *r, ngx_array_t *types) -{ - ngx_uint_t i; - ngx_str_t *t; - ngx_str_t actual_type; - - if (r->headers_in.content_type == NULL) { - return 0; - } - - actual_type = r->headers_in.content_type->value; - if (actual_type.len == 0) { - return 0; - } - - dd("headers_in->content_type: %.*s", - (int) actual_type.len, - actual_type.data); - - t = types->elts; - for (i = 0; i < types->nelts; i++) { - dd("...comparing with type [%.*s]", (int) t[i].len, t[i].data); - - if (actual_type.len == t[i].len - && ngx_strncmp(actual_type.data, t[i].data, t[i].len) == 0) - { - return 1; - } - } - - return 0; -} - - -static char * -ngx_http_headers_more_parse_directive(ngx_conf_t *cf, ngx_command_t *ngx_cmd, - void *conf, ngx_http_headers_more_opcode_t opcode) -{ - ngx_http_headers_more_loc_conf_t *hlcf = conf; - - ngx_uint_t i; - ngx_http_headers_more_cmd_t *cmd; - ngx_str_t *arg; - ngx_flag_t ignore_next_arg; - ngx_str_t *cmd_name; - ngx_int_t rc; - ngx_flag_t replace = 0; - ngx_http_headers_more_header_val_t *h; - - ngx_http_headers_more_main_conf_t *hmcf; - - if (hlcf->cmds == NULL) { - hlcf->cmds = ngx_array_create(cf->pool, 1, - sizeof(ngx_http_headers_more_cmd_t)); - - if (hlcf->cmds == NULL) { - return NGX_CONF_ERROR; - } - } - - cmd = ngx_array_push(hlcf->cmds); - - if (cmd == NULL) { - return NGX_CONF_ERROR; - } - - cmd->headers = ngx_array_create(cf->pool, 1, - sizeof(ngx_http_headers_more_header_val_t)); - - if (cmd->headers == NULL) { - return NGX_CONF_ERROR; - } - - cmd->types = ngx_array_create(cf->pool, 1, sizeof(ngx_str_t)); - if (cmd->types == NULL) { - return NGX_CONF_ERROR; - } - - cmd->statuses = NULL; - - arg = cf->args->elts; - - cmd_name = &arg[0]; - - ignore_next_arg = 0; - - for (i = 1; i < cf->args->nelts; i++) { - if (ignore_next_arg) { - ignore_next_arg = 0; - continue; - } - - if (arg[i].len == 0) { - continue; - } - - if (arg[i].data[0] != '-') { - rc = ngx_http_headers_more_parse_header(cf, cmd_name, - &arg[i], cmd->headers, - opcode, - ngx_http_headers_more_set_handlers); - - if (rc != NGX_OK) { - return NGX_CONF_ERROR; - } - - continue; - } - - if (arg[i].len == 2) { - if (arg[i].data[1] == 't') { - if (i == cf->args->nelts - 1) { - ngx_log_error(NGX_LOG_ERR, cf->log, 0, - "%V: option -t takes an argument.", - cmd_name); - - return NGX_CONF_ERROR; - } - - rc = ngx_http_headers_more_parse_types(cf->log, cmd_name, - &arg[i + 1], - cmd->types); - - if (rc != NGX_OK) { - return NGX_CONF_ERROR; - } - - ignore_next_arg = 1; - - continue; - } - - if (arg[i].data[1] == 'r') { - dd("Found replace flag"); - replace = 1; - continue; - } - } - - ngx_log_error(NGX_LOG_ERR, cf->log, 0, - "%V: invalid option name: \"%V\"", cmd_name, &arg[i]); - - return NGX_CONF_ERROR; - } - - dd("Found %d types, and %d headers", - (int) cmd->types->nelts, - (int) cmd->headers->nelts); - - if (cmd->headers->nelts == 0) { - ngx_pfree(cf->pool, cmd->headers); - cmd->headers = NULL; - - } else { - h = cmd->headers->elts; - for (i = 0; i < cmd->headers->nelts; i++) { - h[i].replace = replace; - } - } - - if (cmd->types->nelts == 0) { - ngx_pfree(cf->pool, cmd->types); - cmd->types = NULL; - } - - cmd->is_input = 1; - - hmcf = ngx_http_conf_get_module_main_conf(cf, - ngx_http_headers_more_filter_module); - - hmcf->requires_handler = 1; - - return NGX_CONF_OK; -} - - -/* borrowed the code from ngx_http_request.c:ngx_http_process_user_agent */ -static ngx_int_t -ngx_http_set_user_agent_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - u_char *user_agent, *msie; - - /* clear existing settings */ - - r->headers_in.msie = 0; - r->headers_in.msie6 = 0; - r->headers_in.opera = 0; - r->headers_in.gecko = 0; - r->headers_in.chrome = 0; - r->headers_in.safari = 0; - r->headers_in.konqueror = 0; - - if (value->len == 0) { - return ngx_http_set_builtin_header(r, hv, value); - } - - /* check some widespread browsers */ - - user_agent = value->data; - - msie = ngx_strstrn(user_agent, "MSIE ", 5 - 1); - - if (msie && msie + 7 < user_agent + value->len) { - - r->headers_in.msie = 1; - - if (msie[6] == '.') { - - switch (msie[5]) { - case '4': - case '5': - r->headers_in.msie6 = 1; - break; - case '6': - if (ngx_strstrn(msie + 8, "SV1", 3 - 1) == NULL) { - r->headers_in.msie6 = 1; - } - break; - } - } - } - - if (ngx_strstrn(user_agent, "Opera", 5 - 1)) { - r->headers_in.opera = 1; - r->headers_in.msie = 0; - r->headers_in.msie6 = 0; - } - - if (!r->headers_in.msie && !r->headers_in.opera) { - - if (ngx_strstrn(user_agent, "Gecko/", 6 - 1)) { - r->headers_in.gecko = 1; - - } else if (ngx_strstrn(user_agent, "Chrome/", 7 - 1)) { - r->headers_in.chrome = 1; - - } else if (ngx_strstrn(user_agent, "Safari/", 7 - 1) - && ngx_strstrn(user_agent, "Mac OS X", 8 - 1)) - { - r->headers_in.safari = 1; - - } else if (ngx_strstrn(user_agent, "Konqueror", 9 - 1)) { - r->headers_in.konqueror = 1; - } - } - - return ngx_http_set_builtin_header(r, hv, value); -} - - -static ngx_int_t -ngx_http_set_connection_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - r->headers_in.connection_type = 0; - - if (value->len == 0) { - return ngx_http_set_builtin_header(r, hv, value); - } - - if (ngx_strcasestrn(value->data, "close", 5 - 1)) { - r->headers_in.connection_type = NGX_HTTP_CONNECTION_CLOSE; - r->headers_in.keep_alive_n = -1; - r->keepalive = 0; - - } else if (ngx_strcasestrn(value->data, "keep-alive", 10 - 1)) { - r->headers_in.connection_type = NGX_HTTP_CONNECTION_KEEP_ALIVE; - } - - return ngx_http_set_builtin_header(r, hv, value); -} - - -static ngx_int_t -ngx_http_set_builtin_multi_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ -#if defined(nginx_version) && nginx_version >= 1023000 - ngx_table_elt_t **headers, **ph, *h; -#if (DDEBUG) - int nelts; -#endif - - if (r->headers_out.status == 400 || r->headers_in.headers.last == NULL) { - /* must be a 400 Bad Request */ - return NGX_OK; - } - - headers = (ngx_table_elt_t **) ((char *) &r->headers_in + hv->offset); - - if (*headers) { -#if (DDEBUG) - nelts = 0; - for (h = *headers; h; h = h->next) { - nelts++; - } - - dd("clear multi-value headers: %d", nelts); -#endif - - *headers = NULL; - } - - if (ngx_http_set_header_helper(r, hv, value, &h) == NGX_ERROR) { - return NGX_ERROR; - } - - if (value->len == 0) { - return NGX_OK; - } - - dd("new multi-value header: %p", h); - - if (*headers) { - for (ph = headers; *ph; ph = &(*ph)->next) { /* void */ } - *ph = h; - - } else { - *headers = h; - } - - h->next = NULL; - - return NGX_OK; -#else - ngx_array_t *headers; - ngx_table_elt_t **v, *h; - - if (r->headers_out.status == 400 || r->headers_in.headers.last == NULL) { - /* must be a 400 Bad Request */ - return NGX_OK; - } - - headers = (ngx_array_t *) ((char *) &r->headers_in + hv->offset); - - if (headers->nelts > 0) { - ngx_array_destroy(headers); - - if (ngx_array_init(headers, r->pool, 2, - sizeof(ngx_table_elt_t *)) - != NGX_OK) - { - return NGX_ERROR; - } - - dd("clear multi-value headers: %d", (int) headers->nelts); - } - -#if 1 - if (headers->nalloc == 0) { - if (ngx_array_init(headers, r->pool, 2, - sizeof(ngx_table_elt_t *)) - != NGX_OK) - { - return NGX_ERROR; - } - } -#endif - - h = NULL; - if (ngx_http_set_header_helper(r, hv, value, &h) == NGX_ERROR) { - return NGX_ERROR; - } - - if (value->len == 0) { - return NGX_OK; - } - - dd("new cookie header: %p", h); - - v = ngx_array_push(headers); - if (v == NULL) { - return NGX_ERROR; - } - - *v = h; - return NGX_OK; -#endif -} - - -static ngx_int_t -ngx_http_headers_more_validate_host(ngx_str_t *host, ngx_pool_t *pool, - ngx_uint_t alloc) -{ - u_char *h, ch; - size_t i, dot_pos, host_len; - - enum { - sw_usual = 0, - sw_literal, - sw_rest - } state; - - dot_pos = host->len; - host_len = host->len; - - h = host->data; - - state = sw_usual; - - for (i = 0; i < host->len; i++) { - ch = h[i]; - - switch (ch) { - - case '.': - if (dot_pos == i - 1) { - return NGX_DECLINED; - } - - dot_pos = i; - break; - - case ':': - if (state == sw_usual) { - host_len = i; - state = sw_rest; - } - break; - - case '[': - if (i == 0) { - state = sw_literal; - } - break; - - case ']': - if (state == sw_literal) { - host_len = i + 1; - state = sw_rest; - } - break; - - case '\0': - return NGX_DECLINED; - - default: - - if (ngx_path_separator(ch)) { - return NGX_DECLINED; - } - - if (ch >= 'A' && ch <= 'Z') { - alloc = 1; - } - - break; - } - } - - if (dot_pos == host_len - 1) { - host_len--; - } - - if (host_len == 0) { - return NGX_DECLINED; - } - - if (alloc) { - host->data = ngx_pnalloc(pool, host_len); - if (host->data == NULL) { - return NGX_ERROR; - } - - ngx_strlow(host->data, h, host_len); - } - - host->len = host_len; - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_headers_in.h b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_headers_in.h deleted file mode 100644 index d2251da..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_headers_in.h +++ /dev/null @@ -1,26 +0,0 @@ - -/* - * Copyright (c) Yichun Zhang (agentzh) - */ - - -#ifndef NGX_HTTP_HEADERS_MORE_INPUT_HEADERS_H -#define NGX_HTTP_HEADERS_MORE_INPUT_HEADERS_H - - -#include "ngx_http_headers_more_filter_module.h" - - -/* output header setters and clearers */ - -ngx_int_t ngx_http_headers_more_exec_input_cmd(ngx_http_request_t *r, - ngx_http_headers_more_cmd_t *cmd); - -char *ngx_http_headers_more_set_input_headers(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); - -char *ngx_http_headers_more_clear_input_headers(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); - - -#endif /* NGX_HTTP_HEADERS_MORE_INPUT_HEADERS_H */ diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_headers_out.c b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_headers_out.c deleted file mode 100644 index 2a95b5f..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_headers_out.c +++ /dev/null @@ -1,814 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include "ngx_http_headers_more_headers_out.h" -#include "ngx_http_headers_more_util.h" -#include - - -static char * -ngx_http_headers_more_parse_directive(ngx_conf_t *cf, ngx_command_t *ngx_cmd, - void *conf, ngx_http_headers_more_opcode_t opcode); -static ngx_flag_t ngx_http_headers_more_check_type(ngx_http_request_t *r, - ngx_array_t *types); -static ngx_flag_t ngx_http_headers_more_check_status(ngx_http_request_t *r, - ngx_array_t *statuses); -static ngx_int_t ngx_http_set_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_set_header_helper(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value, - ngx_table_elt_t **output_header, ngx_flag_t no_create); -static ngx_int_t ngx_http_set_builtin_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_set_accept_ranges_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_set_content_length_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_set_content_type_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_clear_builtin_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_clear_content_length_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); -static ngx_int_t ngx_http_set_builtin_multi_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value); - - -static ngx_http_headers_more_set_header_t ngx_http_headers_more_set_handlers[] - = { - - { ngx_string("Server"), - offsetof(ngx_http_headers_out_t, server), - ngx_http_set_builtin_header }, - - { ngx_string("Date"), - offsetof(ngx_http_headers_out_t, date), - ngx_http_set_builtin_header }, - - { ngx_string("Content-Encoding"), - offsetof(ngx_http_headers_out_t, content_encoding), - ngx_http_set_builtin_header }, - - { ngx_string("Location"), - offsetof(ngx_http_headers_out_t, location), - ngx_http_set_builtin_header }, - - { ngx_string("Refresh"), - offsetof(ngx_http_headers_out_t, refresh), - ngx_http_set_builtin_header }, - - { ngx_string("Last-Modified"), - offsetof(ngx_http_headers_out_t, last_modified), - ngx_http_set_builtin_header }, - - { ngx_string("Content-Range"), - offsetof(ngx_http_headers_out_t, content_range), - ngx_http_set_builtin_header }, - - { ngx_string("Accept-Ranges"), - offsetof(ngx_http_headers_out_t, accept_ranges), - ngx_http_set_accept_ranges_header }, - - { ngx_string("WWW-Authenticate"), - offsetof(ngx_http_headers_out_t, www_authenticate), - ngx_http_set_builtin_header }, - - { ngx_string("Expires"), - offsetof(ngx_http_headers_out_t, expires), - ngx_http_set_builtin_header }, - - { ngx_string("E-Tag"), - offsetof(ngx_http_headers_out_t, etag), - ngx_http_set_builtin_header }, - - { ngx_string("Content-Length"), - offsetof(ngx_http_headers_out_t, content_length), - ngx_http_set_content_length_header }, - - { ngx_string("Content-Type"), - 0, - ngx_http_set_content_type_header }, - - { ngx_string("Cache-Control"), - offsetof(ngx_http_headers_out_t, cache_control), - ngx_http_set_builtin_multi_header }, - - { ngx_null_string, 0, ngx_http_set_header } -}; - - -ngx_int_t -ngx_http_headers_more_exec_cmd(ngx_http_request_t *r, - ngx_http_headers_more_cmd_t *cmd) -{ - ngx_str_t value; - ngx_http_headers_more_header_val_t *h; - ngx_uint_t i; - - if (!cmd->headers) { - return NGX_OK; - } - - if (cmd->types && !ngx_http_headers_more_check_type(r, cmd->types)) { - return NGX_OK; - } - - if (cmd->statuses - && !ngx_http_headers_more_check_status(r, cmd->statuses)) - { - return NGX_OK; - } - - h = cmd->headers->elts; - for (i = 0; i < cmd->headers->nelts; i++) { - - if (ngx_http_complex_value(r, &h[i].value, &value) != NGX_OK) { - return NGX_ERROR; - } - - if (value.len) { - value.len--; /* remove the trailing '\0' added by - ngx_http_headers_more_parse_header */ - } - - if (h[i].handler(r, &h[i], &value) != NGX_OK) { - return NGX_ERROR; - } - } - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_set_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - return ngx_http_set_header_helper(r, hv, value, NULL, 0); -} - - -static ngx_int_t -ngx_http_set_header_helper(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value, - ngx_table_elt_t **output_header, ngx_flag_t no_create) -{ - ngx_table_elt_t *h; - ngx_list_part_t *part; - ngx_uint_t i; - ngx_flag_t matched = 0; - - dd_enter(); - -#if 1 - if (r->headers_out.location - && r->headers_out.location->value.len - && r->headers_out.location->value.data[0] == '/') - { - /* XXX ngx_http_core_find_config_phase, for example, - * may not initialize the "key" and "hash" fields - * for a nasty optimization purpose, and - * we have to work-around it here */ - - r->headers_out.location->hash = ngx_http_headers_more_location_hash; - ngx_str_set(&r->headers_out.location->key, "Location"); - } -#endif - - if (hv->append) { - goto append; - } - - part = &r->headers_out.headers.part; - h = part->elts; - - for (i = 0; /* void */; i++) { - - if (i >= part->nelts) { - if (part->next == NULL) { - break; - } - - part = part->next; - h = part->elts; - i = 0; - } - - if (h[i].hash == 0) { - continue; - } - - if (!hv->wildcard - && h[i].key.len == hv->key.len - && ngx_strncasecmp(h[i].key.data, hv->key.data, - h[i].key.len) == 0) - { - goto matched; - } - - if (hv->wildcard - && h[i].key.len >= hv->key.len - 1 - && ngx_strncasecmp(h[i].key.data, hv->key.data, - hv->key.len - 1) == 0) - { - goto matched; - } - - /* not matched */ - continue; - -matched: - - if (value->len == 0 || matched) { - dd("clearing normal header for %.*s", (int) hv->key.len, - hv->key.data); - - h[i].value.len = 0; - h[i].hash = 0; - - } else { - h[i].value = *value; - h[i].hash = hv->hash; - } - - if (output_header) { - *output_header = &h[i]; - } - - matched = 1; - } - - if (matched){ - return NGX_OK; - } - - if ((hv->wildcard || no_create) && value->len == 0) { - return NGX_OK; - } - - /* XXX we still need to create header slot even if the value - * is empty because some builtin headers like Last-Modified - * relies on this to get cleared */ - -append: - - h = ngx_list_push(&r->headers_out.headers); - if (h == NULL) { - return NGX_ERROR; - } - - if (value->len == 0) { - h->hash = 0; - - } else { - h->hash = hv->hash; - } - - h->key = hv->key; - h->value = *value; - - h->lowcase_key = ngx_pnalloc(r->pool, h->key.len); - if (h->lowcase_key == NULL) { - return NGX_ERROR; - } - - ngx_strlow(h->lowcase_key, h->key.data, h->key.len); - - if (output_header) { - *output_header = h; - } - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_set_builtin_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - ngx_table_elt_t *h, **old; - - dd_enter(); - - if (hv->offset) { - old = (ngx_table_elt_t **) ((char *) &r->headers_out + hv->offset); - - } else { - old = NULL; - } - - if (old == NULL || *old == NULL) { - return ngx_http_set_header_helper(r, hv, value, old, 0); - } - - h = *old; - - if (value->len == 0) { - dd("clearing the builtin header"); - - h->hash = 0; - h->value = *value; - - return NGX_OK; - } - - h->hash = hv->hash; - h->key = hv->key; - h->value = *value; - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_set_builtin_multi_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ -#if defined(nginx_version) && nginx_version >= 1023000 - ngx_table_elt_t **headers, *h, *ho, **ph; - - headers = (ngx_table_elt_t **) ((char *) &r->headers_out + hv->offset); - - if (*headers) { - for (h = (*headers)->next; h; h = h->next) { - h->hash = 0; - h->value.len = 0; - } - - h = *headers; - - h->value = *value; - - if (value->len == 0) { - h->hash = 0; - - } else { - h->hash = hv->hash; - } - - return NGX_OK; - } - - for (ph = headers; *ph; ph = &(*ph)->next) { /* void */ } - - ho = ngx_list_push(&r->headers_out.headers); - if (ho == NULL) { - return NGX_ERROR; - } - - ho->value = *value; - ho->hash = hv->hash; - ngx_str_set(&ho->key, "Cache-Control"); - ho->next = NULL; - *ph = ho; - - return NGX_OK; -#else - ngx_array_t *pa; - ngx_table_elt_t *ho, **ph; - ngx_uint_t i; - - pa = (ngx_array_t *) ((char *) &r->headers_out + hv->offset); - - if (pa->elts == NULL) { - if (ngx_array_init(pa, r->pool, 2, sizeof(ngx_table_elt_t *)) - != NGX_OK) - { - return NGX_ERROR; - } - } - - /* override old values (if any) */ - - if (pa->nelts > 0) { - ph = pa->elts; - for (i = 1; i < pa->nelts; i++) { - ph[i]->hash = 0; - ph[i]->value.len = 0; - } - - ph[0]->value = *value; - - if (value->len == 0) { - ph[0]->hash = 0; - - } else { - ph[0]->hash = hv->hash; - } - - return NGX_OK; - } - - ph = ngx_array_push(pa); - if (ph == NULL) { - return NGX_ERROR; - } - - ho = ngx_list_push(&r->headers_out.headers); - if (ho == NULL) { - return NGX_ERROR; - } - - ho->value = *value; - ho->hash = hv->hash; - ngx_str_set(&ho->key, "Cache-Control"); - *ph = ho; - - return NGX_OK; -#endif -} - - -static ngx_int_t -ngx_http_set_content_type_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - u_char *p, *last, *end; - - r->headers_out.content_type_len = value->len; - r->headers_out.content_type = *value; - r->headers_out.content_type_hash = hv->hash; - r->headers_out.content_type_lowcase = NULL; - - p = value->data; - end = p + value->len; - - for (; p != end; p++) { - - if (*p != ';') { - continue; - } - - last = p; - - while (*++p == ' ') { /* void */ } - - if (p == end) { - break; - } - - if (ngx_strncasecmp(p, (u_char *) "charset=", 8) != 0) { - continue; - } - - p += 8; - - r->headers_out.content_type_len = last - value->data; - - if (*p == '"') { - p++; - } - - last = end; - - if (*(last - 1) == '"') { - last--; - } - - r->headers_out.charset.len = last - p; - r->headers_out.charset.data = p; - - break; - } - - value->len = 0; - - return ngx_http_set_header_helper(r, hv, value, NULL, 1); -} - - -static ngx_int_t -ngx_http_set_content_length_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - off_t len; - - if (value->len == 0) { - return ngx_http_clear_content_length_header(r, hv, value); - } - - len = ngx_atosz(value->data, value->len); - if (len == NGX_ERROR) { - return NGX_ERROR; - } - - r->headers_out.content_length_n = len; - - return ngx_http_set_builtin_header(r, hv, value); -} - - -static ngx_int_t -ngx_http_set_accept_ranges_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - if (value->len == 0) { - r->allow_ranges = 0; - } - - return ngx_http_set_builtin_header(r, hv, value); -} - - -static ngx_int_t -ngx_http_clear_content_length_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - r->headers_out.content_length_n = -1; - - return ngx_http_clear_builtin_header(r, hv, value); -} - - -static ngx_int_t -ngx_http_clear_builtin_header(ngx_http_request_t *r, - ngx_http_headers_more_header_val_t *hv, ngx_str_t *value) -{ - dd_enter(); - - value->len = 0; - - return ngx_http_set_builtin_header(r, hv, value); -} - - -char * -ngx_http_headers_more_set_headers(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf) -{ - return ngx_http_headers_more_parse_directive(cf, cmd, conf, - ngx_http_headers_more_opcode_set); -} - - -char * -ngx_http_headers_more_clear_headers(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf) -{ - return ngx_http_headers_more_parse_directive(cf, cmd, conf, - ngx_http_headers_more_opcode_clear); -} - - -static ngx_flag_t -ngx_http_headers_more_check_type(ngx_http_request_t *r, ngx_array_t *types) -{ - ngx_uint_t i; - ngx_str_t *t; - - dd("headers_out->content_type: %.*s (len %d)", - (int) r->headers_out.content_type.len, - r->headers_out.content_type.data, - (int) r->headers_out.content_type.len); - - t = types->elts; - - for (i = 0; i < types->nelts; i++) { - dd("...comparing with type [%.*s]", (int) t[i].len, t[i].data); - - if (r->headers_out.content_type_len == t[i].len - && ngx_strncmp(r->headers_out.content_type.data, - t[i].data, t[i].len) == 0) - { - return 1; - } - } - - return 0; -} - - -static ngx_flag_t -ngx_http_headers_more_check_status(ngx_http_request_t *r, ngx_array_t *statuses) -{ - ngx_uint_t i; - ngx_uint_t *status; - - dd("headers_out.status = %d", (int) r->headers_out.status); - - status = statuses->elts; - for (i = 0; i < statuses->nelts; i++) { - dd("...comparing with specified status %d", (int) status[i]); - - if (r->headers_out.status == status[i]) { - return 1; - } - } - - return 0; -} - - -static char * -ngx_http_headers_more_parse_directive(ngx_conf_t *cf, ngx_command_t *ngx_cmd, - void *conf, ngx_http_headers_more_opcode_t opcode) -{ - ngx_http_headers_more_loc_conf_t *hlcf = conf; - - ngx_uint_t i, j; - ngx_http_headers_more_cmd_t *cmd; - ngx_str_t *arg; - ngx_flag_t ignore_next_arg; - ngx_str_t *cmd_name; - ngx_int_t rc; - ngx_flag_t append = 0; - ngx_flag_t is_builtin_header = 0; - ngx_http_headers_more_header_val_t *h; - ngx_http_headers_more_set_header_t *handlers; - - ngx_http_headers_more_main_conf_t *hmcf; - - if (hlcf->cmds == NULL) { - hlcf->cmds = ngx_array_create(cf->pool, 1, - sizeof(ngx_http_headers_more_cmd_t)); - - if (hlcf->cmds == NULL) { - return NGX_CONF_ERROR; - } - } - - cmd = ngx_array_push(hlcf->cmds); - if (cmd == NULL) { - return NGX_CONF_ERROR; - } - - cmd->headers = - ngx_array_create(cf->pool, 1, - sizeof(ngx_http_headers_more_header_val_t)); - if (cmd->headers == NULL) { - return NGX_CONF_ERROR; - } - - cmd->types = ngx_array_create(cf->pool, 1, sizeof(ngx_str_t)); - if (cmd->types == NULL) { - return NGX_CONF_ERROR; - } - - cmd->statuses = ngx_array_create(cf->pool, 1, sizeof(ngx_uint_t)); - if (cmd->statuses == NULL) { - return NGX_CONF_ERROR; - } - - arg = cf->args->elts; - - cmd_name = &arg[0]; - - ignore_next_arg = 0; - - for (i = 1; i < cf->args->nelts; i++) { - - if (ignore_next_arg) { - ignore_next_arg = 0; - continue; - } - - if (arg[i].len == 0) { - continue; - } - - if (arg[i].data[0] != '-') { - rc = ngx_http_headers_more_parse_header(cf, cmd_name, - &arg[i], cmd->headers, - opcode, - ngx_http_headers_more_set_handlers); - - if (rc != NGX_OK) { - return NGX_CONF_ERROR; - } - - continue; - } - - if (arg[i].len == 2) { - if (arg[i].data[1] == 't') { - if (i == cf->args->nelts - 1) { - ngx_log_error(NGX_LOG_ERR, cf->log, 0, - "%V: option -t takes an argument.", - cmd_name); - - return NGX_CONF_ERROR; - } - - rc = ngx_http_headers_more_parse_types(cf->log, cmd_name, - &arg[i + 1], - cmd->types); - - if (rc != NGX_OK) { - return NGX_CONF_ERROR; - } - - ignore_next_arg = 1; - - continue; - - } else if (arg[i].data[1] == 's') { - - if (i == cf->args->nelts - 1) { - ngx_log_error(NGX_LOG_ERR, cf->log, 0, - "%V: option -s takes an argument.", - cmd_name); - - return NGX_CONF_ERROR; - } - - rc = ngx_http_headers_more_parse_statuses(cf->log, cmd_name, - &arg[i + 1], - cmd->statuses); - - if (rc != NGX_OK) { - return NGX_CONF_ERROR; - } - - ignore_next_arg = 1; - - continue; - - } else if (arg[i].data[1] == 'a') { - - if (ngx_strncasecmp((u_char *) "more_set_headers", - cmd_name->data, cmd_name->len) != 0) - { - ngx_log_error(NGX_LOG_ERR, cf->log, 0, - "%V: invalid option name: \"%V\"", - cmd_name, &arg[i]); - - return NGX_CONF_ERROR; - } - - dd("Found append flag"); - append = 1; - continue; - } - } - - ngx_log_error(NGX_LOG_ERR, cf->log, 0, - "%V: invalid option name: \"%V\"", cmd_name, &arg[i]); - - return NGX_CONF_ERROR; - } - - dd("Found %d statuses, %d types, and %d headers", - (int) cmd->statuses->nelts, (int) cmd->types->nelts, - (int) cmd->headers->nelts); - - if (cmd->headers->nelts == 0) { - cmd->headers = NULL; - - } else { - - h = cmd->headers->elts; - for (i = 0; i < cmd->headers->nelts; i++) { - h[i].append = 0; - - handlers = ngx_http_headers_more_set_handlers; - - for (j = 0; handlers[j].name.len; j++) { - if (h[i].key.len == handlers[j].name.len - && ngx_strncasecmp(h[i].key.data, handlers[j].name.data, - h[i].key.len) == 0) - { - is_builtin_header = 1; - break; - } - } - - if (is_builtin_header && append) { - ngx_log_error(NGX_LOG_ERR, cf->log, 0, - "%V: can not append builtin headers \"%V\"", - cmd_name, &h[i].key); - - return NGX_CONF_ERROR; - } - - if (!is_builtin_header) { - h[i].append = append; - } - } - } - - if (cmd->types->nelts == 0) { - cmd->types = NULL; - } - - if (cmd->statuses->nelts == 0) { - cmd->statuses = NULL; - } - - cmd->is_input = 0; - - hmcf = ngx_http_conf_get_module_main_conf(cf, - ngx_http_headers_more_filter_module); - - hmcf->requires_filter = 1; - - return NGX_CONF_OK; -} diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_headers_out.h b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_headers_out.h deleted file mode 100644 index c939507..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_headers_out.h +++ /dev/null @@ -1,26 +0,0 @@ - -/* - * Copyright (c) Yichun Zhang (agentzh) - */ - - -#ifndef NGX_HTTP_HEADERS_MORE_OUTPUT_HEADERS_H -#define NGX_HTTP_HEADERS_MORE_OUTPUT_HEADERS_H - - -#include "ngx_http_headers_more_filter_module.h" - - -/* output header setters and clearers */ - -ngx_int_t ngx_http_headers_more_exec_cmd(ngx_http_request_t *r, - ngx_http_headers_more_cmd_t *cmd); - -char *ngx_http_headers_more_set_headers(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); - -char *ngx_http_headers_more_clear_headers(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); - - -#endif /* NGX_HTTP_HEADERS_MORE_OUTPUT_HEADERS_H */ diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_util.c b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_util.c deleted file mode 100644 index e1f3636..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_util.c +++ /dev/null @@ -1,382 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include "ngx_http_headers_more_util.h" -#include - - -ngx_int_t -ngx_http_headers_more_parse_header(ngx_conf_t *cf, ngx_str_t *cmd_name, - ngx_str_t *raw_header, ngx_array_t *headers, - ngx_http_headers_more_opcode_t opcode, - ngx_http_headers_more_set_header_t *handlers) -{ - ngx_http_headers_more_header_val_t *hv; - - ngx_uint_t i; - ngx_str_t key = ngx_null_string; - ngx_str_t value = ngx_null_string; - ngx_flag_t seen_end_of_key; - ngx_http_compile_complex_value_t ccv; - u_char *p; - - hv = ngx_array_push(headers); - if (hv == NULL) { - return NGX_ERROR; - } - - seen_end_of_key = 0; - for (i = 0; i < raw_header->len; i++) { - if (key.len == 0) { - if (isspace(raw_header->data[i])) { - continue; - } - - key.data = raw_header->data; - key.len = 1; - - continue; - } - - if (!seen_end_of_key) { - if (raw_header->data[i] == ':' - || isspace(raw_header->data[i])) - { - seen_end_of_key = 1; - continue; - } - - key.len++; - - continue; - } - - if (value.len == 0) { - if (raw_header->data[i] == ':' - || isspace(raw_header->data[i])) - { - continue; - } - - value.data = &raw_header->data[i]; - value.len = 1; - - continue; - } - - value.len++; - } - - if (key.len == 0) { - ngx_log_error(NGX_LOG_ERR, cf->log, 0, - "%V: no key found in the header argument: %V", - cmd_name, raw_header); - - return NGX_ERROR; - } - - hv->wildcard = (key.data[key.len - 1] == '*'); - if (hv->wildcard && key.len<2){ - ngx_log_error(NGX_LOG_ERR, cf->log, 0, - "%V: wildcard key too short: %V", - cmd_name, raw_header); - return NGX_ERROR; - } - - hv->hash = ngx_hash_key_lc(key.data, key.len); - hv->key = key; - - hv->offset = 0; - - for (i = 0; handlers[i].name.len; i++) { - if (hv->key.len != handlers[i].name.len - || ngx_strncasecmp(hv->key.data, handlers[i].name.data, - handlers[i].name.len) != 0) - { - dd("hv key comparison: %s <> %s", handlers[i].name.data, - hv->key.data); - - continue; - } - - hv->offset = handlers[i].offset; - hv->handler = handlers[i].handler; - - break; - } - - if (handlers[i].name.len == 0 && handlers[i].handler) { - hv->offset = handlers[i].offset; - hv->handler = handlers[i].handler; - } - - if (opcode == ngx_http_headers_more_opcode_clear) { - value.len = 0; - } - - if (value.len == 0) { - ngx_memzero(&hv->value, sizeof(ngx_http_complex_value_t)); - return NGX_OK; - - } - - /* Nginx request header value requires to be a null-terminated - * C string */ - - p = ngx_palloc(cf->pool, value.len + 1); - if (p == NULL) { - return NGX_ERROR; - } - - ngx_memcpy(p, value.data, value.len); - p[value.len] = '\0'; - value.data = p; - value.len++; /* we should also compile the trailing '\0' */ - - /* compile the header value as a complex value */ - - ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); - - ccv.cf = cf; - ccv.value = &value; - ccv.complex_value = &hv->value; - - if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { - return NGX_ERROR; - } - - return NGX_OK; -} - - -ngx_int_t -ngx_http_headers_more_parse_statuses(ngx_log_t *log, ngx_str_t *cmd_name, - ngx_str_t *value, ngx_array_t *statuses) -{ - u_char *p, *last; - ngx_uint_t *s = NULL; - - p = value->data; - last = p + value->len; - - for (; p != last; p++) { - if (s == NULL) { - if (isspace(*p)) { - continue; - } - - s = ngx_array_push(statuses); - if (s == NULL) { - return NGX_ERROR; - } - - if (*p >= '0' && *p <= '9') { - *s = *p - '0'; - - } else { - ngx_log_error(NGX_LOG_ERR, log, 0, - "%V: invalid digit \"%c\" found in " - "the status code list \"%V\"", - cmd_name, *p, value); - - return NGX_ERROR; - } - - continue; - } - - if (isspace(*p)) { - dd("Parsed status %d", (int) *s); - - s = NULL; - continue; - } - - if (*p >= '0' && *p <= '9') { - *s *= 10; - *s += *p - '0'; - - } else { - ngx_log_error(NGX_LOG_ERR, log, 0, - "%V: invalid digit \"%c\" found in " - "the status code list \"%V\"", - cmd_name, *p, value); - - return NGX_ERROR; - } - } - - if (s) { - dd("Parsed status %d", (int) *s); - } - - return NGX_OK; -} - - -ngx_int_t -ngx_http_headers_more_parse_types(ngx_log_t *log, ngx_str_t *cmd_name, - ngx_str_t *value, ngx_array_t *types) -{ - u_char *p, *last; - ngx_str_t *t = NULL; - - p = value->data; - last = p + value->len; - - for (; p != last; p++) { - if (t == NULL) { - if (isspace(*p) || *p == ';') { - continue; - } - - t = ngx_array_push(types); - if (t == NULL) { - return NGX_ERROR; - } - - t->len = 1; - t->data = p; - - continue; - } - - if (isspace(*p) || *p == ';') { - t = NULL; - continue; - } - - t->len++; - } - - return NGX_OK; -} - - -ngx_int_t -ngx_http_headers_more_rm_header_helper(ngx_list_t *l, ngx_list_part_t *cur, - ngx_uint_t i) -{ - ngx_table_elt_t *data; - ngx_list_part_t *new, *part; - - dd("list rm item: part %p, i %d, nalloc %d", cur, (int) i, - (int) l->nalloc); - - data = cur->elts; - - dd("cur: nelts %d, nalloc %d", (int) cur->nelts, - (int) l->nalloc); - - if (i == 0) { - cur->elts = (char *) cur->elts + l->size; - cur->nelts--; - - if (cur == l->last) { - if (cur->nelts == 0) { -#if 1 - part = &l->part; - - if (part == cur) { - cur->elts = (char *) cur->elts - l->size; - /* do nothing */ - - } else { - while (part->next != cur) { - if (part->next == NULL) { - return NGX_ERROR; - } - - part = part->next; - } - - l->last = part; - part->next = NULL; - dd("part nelts: %d", (int) part->nelts); - l->nalloc = part->nelts; - } -#endif - - } else { - l->nalloc--; - } - - return NGX_OK; - } - - if (cur->nelts == 0) { - part = &l->part; - - if (part == cur) { - ngx_http_headers_more_assert(cur->next != NULL); - - dd("remove 'cur' from the list by rewriting 'cur': " - "l->last: %p, cur: %p, cur->next: %p, part: %p", - l->last, cur, cur->next, part); - - if (l->last == cur->next) { - dd("last is cur->next"); - l->part = *(cur->next); - l->last = part; - l->nalloc = part->nelts; - - } else { - l->part = *(cur->next); - } - - } else { - dd("remove 'cur' from the list"); - while (part->next != cur) { - if (part->next == NULL) { - return NGX_ERROR; - } - - part = part->next; - } - - part->next = cur->next; - } - - return NGX_OK; - } - - return NGX_OK; - } - - if (i == cur->nelts - 1) { - cur->nelts--; - - if (cur == l->last) { - l->nalloc = cur->nelts; - } - - return NGX_OK; - } - - new = ngx_palloc(l->pool, sizeof(ngx_list_part_t)); - if (new == NULL) { - return NGX_ERROR; - } - - new->elts = &data[i + 1]; - new->nelts = cur->nelts - i - 1; - new->next = cur->next; - - cur->nelts = i; - cur->next = new; - if (cur == l->last) { - l->last = new; - l->nalloc = new->nelts; - } - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_util.h b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_util.h deleted file mode 100644 index 6c4614b..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/src/ngx_http_headers_more_util.h +++ /dev/null @@ -1,52 +0,0 @@ - -/* - * Copyright (c) Yichun Zhang (agentzh) - */ - - -#ifndef NGX_HTTP_HEADERS_MORE_UTIL_H -#define NGX_HTTP_HEADERS_MORE_UTIL_H - - -#include "ngx_http_headers_more_filter_module.h" - - -#define ngx_http_headers_more_hash_literal(s) \ - ngx_http_headers_more_hash_str((u_char *) s, sizeof(s) - 1) - - -static ngx_inline ngx_uint_t -ngx_http_headers_more_hash_str(u_char *src, size_t n) -{ - ngx_uint_t key; - - key = 0; - - while (n--) { - key = ngx_hash(key, *src); - src++; - } - - return key; -} - - -extern ngx_uint_t ngx_http_headers_more_location_hash; - - -ngx_int_t ngx_http_headers_more_parse_header(ngx_conf_t *cf, - ngx_str_t *cmd_name, ngx_str_t *raw_header, ngx_array_t *headers, - ngx_http_headers_more_opcode_t opcode, - ngx_http_headers_more_set_header_t *handlers); - -ngx_int_t ngx_http_headers_more_parse_statuses(ngx_log_t *log, - ngx_str_t *cmd_name, ngx_str_t *value, ngx_array_t *statuses); - -ngx_int_t ngx_http_headers_more_parse_types(ngx_log_t *log, - ngx_str_t *cmd_name, ngx_str_t *value, ngx_array_t *types); - -ngx_int_t ngx_http_headers_more_rm_header_helper(ngx_list_t *l, - ngx_list_part_t *cur, ngx_uint_t i); - - -#endif /* NGX_HTTP_HEADERS_MORE_UTIL_H */ diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/bug.t b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/bug.t deleted file mode 100644 index 2339401..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/bug.t +++ /dev/null @@ -1,416 +0,0 @@ -# vi:filetype= - -use Test::Nginx::Socket; # 'no_plan'; - -repeat_each(2); - -plan tests => 56 * repeat_each(); - -no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: set Server ---- config - #more_set_headers 'Last-Modified: x'; - more_clear_headers 'Last-Modified'; ---- request - GET /index.html ---- response_headers -! Last-Modified ---- response_body_like: It works! - - - -=== TEST 2: variables in the Ranges header ---- config - location /index.html { - set $rfrom 1; - set $rto 3; - more_set_input_headers 'Range: bytes=$rfrom - $rto'; - #more_set_input_headers 'Range: bytes=1 - 3'; - #echo $http_range; - } ---- request -GET /index.html ---- error_code: 206 ---- response_body chomp -htm - - - -=== TEST 3: mime type overriding (inlined types) ---- config - more_clear_headers 'X-Powered-By' 'X-Runtime' 'ETag'; - - types { - text/html html htm shtml; - text/css css; - } ---- user_files ->>> a.css -hello ---- request -GET /a.css ---- error_code: 200 ---- response_headers -Content-Type: text/css ---- response_body -hello - - - -=== TEST 4: mime type overriding (included types file) ---- config - more_clear_headers 'X-Powered-By' 'X-Runtime' 'ETag'; - include mime.types; ---- user_files ->>> a.css -hello ->>> ../conf/mime.types -types { - text/html html htm shtml; - text/css css; -} ---- request -GET /a.css ---- error_code: 200 ---- response_headers -Content-Type: text/css ---- response_body -hello - - - -=== TEST 5: empty variable as the header value ---- config - location /foo { - more_set_headers 'X-Foo: $arg_foo'; - echo hi; - } ---- request - GET /foo ---- response_headers -! X-Foo ---- response_body -hi - - - -=== TEST 6: range bug ---- config - location /index.html { - more_clear_input_headers "Range*" ; - more_clear_input_headers "Content-Range*" ; - - more_set_input_headers 'Range: bytes=1-5'; - more_set_headers 'Content-Range: bytes 1-5/1000'; - } ---- request - GET /index.html ---- more_headers -Range: bytes=1-3 ---- raw_response_headers_like: Content-Range: bytes 1-5/1000$ ---- response_body chop -html> ---- error_code: 206 ---- SKIP - - - -=== TEST 7: Allow-Ranges ---- config - location /index.html { - more_clear_headers 'Accept-Ranges'; - } ---- request - GET /index.html ---- response_headers -! Accept-Ranges ---- response_body_like: It works - - - -=== TEST 8: clear hand-written Allow-Ranges headers ---- config - location /index.html { - more_set_headers 'Accept-Ranges: bytes'; - more_clear_headers 'Accept-Ranges'; - } ---- request - GET /index.html ---- response_headers -! Accept-Ranges ---- response_body_like: It works - - - -=== TEST 9: clear first, then add ---- config - location /bug { - more_clear_headers 'Foo'; - more_set_headers 'Foo: a'; - echo hello; - } ---- request - GET /bug ---- raw_response_headers_like eval -".*Foo: a.*" ---- response_body -hello - - - -=== TEST 10: first add, then clear, then add again ---- config - location /bug { - more_set_headers 'Foo: a'; - more_clear_headers 'Foo'; - more_set_headers 'Foo: b'; - echo hello; - } ---- request - GET /bug ---- raw_response_headers_like eval -".*Foo: b.*" ---- response_body -hello - - - -=== TEST 11: override charset ---- config - location /foo { - charset iso-8859-1; - default_type "text/html"; - echo hiya; - } - - location /bug { - more_set_headers "Content-Type: text/html; charset=UTF-8"; - proxy_pass http://127.0.0.1:$server_port/foo; - } ---- request - GET /bug ---- response_body -hiya ---- response_headers -Content-Type: text/html; charset=UTF-8 - - - -=== TEST 12: set multi-value header to a single value ---- config - location /main { - set $footer ''; - proxy_pass http://127.0.0.1:$server_port/foo; - more_set_headers 'Foo: b'; - header_filter_by_lua ' - ngx.var.footer = ngx.header.Foo - '; - echo_after_body $footer; - } - location /foo { - echo foo; - add_header Foo a; - add_header Foo c; - } ---- request - GET /main ---- response_headers -Foo: b ---- response_body -foo -b - - - -=== TEST 13: set multi values to cache-control and override it with multiple values (to reproduce a bug) ---- config - location /lua { - content_by_lua ' - ngx.header.cache_control = { "private", "no-store", "foo", "bar", "baz" } - ngx.send_headers() - ngx.say("Cache-Control: ", ngx.var.sent_http_cache_control) - '; - more_clear_headers Cache-Control; - add_header Cache-Control "blah"; - } ---- request - GET /lua ---- response_headers -Cache-Control: blah ---- response_body -Cache-Control: blah - - - -=== TEST 14: set 20+ headers ---- config - location /test { - more_clear_input_headers "Authorization"; - echo $http_a1; - echo $http_authorization; - echo $http_a2; - echo $http_a3; - echo $http_a23; - echo $http_a24; - echo $http_a25; - } ---- request - GET /test ---- more_headers eval -my $i = 1; -my $s; -while ($i <= 25) { - $s .= "A$i: $i\n"; - if ($i == 22) { - $s .= "Authorization: blah\n"; - } - $i++; -} -#warn $s; -$s ---- response_body -1 - -2 -3 -23 -24 -25 - - - -=== TEST 15: github #20: segfault caused by the nasty optimization in the nginx core (set) ---- config - location = /t/ { - more_set_headers "Foo: 1"; - proxy_pass http://127.0.0.1:$server_port; - } ---- request -GET /t ---- more_headers -Foo: bar -Bah: baz ---- response_body_like: 301 Moved Permanently ---- error_code: 301 ---- no_error_log -[error] - - - -=== TEST 16: github #20: segfault caused by the nasty optimization in the nginx core (clear) ---- config - location = /t/ { - more_clear_headers Foo; - proxy_pass http://127.0.0.1:$server_port; - } ---- request -GET /t ---- more_headers -Foo: bar -Bah: baz ---- response_body_like: 301 Moved Permanently ---- error_code: 301 ---- no_error_log -[error] - - - -=== TEST 17: Content-Type response headers with a charset param (correct -t values) ---- config - location = /t { - more_set_headers -t 'text/html' 'X-Foo: Bar'; - proxy_pass http://127.0.0.1:$server_port/fake; - } - - location = /fake { - default_type text/html; - charset utf-8; - echo ok; - } ---- request -GET /t ---- response_headers -X-Foo: Bar ---- response_body -ok - - - -=== TEST 18: Content-Type response headers with a charset param (WRONG -t values) ---- config - location = /t { - more_set_headers -t 'text/html; charset=utf-8' 'X-Foo: Bar'; - proxy_pass http://127.0.0.1:$server_port/fake; - } - - location = /fake { - default_type text/html; - charset utf-8; - echo ok; - } ---- request -GET /t ---- response_headers -X-Foo: Bar ---- response_body -ok - - - -=== TEST 19: for bad requests (bad request method letter case) ---- config - error_page 400 = /err; - - location = /err { - more_set_input_headers "Foo: bar"; - echo ok; - } ---- raw_request -GeT / HTTP/1.1 ---- response_body -ok ---- no_check_leak - - - -=== TEST 20: for bad requests (bad request method names) ---- config - error_page 400 = /err; - - location = /err { - more_set_input_headers "Foo: bar"; - echo ok; - } ---- raw_request -GET x HTTP/1.1 ---- response_body -ok ---- no_check_leak - - - -=== TEST 21: override Cache-Control header sent by proxy module ---- config - location = /back { - content_by_lua_block { - ngx.header['Cache-Control'] = 'max-age=0, no-cache' - ngx.send_headers() - ngx.say("Cache-Control: ", ngx.var.sent_http_cache_control) - } - } - - location = /t { - more_set_headers "Cache-Control: max-age=1800"; - proxy_pass http://127.0.0.1:$server_port/back; - } ---- request - GET /t ---- response_headers -Cache-Control: max-age=1800 ---- response_body -Cache-Control: max-age=0, no-cache diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/builtin.t b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/builtin.t deleted file mode 100644 index 27b20af..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/builtin.t +++ /dev/null @@ -1,338 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; # 'no_plan'; - -plan tests => 60; - -no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: set Server ---- config - location /foo { - echo hi; - more_set_headers 'Server: Foo'; - } ---- request - GET /foo ---- response_headers -Server: Foo ---- response_body -hi - - - -=== TEST 2: clear Server ---- config - location /foo { - echo hi; - more_clear_headers 'Server: '; - } ---- request - GET /foo ---- response_headers -! Server ---- response_body -hi - - - -=== TEST 3: set Content-Type ---- config - location /foo { - default_type 'text/plan'; - more_set_headers 'Content-Type: text/css'; - echo hi; - } ---- request - GET /foo ---- response_headers -Content-Type: text/css ---- response_body -hi - - - -=== TEST 4: set Content-Type ---- config - location /foo { - default_type 'text/plan'; - more_set_headers 'Content-Type: text/css'; - return 404; - } ---- request - GET /foo ---- response_headers -Content-Type: text/css ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 5: clear Content-Type ---- config - location /foo { - default_type 'text/plain'; - more_clear_headers 'Content-Type: '; - return 404; - } ---- request - GET /foo ---- response_headers -! Content-Type ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 6: clear Content-Type (colon not required) ---- config - location /foo { - default_type 'text/plain'; - more_set_headers 'Content-Type: Hello'; - more_clear_headers 'Content-Type'; - return 404; - } ---- request - GET /foo ---- response_headers -! Content-Type ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 7: clear Content-Type (value ignored) ---- config - location /foo { - default_type 'text/plain'; - more_set_headers 'Content-Type: Hello'; - more_clear_headers 'Content-Type: blah'; - return 404; - } ---- request - GET /foo ---- response_headers -! Content-Type ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 8: clear Content-Type (case insensitive) ---- config - location /foo { - default_type 'text/plain'; - more_set_headers 'Content-Type: Hello'; - more_clear_headers 'content-type: blah'; - return 404; - } ---- request - GET /foo ---- response_headers -! Content-Type ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 9: clear Content-Type using set empty ---- config - location /foo { - default_type 'text/plain'; - more_set_headers 'Content-Type: Hello'; - more_set_headers 'content-type:'; - return 404; - } ---- request - GET /foo ---- response_headers -! Content-Type ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 10: clear Content-Type using setting key only ---- config - location /foo { - default_type 'text/plain'; - more_set_headers 'Content-Type: Hello'; - more_set_headers 'content-type'; - return 404; - } ---- request - GET /foo ---- response_headers -! Content-Type ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 11: set content-length ---- config - location /len { - more_set_headers 'Content-Length: 2'; - echo hello; - } ---- request - GET /len ---- response_headers -Content-Length: 2 ---- response_body chop -he - - - -=== TEST 12: set content-length multiple times ---- config - location /len { - more_set_headers 'Content-Length: 2'; - more_set_headers 'Content-Length: 4'; - echo hello; - } ---- request - GET /len ---- response_headers -Content-Length: 4 ---- response_body chop -hell - - - -=== TEST 13: clear content-length ---- config - location /len { - more_set_headers 'Content-Length: 4'; - more_set_headers 'Content-Length:'; - echo hello; - } ---- request - GET /len ---- response_headers -! Content-Length ---- response_body -hello - - - -=== TEST 14: clear content-length (another way) ---- config - location /len { - more_set_headers 'Content-Length: 4'; - more_clear_headers 'Content-Length'; - echo hello; - } ---- request - GET /len ---- response_headers -! Content-Length ---- response_body -hello - - - -=== TEST 15: clear content-type ---- config - location /len { - default_type 'text/plain'; - more_set_headers 'Content-Type:'; - echo hello; - } ---- request - GET /len ---- response_headers -! Content-Type ---- response_body -hello - - - -=== TEST 16: clear content-type (the other way) ---- config - location /len { - default_type 'text/plain'; - more_clear_headers 'Content-Type:'; - echo hello; - } ---- request - GET /len ---- response_headers -! Content-Type ---- response_body -hello - - - -=== TEST 17: set Charset ---- config - location /len { - default_type 'text/plain'; - more_set_headers 'Charset: gbk'; - echo hello; - } ---- request - GET /len ---- response_headers -Charset: gbk ---- response_body -hello - - - -=== TEST 18: clear Charset ---- config - location /len { - default_type 'text/plain'; - more_set_headers 'Charset: gbk'; - more_clear_headers 'Charset'; - echo hello; - } ---- request - GET /len ---- response_headers -! Charset ---- response_body -hello - - - -=== TEST 19: clear Charset (the other way: using set) ---- config - location /len { - default_type 'text/plain'; - more_set_headers 'Charset: gbk'; - more_set_headers 'Charset: '; - echo hello; - } ---- request - GET /len ---- response_headers -! Charset ---- response_body -hello - - - -=== TEST 20: set Vary ---- config - location /foo { - more_set_headers 'Vary: gbk'; - echo hello; - } - location /len { - default_type 'text/plain'; - more_set_headers 'Vary: hello'; - proxy_pass http://127.0.0.1:$server_port/foo; - } ---- request - GET /len ---- response_headers -Vary: hello ---- response_body -hello diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/eval.t b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/eval.t deleted file mode 100644 index febd306..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/eval.t +++ /dev/null @@ -1,36 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; # 'no_plan'; - -repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -#no_long_string(); -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: set request header at client side ---- config - location /foo { - eval_subrequest_in_memory off; - eval_override_content_type text/plain; - eval $res { - echo -n 1; - } - #echo "[$res]"; - if ($res = '1') { - more_set_input_headers 'Foo: Bar'; - echo "OK"; - break; - } - echo "NOT OK"; - } ---- request - GET /foo ---- response_body -OK diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/input-conn.t b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/input-conn.t deleted file mode 100644 index f53e80f..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/input-conn.t +++ /dev/null @@ -1,137 +0,0 @@ -# vim:set ft= ts=4 sw=4 et fdm=marker: - -use lib 'lib'; -use Test::Nginx::Socket; - -#worker_connections(1014); -#master_process_enabled(1); -#log_level('warn'); - -repeat_each(2); - -plan tests => repeat_each() * (4 * blocks()); - -#no_diff(); -no_long_string(); - -run_tests(); - -__DATA__ - -=== TEST 1: clear the Connection req header ---- config - location /req-header { - more_clear_input_headers Connection; - echo "connection: $http_connection"; - } ---- request -GET /req-header - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: conn type: %d\n", $r->headers_in->connection_type) -} - - -F(ngx_http_core_content_phase) { - printf("content: conn type: %d\n", $r->headers_in->connection_type) -} - ---- stap_out -rewrite: conn type: 1 -content: conn type: 0 - ---- response_body -connection: ---- no_error_log -[error] - - - -=== TEST 2: set custom Connection req header (close) ---- config - location /req-header { - more_set_input_headers "Connection: CLOSE"; - echo "connection: $http_connection"; - } ---- request -GET /req-header - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: conn type: %d\n", $r->headers_in->connection_type) -} - - -F(ngx_http_core_content_phase) { - printf("content: conn type: %d\n", $r->headers_in->connection_type) -} - ---- stap_out -rewrite: conn type: 1 -content: conn type: 1 - ---- response_body -connection: CLOSE ---- no_error_log -[error] - - - -=== TEST 3: set custom Connection req header (keep-alive) ---- config - location /req-header { - more_set_input_headers "Connection: keep-alive"; - echo "connection: $http_connection"; - } ---- request -GET /req-header - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: conn type: %d\n", $r->headers_in->connection_type) -} - - -F(ngx_http_core_content_phase) { - printf("content: conn type: %d\n", $r->headers_in->connection_type) -} - ---- stap_out -rewrite: conn type: 1 -content: conn type: 2 - ---- response_body -connection: keep-alive ---- no_error_log -[error] - - - -=== TEST 4: set custom Connection req header (bad) ---- config - location /req-header { - more_set_input_headers "Connection: bad"; - echo "connection: $http_connection"; - } ---- request -GET /req-header - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: conn type: %d\n", $r->headers_in->connection_type) -} - - -F(ngx_http_core_content_phase) { - printf("content: conn type: %d\n", $r->headers_in->connection_type) -} - ---- stap_out -rewrite: conn type: 1 -content: conn type: 0 - ---- response_body -connection: bad ---- no_error_log -[error] diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/input-cookie.t b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/input-cookie.t deleted file mode 100644 index 3e5257b..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/input-cookie.t +++ /dev/null @@ -1,183 +0,0 @@ -# vim:set ft= ts=4 sw=4 et fdm=marker: - -use lib 'lib'; -use Test::Nginx::Socket; - -#worker_connections(1014); -#master_process_enabled(1); -#log_level('warn'); - -repeat_each(2); - -plan tests => repeat_each() * (4 * blocks()); - -#no_diff(); -no_long_string(); - -run_tests(); - -__DATA__ - -=== TEST 1: clear cookie (with existing cookies) ---- config - location /t { - more_clear_input_headers Cookie; - echo "Cookie foo: $cookie_foo"; - echo "Cookie baz: $cookie_baz"; - echo "Cookie: $http_cookie"; - } ---- request -GET /t ---- more_headers -Cookie: foo=bar -Cookie: baz=blah - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: cookies: %d\n", $r->headers_in->cookies->nelts) -} - -F(ngx_http_core_content_phase) { - printf("content: cookies: %d\n", $r->headers_in->cookies->nelts) -} - ---- stap_out -rewrite: cookies: 2 -content: cookies: 0 - ---- response_body -Cookie foo: -Cookie baz: -Cookie: - ---- no_error_log -[error] - - - -=== TEST 2: clear cookie (without existing cookies) ---- config - location /t { - more_clear_input_headers Cookie; - echo "Cookie foo: $cookie_foo"; - echo "Cookie baz: $cookie_baz"; - echo "Cookie: $http_cookie"; - } ---- request -GET /t - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: cookies: %d\n", $r->headers_in->cookies->nelts) -} - -F(ngx_http_core_content_phase) { - printf("content: cookies: %d\n", $r->headers_in->cookies->nelts) -} - ---- stap_out -rewrite: cookies: 0 -content: cookies: 0 - ---- response_body -Cookie foo: -Cookie baz: -Cookie: - ---- no_error_log -[error] - - - -=== TEST 3: set one custom cookie (with existing cookies) ---- config - location /t { - more_set_input_headers "Cookie: boo=123"; - echo "Cookie foo: $cookie_foo"; - echo "Cookie baz: $cookie_baz"; - echo "Cookie boo: $cookie_boo"; - echo "Cookie: $http_cookie"; - } ---- request -GET /t ---- more_headers -Cookie: foo=bar -Cookie: baz=blah - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: cookies: %d\n", $r->headers_in->cookies->nelts) -} - -F(ngx_http_core_content_phase) { - printf("content: cookies: %d\n", $r->headers_in->cookies->nelts) -} - ---- stap_out -rewrite: cookies: 2 -content: cookies: 1 - ---- response_body -Cookie foo: -Cookie baz: -Cookie boo: 123 -Cookie: boo=123 - ---- no_error_log -[error] - - - -=== TEST 4: set one custom cookie (without existing cookies) ---- config - location /t { - more_set_input_headers "Cookie: boo=123"; - echo "Cookie foo: $cookie_foo"; - echo "Cookie baz: $cookie_baz"; - echo "Cookie boo: $cookie_boo"; - echo "Cookie: $http_cookie"; - } ---- request -GET /t - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: cookies: %d\n", $r->headers_in->cookies->nelts) -} - -F(ngx_http_core_content_phase) { - printf("content: cookies: %d\n", $r->headers_in->cookies->nelts) -} - ---- stap_out -rewrite: cookies: 0 -content: cookies: 1 - ---- response_body -Cookie foo: -Cookie baz: -Cookie boo: 123 -Cookie: boo=123 - ---- no_error_log -[error] - - - -=== TEST 5: for bad requests causing segfaults when setting & getting multi-value headers ---- config - error_page 400 = /err; - - location = /err { - more_set_input_headers "Cookie: foo=bar"; - echo -n $cookie_foo; - echo ok; - } ---- raw_request -GeT / HTTP/1.1 ---- response_body -ok ---- no_error_log -[warn] -[error] ---- no_check_leak diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/input-ua.t b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/input-ua.t deleted file mode 100644 index da9a60d..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/input-ua.t +++ /dev/null @@ -1,628 +0,0 @@ -# vim:set ft= ts=4 sw=4 et fdm=marker: - -use lib 'lib'; -use Test::Nginx::Socket; - -#worker_connections(1014); -#master_process_enabled(1); -#log_level('warn'); - -repeat_each(2); - -plan tests => repeat_each() * (4 * blocks()); - -#no_diff(); -no_long_string(); - -run_tests(); - -__DATA__ - -=== TEST 1: clear Opera user-agent ---- config - location /t { - more_clear_input_headers User-Agent; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- more_headers -User-Agent: Opera/9.80 (Macintosh; Intel Mac OS X 10.7.4; U; en) Presto/2.10.229 Version/11.62 - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: opera: %d\n", $r->headers_in->opera) -} - -F(ngx_http_core_content_phase) { - printf("content: opera: %d\n", $r->headers_in->opera) -} - ---- stap_out -rewrite: opera: 1 -content: opera: 0 - ---- response_body -User-Agent: ---- no_error_log -[error] - - - -=== TEST 2: clear MSIE 4 user-agent ---- config - location /t { - more_clear_input_headers User-Agent; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- more_headers -User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT 5.0) - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - -F(ngx_http_core_content_phase) { - printf("content: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - ---- stap_out -rewrite: msie=1 msie6=1 -content: msie=0 msie6=0 - ---- response_body -User-Agent: ---- no_error_log -[error] - - - -=== TEST 3: set custom MSIE 4 user-agent ---- config - location /t { - more_set_input_headers "User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT 5.0)"; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - -F(ngx_http_core_content_phase) { - printf("content: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - ---- stap_out -rewrite: msie=0 msie6=0 -content: msie=1 msie6=1 - ---- response_body -User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT 5.0) ---- no_error_log -[error] - - - -=== TEST 4: clear MSIE 5 user-agent ---- config - location /t { - more_clear_input_headers User-Agent; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- more_headers -User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows 95; MSIECrawler) - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - -F(ngx_http_core_content_phase) { - printf("content: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - ---- stap_out -rewrite: msie=1 msie6=1 -content: msie=0 msie6=0 - ---- response_body -User-Agent: ---- no_error_log -[error] - - - -=== TEST 5: set custom MSIE 5 user-agent ---- config - location /t { - more_set_input_headers "User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows 95; MSIECrawler)"; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - -F(ngx_http_core_content_phase) { - printf("content: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - ---- stap_out -rewrite: msie=0 msie6=0 -content: msie=1 msie6=1 - ---- response_body -User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows 95; MSIECrawler) ---- no_error_log -[error] - - - -=== TEST 6: clear MSIE 6 (without SV1) user-agent ---- config - location /t { - more_clear_input_headers User-Agent; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- more_headers -User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Google Wireless Transcoder;) - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - -F(ngx_http_core_content_phase) { - printf("content: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - ---- stap_out -rewrite: msie=1 msie6=1 -content: msie=0 msie6=0 - ---- response_body -User-Agent: ---- no_error_log -[error] - - - -=== TEST 7: set custom MSIE 6 (without SV1) user-agent ---- config - location /t { - more_set_input_headers "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Google Wireless Transcoder;)"; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - -F(ngx_http_core_content_phase) { - printf("content: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - ---- stap_out -rewrite: msie=0 msie6=0 -content: msie=1 msie6=1 - ---- response_body -User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Google Wireless Transcoder;) ---- no_error_log -[error] - - - -=== TEST 8: clear MSIE 6 (with SV1) user-agent ---- config - location /t { - more_clear_input_headers User-Agent; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- more_headers -User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1) - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - -F(ngx_http_core_content_phase) { - printf("content: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - ---- stap_out -rewrite: msie=1 msie6=0 -content: msie=0 msie6=0 - ---- response_body -User-Agent: ---- no_error_log -[error] - - - -=== TEST 9: set custom MSIE 6 (with SV1) user-agent ---- config - location /t { - more_set_input_headers "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1)"; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - -F(ngx_http_core_content_phase) { - printf("content: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - ---- stap_out -rewrite: msie=0 msie6=0 -content: msie=1 msie6=0 - ---- response_body -User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1) ---- no_error_log -[error] - - - -=== TEST 10: set custom MSIE 7 user-agent ---- config - location /t { - more_set_input_headers "User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; winfx; .NET CLR 1.1.4322; .NET CLR 2.0.50727; Zune 2.0)"; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - -F(ngx_http_core_content_phase) { - printf("content: msie=%d msie6=%d\n", - $r->headers_in->msie, - $r->headers_in->msie6) -} - ---- stap_out -rewrite: msie=0 msie6=0 -content: msie=1 msie6=0 - ---- response_body -User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; winfx; .NET CLR 1.1.4322; .NET CLR 2.0.50727; Zune 2.0) ---- no_error_log -[error] - - - -=== TEST 11: clear Gecko user-agent ---- config - location /t { - more_clear_input_headers User-Agent; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- more_headers -User-Agent: Mozilla/5.0 (Android; Mobile; rv:13.0) Gecko/13.0 Firefox/13.0 - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: gecko: %d\n", $r->headers_in->gecko) -} - - -F(ngx_http_core_content_phase) { - printf("content: gecko: %d\n", $r->headers_in->gecko) -} - ---- stap_out -rewrite: gecko: 1 -content: gecko: 0 - ---- response_body -User-Agent: ---- no_error_log -[error] - - - -=== TEST 12: set custom Gecko user-agent ---- config - location /t { - more_set_input_headers "User-Agent: Mozilla/5.0 (Android; Mobile; rv:13.0) Gecko/13.0 Firefox/13.0"; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: gecko: %d\n", $r->headers_in->gecko) -} - - -F(ngx_http_core_content_phase) { - printf("content: gecko: %d\n", $r->headers_in->gecko) -} - ---- stap_out -rewrite: gecko: 0 -content: gecko: 1 - ---- response_body -User-Agent: Mozilla/5.0 (Android; Mobile; rv:13.0) Gecko/13.0 Firefox/13.0 ---- no_error_log -[error] - - - -=== TEST 13: clear Chrome user-agent ---- config - location /t { - more_clear_input_headers User-Agent; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- more_headers -User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.151 Safari/535.19 - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: chrome: %d\n", $r->headers_in->chrome) -} - - -F(ngx_http_core_content_phase) { - printf("content: chrome: %d\n", $r->headers_in->chrome) -} - ---- stap_out -rewrite: chrome: 1 -content: chrome: 0 - ---- response_body -User-Agent: ---- no_error_log -[error] - - - -=== TEST 14: set custom Chrome user-agent ---- config - location /t { - more_set_input_headers "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.151 Safari/535.19"; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: chrome: %d\n", $r->headers_in->chrome) -} - - -F(ngx_http_core_content_phase) { - printf("content: chrome: %d\n", $r->headers_in->chrome) -} - ---- stap_out -rewrite: chrome: 0 -content: chrome: 1 - ---- response_body -User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.151 Safari/535.19 ---- no_error_log -[error] - - - -=== TEST 15: clear Safari (Mac OS X) user-agent ---- config - location /t { - more_clear_input_headers User-Agent; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- more_headers -User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/125.2 (KHTML, like Gecko) Safari/125.8 - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: safari: %d\n", $r->headers_in->safari) -} - - -F(ngx_http_core_content_phase) { - printf("content: safari: %d\n", $r->headers_in->safari) -} - ---- stap_out -rewrite: safari: 1 -content: safari: 0 - ---- response_body -User-Agent: ---- no_error_log -[error] - - - -=== TEST 16: set custom Safari user-agent ---- config - location /t { - more_set_input_headers "User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/125.2 (KHTML, like Gecko) Safari/125.8"; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: safari: %d\n", $r->headers_in->safari) -} - - -F(ngx_http_core_content_phase) { - printf("content: safari: %d\n", $r->headers_in->safari) -} - ---- stap_out -rewrite: safari: 0 -content: safari: 1 - ---- response_body -User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/125.2 (KHTML, like Gecko) Safari/125.8 ---- no_error_log -[error] - - - -=== TEST 17: clear Konqueror user-agent ---- config - location /t { - more_clear_input_headers User-Agent; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- more_headers -User-Agent: Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.10 (like Gecko) (Kubuntu) - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: konqueror: %d\n", $r->headers_in->konqueror) -} - - -F(ngx_http_core_content_phase) { - printf("content: konqueror: %d\n", $r->headers_in->konqueror) -} - ---- stap_out -rewrite: konqueror: 1 -content: konqueror: 0 - ---- response_body -User-Agent: ---- no_error_log -[error] - - - -=== TEST 18: set custom Konqueror user-agent ---- config - location /t { - more_set_input_headers "User-Agent: Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.10 (like Gecko) (Kubuntu)"; - echo "User-Agent: $http_user_agent"; - } - ---- request -GET /t - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - printf("rewrite: konqueror: %d\n", $r->headers_in->konqueror) -} - - -F(ngx_http_core_content_phase) { - printf("content: konqueror: %d\n", $r->headers_in->konqueror) -} - ---- stap_out -rewrite: konqueror: 0 -content: konqueror: 1 - ---- response_body -User-Agent: Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.10 (like Gecko) (Kubuntu) ---- no_error_log -[error] diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/input.t b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/input.t deleted file mode 100644 index 01ae73f..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/input.t +++ /dev/null @@ -1,1331 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; # 'no_plan'; - -repeat_each(2); - -plan tests => repeat_each() * 128; - -no_long_string(); -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: set request header at client side ---- config - location /foo { - #more_set_input_headers 'X-Foo: howdy'; - echo $http_x_foo; - } ---- request - GET /foo ---- more_headers -X-Foo: blah ---- response_headers -! X-Foo ---- response_body -blah - - - -=== TEST 2: set request header at client side and rewrite it ---- config - location /foo { - more_set_input_headers 'X-Foo: howdy'; - echo $http_x_foo; - } ---- request - GET /foo ---- more_headers -X-Foo: blah ---- response_headers -! X-Foo ---- response_body -howdy - - - -=== TEST 3: rewrite content length ---- config - location /bar { - more_set_input_headers 'Content-Length: 2048'; - echo_read_request_body; - echo_request_body; - } ---- request eval -"POST /bar\n" . -"a" x 4096 ---- response_body eval -"a" x 2048 ---- timeout: 15 - - - -=== TEST 4: try to rewrite content length using the rewrite module -Thisshould not take effect ;) ---- config - location /bar { - set $http_content_length 2048; - echo_read_request_body; - echo_request_body; - } ---- request eval -"POST /bar\n" . -"a" x 4096 ---- response_body eval -"a" x 4096 - - - -=== TEST 5: rewrite host and user-agent ---- config - location /bar { - more_set_input_headers 'Host: foo' 'User-Agent: blah'; - echo "Host: $host"; - echo "User-Agent: $http_user_agent"; - } ---- request -GET /bar ---- response_body -Host: foo -User-Agent: blah - - - -=== TEST 6: clear host and user-agent -$host always has a default value and cannot be really cleared. ---- config - location /bar { - more_clear_input_headers 'Host: foo' 'User-Agent: blah'; - echo "Host: $host"; - echo "Host (2): $http_host"; - echo "User-Agent: $http_user_agent"; - } ---- request -GET /bar ---- response_body -Host: localhost -Host (2): -User-Agent: - - - -=== TEST 7: clear host and user-agent (the other way) ---- config - location /bar { - more_set_input_headers 'Host:' 'User-Agent:' 'X-Foo:'; - echo "Host: $host"; - echo "User-Agent: $http_user_agent"; - echo "X-Foo: $http_x_foo"; - } ---- request -GET /bar ---- more_headers -X-Foo: bar ---- response_body -Host: localhost -User-Agent: -X-Foo: - - - -=== TEST 8: clear content-length ---- config - location /bar { - more_set_input_headers 'Content-Length: '; - echo "Content-Length: $http_content_length"; - } ---- request -POST /bar -hello ---- more_headers ---- response_body -Content-Length: - - - -=== TEST 9: clear content-length (the other way) ---- config - location /bar { - more_clear_input_headers 'Content-Length: '; - echo "Content-Length: $http_content_length"; - } ---- request -POST /bar -hello ---- more_headers ---- response_body -Content-Length: - - - -=== TEST 10: rewrite type ---- config - location /bar { - more_set_input_headers 'Content-Type: text/css'; - echo "Content-Type: $content_type"; - } ---- request -POST /bar -hello ---- more_headers -Content-Type: text/plain ---- response_body -Content-Type: text/css - - - -=== TEST 11: clear type ---- config - location /bar { - more_set_input_headers 'Content-Type:'; - echo "Content-Type: $content_type"; - } ---- request -POST /bar -hello ---- more_headers -Content-Type: text/plain ---- response_body -Content-Type: - - - -=== TEST 12: clear type (the other way) ---- config - location /bar { - more_clear_input_headers 'Content-Type:foo'; - echo "Content-Type: $content_type"; - } ---- request -POST /bar -hello ---- more_headers -Content-Type: text/plain ---- response_body -Content-Type: - - - -=== TEST 13: add type constraints ---- config - location /bar { - more_set_input_headers -t 'text/plain' 'X-Blah:yay'; - echo $http_x_blah; - } ---- request -POST /bar -hello ---- more_headers -Content-Type: text/plain ---- response_body -yay - - - -=== TEST 14: add type constraints (not matched) ---- config - location /bar { - more_set_input_headers -t 'text/plain' 'X-Blah:yay'; - echo $http_x_blah; - } ---- request -POST /bar -hello ---- more_headers -Content-Type: text/css ---- response_body eval: "\n" - - - -=== TEST 15: add type constraints (OR'd) ---- config - location /bar { - more_set_input_headers -t 'text/plain text/css' 'X-Blah:yay'; - echo $http_x_blah; - } ---- request -POST /bar -hello ---- more_headers -Content-Type: text/css ---- response_body -yay - - - -=== TEST 16: add type constraints (OR'd) ---- config - location /bar { - more_set_input_headers -t 'text/plain text/css' 'X-Blah:yay'; - echo $http_x_blah; - } ---- request -POST /bar -hello ---- more_headers -Content-Type: text/plain ---- response_body -yay - - - -=== TEST 17: add type constraints (OR'd) (not matched) ---- config - location /bar { - more_set_input_headers -t 'text/plain text/css' 'X-Blah:yay'; - echo $http_x_blah; - } ---- request -POST /bar -hello ---- more_headers -Content-Type: text/html ---- response_body eval: "\n" - - - -=== TEST 18: mix input and output cmds ---- config - location /bar { - more_set_input_headers 'X-Blah:yay'; - more_set_headers 'X-Blah:hiya'; - echo $http_x_blah; - } ---- request -GET /bar ---- response_headers -X-Blah: hiya ---- response -yay - - - -=== TEST 19: set request header at client side and replace ---- config - location /foo { - more_set_input_headers -r 'X-Foo: howdy'; - echo $http_x_foo; - } ---- request - GET /foo ---- more_headers -X-Foo: blah ---- response_headers -! X-Foo ---- response_body -howdy - - - -=== TEST 20: do no set request header at client, so no replace with -r option ---- config - location /foo { - more_set_input_headers -r 'X-Foo: howdy'; - echo "empty_header:" $http_x_foo; - } ---- request - GET /foo ---- response_headers -! X-Foo ---- response_body -empty_header: - - - -=== TEST 21: clear input headers ---- config - location /foo { - set $val 'dog'; - - more_clear_input_headers 'User-Agent'; - - proxy_pass http://127.0.0.1:$server_port/proxy; - } - location /proxy { - echo -n $echo_client_request_headers; - } ---- request - GET /foo ---- more_headers -User-Agent: my-sock ---- response_body eval -"GET /proxy HTTP/1.0\r -Host: 127.0.0.1:\$ServerPort\r -Connection: close\r -\r -" ---- skip_nginx: 3: < 0.7.46 - - - -=== TEST 22: clear input headers ---- config - location /foo { - more_clear_input_headers 'User-Agent'; - - proxy_pass http://127.0.0.1:$server_port/proxy; - } - location /proxy { - echo -n $echo_client_request_headers; - } ---- request - GET /foo ---- response_body eval -"GET /proxy HTTP/1.0\r -Host: 127.0.0.1:\$ServerPort\r -Connection: close\r -\r -" ---- skip_nginx: 3: < 0.7.46 - - - -=== TEST 23: clear input headers ---- config - location /foo { - more_clear_input_headers 'X-Foo19'; - more_clear_input_headers 'X-Foo20'; - more_clear_input_headers 'X-Foo21'; - - proxy_pass http://127.0.0.1:$server_port/proxy; - } - location /proxy { - echo -n $echo_client_request_headers; - } ---- request - GET /foo ---- more_headers eval -my $s; -for my $i (3..21) { - $s .= "X-Foo$i: $i\n"; -} -$s; ---- response_body eval -"GET /proxy HTTP/1.0\r -Host: 127.0.0.1:\$ServerPort\r -Connection: close\r -X-Foo3: 3\r -X-Foo4: 4\r -X-Foo5: 5\r -X-Foo6: 6\r -X-Foo7: 7\r -X-Foo8: 8\r -X-Foo9: 9\r -X-Foo10: 10\r -X-Foo11: 11\r -X-Foo12: 12\r -X-Foo13: 13\r -X-Foo14: 14\r -X-Foo15: 15\r -X-Foo16: 16\r -X-Foo17: 17\r -X-Foo18: 18\r -\r -" ---- skip_nginx: 3: < 0.7.46 - - - -=== TEST 24: Accept-Encoding ---- config - location /bar { - default_type 'text/plain'; - more_set_input_headers 'Accept-Encoding: gzip'; - gzip on; - gzip_min_length 1; - gzip_buffers 4 8k; - gzip_types text/plain; - } ---- user_files -">>> bar -" . ("hello" x 512) ---- request -GET /bar ---- response_headers -Content-Encoding: gzip ---- response_body_like: . - - - -=== TEST 25: rewrite + set request header ---- config - location /t { - rewrite ^ /foo last; - } - - location /foo { - more_set_input_headers 'X-Foo: howdy'; - proxy_pass http://127.0.0.1:$server_port/echo; - } - - location /echo { - echo "X-Foo: $http_x_foo"; - } ---- request - GET /foo ---- response_headers -! X-Foo ---- response_body -X-Foo: howdy - - - -=== TEST 26: clear_header should clear all the instances of the user custom header ---- config - location = /t { - more_clear_input_headers Foo; - - proxy_pass http://127.0.0.1:$server_port/echo; - } - - location = /echo { - echo "Foo: [$http_foo]"; - echo "Test-Header: [$http_test_header]"; - } ---- request -GET /t ---- more_headers -Foo: foo -Foo: bah -Test-Header: 1 ---- response_body -Foo: [] -Test-Header: [1] - - - -=== TEST 27: clear_header should clear all the instances of the builtin header ---- config - location = /t { - more_clear_input_headers Content-Type; - - proxy_pass http://127.0.0.1:$server_port/echo; - } - - location = /echo { - echo "Content-Type: [$http_content_type]"; - echo "Test-Header: [$http_test_header]"; - #echo $echo_client_request_headers; - } ---- request -GET /t ---- more_headers -Content-Type: foo -Content-Type: bah -Test-Header: 1 ---- response_body -Content-Type: [] -Test-Header: [1] - - - -=== TEST 28: Converting POST to GET - clearing headers (bug found by Matthieu Tourne, 411 error page) ---- config - location /t { - more_clear_input_headers Content-Type; - more_clear_input_headers Content-Length; - - #proxy_pass http://127.0.0.1:8888; - proxy_pass http://127.0.0.1:$server_port/back; - } - - location /back { - echo $echo_client_request_headers; - } ---- request -POST /t -hello world ---- more_headers -Content-Type: application/ocsp-request -Test-Header: 1 ---- response_body_like eval -qr/Connection: close\r -Test-Header: 1\r -\r -$/ ---- no_error_log -[error] - - - -=== TEST 29: clear_header() does not duplicate subsequent headers (old bug) ---- config - location = /t { - more_clear_input_headers Foo; - - proxy_pass http://127.0.0.1:$server_port/echo; - } - - location = /echo { - echo $echo_client_request_headers; - } ---- request -GET /t ---- more_headers -Bah: bah -Foo: foo -Test-Header: 1 -Foo1: foo1 -Foo2: foo2 -Foo3: foo3 -Foo4: foo4 -Foo5: foo5 -Foo6: foo6 -Foo7: foo7 -Foo8: foo8 -Foo9: foo9 -Foo10: foo10 -Foo11: foo11 -Foo12: foo12 -Foo13: foo13 -Foo14: foo14 -Foo15: foo15 -Foo16: foo16 -Foo17: foo17 -Foo18: foo18 -Foo19: foo19 -Foo20: foo20 -Foo21: foo21 -Foo22: foo22 ---- response_body_like eval -qr/Bah: bah\r -Test-Header: 1\r -Foo1: foo1\r -Foo2: foo2\r -Foo3: foo3\r -Foo4: foo4\r -Foo5: foo5\r -Foo6: foo6\r -Foo7: foo7\r -Foo8: foo8\r -Foo9: foo9\r -Foo10: foo10\r -Foo11: foo11\r -Foo12: foo12\r -Foo13: foo13\r -Foo14: foo14\r -Foo15: foo15\r -Foo16: foo16\r -Foo17: foo17\r -Foo18: foo18\r -Foo19: foo19\r -Foo20: foo20\r -Foo21: foo21\r -Foo22: foo22\r -/ - - - -=== TEST 30: clear input header (just more than 20 headers) ---- config - location = /t { - more_clear_input_headers "R"; - proxy_pass http://127.0.0.1:$server_port/back; - proxy_set_header Host foo; - #proxy_pass http://127.0.0.1:1234/back; - } - - location = /back { - echo -n $echo_client_request_headers; - } ---- request -GET /t ---- more_headers eval -my $s = "User-Agent: curl\n"; - -for my $i ('a' .. 'r') { - $s .= uc($i) . ": " . "$i\n" -} -$s ---- response_body eval -"GET /back HTTP/1.0\r -Host: foo\r -Connection: close\r -User-Agent: curl\r -A: a\r -B: b\r -C: c\r -D: d\r -E: e\r -F: f\r -G: g\r -H: h\r -I: i\r -J: j\r -K: k\r -L: l\r -M: m\r -N: n\r -O: o\r -P: p\r -Q: q\r -\r -" - - - -=== TEST 31: clear input header (just more than 20 headers, and add more) ---- config - location = /t { - more_clear_input_headers R; - more_set_input_headers "foo-1: 1" "foo-2: 2" "foo-3: 3" "foo-4: 4" - "foo-5: 5" "foo-6: 6" "foo-7: 7" "foo-8: 8" "foo-9: 9" - "foo-10: 10" "foo-11: 11" "foo-12: 12" "foo-13: 13" - "foo-14: 14" "foo-15: 15" "foo-16: 16" "foo-17: 17" "foo-18: 18" - "foo-19: 19" "foo-20: 20" "foo-21: 21"; - - proxy_pass http://127.0.0.1:$server_port/back; - proxy_set_header Host foo; - #proxy_pass http://127.0.0.1:1234/back; - } - - location = /back { - echo -n $echo_client_request_headers; - } ---- request -GET /t ---- more_headers eval -my $s = "User-Agent: curl\n"; - -for my $i ('a' .. 'r') { - $s .= uc($i) . ": " . "$i\n" -} -$s ---- response_body eval -"GET /back HTTP/1.0\r -Host: foo\r -Connection: close\r -User-Agent: curl\r -A: a\r -B: b\r -C: c\r -D: d\r -E: e\r -F: f\r -G: g\r -H: h\r -I: i\r -J: j\r -K: k\r -L: l\r -M: m\r -N: n\r -O: o\r -P: p\r -Q: q\r -foo-1: 1\r -foo-2: 2\r -foo-3: 3\r -foo-4: 4\r -foo-5: 5\r -foo-6: 6\r -foo-7: 7\r -foo-8: 8\r -foo-9: 9\r -foo-10: 10\r -foo-11: 11\r -foo-12: 12\r -foo-13: 13\r -foo-14: 14\r -foo-15: 15\r -foo-16: 16\r -foo-17: 17\r -foo-18: 18\r -foo-19: 19\r -foo-20: 20\r -foo-21: 21\r -\r -" - - - -=== TEST 32: clear input header (just more than 21 headers) ---- config - location = /t { - more_clear_input_headers R Q; - proxy_pass http://127.0.0.1:$server_port/back; - proxy_set_header Host foo; - #proxy_pass http://127.0.0.1:1234/back; - } - - location = /back { - echo -n $echo_client_request_headers; - } ---- request -GET /t ---- more_headers eval -my $s = "User-Agent: curl\nBah: bah\n"; - -for my $i ('a' .. 'r') { - $s .= uc($i) . ": " . "$i\n" -} -$s ---- response_body eval -"GET /back HTTP/1.0\r -Host: foo\r -Connection: close\r -User-Agent: curl\r -Bah: bah\r -A: a\r -B: b\r -C: c\r -D: d\r -E: e\r -F: f\r -G: g\r -H: h\r -I: i\r -J: j\r -K: k\r -L: l\r -M: m\r -N: n\r -O: o\r -P: p\r -\r -" - - - -=== TEST 33: clear input header (just more than 21 headers) ---- config - location = /t { - more_clear_input_headers R Q; - more_set_input_headers "foo-1: 1" "foo-2: 2" "foo-3: 3" "foo-4: 4" - "foo-5: 5" "foo-6: 6" "foo-7: 7" "foo-8: 8" "foo-9: 9" - "foo-10: 10" "foo-11: 11" "foo-12: 12" "foo-13: 13" - "foo-14: 14" "foo-15: 15" "foo-16: 16" "foo-17: 17" "foo-18: 18" - "foo-19: 19" "foo-20: 20" "foo-21: 21"; - - proxy_pass http://127.0.0.1:$server_port/back; - proxy_set_header Host foo; - #proxy_pass http://127.0.0.1:1234/back; - } - - location = /back { - echo -n $echo_client_request_headers; - } ---- request -GET /t ---- more_headers eval -my $s = "User-Agent: curl\nBah: bah\n"; - -for my $i ('a' .. 'r') { - $s .= uc($i) . ": " . "$i\n" -} -$s ---- response_body eval -"GET /back HTTP/1.0\r -Host: foo\r -Connection: close\r -User-Agent: curl\r -Bah: bah\r -A: a\r -B: b\r -C: c\r -D: d\r -E: e\r -F: f\r -G: g\r -H: h\r -I: i\r -J: j\r -K: k\r -L: l\r -M: m\r -N: n\r -O: o\r -P: p\r -foo-1: 1\r -foo-2: 2\r -foo-3: 3\r -foo-4: 4\r -foo-5: 5\r -foo-6: 6\r -foo-7: 7\r -foo-8: 8\r -foo-9: 9\r -foo-10: 10\r -foo-11: 11\r -foo-12: 12\r -foo-13: 13\r -foo-14: 14\r -foo-15: 15\r -foo-16: 16\r -foo-17: 17\r -foo-18: 18\r -foo-19: 19\r -foo-20: 20\r -foo-21: 21\r -\r -" - - - -=== TEST 34: clear X-Real-IP ---- config - location /t { - more_clear_input_headers X-Real-IP; - echo "X-Real-IP: $http_x_real_ip"; - } ---- request -GET /t ---- more_headers -X-Real-IP: 8.8.8.8 - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - if (@defined($r->headers_in->x_real_ip) && $r->headers_in->x_real_ip) { - printf("rewrite: x-real-ip: %s\n", - user_string_n($r->headers_in->x_real_ip->value->data, - $r->headers_in->x_real_ip->value->len)) - } else { - println("rewrite: no x-real-ip") - } -} - -F(ngx_http_core_content_phase) { - if (@defined($r->headers_in->x_real_ip) && $r->headers_in->x_real_ip) { - printf("content: x-real-ip: %s\n", - user_string_n($r->headers_in->x_real_ip->value->data, - $r->headers_in->x_real_ip->value->len)) - } else { - println("content: no x-real-ip") - } -} - ---- stap_out -rewrite: x-real-ip: 8.8.8.8 -content: no x-real-ip - ---- response_body -X-Real-IP: - ---- no_error_log -[error] - - - -=== TEST 35: set custom X-Real-IP ---- config - location /t { - more_set_input_headers "X-Real-IP: 8.8.4.4"; - echo "X-Real-IP: $http_x_real_ip"; - } ---- request -GET /t - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - if (@defined($r->headers_in->x_real_ip) && $r->headers_in->x_real_ip) { - printf("rewrite: x-real-ip: %s\n", - user_string_n($r->headers_in->x_real_ip->value->data, - $r->headers_in->x_real_ip->value->len)) - } else { - println("rewrite: no x-real-ip") - } - -} - -F(ngx_http_core_content_phase) { - if (@defined($r->headers_in->x_real_ip) && $r->headers_in->x_real_ip) { - printf("content: x-real-ip: %s\n", - user_string_n($r->headers_in->x_real_ip->value->data, - $r->headers_in->x_real_ip->value->len)) - } else { - println("content: no x-real-ip") - } -} - ---- stap_out -rewrite: no x-real-ip -content: x-real-ip: 8.8.4.4 - ---- response_body -X-Real-IP: 8.8.4.4 - ---- no_error_log -[error] - - - -=== TEST 36: clear Via ---- config - location /t { - more_clear_input_headers Via; - echo "Via: $http_via"; - } ---- request -GET /t ---- more_headers -Via: 1.0 fred, 1.1 nowhere.com (Apache/1.1) - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - if (@defined($r->headers_in->via) && $r->headers_in->via) { - printf("rewrite: via: %s\n", - user_string_n($r->headers_in->via->value->data, - $r->headers_in->via->value->len)) - } else { - println("rewrite: no via") - } -} - -F(ngx_http_core_content_phase) { - if (@defined($r->headers_in->via) && $r->headers_in->via) { - printf("content: via: %s\n", - user_string_n($r->headers_in->via->value->data, - $r->headers_in->via->value->len)) - } else { - println("content: no via") - } -} - ---- stap_out -rewrite: via: 1.0 fred, 1.1 nowhere.com (Apache/1.1) -content: no via - ---- response_body -Via: - ---- no_error_log -[error] - - - -=== TEST 37: set custom Via ---- config - location /t { - more_set_input_headers "Via: 1.0 fred, 1.1 nowhere.com (Apache/1.1)"; - echo "Via: $http_via"; - } ---- request -GET /t - ---- stap -F(ngx_http_headers_more_exec_input_cmd) { - if (@defined($r->headers_in->via) && $r->headers_in->via) { - printf("rewrite: via: %s\n", - user_string_n($r->headers_in->via->value->data, - $r->headers_in->via->value->len)) - } else { - println("rewrite: no via") - } - -} - -F(ngx_http_core_content_phase) { - if (@defined($r->headers_in->via) && $r->headers_in->via) { - printf("content: via: %s\n", - user_string_n($r->headers_in->via->value->data, - $r->headers_in->via->value->len)) - } else { - println("content: no via") - } -} - ---- stap_out -rewrite: no via -content: via: 1.0 fred, 1.1 nowhere.com (Apache/1.1) - ---- response_body -Via: 1.0 fred, 1.1 nowhere.com (Apache/1.1) - ---- no_error_log -[error] - - - -=== TEST 38: HTTP 0.9 (set) ---- config - location /foo { - more_set_input_headers 'X-Foo: howdy'; - echo "x-foo: $http_x_foo"; - } ---- raw_request eval -"GET /foo\r\n" ---- response_headers -! X-Foo ---- response_body -x-foo: ---- http09 - - - -=== TEST 39: HTTP 0.9 (clear) ---- config - location /foo { - more_clear_input_headers 'X-Foo'; - echo "x-foo: $http_x_foo"; - } ---- raw_request eval -"GET /foo\r\n" ---- response_headers -! X-Foo ---- response_body -x-foo: ---- http09 - - - -=== TEST 40: Host header with port and $host ---- config - location /bar { - more_set_input_headers 'Host: agentzh.org:1984'; - echo "host var: $host"; - echo "http_host var: $http_host"; - } ---- request -GET /bar ---- response_body -host var: agentzh.org -http_host var: agentzh.org:1984 - - - -=== TEST 41: Host header with upper case letters and $host ---- config - location /bar { - more_set_input_headers 'Host: agentZH.org:1984'; - echo "host var: $host"; - echo "http_host var: $http_host"; - } ---- request -GET /bar ---- response_body -host var: agentzh.org -http_host var: agentZH.org:1984 - - - -=== TEST 42: clear all and re-insert ---- config - location = /t { - more_clear_input_headers Host Connection Cache-Control Accept - User-Agent Accept-Encoding Accept-Language - Cookie; - - more_set_input_headers "Host: a" "Connection: b" "Cache-Control: c" - "Accept: d" "User-Agent: e" "Accept-Encoding: f" - "Accept-Language: g" "Cookie: h"; - - more_clear_input_headers Host Connection Cache-Control Accept - User-Agent Accept-Encoding Accept-Language - Cookie; - - more_set_input_headers "Host: a" "Connection: b" "Cache-Control: c" - "Accept: d" "User-Agent: e" "Accept-Encoding: f" - "Accept-Language: g" "Cookie: h"; - - echo ok; - } - ---- raw_request eval -"GET /t HTTP/1.1\r -Host: localhost\r -Connection: close\r -Cache-Control: max-age=0\r -Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\r -User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36\r -Accept-Encoding: gzip,deflate,sdch\r -Accept-Language: en-US,en;q=0.8\r -Cookie: test=cookie;\r -\r -" ---- response_body -ok ---- no_error_log -[error] - - - -=== TEST 43: more_set_input_header does not override request headers with multiple values ---- config - #lua_code_cache off; - location = /t { - more_set_input_headers "AAA: 111"; - - content_by_lua ' - local headers = ngx.req.get_headers() - ngx.say(headers["AAA"]) - '; - } ---- request -GET /t ---- more_headers -AAA: 123 -AAA: 456 -AAA: 678 - ---- response_body -111 ---- no_error_log -[error] - - - -=== TEST 44: clear If-Unmodified-Since req header ---- config - location = /t { - more_clear_input_headers 'If-Unmodified-Since'; - content_by_lua ' - ngx.header["Last-Modified"] = "Tue, 30 Jun 2011 12:16:36 GMT" - ngx.say("If-Unmodified-Since: ", ngx.var.http_if_unmodified_since) - '; - } ---- request -GET /t ---- more_headers -If-Unmodified-Since: Tue, 28 Jun 2011 12:16:36 GMT ---- response_body -If-Unmodified-Since: nil ---- no_error_log -[error] - - - -=== TEST 45: clear If-Match req header ---- config - location = /t { - more_clear_input_headers 'If-Match'; - echo "If-Match: $http_if_match"; - } ---- request -GET /t ---- more_headers -If-Match: abc ---- response_body -If-Match: ---- no_error_log -[error] - - - -=== TEST 46: clear If-None-Match req header ---- config - location = /t { - more_clear_input_headers 'If-None-Match'; - echo "If-None-Match: $http_if_none_match"; - } ---- request -GET /t ---- more_headers -If-None-Match: * ---- response_body -If-None-Match: ---- no_error_log -[error] - - - -=== TEST 47: set the Destination request header for WebDav ---- config - location = /a.txt { - more_set_input_headers "Destination: /b.txt"; - dav_methods MOVE; - dav_access all:rw; - root html; - } - ---- user_files ->>> a.txt -hello, world! - ---- request -MOVE /a.txt - ---- response_body ---- no_error_log -client sent no "Destination" header -[error] ---- error_code: 204 - - - -=== TEST 48: more_set_input_headers + X-Forwarded-For ---- config - location = /t { - more_set_input_headers "X-Forwarded-For: 8.8.8.8"; - proxy_pass http://127.0.0.1:$server_port/back; - proxy_set_header Foo $proxy_add_x_forwarded_for; - } - - location = /back { - echo "Foo: $http_foo"; - } - ---- request -GET /t - ---- response_body -Foo: 8.8.8.8, 127.0.0.1 ---- no_error_log -[error] - - - -=== TEST 49: more_clear_input_headers + X-Forwarded-For ---- config - location = /t { - more_clear_input_headers "X-Forwarded-For"; - proxy_pass http://127.0.0.1:$server_port/back; - proxy_set_header Foo $proxy_add_x_forwarded_for; - } - - location = /back { - echo "Foo: $http_foo"; - } - ---- request -GET /t - ---- more_headers -X-Forwarded-For: 8.8.8.8 ---- response_body -Foo: 127.0.0.1 ---- no_error_log -[error] - - - -=== TEST 50: clear input headers with wildcard ---- config - location /hello { - more_clear_input_headers 'X-Hidden-*'; - content_by_lua ' - ngx.say("X-Hidden-One: ", ngx.var.http_x_hidden_one) - ngx.say("X-Hidden-Two: ", ngx.var.http_x_hidden_two) - '; - } ---- request - GET /hello ---- more_headers -X-Hidden-One: i am hidden -X-Hidden-Two: me 2 ---- response_body -X-Hidden-One: nil -X-Hidden-Two: nil - - - -=== TEST 51: make sure wildcard doesn't affect more_set_input_headers ---- config - location /hello { - more_set_input_headers 'X-Hidden-*: lol'; - content_by_lua ' - ngx.say("X-Hidden-One: ", ngx.var.http_x_hidden_one) - ngx.say("X-Hidden-Two: ", ngx.var.http_x_hidden_two) - '; - } ---- request - GET /hello ---- more_headers -X-Hidden-One: i am hidden -X-Hidden-Two: me 2 ---- response_body -X-Hidden-One: i am hidden -X-Hidden-Two: me 2 diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/phase.t b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/phase.t deleted file mode 100644 index 11183db..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/phase.t +++ /dev/null @@ -1,25 +0,0 @@ -# vi:filetype=perl - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => 3; - -no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: simple set (1 arg) ---- config - location /foo { - deny all; - more_set_headers 'X-Foo: Blah'; - } ---- request - GET /foo ---- response_headers -X-Foo: Blah ---- response_body_like: 403 Forbidden ---- error_code: 403 diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/sanity.t b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/sanity.t deleted file mode 100644 index 47d65e3..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/sanity.t +++ /dev/null @@ -1,628 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * 123; - -#master_on(); -#workers(2); -log_level("warn"); -no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: simple set (1 arg) ---- config - location /foo { - echo hi; - more_set_headers 'X-Foo: Blah'; - } ---- request - GET /foo ---- response_headers -X-Foo: Blah ---- response_body -hi - - - -=== TEST 2: simple set (2 args) ---- config - location /foo { - echo hi; - more_set_headers 'X-Foo: Blah' 'X-Bar: hi'; - } ---- request - GET /foo ---- response_headers -X-Foo: Blah -X-Bar: hi ---- response_body -hi - - - -=== TEST 3: two sets in a single location ---- config - location /two { - echo hi; - more_set_headers 'X-Foo: Blah' - more_set_headers 'X-Bar: hi'; - } ---- request - GET /two ---- response_headers -X-Foo: Blah -X-Bar: hi ---- response_body -hi - - - -=== TEST 4: two sets in a single location (for 404 too) ---- config - location /two { - more_set_headers 'X-Foo: Blah' - more_set_headers 'X-Bar: hi'; - return 404; - } ---- request - GET /two ---- response_headers -X-Foo: Blah -X-Bar: hi ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 5: set a header then clears it (500) ---- config - location /two { - more_set_headers 'X-Foo: Blah'; - more_set_headers 'X-Foo:'; - return 500; - } ---- request - GET /two ---- response_headers -! X-Foo -! X-Bar ---- response_body_like: 500 Internal Server Error ---- error_code: 500 - - - -=== TEST 6: set a header only when 500 (matched) ---- config - location /bad { - more_set_headers -s 500 'X-Mine: Hiya'; - more_set_headers -s 404 'X-Yours: Blah'; - return 500; - } ---- request - GET /bad ---- response_headers -X-Mine: Hiya -! X-Yours ---- response_body_like: 500 Internal Server Error ---- error_code: 500 - - - -=== TEST 7: set a header only when 500 (not matched with 200) ---- config - location /bad { - more_set_headers -s 500 'X-Mine: Hiya'; - more_set_headers -s 404 'X-Yours: Blah'; - echo hello; - } ---- request - GET /bad ---- response_headers -! X-Mine -! X-Yours ---- response_body -hello ---- error_code: 200 - - - -=== TEST 8: set a header only when 500 (not matched with 404) ---- config - location /bad { - more_set_headers -s 500 'X-Mine: Hiya'; - more_set_headers -s 404 'X-Yours: Blah'; - return 404; - } ---- request - GET /bad ---- response_headers -! X-Mine -X-Yours: Blah ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 9: more conditions ---- config - location /bad { - more_set_headers -s '503 404' 'X-Mine: Hiya'; - more_set_headers -s ' 404 413 ' 'X-Yours: Blah'; - return 503; - } ---- request - GET /bad ---- response_headers -X-Mine: Hiya -! X-Yours ---- response_body_like: 503 Service ---- error_code: 503 - - - -=== TEST 10: more conditions ---- config - location /bad { - more_set_headers -s '503 404' 'X-Mine: Hiya'; - more_set_headers -s ' 404 413 ' 'X-Yours: Blah'; - return 404; - } ---- request - GET /bad ---- response_headers -X-Mine: Hiya -X-Yours: Blah ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 11: more conditions ---- config - location /bad { - more_set_headers -s '503 404' 'X-Mine: Hiya'; - more_set_headers -s ' 404 413 ' 'X-Yours: Blah'; - return 413; - } ---- request - GET /bad ---- response_headers -! X-Mine -X-Yours: Blah ---- response_body_like: 413 Request Entity Too Large ---- error_code: 413 - - - -=== TEST 12: simple -t ---- config - location /bad { - default_type 'text/css'; - more_set_headers -t 'text/css' 'X-CSS: yes'; - echo hi; - } ---- request - GET /bad ---- response_headers -X-CSS: yes ---- response_body -hi - - - -=== TEST 13: simple -t (not matched) ---- config - location /bad { - default_type 'text/plain'; - more_set_headers -t 'text/css' 'X-CSS: yes'; - echo hi; - } ---- request - GET /bad ---- response_headers -! X-CSS ---- response_body -hi - - - -=== TEST 14: multiple -t (not matched) ---- config - location /bad { - default_type 'text/plain'; - more_set_headers -t 'text/javascript' -t 'text/css' 'X-CSS: yes'; - echo hi; - } ---- request - GET /bad ---- response_headers -! X-CSS ---- response_body -hi - - - -=== TEST 15: multiple -t (matched) ---- config - location /bad { - default_type 'text/plain'; - more_set_headers -t 'text/javascript' -t 'text/plain' 'X-CSS: yes'; - echo hi; - } ---- request - GET /bad ---- response_headers -X-CSS: yes ---- response_body -hi - - - -=== TEST 16: multiple -t (matched) ---- config - location /bad { - default_type 'text/javascript'; - more_set_headers -t 'text/javascript' -t 'text/plain' 'X-CSS: yes'; - echo hi; - } ---- request - GET /bad ---- response_headers -X-CSS: yes ---- response_body -hi - - - -=== TEST 17: multiple -t (matched) with extra spaces ---- config - location /bad { - default_type 'text/javascript'; - more_set_headers -t ' text/javascript ' -t 'text/plain' 'X-CSS: yes'; - echo hi; - } ---- request - GET /bad ---- response_headers -X-CSS: yes ---- response_body -hi - - - -=== TEST 18: multiple -t merged ---- config - location /bad { - default_type 'text/javascript'; - more_set_headers -t ' text/javascript text/plain' 'X-CSS: yes'; - echo hi; - } ---- request - GET /bad ---- response_headers -X-CSS: yes ---- response_body -hi - - - -=== TEST 19: multiple -t merged (2) ---- config - location /bad { - default_type 'text/plain'; - more_set_headers -t ' text/javascript text/plain' 'X-CSS: yes'; - echo hi; - } ---- request - GET /bad ---- response_headers -X-CSS: yes ---- response_body -hi - - - -=== TEST 20: multiple -s option in a directive (not matched) ---- config - location /bad { - more_set_headers -s 404 -s 500 'X-status: howdy'; - echo hi; - } ---- request - GET /bad ---- response_headers -! X-status ---- response_body -hi - - - -=== TEST 21: multiple -s option in a directive (matched 404) ---- config - location /bad { - more_set_headers -s 404 -s 500 'X-status: howdy'; - return 404; - } ---- request - GET /bad ---- response_headers -X-status: howdy ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 22: multiple -s option in a directive (matched 500) ---- config - location /bad { - more_set_headers -s 404 -s 500 'X-status: howdy'; - return 500; - } ---- request - GET /bad ---- response_headers -X-status: howdy ---- response_body_like: 500 Internal Server Error ---- error_code: 500 - - - -=== TEST 23: -s mixed with -t ---- config - location /bad { - default_type 'text/html'; - more_set_headers -s 404 -s 200 -t 'text/html' 'X-status: howdy2'; - return 404; - } ---- request - GET /bad ---- response_headers -X-status: howdy2 ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 24: -s mixed with -t ---- config - location /bad { - default_type 'text/html'; - more_set_headers -s 404 -s 200 -t 'text/plain' 'X-status: howdy2'; - return 404; - } ---- request - GET /bad ---- response_headers -! X-status ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 25: -s mixed with -t ---- config - location /bad { - default_type 'text/html'; - more_set_headers -s 404 -s 200 -t 'text/html' 'X-status: howdy2'; - echo hi; - } ---- request - GET /bad ---- response_headers -X-status: howdy2 ---- response_body -hi ---- error_code: 200 - - - -=== TEST 26: -s mixed with -t ---- config - location /bad { - default_type 'text/html'; - more_set_headers -s 500 -s 200 -t 'text/html' 'X-status: howdy2'; - return 404; - } ---- request - GET /bad ---- response_headers -! X-status ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 27: merge from the upper level ---- config - more_set_headers -s 404 -t 'text/html' 'X-status2: howdy3'; - location /bad { - default_type 'text/html'; - more_set_headers -s 500 -s 200 -t 'text/html' 'X-status: howdy2'; - return 404; - } ---- request - GET /bad ---- response_headers -X-status2: howdy3 -! X-status ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 28: merge from the upper level ---- config - more_set_headers -s 404 -t 'text/html' 'X-status2: howdy3'; - location /bad { - default_type 'text/html'; - more_set_headers -s 500 -s 200 -t 'text/html' 'X-status: howdy2'; - echo yeah; - } ---- request - GET /bad ---- response_headers -! X-status2 -X-status: howdy2 ---- response_body -yeah ---- error_code: 200 - - - -=== TEST 29: override settings by inheritance ---- config - more_set_headers -s 404 -t 'text/html' 'X-status: yeah'; - location /bad { - default_type 'text/html'; - more_set_headers -s 404 -t 'text/html' 'X-status: nope'; - return 404; - } ---- request - GET /bad ---- response_headers -X-status: nope ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 30: append settings by inheritance ---- config - more_set_headers -s 404 -t 'text/html' 'X-status: yeah'; - location /bad { - default_type 'text/html'; - more_set_headers -s 404 -t 'text/html' 'X-status2: nope'; - return 404; - } ---- request - GET /bad ---- response_headers -X-status: yeah -X-status2: nope ---- response_body_like: 404 Not Found ---- error_code: 404 - - - -=== TEST 31: clear headers with wildcard ---- config - location = /backend { - add_header X-Hidden-One "i am hidden"; - add_header X-Hidden-Two "me 2"; - echo hi; - } - location /hello { - more_clear_headers 'X-Hidden-*'; - proxy_pass http://127.0.0.1:$server_port/backend; - } ---- request - GET /hello ---- response_headers -! X-Hidden-One -! X-Hidden-Two ---- response_body -hi - - - -=== TEST 32: clear duplicate headers ---- config - location = /backend { - add_header pragma no-cache; - add_header pragma no-cache; - echo hi; - } - location /hello { - more_clear_headers 'pragma'; - proxy_pass http://127.0.0.1:$server_port/backend; - } ---- request - GET /hello ---- response_headers -!pragma ---- response_body -hi - - - -=== TEST 33: HTTP 0.9 (set) ---- config - location /foo { - more_set_headers 'X-Foo: howdy'; - echo ok; - } ---- raw_request eval -"GET /foo\r\n" ---- response_headers -! X-Foo ---- response_body -ok ---- http09 - - - -=== TEST 34: use the -a option to append the cookie field ---- config - location /cookie { - more_set_headers -a 'Set-Cookie: name=lynch'; - echo ok; - } ---- request - GET /cookie ---- response_headers -Set-Cookie: name=lynch ---- response_body -ok - - - -=== TEST 35: the original Set-Cookie fields will not be overwritten, when using the -a option ---- config - location /cookie { - more_set_headers 'Set-Cookie: name=lynch'; - more_set_headers -a 'Set-Cookie: born=1981'; - echo ok; - } ---- request - GET /cookie ---- raw_response_headers_like eval -"Set-Cookie: name=lynch\r\nSet-Cookie: born=1981\r\n" ---- response_body -ok - - - -=== TEST 36: The behavior of builtin headers can not be changed ---- config - location /foo { - more_set_headers -a "Server: myServer"; - echo ok; - } ---- request - GET /foo ---- must_die ---- error_log chomp -can not append builtin headers ---- suppress_stderr - - - -=== TEST 37: can not use -a option with more_clear_headers ---- config - location /foo { - more_clear_headers -a 'Content-Type'; - echo ok; - } ---- request - GET /foo ---- must_die ---- error_log chomp -invalid option name: "-a" ---- suppress_stderr diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/subrequest.t b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/subrequest.t deleted file mode 100644 index 9443eca..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/subrequest.t +++ /dev/null @@ -1,68 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; # 'no_plan'; - -plan tests => blocks() * 3; - -no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: vars in input header directives ---- config - location /main { - echo_location /foo; - echo "main: $http_user_agent"; - } - location /foo { - set $val 'dog'; - - more_set_input_headers 'User-Agent: $val'; - - proxy_pass http://127.0.0.1:$server_port/proxy; - } - location /proxy { - echo "sub: $http_user_agent"; - } ---- request - GET /main ---- more_headers -User-Agent: my-sock ---- response_body -sub: dog -main: dog ---- response_headers -! Host ---- skip_nginx: 3: < 0.7.46 - - - -=== TEST 2: vars in input header directives ---- config - location /main { - #more_set_input_headers 'User-Agent: cat'; - echo_location /foo; - echo "main: $http_user_agent"; - } - location /foo { - set $val 'dog'; - - more_set_input_headers 'User-Agent: $val'; - - proxy_pass http://127.0.0.1:$server_port/proxy; - #echo $http_user_agent; - } - location /proxy { - echo "sub: $http_user_agent"; - } ---- request - GET /main ---- response_body -sub: dog -main: dog ---- response_headers -! Host ---- skip_nginx: 3: < 0.7.46 diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/unused.t b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/unused.t deleted file mode 100644 index c51f91c..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/unused.t +++ /dev/null @@ -1,174 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (blocks() * 4 + 2); - -#master_on(); -#workers(2); -log_level("warn"); -no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: used output filter ---- config - location /foo { - echo hi; - more_set_headers "Foo: bar"; - } ---- request - GET /foo ---- response_headers -Foo: bar ---- response_body -hi ---- error_log -headers more header filter ---- no_error_log -[error] ---- log_level: debug - - - -=== TEST 2: unused output filter (none) ---- config - location /foo { - echo hi; - } ---- request - GET /foo ---- response_body -hi ---- no_error_log -headers more header filter -[error] ---- log_level: debug - - - -=== TEST 3: unused output filter (with more_set_input_headers only) ---- config - location /foo { - more_set_input_headers "Foo: bar"; - echo hi; - } ---- request - GET /foo ---- response_body -hi ---- no_error_log -headers more header filter -[error] ---- log_level: debug - - - -=== TEST 4: used rewrite handler ---- config - location /foo { - more_set_input_headers "Foo: bar"; - echo hi; - } ---- request - GET /foo ---- response_body -hi ---- error_log -headers more rewrite handler ---- no_error_log -[error] ---- log_level: debug - - - -=== TEST 5: unused rewrite handler (none) ---- config - location /foo { - #more_set_input_headers "Foo: bar"; - echo hi; - } ---- request - GET /foo ---- response_body -hi ---- no_error_log -headers more rewrite handler -[error] ---- log_level: debug - - - -=== TEST 6: unused rewrite handler (with output header filters) ---- config - location /foo { - #more_set_input_headers "Foo: bar"; - echo hi; - more_set_headers "Foo: bar"; - } ---- request - GET /foo ---- response_headers -Foo: bar ---- response_body -hi ---- no_error_log -headers more rewrite handler -[error] ---- log_level: debug - - - -=== TEST 7: multiple http {} blocks (filter) -This test case won't run with nginx 1.9.3+ since duplicate http {} blocks -have been prohibited since then. ---- SKIP ---- config - location /foo { - echo hi; - more_set_headers 'Foo: bar'; - } ---- post_main_config - http { - } - ---- request - GET /foo ---- response_body -hi ---- response_headers -Foo: bar ---- no_error_log -[error] ---- error_log -headers more header filter ---- log_level: debug - - - -=== TEST 8: multiple http {} blocks (handler) -This test case won't run with nginx 1.9.3+ since duplicate http {} blocks -have been prohibited since then. ---- SKIP ---- config - location /foo { - more_set_input_headers 'Foo: bar'; - echo $http_foo; - } ---- post_main_config - http { - } - ---- request - GET /foo ---- response_body -bar ---- no_error_log -headers more header handler -[error] ---- log_level: debug diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/vars.t b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/vars.t deleted file mode 100644 index 04c75c3..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/t/vars.t +++ /dev/null @@ -1,58 +0,0 @@ -# vi:ft= - -use lib 'lib'; -use Test::Nginx::Socket; # 'no_plan'; - -plan tests => 9; - -no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: vars ---- config - location /foo { - echo hi; - set $val 'hello, world'; - more_set_headers 'X-Foo: $val'; - } ---- request - GET /foo ---- response_headers -X-Foo: hello, world ---- response_body -hi - - - -=== TEST 2: vars in both key and val ---- config - location /foo { - echo hi; - set $val 'hello, world'; - more_set_headers '$val: $val'; - } ---- request - GET /foo ---- response_headers -$val: hello, world ---- response_body -hi - - - -=== TEST 3: vars in input header directives ---- config - location /foo { - set $val 'dog'; - more_set_input_headers 'Host: $val'; - echo $host; - } ---- request - GET /foo ---- response_body -dog ---- response_headers -Host: diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/util/build.sh b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/util/build.sh deleted file mode 100755 index 00a191f..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/util/build.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -# this file is mostly meant to be used by the author himself. - -root=`pwd` -version=$1 -home=~ -force=$2 -pcre2_opt="" -if [ "$WITHOUT_PCRE2" = "1" ]; then - pcre2_opt="--without-pcre2" -fi - - #--with-cc=gcc46 \ - -ngx-build $force $version \ - --with-ld-opt="-L$PCRE_LIB -Wl,-rpath,$PCRE_LIB:$LIBDRIZZLE_LIB" \ - --without-mail_pop3_module \ - --without-mail_imap_module \ - --without-mail_smtp_module \ - --without-http_upstream_ip_hash_module \ - --without-http_empty_gif_module \ - --without-http_memcached_module \ - --without-http_referer_module \ - --without-http_autoindex_module \ - --without-http_auth_basic_module \ - --without-http_userid_module \ - $pcre2_opt \ - --with-http_realip_module \ - --with-http_dav_module \ - --add-module=$root/../eval-nginx-module \ - --add-module=$root/../lua-nginx-module \ - --add-module=$root/../echo-nginx-module \ - --add-module=$root $opts \ - --with-debug - #--add-module=$root/../ndk-nginx-module \ - #--without-http_ssi_module # we cannot disable ssi because echo_location_async depends on it (i dunno why?!) - diff --git a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/valgrind.suppress b/modules_deb/libnginx-mod-http-headers-more-filter-0.38/valgrind.suppress deleted file mode 100644 index d51de70..0000000 --- a/modules_deb/libnginx-mod-http-headers-more-filter-0.38/valgrind.suppress +++ /dev/null @@ -1,135 +0,0 @@ -{ - - Memcheck:Leak - fun:malloc - fun:ngx_alloc - obj:* -} -{ - - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_calloc - fun:ngx_event_process_init -} -{ - - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_event_process_init -} -{ - - Memcheck:Param - epoll_ctl(event) - fun:epoll_ctl -} -{ - - Memcheck:Cond - fun:memcpy - fun:ngx_vslprintf - fun:ngx_log_error_core - fun:ngx_http_charset_header_filter -} -{ - nginx-core-process-init - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_event_process_init -} -{ - nginx-core-crc32-init - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_crc32_table_init - fun:main -} -{ - palloc_large_for_init_request - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_palloc_large - fun:ngx_palloc - fun:ngx_pcalloc - fun:ngx_http_init_request - fun:ngx_epoll_process_events - fun:ngx_process_events_and_timers -} -{ - palloc_large_for_create_temp_buf - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_palloc_large - fun:ngx_palloc - fun:ngx_create_temp_buf - fun:ngx_http_init_request - fun:ngx_epoll_process_events - fun:ngx_process_events_and_timers -} -{ - accept_create_pool - Memcheck:Leak - fun:memalign - fun:posix_memalign - fun:ngx_memalign - fun:ngx_create_pool - fun:ngx_event_accept - fun:ngx_epoll_process_events - fun:ngx_process_events_and_timers -} -{ - create_pool_for_init_req - Memcheck:Leak - fun:memalign - fun:posix_memalign - fun:ngx_memalign - fun:ngx_create_pool - fun:ngx_http_init_request - fun:ngx_epoll_process_events - fun:ngx_process_events_and_timers -} -{ - - Memcheck:Addr8 - fun:getenv - fun:gcov_exit - fun:exit - fun:ngx_master_process_exit -} -{ - - Memcheck:Cond - fun:index - fun:expand_dynamic_string_token - fun:_dl_map_object - fun:map_doit - fun:_dl_catch_error - fun:do_preload - fun:dl_main -} -{ - - Memcheck:Leak - match-leak-kinds: definite - fun:malloc - fun:ngx_alloc - fun:ngx_set_environment - fun:ngx_single_process_cycle -} -{ - - Memcheck:Leak - match-leak-kinds: definite - fun:malloc - fun:ngx_alloc - fun:ngx_set_environment - fun:ngx_worker_process_init - fun:ngx_worker_process_cycle -} diff --git a/modules_deb/libnginx-mod-http-memc-0.20/.gitattributes b/modules_deb/libnginx-mod-http-memc-0.20/.gitattributes deleted file mode 100644 index 6fe6f35..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.t linguist-language=Text diff --git a/modules_deb/libnginx-mod-http-memc-0.20/.gitignore b/modules_deb/libnginx-mod-http-memc-0.20/.gitignore deleted file mode 100644 index ed5f748..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/.gitignore +++ /dev/null @@ -1,54 +0,0 @@ -.libs -*.t_ -*.swp -*.slo -*.la -*.swo -*.lo -*~ -*.o -print.txt -.rsync -*.tar.gz -dist -build[789] -build -tags -update-readme -*.tmp -test/Makefile -test/blib -test.sh -t.sh -t/t.sh -test/t/servroot/ -releng -reset -*.t_ -genmobi.sh -*.mobi -misc/chunked -reindex -src/response.c -src/handler.h -src/util.c -src/module.c -src/handler.c -src/response.rl -src/response.h -src/module.h -src/util.h -src/request.h -src/request.c -ctags -nginx -*.html -t/servroot/ -all -Changes -build1[0-9] -go -buildroot/ -analyze -*.plist -Makefile diff --git a/modules_deb/libnginx-mod-http-memc-0.20/.travis.yml b/modules_deb/libnginx-mod-http-memc-0.20/.travis.yml deleted file mode 100644 index e695941..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/.travis.yml +++ /dev/null @@ -1,62 +0,0 @@ -sudo: required -dist: bionic - -os: linux - -language: c - -compiler: - - gcc - -addons: - apt: - packages: [ axel, cpanminus, libtest-base-perl, libtext-diff-perl, liburi-perl, libwww-perl, libtest-longstring-perl, liblist-moreutils-perl ] - -cache: - apt: true - -env: - global: - - LUAJIT_PREFIX=/opt/luajit21 - - LUAJIT_LIB=$LUAJIT_PREFIX/lib - - LD_LIBRARY_PATH=$LUAJIT_LIB:$LD_LIBRARY_PATH - - LUAJIT_INC=$LUAJIT_PREFIX/include/luajit-2.1 - - LUA_INCLUDE_DIR=$LUAJIT_INC - - LUA_CMODULE_DIR=/lib - - JOBS=3 - - NGX_BUILD_JOBS=$JOBS - matrix: - - NGINX_VERSION=1.17.8 - - NGINX_VERSION=1.19.9 - -services: - - memcache - -install: - - git clone https://github.com/openresty/nginx-devel-utils.git - - git clone https://github.com/openresty/openresty.git ../openresty - - git clone https://github.com/openresty/no-pool-nginx.git ../no-pool-nginx - - git clone https://github.com/simpl/ngx_devel_kit.git ../ndk-nginx-module - - git clone https://github.com/openresty/test-nginx.git - - git clone -b v2.1-agentzh https://github.com/openresty/luajit2.git - - git clone https://github.com/openresty/lua-nginx-module.git ../lua-nginx-module - - git clone https://github.com/openresty/lua-resty-core.git ../lua-resty-core - - git clone https://github.com/openresty/lua-resty-lrucache.git ../lua-resty-lrucache - - git clone https://github.com/openresty/nginx-eval-module.git ../eval-nginx-module - - git clone https://github.com/openresty/echo-nginx-module.git ../echo-nginx-module - - git clone https://github.com/openresty/set-misc-nginx-module.git ../set-misc-nginx-module - -script: - - sudo iptables -I OUTPUT -p tcp --dst 127.0.0.2 --dport 12345 -j DROP - - sudo iptables -I OUTPUT -p udp --dst 127.0.0.2 --dport 12345 -j DROP - - cd luajit2 - - make -j$JOBS CCDEBUG=-g Q= PREFIX=$LUAJIT_PREFIX CC=$CC XCFLAGS='-DLUA_USE_APICHECK -DLUA_USE_ASSERT' > build.log 2>&1 || (cat build.log && exit 1) - - sudo make install PREFIX=$LUAJIT_PREFIX > build.log 2>&1 || (cat build.log && exit 1) - - cd .. - - perlbrew off && cd test-nginx && sudo cpanm . && cd .. - - export PATH=$PWD/work/nginx/sbin:$PWD/nginx-devel-utils:$PATH - - export NGX_BUILD_CC=$CC - - sh util/build.sh $NGINX_VERSION > build.log 2>&1 || (cat build.log && exit 1) - - nginx -V - - ldd `which nginx`|grep luajit - - prove -I. -r t diff --git a/modules_deb/libnginx-mod-http-memc-0.20/README.markdown b/modules_deb/libnginx-mod-http-memc-0.20/README.markdown deleted file mode 100644 index 7f82bd1..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/README.markdown +++ /dev/null @@ -1,813 +0,0 @@ -Name -==== - -**ngx_memc** - An extended version of the standard memcached module that supports set, add, delete, and many more memcached commands. - -*This module is not distributed with the Nginx source.* See [the installation instructions](#installation). - -Table of Contents -================= - -* [Version](#version) -* [Synopsis](#synopsis) -* [Description](#description) - * [Keep-alive connections to memcached servers](#keep-alive-connections-to-memcached-servers) - * [How it works](#how-it-works) -* [Memcached commands supported](#memcached-commands-supported) - * [get $memc_key](#get-memc_key) - * [set $memc_key $memc_flags $memc_exptime $memc_value](#set-memc_key-memc_flags-memc_exptime-memc_value) - * [add $memc_key $memc_flags $memc_exptime $memc_value](#add-memc_key-memc_flags-memc_exptime-memc_value) - * [replace $memc_key $memc_flags $memc_exptime $memc_value](#replace-memc_key-memc_flags-memc_exptime-memc_value) - * [append $memc_key $memc_flags $memc_exptime $memc_value](#append-memc_key-memc_flags-memc_exptime-memc_value) - * [prepend $memc_key $memc_flags $memc_exptime $memc_value](#prepend-memc_key-memc_flags-memc_exptime-memc_value) - * [delete $memc_key](#delete-memc_key) - * [delete $memc_key $memc_exptime](#delete-memc_key-memc_exptime) - * [incr $memc_key $memc_value](#incr-memc_key-memc_value) - * [decr $memc_key $memc_value](#decr-memc_key-memc_value) - * [flush_all](#flush_all) - * [flush_all $memc_exptime](#flush_all-memc_exptime) - * [stats](#stats) - * [version](#version) -* [Directives](#directives) - * [memc_pass](#memc_pass) - * [memc_cmds_allowed](#memc_cmds_allowed) - * [memc_flags_to_last_modified](#memc_flags_to_last_modified) - * [memc_connect_timeout](#memc_connect_timeout) - * [memc_send_timeout](#memc_send_timeout) - * [memc_read_timeout](#memc_read_timeout) - * [memc_buffer_size](#memc_buffer_size) - * [memc_ignore_client_abort](#memc_ignore_client_abort) -* [Installation](#installation) - * [For Developers](#for-developers) -* [Compatibility](#compatibility) -* [Community](#community) - * [English Mailing List](#english-mailing-list) - * [Chinese Mailing List](#chinese-mailing-list) -* [Report Bugs](#report-bugs) -* [Source Repository](#source-repository) -* [Changes](#changes) -* [Test Suite](#test-suite) -* [TODO](#todo) -* [Getting involved](#getting-involved) -* [Author](#author) -* [Copyright & License](#copyright--license) -* [See Also](#see-also) - -Version -======= - -This document describes ngx_memc [v0.19](http://github.com/openresty/memc-nginx-module/tags) released on 19 April 2018. - -Synopsis -======== - -```nginx - - # GET /foo?key=dog - # - # POST /foo?key=cat - # Cat's value... - # - # PUT /foo?key=bird - # Bird's value... - # - # DELETE /foo?key=Tiger - location /foo { - set $memc_key $arg_key; - - # $memc_cmd defaults to get for GET, - # add for POST, set for PUT, and - # delete for the DELETE request method. - - memc_pass 127.0.0.1:11211; - } -``` - -```nginx - - # GET /bar?cmd=get&key=cat - # - # POST /bar?cmd=set&key=dog - # My value for the "dog" key... - # - # DELETE /bar?cmd=delete&key=dog - # GET /bar?cmd=delete&key=dog - location /bar { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_flags $arg_flags; # defaults to 0 - set $memc_exptime $arg_exptime; # defaults to 0 - - memc_pass 127.0.0.1:11211; - } -``` - -```nginx - - # GET /bar?cmd=get&key=cat - # GET /bar?cmd=set&key=dog&val=animal&flags=1234&exptime=2 - # GET /bar?cmd=delete&key=dog - # GET /bar?cmd=flush_all - location /bar { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_flags $arg_flags; # defaults to 0 - set $memc_exptime $arg_exptime; # defaults to 0 - - memc_cmds_allowed get set add delete flush_all; - - memc_pass 127.0.0.1:11211; - } -``` - -```nginx - - http { - ... - upstream backend { - server 127.0.0.1:11984; - server 127.0.0.1:11985; - } - server { - location /stats { - set $memc_cmd stats; - memc_pass backend; - } - ... - } - } - ... -``` - -```nginx - - # read the memcached flags into the Last-Modified header - # to respond 304 to conditional GET - location /memc { - set $memc_key $arg_key; - - memc_pass 127.0.0.1:11984; - - memc_flags_to_last_modified on; - } -``` - -```nginx - - location /memc { - set $memc_key foo; - set $memc_cmd get; - - # access the unix domain socket listend by memcached - memc_pass unix:/tmp/memcached.sock; - } -``` - -Description -=========== - -This module extends the standard [memcached module](http://nginx.org/en/docs/http/ngx_http_memcached_module.html) to support almost the whole [memcached ascii protocol](http://code.sixapart.com/svn/memcached/trunk/server/doc/protocol.txt). - -It allows you to define a custom [REST](http://en.wikipedia.org/wiki/REST) interface to your memcached servers or access memcached in a very efficient way from within the nginx server by means of subrequests or [independent fake requests](http://github.com/srlindsay/nginx-independent-subrequest). - -This module is not supposed to be merged into the Nginx core because I've used [Ragel](http://www.complang.org/ragel/) to generate the memcached response parsers (in C) for joy :) - -If you are going to use this module to cache location responses out of the box, try [srcache-nginx-module](http://github.com/openresty/srcache-nginx-module) with this module to achieve that. - -When used in conjunction with [lua-nginx-module](http://github.com/openresty/lua-nginx-module), it is recommended to use the [lua-resty-memcached](http://github.com/openresty/lua-resty-memcached) library instead of this module though, because the former is much more flexible and memory-efficient. - -[Back to TOC](#table-of-contents) - -Keep-alive connections to memcached servers -------------------------------------------- - -You need [HttpUpstreamKeepaliveModule](http://wiki.nginx.org/HttpUpstreamKeepaliveModule) together with this module for keep-alive TCP connections to your backend memcached servers. - -Here's a sample configuration: - -```nginx - - http { - upstream backend { - server 127.0.0.1:11211; - - # a pool with at most 1024 connections - # and do not distinguish the servers: - keepalive 1024; - } - - server { - ... - location /memc { - set $memc_cmd get; - set $memc_key $arg_key; - memc_pass backend; - } - } - } -``` - -[Back to TOC](#table-of-contents) - -How it works ------------- - -It implements the memcached TCP protocol all by itself, based upon the `upstream` mechanism. Everything involving I/O is non-blocking. - -The module itself does not keep TCP connections to the upstream memcached servers across requests, just like other upstream modules. For a working solution, see section [Keep-alive connections to memcached servers](#keep-alive-connections-to-memcached-servers). - -[Back to TOC](#table-of-contents) - -Memcached commands supported -============================ - -The memcached storage commands [set](#set-memc_key-memc_flags-memc_exptime-memc_value), [add](#add-memc_key-memc_flags-memc_exptime-memc_value), [replace](#replace-memc_key-memc_flags-memc_exptime-memc_value), [prepend](#prepend-memc_key-memc_flags-memc_exptime-memc_value), and [append](#append-memc_key-memc_flags-memc_exptime-memc_value) uses the `$memc_key` as the key, `$memc_exptime` as the expiration time (or delay) (defaults to 0), `$memc_flags` as the flags (defaults to 0), to build the corresponding memcached queries. - -If `$memc_value` is not defined at all, then the request body will be used as the value of the `$memc_value` except for the [incr](#incr-memc_key-memc_value) and [decr](#decr-memc_key-memc_value) commands. Note that if `$memc_value` is defined as an empty string (`""`), that empty string will still be used as the value as is. - -The following memcached commands have been implemented and tested (with their parameters marked by corresponding -nginx variables defined by this module): - -[Back to TOC](#table-of-contents) - -get $memc_key -------------- - -Retrieves the value using a key. - -```nginx - - location /foo { - set $memc_cmd 'get'; - set $memc_key 'my_key'; - - memc_pass 127.0.0.1:11211; - - add_header X-Memc-Flags $memc_flags; - } -``` - -Returns `200 OK` with the value put into the response body if the key is found, or `404 Not Found` otherwise. The `flags` number will be set into the `$memc_flags` variable so it's often desired to put that info into the response headers by means of the standard [add_header directive](http://nginx.org/en/docs/http/ngx_http_headers_module.html#add_header). - -It returns `502` for `ERROR`, `CLIENT_ERROR`, or `SERVER_ERROR`. - -[Back to TOC](#table-of-contents) - -set $memc_key $memc_flags $memc_exptime $memc_value ---------------------------------------------------- - -To use the request body as the memcached value, just avoid setting the `$memc_value` variable: - -```nginx - - # POST /foo - # my value... - location /foo { - set $memc_cmd 'set'; - set $memc_key 'my_key'; - set $memc_flags 12345; - set $memc_exptime 24; - - memc_pass 127.0.0.1:11211; - } -``` - -Or let the `$memc_value` hold the value: - -```nginx - - location /foo { - set $memc_cmd 'set'; - set $memc_key 'my_key'; - set $memc_flags 12345; - set $memc_exptime 24; - set $memc_value 'my_value'; - - memc_pass 127.0.0.1:11211; - } -``` - -Returns `201 Created` if the upstream memcached server replies `STORED`, `200` for `NOT_STORED`, `404` for `NOT_FOUND`, `502` for `ERROR`, `CLIENT_ERROR`, or `SERVER_ERROR`. - -The original memcached responses are returned as the response body except for `404 NOT FOUND`. - -[Back to TOC](#table-of-contents) - -add $memc_key $memc_flags $memc_exptime $memc_value ---------------------------------------------------- - -Similar to the [set command](#set-memc_key-memc_flags-memc_exptime-memc_value). - -[Back to TOC](#table-of-contents) - -replace $memc_key $memc_flags $memc_exptime $memc_value -------------------------------------------------------- - -Similar to the [set command](#set-memc_key-memc_flags-memc_exptime-memc_value). - -[Back to TOC](#table-of-contents) - -append $memc_key $memc_flags $memc_exptime $memc_value ------------------------------------------------------- - -Similar to the [set command](#set-memc_key-memc_flags-memc_exptime-memc_value). - -Note that at least memcached version 1.2.2 does not support the "append" and "prepend" commands. At least 1.2.4 and later versions seem to supports these two commands. - -[Back to TOC](#table-of-contents) - -prepend $memc_key $memc_flags $memc_exptime $memc_value -------------------------------------------------------- - -Similar to the [append command](#append-memc_key-memc_flags-memc_exptime-memc_value). - -[Back to TOC](#table-of-contents) - -delete $memc_key ----------------- - -Deletes the memcached entry using a key. - -```nginx - - location /foo - set $memc_cmd delete; - set $memc_key my_key; - - memc_pass 127.0.0.1:11211; - } -``` - -Returns `200 OK` if deleted successfully, `404 Not Found` for `NOT_FOUND`, or `502` for `ERROR`, `CLIENT_ERROR`, or `SERVER_ERROR`. - -The original memcached responses are returned as the response body except for `404 NOT FOUND`. - -[Back to TOC](#table-of-contents) - -delete $memc_key $memc_exptime ------------------------------- - -Similar to the [delete $memc_key](#delete-memc_key) command except it accepts an optional `expiration` time specified by the `$memc_exptime` variable. - -This command is no longer available in the latest memcached version 1.4.4. - -[Back to TOC](#table-of-contents) - -incr $memc_key $memc_value --------------------------- - -Increments the existing value of `$memc_key` by the amount specified by `$memc_value`: - -```nginx - - location /foo { - set $memc_cmd incr; - set $memc_key my_key; - set $memc_value 2; - memc_pass 127.0.0.1:11211; - } -``` - -In the preceding example, every time we access `/foo` will cause the value of `my_key` increments by `2`. - -Returns `200 OK` with the new value associated with that key as the response body if successful, or `404 Not Found` if the key is not found. - -It returns `502` for `ERROR`, `CLIENT_ERROR`, or `SERVER_ERROR`. - -[Back to TOC](#table-of-contents) - -decr $memc_key $memc_value --------------------------- - -Similar to [incr $memc_key $memc_value](#incr-memc_key-memc_value). - -[Back to TOC](#table-of-contents) - -flush_all ---------- - -Mark all the keys on the memcached server as expired: - -```nginx - - location /foo { - set $memc_cmd flush_all; - memc_pass 127.0.0.1:11211; - } -``` - -[Back to TOC](#table-of-contents) - -flush_all $memc_exptime ------------------------ - -Just like [flush_all](#flush_all) but also accepts an expiration time specified by the `$memc_exptime` variable. - -[Back to TOC](#table-of-contents) - -stats ------ - -Causes the memcached server to output general-purpose statistics and settings - -```nginx - - location /foo { - set $memc_cmd stats; - memc_pass 127.0.0.1:11211; - } -``` - -Returns `200 OK` if the request succeeds, or 502 for `ERROR`, `CLIENT_ERROR`, or `SERVER_ERROR`. - -The raw `stats` command output from the upstream memcached server will be put into the response body. - -[Back to TOC](#table-of-contents) - -version -------- - -Queries the memcached server's version number: - -```nginx - - location /foo { - set $memc_cmd version; - memc_pass 127.0.0.1:11211; - } -``` - -Returns `200 OK` if the request succeeds, or 502 for `ERROR`, `CLIENT_ERROR`, or `SERVER_ERROR`. - -The raw `version` command output from the upstream memcached server will be put into the response body. - -[Back to TOC](#table-of-contents) - -Directives -========== - -All the standard [memcached module](http://nginx.org/en/docs/http/ngx_http_memcached_module.html) directives in nginx 0.8.28 are directly inherited, with the `memcached_` prefixes replaced by `memc_`. For example, the `memcached_pass` directive is spelled `memc_pass`. - -Here we only document the most important two directives (the latter is a new directive introduced by this module). - -[Back to TOC](#table-of-contents) - -memc_pass ---------- - -**syntax:** *memc_pass <memcached server IP address>:<memcached server port>* - -**syntax:** *memc_pass <memcached server hostname>:<memcached server port>* - -**syntax:** *memc_pass <upstream_backend_name>* - -**syntax:** *memc_pass unix:<path_to_unix_domain_socket>* - -**default:** *none* - -**context:** *http, server, location, if* - -**phase:** *content* - -Specify the memcached server backend. - -[Back to TOC](#table-of-contents) - -memc_cmds_allowed ------------------ -**syntax:** *memc_cmds_allowed <cmd>...* - -**default:** *none* - -**context:** *http, server, location, if* - -Lists memcached commands that are allowed to access. By default, all the memcached commands supported by this module are accessible. -An example is - -```nginx - - location /foo { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass 127.0.0.1:11211; - - memc_cmds_allowed get; - } -``` - -[Back to TOC](#table-of-contents) - -memc_flags_to_last_modified ---------------------------- -**syntax:** *memc_flags_to_last_modified on|off* - -**default:** *off* - -**context:** *http, server, location, if* - -Read the memcached flags as epoch seconds and set it as the value of the `Last-Modified` header. For conditional GET, it will signal nginx to return `304 Not Modified` response to save bandwidth. - -[Back to TOC](#table-of-contents) - -memc_connect_timeout --------------------- -**syntax:** *memc_connect_timeout <time>* - -**default:** *60s* - -**context:** *http, server, location* - -The timeout for connecting to the memcached server, in seconds by default. - -It's wise to always explicitly specify the time unit to avoid confusion. Time units supported are "s"(seconds), "ms"(milliseconds), "y"(years), "M"(months), "w"(weeks), "d"(days), "h"(hours), and "m"(minutes). - -This time must be less than 597 hours. - -[Back to TOC](#table-of-contents) - -memc_send_timeout ------------------ -**syntax:** *memc_send_timeout <time>* - -**default:** *60s* - -**context:** *http, server, location* - -The timeout for sending TCP requests to the memcached server, in seconds by default. - -It is wise to always explicitly specify the time unit to avoid confusion. Time units supported are "s"(seconds), "ms"(milliseconds), "y"(years), "M"(months), "w"(weeks), "d"(days), "h"(hours), and "m"(minutes). - -This time must be less than 597 hours. - -[Back to TOC](#table-of-contents) - -memc_read_timeout ------------------ -**syntax:** *memc_read_timeout <time>* - -**default:** *60s* - -**context:** *http, server, location* - -The timeout for reading TCP responses from the memcached server, in seconds by default. - -It's wise to always explicitly specify the time unit to avoid confusion. Time units supported are "s"(seconds), "ms"(milliseconds), "y"(years), "M"(months), "w"(weeks), "d"(days), "h"(hours), and "m"(minutes). - -This time must be less than 597 hours. - -[Back to TOC](#table-of-contents) - -memc_buffer_size ----------------- -**syntax:** *memc_buffer_size <size>* - -**default:** *4k/8k* - -**context:** *http, server, location* - -This buffer size is used for the memory buffer to hold - -* the complete response for memcached commands other than `get`, -* the complete response header (i.e., the first line of the response) for the `get` memcached command. - -This default size is the page size, may be `4k` or `8k`. - -[Back to TOC](#table-of-contents) - -memc_ignore_client_abort ------------------------- -**syntax:** *memc_ignore_client_abort on|off* - -**default:** *off* - -**context:** *location* - -Determines whether the connection with a memcache server should be closed when a client closes a connection without waiting for a response. - -This directive was first added in the `v0.14` release. - -[Back to TOC](#table-of-contents) - -Installation -============ - -You're recommended to install this module (as well as the Nginx core and many other goodies) via the [OpenResty bundle](http://openresty.org). See the [installation steps](http://openresty.org/#Installation) for `OpenResty`. - -Alternatively, you can compile this module into the standard Nginx source distribution by hand: - -Grab the nginx source code from [nginx.org](http://nginx.org/), for example, -the version 1.13.6 (see [nginx compatibility](#compatibility)), and then build the source with this module: - -```bash - - wget 'http://nginx.org/download/nginx-1.13.6.tar.gz' - tar -xzvf nginx-1.13.6.tar.gz - cd nginx-1.13.6/ - - # Here we assume you would install you nginx under /opt/nginx/. - ./configure --prefix=/opt/nginx \ - --add-module=/path/to/memc-nginx-module - - make -j2 - make install -``` - -Download the latest version of the release tarball of this module from [memc-nginx-module file list](http://github.com/openresty/memc-nginx-module/tags). - -Starting from NGINX 1.9.11, you can also compile this module as a dynamic module, by using the `--add-dynamic-module=PATH` option instead of `--add-module=PATH` on the -`./configure` command line above. And then you can explicitly load the module in your `nginx.conf` via the [load_module](http://nginx.org/en/docs/ngx_core_module.html#load_module) -directive, for example, - -```nginx -load_module /path/to/modules/ngx_http_memc_module.so; -``` - -[Back to TOC](#table-of-contents) - -For Developers --------------- - -The memached response parsers were generated by [Ragel](http://www.complang.org/ragel/). If you want to -regenerate the parser's C file, i.e., [src/ngx_http_memc_response.c](http://github.com/openresty/memc-nginx-module/blob/master/src/ngx_http_memc_response.c), use the following command from the root of the memc module's source tree: - -```bash - - $ ragel -G2 src/ngx_http_memc_response.rl -``` - -[Back to TOC](#table-of-contents) - -Compatibility -============= - -The following versions of Nginx should work with this module: - - -* **1.17.x** (last tested: 1.17.4) -* **1.16.x** -* **1.15.x** (last tested: 1.15.8) -* **1.14.x** -* **1.13.x** (last tested: 1.13.6) -* **1.12.x** -* **1.11.x** (last tested: 1.11.2) -* **1.10.x** -* **1.9.x** (last tested: 1.9.15) -* **1.8.x** -* **1.7.x** (last tested: 1.7.10) -* **1.6.x** -* **1.5.x** (last tested: 1.5.12) -* **1.4.x** (last tested: 1.4.4) -* **1.2.x** (last tested: 1.2.9) -* **1.1.x** (last tested: 1.1.5) -* **1.0.x** (last tested: 1.0.10) -* **0.9.x** (last tested: 0.9.4) -* **0.8.x** (last tested: 0.8.54) -* **0.7.x >= 0.7.46** (last tested: 0.7.68) - -It's worth mentioning that some 0.7.x versions older than 0.7.46 might also work, but I can't easily test them because the test suite makes extensive use of the [echo module](http://github.com/openresty/echo-nginx-module)'s [echo_location directive](http://github.com/openresty/echo-nginx-module#echo_location), which requires at least nginx 0.7.46 :) - -Earlier versions of Nginx like 0.6.x and 0.5.x will *not* work. - -If you find that any particular version of Nginx above 0.7.46 does not work with this module, please consider [reporting a bug](#report-bugs). - -[Back to TOC](#table-of-contents) - -Community -========= - -[Back to TOC](#table-of-contents) - -English Mailing List --------------------- - -The [openresty-en](https://groups.google.com/group/openresty-en) mailing list is for English speakers. - -[Back to TOC](#table-of-contents) - -Chinese Mailing List --------------------- - -The [openresty](https://groups.google.com/group/openresty) mailing list is for Chinese speakers. - -[Back to TOC](#table-of-contents) - -Report Bugs -=========== - -Although a lot of effort has been put into testing and code tuning, there must be some serious bugs lurking somewhere in this module. So whenever you are bitten by any quirks, please don't hesitate to - -1. create a ticket on the [issue tracking interface](http://github.com/openresty/memc-nginx-module/issues) provided by GitHub, -1. or send a bug report or even patches to the [nginx mailing list](http://mailman.nginx.org/mailman/listinfo/nginx). - -[Back to TOC](#table-of-contents) - -Source Repository -================= - -Available on github at [openresty/memc-nginx-module](http://github.com/openresty/memc-nginx-module). - -[Back to TOC](#table-of-contents) - -Changes -======= - -The changes of every release of this module can be obtained from the OpenResty bundle's change logs: - - - -[Back to TOC](#table-of-contents) - -Test Suite -========== - -This module comes with a Perl-driven test suite. The [test cases](http://github.com/openresty/memc-nginx-module/tree/master/t/) are -[declarative](http://github.com/openresty/memc-nginx-module/blob/master/t/storage.t) too. Thanks to the [Test::Base](http://search.cpan.org/perldoc?Test::Base) module in the Perl world. - -To run it on your side: - -```bash - - $ PATH=/path/to/your/nginx-with-memc-module:$PATH prove -r t -``` - -You need to terminate any Nginx processes before running the test suite if you have changed the Nginx server binary. - -Either [LWP::UserAgent](http://search.cpan.org/perldoc?LWP::UserAgent) or [IO::Socket](http://search.cpan.org/perldoc?IO::Socket) is used by the [test scaffold](http://github.com/openresty/memc-nginx-module/blob/master/test/lib/Test/Nginx/LWP.pm). - -Because a single nginx server (by default, `localhost:1984`) is used across all the test scripts (`.t` files), it's meaningless to run the test suite in parallel by specifying `-jN` when invoking the `prove` utility. - -You should also keep a memcached server listening on the `11211` port at localhost before running the test suite. - -Some parts of the test suite requires modules [rewrite](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html) and [echo](http://github.com/openresty/echo-nginx-module) to be enabled as well when building Nginx. - -[Back to TOC](#table-of-contents) - -TODO -==== - -* add support for the memcached commands `cas`, `gets` and `stats $memc_value`. -* add support for the `noreply` option. - -[Back to TOC](#table-of-contents) - -Getting involved -================ - -You'll be very welcomed to submit patches to the [author](#author) or just ask for a commit bit to the [source repository](#source-repository) on GitHub. - -[Back to TOC](#table-of-contents) - -Author -====== - -Yichun "agentzh" Zhang (章亦春) *<agentzh@gmail.com>*, OpenResty Inc. - -This wiki page is also maintained by the author himself, and everybody is encouraged to improve this page as well. - -[Back to TOC](#table-of-contents) - -Copyright & License -=================== - -The code base is borrowed directly from the standard [memcached module](http://nginx.org/en/docs/http/ngx_http_memcached_module.html) in the Nginx core. This part of code is copyrighted by Igor Sysoev and Nginx Inc. - -Copyright (c) 2009-2018, Yichun "agentzh" Zhang (章亦春) , OpenResty Inc. - -This module is licensed under the terms of the BSD license. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright 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 THE COPYRIGHT HOLDERS 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 THE COPYRIGHT -HOLDER 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) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -[Back to TOC](#table-of-contents) - -See Also -======== - -* The original announcement email on the nginx mailing list: [ngx_memc: "an extended version of ngx_memcached that supports set, add, delete, and many more commands"](http://forum.nginx.org/read.php?2,28359) -* My slides demonstrating various ngx_memc usage: (use the arrow or pageup/pagedown keys on the keyboard to swith pages) -* The latest [memcached TCP protocol](http://code.sixapart.com/svn/memcached/trunk/server/doc/protocol.txt). -* The [ngx_srcache](http://github.com/openresty/srcache-nginx-module) module -* The [lua-resty-memcached](https://github.com/openresty/lua-resty-memcached) library based on the [lua-nginx-module](http://github.com/openresty/lua-nginx-module) cosocket API. -* The standard [memcached](http://nginx.org/en/docs/http/ngx_http_memcached_module.html) module. -* The [echo module](http://github.com/openresty/echo-nginx-module) for Nginx module's automated testing. -* The standard [headers](http://nginx.org/en/docs/http/ngx_http_headers_module.html) module and the 3rd-parth [headers-more](http://github.com/openresty/headers-more-nginx-module) module. - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/config b/modules_deb/libnginx-mod-http-memc-0.20/config deleted file mode 100644 index 7e4bfd6..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/config +++ /dev/null @@ -1,31 +0,0 @@ -ngx_addon_name=ngx_http_memc_module - -MEMC_SRCS=" \ - $ngx_addon_dir/src/ngx_http_memc_module.c \ - $ngx_addon_dir/src/ngx_http_memc_request.c \ - $ngx_addon_dir/src/ngx_http_memc_response.c \ - $ngx_addon_dir/src/ngx_http_memc_util.c \ - $ngx_addon_dir/src/ngx_http_memc_handler.c \ - " - -MEMC_DEPS=" \ - $ngx_addon_dir/src/ddebug.h \ - $ngx_addon_dir/src/ngx_http_memc_module.h \ - $ngx_addon_dir/src/ngx_http_memc_request.h \ - $ngx_addon_dir/src/ngx_http_memc_response.h \ - $ngx_addon_dir/src/ngx_http_memc_util.h \ - $ngx_addon_dir/src/ngx_http_memc_handler.h \ - " - -if [ -n "$ngx_module_link" ]; then - ngx_module_type=HTTP - ngx_module_name=$ngx_addon_name - ngx_module_srcs="$MEMC_SRCS" - ngx_module_deps="$MEMC_DEPS" - - . auto/module -else - HTTP_MODULES="$HTTP_MODULES $ngx_addon_name" - NGX_ADDON_SRCS="$NGX_ADDON_SRCS $MEMC_SRCS" - NGX_ADDON_DEPS="$NGX_ADDON_DEPS $MEMC_DEPS" -fi diff --git a/modules_deb/libnginx-mod-http-memc-0.20/debian/changelog b/modules_deb/libnginx-mod-http-memc-0.20/debian/changelog deleted file mode 100644 index 57faeca..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/debian/changelog +++ /dev/null @@ -1,51 +0,0 @@ -libnginx-mod-http-memc (0.20-2) unstable; urgency=medium - - * Team upload. - * d/control: bump Standards-Version: 4.7.2, no changes - * d/watch: use more generic template - * d/copyright: bump debian/* copyright year - - -- Jan Mojžíš Sat, 12 Apr 2025 09:05:46 +0200 - -libnginx-mod-http-memc (0.20-1) unstable; urgency=medium - - * Team upload - * New upstream version 0.20 - * d/rules: Rebuild ngx_http_memc_response.c using ragel (Closes: 1025810) - * d/copyright: bump debian/* copyright year - * d/watch: use new recommended github template - * d/gbp.conf: add [pull] track-missing = True - - -- Jan Mojžíš Mon, 08 Jan 2024 11:33:58 +0100 - -libnginx-mod-http-memc (0.19-4) unstable; urgency=medium - - * Team upload - * d/control: remove Build-Depends nginx-abi-1.24.0-1 - - -- Jan Mojžíš Sat, 07 Oct 2023 17:50:21 +0200 - -libnginx-mod-http-memc (0.19-3) unstable; urgency=medium - - * Team upload - * NEW ABI: rebuild with nginx-abi-1.24.0-1 - - -- Jan Mojžíš Wed, 28 Jun 2023 00:01:44 +0200 - -libnginx-mod-http-memc (0.19-2) unstable; urgency=medium - - * Team upload. - * d/t/generic rework. The test now checks module after - installation/reload/restart. - * d/control: bump Standards-Version: 4.6.2, no changes - * d/copyright: reformat text to be compatible with 'cme update dpkg-copyright' - * d/fix.scanned.copyright: added, fixes upstream author name parsing - * NEW ABI: rebuild with nginx-abi-1.22.1-7 - - -- Jan Mojžíš Mon, 13 Feb 2023 12:56:30 +0100 - -libnginx-mod-http-memc (0.19-1) unstable; urgency=medium - - * Initial release. (Closes: #1025289) - - -- Jérémy Lal Fri, 02 Dec 2022 00:32:56 +0100 diff --git a/modules_deb/libnginx-mod-http-memc-0.20/debian/control b/modules_deb/libnginx-mod-http-memc-0.20/debian/control deleted file mode 100644 index 3b34393..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/debian/control +++ /dev/null @@ -1,26 +0,0 @@ -Source: libnginx-mod-http-memc -Section: httpd -Priority: optional -Maintainer: Debian Nginx Maintainers -Uploaders: Jérémy Lal , -Build-Depends: debhelper-compat (= 13), - dh-sequence-nginx, - ragel, -Standards-Version: 4.7.2 -Homepage: https://github.com/openresty/memc-nginx-module -Vcs-Git: https://salsa.debian.org/nginx-team/libnginx-mod-http-memc.git -Vcs-Browser: https://salsa.debian.org/nginx-team/libnginx-mod-http-memc -Rules-Requires-Root: no - -Package: libnginx-mod-http-memc -Architecture: any -Multi-Arch: foreign -Depends: ${misc:Depends}, - ${shlibs:Depends}, -Recommends: nginx, -Description: Extended memcached commands module for Nginx - This module supports almost the whole memcached ascii protocol, - and provides many more commands than the embedded memcached - module in Nginx. - The libnginx-mod-http-srcache-filter module can be configured to - use that module to cache responses. diff --git a/modules_deb/libnginx-mod-http-memc-0.20/debian/copyright b/modules_deb/libnginx-mod-http-memc-0.20/debian/copyright deleted file mode 100644 index a2e9e2e..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/debian/copyright +++ /dev/null @@ -1,62 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: memc-nginx-module -Upstream-Contact: Yichun "agentzh" Zhang (章亦春) -Source: https://github.com/openresty/memc-nginx-module - -Files: * -Copyright: 2009-2018, Yichun "agentzh" Zhang (章亦春) , OpenResty Inc. -License: BSD-2-clause - -Files: config -Copyright: 2009-2018, Yichun "agentzh" Zhang (章亦春) , OpenResty Inc. -License: BSD-2-clause - -Files: debian/* -Copyright: 2022-2024, Jérémy Lal , - 2022-2025, Jan Mojzis -License: BSD-2-clause - -Files: src/* -Copyright: Yichun Zhang (agentzh) -License: BSD-2-clause - -Files: src/ddebug.h - src/ngx_http_memc_handler.h -Copyright: 2009-2018, Yichun "agentzh" Zhang (章亦春) , OpenResty Inc. -License: BSD-2-clause - -Files: src/ngx_http_memc_module.c -Copyright: Zhang "agentzh" Yichun - Igor Sysoev -License: BSD-2-clause - -Files: t/* -Copyright: 2009-2018, Yichun "agentzh" Zhang (章亦春) , OpenResty Inc. -License: BSD-2-clause - -Files: util/* -Copyright: 2009-2018, Yichun "agentzh" Zhang (章亦春) , OpenResty Inc. -License: BSD-2-clause - -License: BSD-2-clause - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - . - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - 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 THE COPYRIGHT HOLDERS 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 THE COPYRIGHT - HOLDER 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) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/modules_deb/libnginx-mod-http-memc-0.20/debian/fix.scanned.copyright b/modules_deb/libnginx-mod-http-memc-0.20/debian/fix.scanned.copyright deleted file mode 100644 index b25e244..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/debian/fix.scanned.copyright +++ /dev/null @@ -1,2 +0,0 @@ -# fixes upstream author name parsing -! copyright Files:~/.*/ Copyright=~"s/(Zhang)\s\(.*x\{6625\}\)/$1\ (章亦春)/" diff --git a/modules_deb/libnginx-mod-http-memc-0.20/debian/gbp.conf b/modules_deb/libnginx-mod-http-memc-0.20/debian/gbp.conf deleted file mode 100644 index 97cd209..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/debian/gbp.conf +++ /dev/null @@ -1,12 +0,0 @@ -[DEFAULT] -debian-branch = main -upstream-branch = upstream -upstream-tag = upstream/%(version)s -pristine-tar = True -sign-tags = True - -[import-orig] -merge-mode = replace - -[pull] -track-missing = True diff --git a/modules_deb/libnginx-mod-http-memc-0.20/debian/rules b/modules_deb/libnginx-mod-http-memc-0.20/debian/rules deleted file mode 100755 index ec9b918..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/debian/rules +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/make -f - -export DEB_BUILD_MAINT_OPTIONS = hardening=+all - -execute_before_dh_auto_build: - # rebuild ngx_http_memc_response.c using ragel - [ -f src/ngx_http_memc_response.c.orig ] || cp src/ngx_http_memc_response.c src/ngx_http_memc_response.c.orig - ragel -G2 src/ngx_http_memc_response.rl || mv -f src/ngx_http_memc_response.c.orig src/ngx_http_memc_response.c - diff -u src/ngx_http_memc_response.c.orig src/ngx_http_memc_response.c || : - -execute_after_dh_auto_build: - mv -f src/ngx_http_memc_response.c.orig src/ngx_http_memc_response.c - -%: - dh $@ diff --git a/modules_deb/libnginx-mod-http-memc-0.20/debian/source/format b/modules_deb/libnginx-mod-http-memc-0.20/debian/source/format deleted file mode 100644 index 163aaf8..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/modules_deb/libnginx-mod-http-memc-0.20/debian/tests/control b/modules_deb/libnginx-mod-http-memc-0.20/debian/tests/control deleted file mode 100644 index 3c57b8b..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/debian/tests/control +++ /dev/null @@ -1,14 +0,0 @@ -Tests: generic -Restrictions: allow-stderr isolation-container needs-root -Depends: curl, - nginx, - nginx-core, - @, - -Tests: flush -Restrictions: allow-stderr isolation-container needs-root -Depends: curl, - memcached, - nginx, - nginx-core, - @, diff --git a/modules_deb/libnginx-mod-http-memc-0.20/debian/tests/flush b/modules_deb/libnginx-mod-http-memc-0.20/debian/tests/flush deleted file mode 100644 index a194656..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/debian/tests/flush +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -set -e - -cat < "/etc/nginx/sites-enabled/default" -server { - listen 80 default_server; - - location /flush { - set \$memc_cmd flush_all; - memc_pass 127.0.0.1:11211; - } -} -EOF - -exp="OK -response_code: 200" - -nginx -t -invoke-rc.d nginx restart || { journalctl -n all -xu nginx.service; exit 1; } - -out=`curl --fail -w "response_code: %{http_code}\n" http://127.0.0.1/flush` -out=`echo "${out}" | sed 's/\r//'` - -if [ x"${out}" != x"${exp}" ]; then - echo "output:" - echo "=====================" - echo "${out}" - echo "=====================" - echo "expected output:" - echo "=====================" - echo "${exp}" - echo "=====================" - exit 1 -fi diff --git a/modules_deb/libnginx-mod-http-memc-0.20/debian/tests/generic b/modules_deb/libnginx-mod-http-memc-0.20/debian/tests/generic deleted file mode 100644 index a14fc80..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/debian/tests/generic +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -# version 20221215 - -# generic test that only verifies that nginx is running with the given -# libnginx-... module -# - after installation -# - after nginx reload -# - after nginx restart - -EX=0 -CURL_CMD="curl --max-time 60 --silent --fail -o /dev/null" - -#change directory to $AUTOPKGTEST_TMP -cd "${AUTOPKGTEST_TMP}" - -echo -n "curl after installation: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx reload ... " -if invoke-rc.d nginx reload; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - - -echo -n "curl after reload: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx restart ... " -if invoke-rc.d nginx restart; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - -echo -n "curl after restart: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -if [ ${EX} -ne 0 ]; then - echo "=== journalctl ===" - journalctl -n all -xu nginx.service || : - - echo "=== error.log ===" - if [ `wc -l /var/log/nginx/error.log | cut -d ' ' -f1` -gt 100 ]; then - head -n 50 /var/log/nginx/error.log - echo '...' - tail -n 50 /var/log/nginx/error.log - else - cat /var/log/nginx/error.log - fi -fi - -exit ${EX} diff --git a/modules_deb/libnginx-mod-http-memc-0.20/debian/upstream/metadata b/modules_deb/libnginx-mod-http-memc-0.20/debian/upstream/metadata deleted file mode 100644 index 1f4a243..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/debian/upstream/metadata +++ /dev/null @@ -1,4 +0,0 @@ ---- -Bug-Database: https://github.com/openresty/memc-nginx-module/issues -Bug-Submit: https://github.com/openresty/memc-nginx-module/issues/new -Repository-Browse: https://github.com/openresty/memc-nginx-module diff --git a/modules_deb/libnginx-mod-http-memc-0.20/debian/watch b/modules_deb/libnginx-mod-http-memc-0.20/debian/watch deleted file mode 100644 index 81f077a..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/debian/watch +++ /dev/null @@ -1,6 +0,0 @@ -version=4 -opts="\ -uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha|a|b)\d*)$/$1~$2/,\ -" \ -https://github.com/openresty/memc-nginx-module/tags \ -(?:.*?/)?v?@ANY_VERSION@@ARCHIVE_EXT@ diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/ddebug.h b/modules_deb/libnginx-mod-http-memc-0.20/src/ddebug.h deleted file mode 100644 index 36e810e..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/ddebug.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef DDEBUG_H -#define DDEBUG_H - - -#include -#include - - -#if defined(DDEBUG) && (DDEBUG) - -# if (NGX_HAVE_VARIADIC_MACROS) - -# define dd(...) fprintf(stderr, "memc *** "); \ - fprintf(stderr, __VA_ARGS__); \ - fprintf(stderr, " at %s line %d.\n", __FILE__, __LINE__) - -# else - -#include -#include - -#include - -static ngx_inline void -dd(const char* fmt, ...) { -} - -# endif - -#else - -# if (NGX_HAVE_VARIADIC_MACROS) - -# define dd(...) - -# else - -#include - -static ngx_inline void -dd(const char* fmt, ...) { -} - -# endif - -#endif - -#if defined(DDEBUG) && (DDEBUG) - -#define dd_check_read_event_handler(r) \ - dd("r->read_event_handler = %s", \ - r->read_event_handler == ngx_http_block_reading ? \ - "ngx_http_block_reading" : \ - r->read_event_handler == ngx_http_test_reading ? \ - "ngx_http_test_reading" : \ - r->read_event_handler == ngx_http_request_empty_handler ? \ - "ngx_http_request_empty_handler" : "UNKNOWN") - -#define dd_check_write_event_handler(r) \ - dd("r->write_event_handler = %s", \ - r->write_event_handler == ngx_http_handler ? \ - "ngx_http_handler" : \ - r->write_event_handler == ngx_http_core_run_phases ? \ - "ngx_http_core_run_phases" : \ - r->write_event_handler == ngx_http_request_empty_handler ? \ - "ngx_http_request_empty_handler" : "UNKNOWN") - -#else - -#define dd_check_read_event_handler(r) -#define dd_check_write_event_handler(r) - -#endif - -#endif /* DDEBUG_H */ diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/memc_common.rl b/modules_deb/libnginx-mod-http-memc-0.20/src/memc_common.rl deleted file mode 100644 index eeb61c1..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/memc_common.rl +++ /dev/null @@ -1,44 +0,0 @@ -%%{ - machine memc_common; - - action catch_err { - dd("caught error..."); - dd("machine state: %d", cs); - - *status_addr = NGX_HTTP_BAD_GATEWAY; - } - - msg = any* -- "\r\n"; - - error_helper = "ERROR\r\n" - | "CLIENT_ERROR " msg "\r\n" - | "SERVER_ERROR " msg "\r\n" - ; - - error = error_helper @catch_err - ; - - action finalize { - dd("done it!"); - *done_addr = 1; - } - - action check { - dd("state %d, left %d, reading char '%c'", cs, - (int) (pe - p), *p); - } - - action handle_stored { - dd("status set to 201"); - - *status_addr = NGX_HTTP_CREATED; - } - - action handle_not_found { - dd("status set to 404"); - - *status_addr = NGX_HTTP_NOT_FOUND; - } - -}%% - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/memc_delete.rl b/modules_deb/libnginx-mod-http-memc-0.20/src/memc_delete.rl deleted file mode 100644 index 1e01b05..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/memc_delete.rl +++ /dev/null @@ -1,17 +0,0 @@ -%%{ - machine memc_delete; - - alphtype short; - - include memc_common "memc_common.rl"; - - response = "DELETED\r\n" - | "NOT_FOUND\r\n" @handle_not_found - | error - ; - - main := response @finalize - ; - -}%% - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/memc_flush_all.rl b/modules_deb/libnginx-mod-http-memc-0.20/src/memc_flush_all.rl deleted file mode 100644 index 74c7288..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/memc_flush_all.rl +++ /dev/null @@ -1,16 +0,0 @@ -%%{ - machine memc_flush_all; - - alphtype short; - - include memc_common "memc_common.rl"; - - response = "OK\r\n" - | error - ; - - main := response @finalize - ; - -}%% - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/memc_incr_decr.rl b/modules_deb/libnginx-mod-http-memc-0.20/src/memc_incr_decr.rl deleted file mode 100644 index b4b13a5..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/memc_incr_decr.rl +++ /dev/null @@ -1,20 +0,0 @@ -%%{ - machine memc_incr_decr; - - alphtype short; - - include memc_common "memc_common.rl"; - - value = digit+ - ; - - response = value " "* "\r\n" @handle_stored - | "NOT_FOUND\r\n" @handle_not_found - | error - ; - - main := response @finalize $check - ; - -}%% - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/memc_stats.rl b/modules_deb/libnginx-mod-http-memc-0.20/src/memc_stats.rl deleted file mode 100644 index 9526b77..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/memc_stats.rl +++ /dev/null @@ -1,22 +0,0 @@ -%%{ - machine memc_stats; - - alphtype short; - - include memc_common "memc_common.rl"; - - content = any+ - "\r\n" - ; - - stat_line = "STAT " content "\r\n" - ; - - response = stat_line* "END\r\n" - | error - ; - - main := response @finalize - ; - -}%% - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/memc_storage.rl b/modules_deb/libnginx-mod-http-memc-0.20/src/memc_storage.rl deleted file mode 100644 index b64a441..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/memc_storage.rl +++ /dev/null @@ -1,17 +0,0 @@ -%%{ - machine memc_storage; - - include memc_common "memc_common.rl"; - - response = "STORED\r\n" @handle_stored - | "NOT_STORED\r\n" - | "EXISTS\r\n" - | "NOT_FOUND\r\n" @handle_not_found - | error - ; - - main := response @finalize - ; - -}%% - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/memc_version.rl b/modules_deb/libnginx-mod-http-memc-0.20/src/memc_version.rl deleted file mode 100644 index 3a85b59..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/memc_version.rl +++ /dev/null @@ -1,19 +0,0 @@ -%%{ - machine memc_version; - - alphtype short; - - include memc_common "memc_common.rl"; - - version = any+ - "\r\n" - ; - - response = "VERSION " version "\r\n" - | error - ; - - main := response @finalize - ; - -}%% - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_handler.c b/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_handler.c deleted file mode 100644 index 0236242..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_handler.c +++ /dev/null @@ -1,612 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include "ngx_http_memc_handler.h" -#include "ngx_http_memc_module.h" -#include "ngx_http_memc_request.h" -#include "ngx_http_memc_response.h" -#include "ngx_http_memc_util.h" - - -static ngx_int_t ngx_http_memc_flags_as_http_time_variable( - ngx_http_request_t *r, ngx_http_variable_value_t *v, uintptr_t data); - - -static ngx_http_variable_t ngx_http_memc_variables[] = { - - { ngx_string("memc_flags_as_http_time"), NULL, - ngx_http_memc_flags_as_http_time_variable, 0, - 0, 0 }, - - { ngx_null_string, NULL, NULL, 0, 0, 0 } -}; - - -static ngx_str_t ngx_http_memc_key = ngx_string("memc_key"); -static ngx_str_t ngx_http_memc_cmd = ngx_string("memc_cmd"); -static ngx_str_t ngx_http_memc_value = ngx_string("memc_value"); -static ngx_str_t ngx_http_memc_flags = ngx_string("memc_flags"); -static ngx_str_t ngx_http_memc_exptime = ngx_string("memc_exptime"); - - -static ngx_int_t ngx_http_memc_add_more_variables(ngx_conf_t *cf); -static ngx_int_t ngx_http_memc_variable_not_found(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data); -static ngx_int_t ngx_http_memc_add_variable(ngx_conf_t *cf, ngx_str_t *name); -static ngx_flag_t ngx_http_memc_in_cmds_allowed(ngx_http_memc_loc_conf_t *mlcf, - ngx_http_memc_cmd_t memc_cmd); -static ngx_int_t ngx_http_memc_reinit_request(ngx_http_request_t *r); -static void ngx_http_memc_abort_request(ngx_http_request_t *r); -static void ngx_http_memc_finalize_request(ngx_http_request_t *r, - ngx_int_t rc); -static ngx_flag_t ngx_http_memc_valid_uint32_str(u_char *data, size_t len); -static ngx_flag_t ngx_http_memc_valid_uint64_str(u_char *data, size_t len); - - -ngx_int_t -ngx_http_memc_handler(ngx_http_request_t *r) -{ - ngx_int_t rc; - ngx_http_upstream_t *u; - ngx_http_memc_ctx_t *ctx; - ngx_http_memc_loc_conf_t *mlcf; - ngx_http_memc_main_conf_t *mmcf; - ngx_str_t target; - ngx_url_t url; - - ngx_http_variable_value_t *cmd_vv; - ngx_http_variable_value_t *key_vv; - ngx_http_variable_value_t *value_vv; - ngx_http_variable_value_t *flags_vv; - ngx_http_variable_value_t *exptime_vv; - - ngx_http_memc_cmd_t memc_cmd; - ngx_flag_t is_storage_cmd = 0; - - dd("memc handler"); - - mmcf = ngx_http_get_module_main_conf(r, ngx_http_memc_module); - - key_vv = ngx_http_get_indexed_variable(r, mmcf->key_index); - if (key_vv == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - cmd_vv = ngx_http_get_indexed_variable(r, mmcf->cmd_index); - if (cmd_vv == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - if (cmd_vv->not_found || cmd_vv->len == 0) { - dd("variable $memc_cmd not found"); - cmd_vv->not_found = 0; - cmd_vv->valid = 1; - cmd_vv->no_cacheable = 0; - - if (r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD)) { - cmd_vv->len = sizeof("get") - 1; - cmd_vv->data = (u_char *) "get"; - memc_cmd = ngx_http_memc_cmd_get; - - } else if (r->method == NGX_HTTP_POST) { - cmd_vv->len = sizeof("add") - 1; - cmd_vv->data = (u_char *) "add"; - memc_cmd = ngx_http_memc_cmd_add; - is_storage_cmd = 1; - - } else if (r->method == NGX_HTTP_PUT) { - cmd_vv->len = sizeof("set") - 1; - cmd_vv->data = (u_char *) "set"; - memc_cmd = ngx_http_memc_cmd_set; - is_storage_cmd = 1; - - } else if (r->method == NGX_HTTP_DELETE) { - cmd_vv->len = sizeof("delete") - 1; - cmd_vv->data = (u_char *) "delete"; - memc_cmd = ngx_http_memc_cmd_delete; - - } else { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "ngx_memc: $memc_cmd variable not found for HTTP " - "%V requests", &r->method_name); - - return NGX_HTTP_BAD_REQUEST; - } - - } else { - - memc_cmd = ngx_http_memc_parse_cmd(cmd_vv->data, cmd_vv->len, - &is_storage_cmd); - - if (memc_cmd == ngx_http_memc_cmd_unknown) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "ngx_memc: unknown $memc_cmd \"%v\"", cmd_vv); - return NGX_HTTP_BAD_REQUEST; - } - } - - mlcf = ngx_http_get_module_loc_conf(r, ngx_http_memc_module); - - dd("XXX connect timeout %d", (int) mlcf->upstream.connect_timeout); - - if (!ngx_http_memc_in_cmds_allowed(mlcf, memc_cmd)) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "ngx_memc: memcached command \"%v\" not allowed", - cmd_vv); - - return NGX_HTTP_FORBIDDEN; - } - - if (ngx_http_set_content_type(r) != NGX_OK) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - -#if defined(nginx_version) && \ - ((nginx_version >= 7063 && nginx_version < 8000) \ - || nginx_version >= 8007) - - if (ngx_http_upstream_create(r) != NGX_OK) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - u = r->upstream; - -#else /* 0.7.x < 0.7.63, 0.8.x < 0.8.7 */ - - u = ngx_pcalloc(r->pool, sizeof(ngx_http_upstream_t)); - if (u == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - u->peer.log = r->connection->log; - u->peer.log_error = NGX_ERROR_ERR; -# if (NGX_THREADS) - u->peer.lock = &r->connection->lock; -# endif - - r->upstream = u; - -#endif - - if (mlcf->complex_target) { - /* variables used in the memc_pass directive */ - if (ngx_http_complex_value(r, mlcf->complex_target, &target) - != NGX_OK) - { - dd("failed to compile"); - return NGX_ERROR; - } - - if (target.len == 0) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "memc: handler: empty \"memc_pass\" target"); - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - url.host = target; - url.port = 0; - url.no_resolve = 1; - - mlcf->upstream.upstream = ngx_http_memc_upstream_add(r, &url); - - if (mlcf->upstream.upstream == NULL) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "memc: upstream \"%V\" not found", &target); - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - } - - u->schema.len = sizeof("memcached://") - 1; - u->schema.data = (u_char *) "memcached://"; - - u->output.tag = (ngx_buf_tag_t) &ngx_http_memc_module; - - u->conf = &mlcf->upstream; - - ctx = ngx_palloc(r->pool, sizeof(ngx_http_memc_ctx_t)); - if (ctx == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - ctx->body_length = 0; - ctx->memc_key_vv = key_vv; - ctx->memc_value_vv = NULL; - ctx->memc_flags_vv = NULL; - - ctx->parser_state = NGX_ERROR; - - ctx->rest = NGX_HTTP_MEMC_END; - ctx->request = r; - - ctx->cmd_str.data = cmd_vv->data; - ctx->cmd_str.len = cmd_vv->len; - - ctx->cmd = memc_cmd; - - ctx->is_storage_cmd = is_storage_cmd; - - ngx_http_set_ctx(r, ctx, ngx_http_memc_module); - - if (is_storage_cmd) { - u->create_request = ngx_http_memc_create_storage_cmd_request; - u->process_header = ngx_http_memc_process_simple_header; - - u->input_filter_init = ngx_http_memc_empty_filter_init; - u->input_filter = ngx_http_memc_empty_filter; - - } else if (memc_cmd == ngx_http_memc_cmd_get) { - u->create_request = ngx_http_memc_create_get_cmd_request; - u->process_header = ngx_http_memc_process_get_cmd_header; - - u->input_filter_init = ngx_http_memc_get_cmd_filter_init; - u->input_filter = ngx_http_memc_get_cmd_filter; - - } else if (memc_cmd == ngx_http_memc_cmd_flush_all) { - u->create_request = ngx_http_memc_create_flush_all_cmd_request; - u->process_header = ngx_http_memc_process_simple_header; - - u->input_filter_init = ngx_http_memc_empty_filter_init; - u->input_filter = ngx_http_memc_empty_filter; - - } else if (memc_cmd == ngx_http_memc_cmd_version - || memc_cmd == ngx_http_memc_cmd_stats) - { - u->create_request = ngx_http_memc_create_noarg_cmd_request; - u->process_header = ngx_http_memc_process_simple_header; - - u->input_filter_init = ngx_http_memc_empty_filter_init; - u->input_filter = ngx_http_memc_empty_filter; - - } else if (memc_cmd == ngx_http_memc_cmd_delete) { - u->create_request = ngx_http_memc_create_delete_cmd_request; - u->process_header = ngx_http_memc_process_simple_header; - - u->input_filter_init = ngx_http_memc_empty_filter_init; - u->input_filter = ngx_http_memc_empty_filter; - - } else if (memc_cmd == ngx_http_memc_cmd_incr - || memc_cmd == ngx_http_memc_cmd_decr) - { - u->create_request = ngx_http_memc_create_incr_decr_cmd_request; - u->process_header = ngx_http_memc_process_simple_header; - - u->input_filter_init = ngx_http_memc_empty_filter_init; - u->input_filter = ngx_http_memc_empty_filter; - - } else { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "assertion failed: command \"%v\" does not have proper " - "handlers.", cmd_vv); - - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - u->reinit_request = ngx_http_memc_reinit_request; - u->abort_request = ngx_http_memc_abort_request; - u->finalize_request = ngx_http_memc_finalize_request; - - u->input_filter_ctx = ctx; - - if (is_storage_cmd - || memc_cmd == ngx_http_memc_cmd_flush_all - || memc_cmd == ngx_http_memc_cmd_delete) - { - exptime_vv = ngx_http_get_indexed_variable(r, mmcf->exptime_index); - - if (exptime_vv == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - ctx->memc_exptime_vv = exptime_vv; - - if (!exptime_vv->not_found - && exptime_vv->len - && !ngx_http_memc_valid_uint32_str(exptime_vv->data, - exptime_vv->len)) - { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "variable \"$memc_exptime\" takes invalid value: %v", - exptime_vv); - - return NGX_HTTP_BAD_REQUEST; - } - } - - if (is_storage_cmd || memc_cmd == ngx_http_memc_cmd_get) { - flags_vv = ngx_http_get_indexed_variable(r, mmcf->flags_index); - if (flags_vv == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - ctx->memc_flags_vv = flags_vv; - - if (is_storage_cmd - && !flags_vv->not_found - && flags_vv->len - && !ngx_http_memc_valid_uint32_str(flags_vv->data, flags_vv->len)) - { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "variable \"$memc_flags\" takes invalid value: %v", - flags_vv); - - return NGX_HTTP_BAD_REQUEST; - } - } - - if (is_storage_cmd - || memc_cmd == ngx_http_memc_cmd_incr - || memc_cmd == ngx_http_memc_cmd_decr) - { - value_vv = ngx_http_get_indexed_variable(r, mmcf->value_index); - if (value_vv == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - if (memc_cmd == ngx_http_memc_cmd_incr - || memc_cmd == ngx_http_memc_cmd_decr) - { - if (value_vv->not_found || value_vv->len == 0) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "the \"$memc_value\" variable is required for " - "command \"%V\"", &ctx->cmd_str); - - return NGX_HTTP_BAD_REQUEST; - } - - if (!ngx_http_memc_valid_uint64_str(value_vv->data, - value_vv->len)) - { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "variable \"$memc_value\" is invalid for " - "incr/decr: %v", value_vv); - - return NGX_HTTP_BAD_REQUEST; - } - } - - ctx->memc_value_vv = value_vv; - } - - rc = ngx_http_read_client_request_body(r, ngx_http_upstream_init); - - if (rc == NGX_ERROR || rc > NGX_OK) { - return rc; - } - - return NGX_DONE; -} - - -static ngx_int_t -ngx_http_memc_reinit_request(ngx_http_request_t *r) -{ - return NGX_OK; -} - - -static void -ngx_http_memc_abort_request(ngx_http_request_t *r) -{ - ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "abort http memcached request"); - return; -} - - -static void -ngx_http_memc_finalize_request(ngx_http_request_t *r, ngx_int_t rc) -{ - ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "finalize http memcached request"); - return; -} - - -static ngx_flag_t -ngx_http_memc_in_cmds_allowed(ngx_http_memc_loc_conf_t *mlcf, - ngx_http_memc_cmd_t memc_cmd) -{ - ngx_uint_t i; - ngx_http_memc_cmd_t *value; - - if (mlcf->cmds_allowed == NULL || mlcf->cmds_allowed->nelts == 0) { - /* by default, all the memcached commands supported are allowed. */ - return 1; - } - - value = mlcf->cmds_allowed->elts; - - for (i = 0; i < mlcf->cmds_allowed->nelts; i++) { - if (memc_cmd == value[i]) { - return 1; - } - } - - return 0; -} - - -static ngx_flag_t -ngx_http_memc_valid_uint32_str(u_char *data, size_t len) -{ - u_char *p, *last; - - if (len > NGX_UINT32_LEN) { - return 0; - } - - last = data + len; - for (p = data; p != last; p++) { - if (*p < '0' || *p > '9') { - return 0; - } - } - - return 1; -} - - -static ngx_flag_t -ngx_http_memc_valid_uint64_str(u_char *data, size_t len) -{ - u_char *p, *last; - - if (len > NGX_UINT64_LEN) { - return 0; - } - - last = data + len; - for (p = data; p != last; p++) { - if (*p < '0' || *p > '9') { - return 0; - } - } - - return 1; -} - - -ngx_int_t -ngx_http_memc_init(ngx_conf_t *cf) -{ - ngx_http_memc_main_conf_t *mmcf; - - mmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_memc_module); - - if (!mmcf->module_used) { - return NGX_OK; - } - - mmcf->key_index = ngx_http_memc_add_variable(cf, &ngx_http_memc_key); - if (mmcf->key_index == NGX_ERROR) { - return NGX_ERROR; - } - - mmcf->cmd_index = ngx_http_memc_add_variable(cf, &ngx_http_memc_cmd); - if (mmcf->cmd_index == NGX_ERROR) { - return NGX_ERROR; - } - - mmcf->flags_index = ngx_http_memc_add_variable(cf, &ngx_http_memc_flags); - if (mmcf->flags_index == NGX_ERROR) { - return NGX_ERROR; - } - - mmcf->exptime_index = ngx_http_memc_add_variable(cf, - &ngx_http_memc_exptime); - if (mmcf->exptime_index == NGX_ERROR) { - return NGX_ERROR; - } - - mmcf->value_index = ngx_http_memc_add_variable(cf, &ngx_http_memc_value); - if (mmcf->value_index == NGX_ERROR) { - return NGX_ERROR; - } - - return ngx_http_memc_add_more_variables(cf); -} - - -static ngx_int_t -ngx_http_memc_add_variable(ngx_conf_t *cf, ngx_str_t *name) -{ - ngx_http_variable_t *v; - - v = ngx_http_add_variable(cf, name, NGX_HTTP_VAR_CHANGEABLE); - if (v == NULL) { - return NGX_ERROR; - } - - v->get_handler = ngx_http_memc_variable_not_found; - return ngx_http_get_variable_index(cf, name); -} - - -static ngx_int_t -ngx_http_memc_variable_not_found(ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data) -{ - v->not_found = 1; - return NGX_OK; -} - - -static ngx_int_t -ngx_http_memc_add_more_variables(ngx_conf_t *cf) -{ - ngx_http_variable_t *var, *v; - for (v = ngx_http_memc_variables; v->name.len; v++) { - var = ngx_http_add_variable(cf, &v->name, v->flags); - if (var == NULL) { - return NGX_ERROR; - } - var->get_handler = v->get_handler; - var->data = v->data; - } - return NGX_OK; -} - - -static ngx_int_t -ngx_http_memc_flags_as_http_time_variable( - ngx_http_request_t *r, ngx_http_variable_value_t *v, uintptr_t data) -{ - u_char *p; - size_t len; - time_t flags_time = 0; - ngx_http_memc_ctx_t *ctx; - - ngx_http_variable_value_t *flags_vv; - - ctx = ngx_http_get_module_ctx(r, ngx_http_memc_module); - - flags_vv = ctx->memc_flags_vv; - if (flags_vv == NULL) { - goto not_found; - } - - if (flags_vv->not_found || flags_vv->len == 0) { - goto not_found; - } - - flags_time = ngx_atotm(flags_vv->data, flags_vv->len); - if (flags_time == NGX_ERROR) { - return NGX_ERROR; - } - - len = sizeof("Mon, 28 Sep 1970 06:00:00 GMT") - 1; - - p = ngx_pnalloc(r->pool, len); - if (p == NULL) { - return NGX_ERROR; - } - - ngx_http_time(p, flags_time); - - v->len = len; - v->data = p; - - v->valid = 1; - v->not_found = 0; - v->no_cacheable = 0; - - return NGX_OK; - -not_found: - - v->len = 0; - v->data = NULL; - v->valid = 1; - v->not_found = 1; - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_handler.h b/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_handler.h deleted file mode 100644 index cd63c4c..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_handler.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef NGX_HTTP_MEMC_HANDLER_H -#define NGX_HTTP_MEMC_HANDLER_H - -#include -#include - - -ngx_int_t ngx_http_memc_handler(ngx_http_request_t *r); -ngx_int_t ngx_http_memc_init(ngx_conf_t *cf); - - -#endif /* NGX_HTTP_MEMC_HANDLER_H */ - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_module.c b/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_module.c deleted file mode 100644 index 5b534d2..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_module.c +++ /dev/null @@ -1,404 +0,0 @@ - -/* - * Copyright (C) Igor Sysoev - * Copyright (C) Zhang "agentzh" Yichun - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif - -#include "ddebug.h" -#include "ngx_http_memc_module.h" -#include "ngx_http_memc_handler.h" -#include "ngx_http_memc_util.h" - -#include -#include -#include -#include - - -static void *ngx_http_memc_create_loc_conf(ngx_conf_t *cf); -static char *ngx_http_memc_merge_loc_conf(ngx_conf_t *cf, void *parent, - void *child); -static char *ngx_http_memc_cmds_allowed(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); -static char *ngx_http_memc_pass(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); -static char *ngx_http_memc_upstream_max_fails_unsupported(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static char *ngx_http_memc_upstream_fail_timeout_unsupported(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); -static void *ngx_http_memc_create_main_conf(ngx_conf_t *cf); - - -static ngx_conf_bitmask_t ngx_http_memc_next_upstream_masks[] = { - { ngx_string("error"), NGX_HTTP_UPSTREAM_FT_ERROR }, - { ngx_string("timeout"), NGX_HTTP_UPSTREAM_FT_TIMEOUT }, - { ngx_string("invalid_response"), NGX_HTTP_UPSTREAM_FT_INVALID_HEADER }, - { ngx_string("not_found"), NGX_HTTP_UPSTREAM_FT_HTTP_404 }, - { ngx_string("off"), NGX_HTTP_UPSTREAM_FT_OFF }, - { ngx_null_string, 0 } -}; - - -static ngx_command_t ngx_http_memc_commands[] = { - - { ngx_string("memc_cmds_allowed"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF - |NGX_HTTP_LIF_CONF|NGX_CONF_1MORE, - ngx_http_memc_cmds_allowed, - NGX_HTTP_LOC_CONF_OFFSET, - 0, - NULL }, - - { ngx_string("memc_pass"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE1, - ngx_http_memc_pass, - NGX_HTTP_LOC_CONF_OFFSET, - 0, - NULL }, - - { ngx_string("memc_connect_timeout"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, - ngx_conf_set_msec_slot, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_memc_loc_conf_t, upstream.connect_timeout), - NULL }, - - { ngx_string("memc_send_timeout"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, - ngx_conf_set_msec_slot, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_memc_loc_conf_t, upstream.send_timeout), - NULL }, - - { ngx_string("memc_read_timeout"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, - ngx_conf_set_msec_slot, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_memc_loc_conf_t, upstream.read_timeout), - NULL }, - - { ngx_string("memc_buffer_size"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, - ngx_conf_set_size_slot, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_memc_loc_conf_t, upstream.buffer_size), - NULL }, - - { ngx_string("memc_next_upstream"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, - ngx_conf_set_bitmask_slot, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_memc_loc_conf_t, upstream.next_upstream), - &ngx_http_memc_next_upstream_masks }, - - { ngx_string("memc_upstream_max_fails"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, - ngx_http_memc_upstream_max_fails_unsupported, - 0, - 0, - NULL }, - - { ngx_string("memc_upstream_fail_timeout"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, - ngx_http_memc_upstream_fail_timeout_unsupported, - 0, - 0, - NULL }, - - { ngx_string("memc_flags_to_last_modified"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_FLAG, - ngx_conf_set_flag_slot, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_memc_loc_conf_t, flags_to_last_modified), - NULL }, - - { ngx_string("memc_ignore_client_abort"), - NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_FLAG, - ngx_conf_set_flag_slot, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_memc_loc_conf_t, upstream.ignore_client_abort), - NULL }, - - ngx_null_command -}; - - -static ngx_http_module_t ngx_http_memc_module_ctx = { - NULL, /* preconfiguration */ - ngx_http_memc_init, /* postconfiguration */ - - ngx_http_memc_create_main_conf, /* create main configuration */ - NULL, /* init main configuration */ - - NULL, /* create server configuration */ - NULL, /* merge server configuration */ - - ngx_http_memc_create_loc_conf, /* create location configration */ - ngx_http_memc_merge_loc_conf /* merge location configration */ -}; - - -ngx_module_t ngx_http_memc_module = { - NGX_MODULE_V1, - &ngx_http_memc_module_ctx, /* module context */ - ngx_http_memc_commands, /* module directives */ - NGX_HTTP_MODULE, /* module type */ - NULL, /* init master */ - NULL, /* init module */ - NULL, /* init process */ - NULL, /* init thread */ - NULL, /* exit thread */ - NULL, /* exit process */ - NULL, /* exit master */ - NGX_MODULE_V1_PADDING -}; - - -static void * -ngx_http_memc_create_loc_conf(ngx_conf_t *cf) -{ - ngx_http_memc_loc_conf_t *conf; - - conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_memc_loc_conf_t)); - if (conf == NULL) { - return NULL; - } - - /* - * set by ngx_pcalloc(): - * - * conf->cmds_allowed = NULL; - * conf->upstream.bufs.num = 0; - * conf->upstream.next_upstream = 0; - * conf->upstream.temp_path = NULL; - * conf->upstream.uri = { 0, NULL }; - * conf->upstream.location = NULL; - */ - - conf->flags_to_last_modified = NGX_CONF_UNSET; - - conf->upstream.connect_timeout = NGX_CONF_UNSET_MSEC; - conf->upstream.send_timeout = NGX_CONF_UNSET_MSEC; - conf->upstream.read_timeout = NGX_CONF_UNSET_MSEC; - - conf->upstream.buffer_size = NGX_CONF_UNSET_SIZE; - - conf->upstream.ignore_client_abort = NGX_CONF_UNSET; - - /* the hardcoded values */ - conf->upstream.cyclic_temp_file = 0; - conf->upstream.buffering = 0; - conf->upstream.send_lowat = 0; - conf->upstream.bufs.num = 0; - conf->upstream.busy_buffers_size = 0; - conf->upstream.max_temp_file_size = 0; - conf->upstream.temp_file_write_size = 0; - conf->upstream.intercept_errors = 1; - conf->upstream.intercept_404 = 1; - conf->upstream.pass_request_headers = 0; - conf->upstream.pass_request_body = 0; - - return conf; -} - - -static char * -ngx_http_memc_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) -{ - ngx_http_memc_loc_conf_t *prev = parent; - ngx_http_memc_loc_conf_t *conf = child; - - ngx_conf_merge_value(conf->flags_to_last_modified, - prev->flags_to_last_modified, 0); - - ngx_conf_merge_msec_value(conf->upstream.connect_timeout, - prev->upstream.connect_timeout, 60000); - - ngx_conf_merge_msec_value(conf->upstream.send_timeout, - prev->upstream.send_timeout, 60000); - - ngx_conf_merge_msec_value(conf->upstream.read_timeout, - prev->upstream.read_timeout, 60000); - - ngx_conf_merge_size_value(conf->upstream.buffer_size, - prev->upstream.buffer_size, - (size_t) ngx_pagesize); - - ngx_conf_merge_bitmask_value(conf->upstream.next_upstream, - prev->upstream.next_upstream, - (NGX_CONF_BITMASK_SET - |NGX_HTTP_UPSTREAM_FT_ERROR - |NGX_HTTP_UPSTREAM_FT_TIMEOUT)); - - if (conf->upstream.next_upstream & NGX_HTTP_UPSTREAM_FT_OFF) { - conf->upstream.next_upstream = NGX_CONF_BITMASK_SET - |NGX_HTTP_UPSTREAM_FT_OFF; - } - - if (conf->upstream.upstream == NULL) { - conf->upstream.upstream = prev->upstream.upstream; - } - - if (conf->cmds_allowed == NULL) { - conf->cmds_allowed = prev->cmds_allowed; - } - - ngx_conf_merge_value(conf->upstream.ignore_client_abort, - prev->upstream.ignore_client_abort, 0); - - return NGX_CONF_OK; -} - - -static char * -ngx_http_memc_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_http_memc_loc_conf_t *mlcf = conf; - ngx_http_memc_main_conf_t *mmcf; - - ngx_str_t *value; - ngx_url_t url; - ngx_http_core_loc_conf_t *clcf; - ngx_uint_t n; - - ngx_http_compile_complex_value_t ccv; - - if (mlcf->upstream.upstream) { - return "is duplicate"; - } - - clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module); - - clcf->handler = ngx_http_memc_handler; - - if (clcf->name.data[clcf->name.len - 1] == '/') { - clcf->auto_redirect = 1; - } - - mmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_memc_module); - mmcf->module_used = 1; - - value = cf->args->elts; - - n = ngx_http_script_variables_count(&value[1]); - if (n) { - mlcf->complex_target = ngx_palloc(cf->pool, - sizeof(ngx_http_complex_value_t)); - if (mlcf->complex_target == NULL) { - return NGX_CONF_ERROR; - } - - ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); - ccv.cf = cf; - ccv.value = &value[1]; - ccv.complex_value = mlcf->complex_target; - - if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { - return NGX_CONF_ERROR; - } - - return NGX_CONF_OK; - } - - mlcf->complex_target = NULL; - - ngx_memzero(&url, sizeof(ngx_url_t)); - - url.url = value[1]; - url.no_resolve = 1; - - mlcf->upstream.upstream = ngx_http_upstream_add(cf, &url, 0); - if (mlcf->upstream.upstream == NULL) { - return NGX_CONF_ERROR; - } - - return NGX_CONF_OK; -} - - -static char * -ngx_http_memc_upstream_max_fails_unsupported(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf) -{ - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "\"memc_upstream_max_fails\" is not supported, " - "use the \"max_fails\" parameter of the \"server\" " - "directive inside the \"upstream\" block"); - - return NGX_CONF_ERROR; -} - - -static char * -ngx_http_memc_upstream_fail_timeout_unsupported(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf) -{ - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "\"memc_upstream_fail_timeout\" is not supported, " - "use the \"fail_timeout\" parameter of the \"server\" " - "directive inside the \"upstream\" block"); - - return NGX_CONF_ERROR; -} - -static char * -ngx_http_memc_cmds_allowed(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_http_memc_loc_conf_t *mlcf = conf; - - ngx_uint_t i; - ngx_str_t *value; - ngx_http_memc_cmd_t memc_cmd; - ngx_http_memc_cmd_t *c; - ngx_flag_t is_storage_cmd; - - value = cf->args->elts; - - mlcf->cmds_allowed = ngx_array_create(cf->pool, cf->args->nelts - 1, - sizeof(ngx_http_memc_cmd_t)); - - if (mlcf->cmds_allowed == NULL) { - return NGX_CONF_ERROR; - } - - for (i = 1; i < cf->args->nelts; i++) { - memc_cmd = ngx_http_memc_parse_cmd(value[i].data, value[i].len, - &is_storage_cmd); - - if (memc_cmd == ngx_http_memc_cmd_unknown) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "Unknown memcached command \"%V\" used in " - "\"memc_cmds_allowed\"", &value[i]); - - return NGX_CONF_ERROR; - } - - c = ngx_array_push(mlcf->cmds_allowed); - if (c == NULL) { - return NGX_CONF_ERROR; - } - - *c = memc_cmd; - } - - return NGX_CONF_OK; -} - - -static void * -ngx_http_memc_create_main_conf(ngx_conf_t *cf) -{ - ngx_http_memc_main_conf_t *mmcf; - - mmcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_memc_main_conf_t)); - if (mmcf == NULL) { - return NULL; - } - - return mmcf; -} diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_module.h b/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_module.h deleted file mode 100644 index bea4578..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_module.h +++ /dev/null @@ -1,98 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef NGX_HTTP_MEMC_MODULE_H -#define NGX_HTTP_MEMC_MODULE_H - - -#include -#include -#include - - -typedef enum { - ngx_http_memc_cmd_set, - ngx_http_memc_cmd_add, - ngx_http_memc_cmd_replace, - ngx_http_memc_cmd_append, - ngx_http_memc_cmd_prepend, - /* ngx_http_memc_cmd_cas, */ - - ngx_http_memc_cmd_get, - /* ngx_http_memc_cmd_gets, */ - - ngx_http_memc_cmd_delete, - - ngx_http_memc_cmd_incr, - ngx_http_memc_cmd_decr, - - ngx_http_memc_cmd_stats, - - ngx_http_memc_cmd_flush_all, - ngx_http_memc_cmd_version, - /* ngx_http_memc_cmd_verbosity, */ - - /* we do not want to support the "quit" command here */ - /* ngx_http_memc_cmd_quit, */ - - ngx_http_memc_cmd_unknown -} ngx_http_memc_cmd_t; - - -typedef struct { - ngx_flag_t flags_to_last_modified; - ngx_http_upstream_conf_t upstream; - ngx_array_t *cmds_allowed; - ngx_http_complex_value_t *complex_target; - -} ngx_http_memc_loc_conf_t; - - -typedef struct { - ngx_int_t key_index; - ngx_int_t cmd_index; - ngx_int_t value_index; - ngx_int_t flags_index; - ngx_int_t exptime_index; - ngx_int_t module_used; -} ngx_http_memc_main_conf_t; - - -typedef struct { -#if defined(nginx_version) && nginx_version >= 1001004 - off_t rest; -#else - size_t rest; -#endif - - ngx_http_request_t *request; - ngx_str_t key; - - ngx_str_t cmd_str; - ngx_http_memc_cmd_t cmd; - - ngx_http_variable_value_t *memc_value_vv; - ngx_http_variable_value_t *memc_key_vv; - ngx_http_variable_value_t *memc_flags_vv; - ngx_http_variable_value_t *memc_exptime_vv; - - ngx_flag_t is_storage_cmd; - - int parser_state; - - /* just for the subrequests in memory support */ - size_t body_length; - -} ngx_http_memc_ctx_t; - - -extern ngx_module_t ngx_http_memc_module; - - -#define NGX_HTTP_MEMC_END (sizeof(CRLF "END" CRLF) - 1) - - -#endif /* NGX_HTTP_MEMC_MODULE_H */ diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_request.c b/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_request.c deleted file mode 100644 index 482a001..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_request.c +++ /dev/null @@ -1,571 +0,0 @@ - -/* - * Copyright (c) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include "ngx_http_memc_request.h" -#include "ngx_http_memc_module.h" -#include "ngx_http_memc_util.h" - - -ngx_int_t -ngx_http_memc_create_storage_cmd_request(ngx_http_request_t *r) -{ - size_t len; - off_t bytes; - size_t bytes_len; - uintptr_t escape; - ngx_buf_t *b; - ngx_chain_t *cl, *in; - ngx_chain_t **ll; - ngx_http_memc_ctx_t *ctx; - - ngx_http_variable_value_t *key_vv; - ngx_http_variable_value_t *flags_vv; - ngx_http_variable_value_t *exptime_vv; - ngx_http_variable_value_t *memc_value_vv; - - u_char bytes_buf[NGX_UINT32_LEN]; - - /* TODO add support for the "cas" command */ - - ctx = ngx_http_get_module_ctx(r, ngx_http_memc_module); - - /* prepare the "key" argument */ - - key_vv = ctx->memc_key_vv; - - if (key_vv == NULL || key_vv->not_found || key_vv->len == 0) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "the \"$memc_key\" variable is not set"); - return NGX_ERROR; - } - - escape = 2 * ngx_escape_uri(NULL, key_vv->data, key_vv->len, - NGX_ESCAPE_MEMCACHED); - - /* prepare the "bytes" argument */ - - if (ctx->memc_value_vv && !ctx->memc_value_vv->not_found) { - dd("found variable $memc_value"); - - memc_value_vv = ctx->memc_value_vv; - - bytes = memc_value_vv->len; - - } else if (r->request_body == NULL || r->request_body->bufs == NULL) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "neither the \"$memc_value\" variable " - "nor the request body is available"); - return NGX_HTTP_INTERNAL_SERVER_ERROR; - - } else { - memc_value_vv = NULL; - - bytes = 0; - for (cl = r->request_body->bufs; cl; cl = cl->next) { - bytes += ngx_buf_size(cl->buf); - } - } - - bytes_len = ngx_snprintf(bytes_buf, sizeof(bytes_buf), "%O", bytes) - - bytes_buf; - - /* prepare the "flags" argument */ - - flags_vv = ctx->memc_flags_vv; - - if (flags_vv == NULL) { - return NGX_ERROR; - } - - if (flags_vv->not_found) { - flags_vv->not_found = 0; - flags_vv->valid = 1; - flags_vv->no_cacheable = 0; - flags_vv->len = sizeof("0") - 1; - flags_vv->data = (u_char *) "0"; - } else if (flags_vv->len == 0) { - flags_vv->len = sizeof("0") - 1; - flags_vv->data = (u_char *) "0"; - } - - /* prepare the "exptime" argument */ - - exptime_vv = ctx->memc_exptime_vv; - - if (exptime_vv == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - if (exptime_vv->not_found || exptime_vv->len == 0) { - dd("setting exptime to its default value 0..."); - - exptime_vv->not_found = 0; - exptime_vv->valid = 1; - exptime_vv->no_cacheable = 0; - exptime_vv->len = sizeof("0") - 1; - exptime_vv->data = (u_char *) "0"; - } - - /* calculate the total length of the command */ - - len = ctx->cmd_str.len + sizeof(" ") - 1 - + key_vv->len + escape + sizeof(" ") - 1 - + flags_vv->len + sizeof(" ") - 1 - + exptime_vv->len + sizeof(" ") - 1 - + bytes_len - + sizeof(CRLF) - 1; - - b = ngx_create_temp_buf(r->pool, len); - if (b == NULL) { - return NGX_ERROR; - } - - cl = ngx_alloc_chain_link(r->pool); - if (cl == NULL) { - return NGX_ERROR; - } - - cl->buf = b; - cl->next = NULL; - - ll = &cl->next; - - r->upstream->request_bufs = cl; - - /* copy the memcached command over */ - - b->last = ngx_copy(b->last, ctx->cmd_str.data, ctx->cmd_str.len); - - *b->last++ = ' '; - - /* copy the memcached key over */ - - ctx->key.data = b->last; - - if (escape == 0) { - b->last = ngx_copy(b->last, key_vv->data, key_vv->len); - - } else { - b->last = (u_char *) ngx_escape_uri(b->last, key_vv->data, key_vv->len, - NGX_ESCAPE_MEMCACHED); - } - - ctx->key.len = b->last - ctx->key.data; - - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "http memcached request: \"%V\"", &ctx->key); - - *b->last++ = ' '; - - /* copy the memcached flags over */ - - b->last = ngx_copy(b->last, flags_vv->data, flags_vv->len); - - *b->last++ = ' '; - - /* copy the memcached exptime over */ - - b->last = ngx_copy(b->last, exptime_vv->data, exptime_vv->len); - - *b->last++ = ' '; - - /* copy the memcached bytes over */ - - b->last = ngx_copy(b->last, bytes_buf, bytes_len); - - *b->last++ = CR; *b->last++ = LF; - - if (memc_value_vv) { - if (memc_value_vv->len) { - dd("copy $memc_value to the request"); - b = ngx_calloc_buf(r->pool); - - if (b == NULL) { - return NGX_ERROR; - } - - b->memory = 1; - - b->start = b->pos = memc_value_vv->data; - b->last = b->end = b->start + memc_value_vv->len; - - cl = ngx_alloc_chain_link(r->pool); - if (cl == NULL) { - return NGX_ERROR; - } - - cl->buf = b; - cl->next = NULL; - - *ll = cl; - ll = &cl->next; - } - - } else { - /* to preserve the r->request_body->bufs untouched */ - - in = r->request_body->bufs; - - while (in) { - cl = ngx_alloc_chain_link(r->pool); - if (cl == NULL) { - return NGX_ERROR; - } - - cl->buf = ngx_calloc_buf(r->pool); - if (cl->buf == NULL) { - return NGX_ERROR; - } - - cl->buf->memory = 1; - *cl->buf = *in->buf; - - *ll = cl; - ll = &cl->next; - in = in->next; - } - } - - /* append the trailing CRLF */ - - b = ngx_calloc_buf(r->pool); - - if (b == NULL) { - return NGX_ERROR; - } - - b->start = b->pos = (u_char *) CRLF; - b->last = b->end = b->start + sizeof(CRLF) - 1; - - b->memory = 1; - - cl = ngx_alloc_chain_link(r->pool); - if (cl == NULL) { - return NGX_ERROR; - } - - cl->buf = b; - cl->next = NULL; - - *ll = cl; - - return NGX_OK; -} - - -ngx_int_t -ngx_http_memc_create_get_cmd_request(ngx_http_request_t *r) -{ - size_t len; - uintptr_t escape; - ngx_buf_t *b; - ngx_chain_t *cl; - ngx_http_memc_ctx_t *ctx; - ngx_http_variable_value_t *vv; - - ctx = ngx_http_get_module_ctx(r, ngx_http_memc_module); - - vv = ctx->memc_key_vv; - - if (vv == NULL || vv->not_found || vv->len == 0) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "the \"$memc_key\" variable is not set"); - return NGX_ERROR; - } - - escape = 2 * ngx_escape_uri(NULL, vv->data, vv->len, NGX_ESCAPE_MEMCACHED); - - len = sizeof("get ") - 1 + vv->len + escape + sizeof(CRLF) - 1; - - b = ngx_create_temp_buf(r->pool, len); - if (b == NULL) { - return NGX_ERROR; - } - - cl = ngx_alloc_chain_link(r->pool); - if (cl == NULL) { - return NGX_ERROR; - } - - cl->buf = b; - cl->next = NULL; - - r->upstream->request_bufs = cl; - - *b->last++ = 'g'; *b->last++ = 'e'; *b->last++ = 't'; *b->last++ = ' '; - - ctx->key.data = b->last; - - if (escape == 0) { - b->last = ngx_copy(b->last, vv->data, vv->len); - - } else { - b->last = (u_char *) ngx_escape_uri(b->last, vv->data, vv->len, - NGX_ESCAPE_MEMCACHED); - } - - ctx->key.len = b->last - ctx->key.data; - - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "http memcached request: \"%V\"", &ctx->key); - - *b->last++ = CR; *b->last++ = LF; - - ctx->parser_state = NGX_ERROR; - - return NGX_OK; -} - -ngx_int_t -ngx_http_memc_create_noarg_cmd_request(ngx_http_request_t *r) -{ - size_t len; - ngx_buf_t *b; - ngx_http_memc_ctx_t *ctx; - ngx_chain_t *cl; - - ctx = ngx_http_get_module_ctx(r, ngx_http_memc_module); - - len = ctx->cmd_str.len + sizeof(CRLF) - 1; - - b = ngx_create_temp_buf(r->pool, len); - if (b == NULL) { - return NGX_ERROR; - } - - cl = ngx_alloc_chain_link(r->pool); - if (cl == NULL) { - return NGX_ERROR; - } - - cl->buf = b; - cl->next = NULL; - - r->upstream->request_bufs = cl; - - b->last = ngx_copy(b->last, ctx->cmd_str.data, ctx->cmd_str.len); - - *b->last++ = CR; *b->last++ = LF; - - return NGX_OK; -} - - -ngx_int_t -ngx_http_memc_create_flush_all_cmd_request(ngx_http_request_t *r) -{ - size_t len; - ngx_buf_t *b; - ngx_http_memc_ctx_t *ctx; - ngx_chain_t *cl; - ngx_http_variable_value_t *exptime_vv; - - ctx = ngx_http_get_module_ctx(r, ngx_http_memc_module); - - /* prepare the (optional) "exptime" argument */ - - exptime_vv = ctx->memc_exptime_vv; - - if (exptime_vv == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - len = ctx->cmd_str.len; - - if (!exptime_vv->not_found && exptime_vv->len) { - dd("found exptime: %s", exptime_vv->data); - - len += sizeof(" ") - 1 + exptime_vv->len; - } - - len += sizeof(CRLF) - 1; - - b = ngx_create_temp_buf(r->pool, len); - if (b == NULL) { - return NGX_ERROR; - } - - cl = ngx_alloc_chain_link(r->pool); - if (cl == NULL) { - return NGX_ERROR; - } - - cl->buf = b; - cl->next = NULL; - - r->upstream->request_bufs = cl; - - b->last = ngx_copy(b->last, ctx->cmd_str.data, ctx->cmd_str.len); - - if (!exptime_vv->not_found && exptime_vv->len) { - *b->last++ = ' '; - b->last = ngx_copy(b->last, exptime_vv->data, exptime_vv->len); - } - - *b->last++ = CR; *b->last++ = LF; - - return NGX_OK; -} - - -ngx_int_t -ngx_http_memc_create_delete_cmd_request(ngx_http_request_t *r) -{ - size_t len; - ngx_buf_t *b; - ngx_http_memc_ctx_t *ctx; - ngx_chain_t *cl; - uintptr_t escape; - ngx_http_variable_value_t *key_vv; - ngx_http_variable_value_t *exptime_vv; - - ctx = ngx_http_get_module_ctx(r, ngx_http_memc_module); - - /* prepare the "key" argument */ - - key_vv = ctx->memc_key_vv; - - if (key_vv == NULL || key_vv->not_found || key_vv->len == 0) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "the \"$memc_key\" variable is not set"); - return NGX_ERROR; - } - - escape = 2 * ngx_escape_uri(NULL, key_vv->data, key_vv->len, - NGX_ESCAPE_MEMCACHED); - - /* prepare the (optional) "exptime" argument */ - - exptime_vv = ctx->memc_exptime_vv; - - if (exptime_vv == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - len = ctx->cmd_str.len + sizeof(" ") - 1 + key_vv->len + escape; - - if (!exptime_vv->not_found && exptime_vv->len) { - dd("found exptime: %s", exptime_vv->data); - - len += sizeof(" ") - 1 + exptime_vv->len; - } - - len += sizeof(CRLF) - 1; - - b = ngx_create_temp_buf(r->pool, len); - if (b == NULL) { - return NGX_ERROR; - } - - cl = ngx_alloc_chain_link(r->pool); - if (cl == NULL) { - return NGX_ERROR; - } - - cl->buf = b; - cl->next = NULL; - - r->upstream->request_bufs = cl; - - b->last = ngx_copy(b->last, ctx->cmd_str.data, ctx->cmd_str.len); - - *b->last++ = ' '; - - if (escape == 0) { - b->last = ngx_copy(b->last, key_vv->data, key_vv->len); - - } else { - b->last = (u_char *) ngx_escape_uri(b->last, key_vv->data, key_vv->len, - NGX_ESCAPE_MEMCACHED); - } - - if (!exptime_vv->not_found && exptime_vv->len) { - *b->last++ = ' '; - b->last = ngx_copy(b->last, exptime_vv->data, exptime_vv->len); - } - - *b->last++ = CR; *b->last++ = LF; - - return NGX_OK; -} - - -ngx_int_t -ngx_http_memc_create_incr_decr_cmd_request(ngx_http_request_t *r) -{ - size_t len; - ngx_buf_t *b; - ngx_http_memc_ctx_t *ctx; - ngx_chain_t *cl; - uintptr_t escape; - ngx_http_variable_value_t *key_vv; - ngx_http_variable_value_t *value_vv; - - ctx = ngx_http_get_module_ctx(r, ngx_http_memc_module); - - /* prepare the "key" argument */ - - key_vv = ctx->memc_key_vv; - - if (key_vv == NULL || key_vv->not_found || key_vv->len == 0) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "the \"$memc_key\" variable is not set"); - return NGX_ERROR; - } - - escape = 2 * ngx_escape_uri(NULL, key_vv->data, key_vv->len, - NGX_ESCAPE_MEMCACHED); - - /* prepare the "value" argument */ - - value_vv = ctx->memc_value_vv; - - /* XXX validate if $memc_value_vv is a valid uint64 string */ - - len = ctx->cmd_str.len + sizeof(" ") - 1 + key_vv->len + escape - + sizeof(" ") - 1 + value_vv->len + sizeof(CRLF) - 1; - - b = ngx_create_temp_buf(r->pool, len); - if (b == NULL) { - return NGX_ERROR; - } - - cl = ngx_alloc_chain_link(r->pool); - if (cl == NULL) { - return NGX_ERROR; - } - - cl->buf = b; - cl->next = NULL; - - r->upstream->request_bufs = cl; - - b->last = ngx_copy(b->last, ctx->cmd_str.data, ctx->cmd_str.len); - - *b->last++ = ' '; - - if (escape == 0) { - b->last = ngx_copy(b->last, key_vv->data, key_vv->len); - - } else { - b->last = (u_char *) ngx_escape_uri(b->last, key_vv->data, key_vv->len, - NGX_ESCAPE_MEMCACHED); - } - - *b->last++ = ' '; - - b->last = ngx_copy(b->last, value_vv->data, value_vv->len); - - *b->last++ = CR; *b->last++ = LF; - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_request.h b/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_request.h deleted file mode 100644 index 10e74c6..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_request.h +++ /dev/null @@ -1,27 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef NGX_HTTP_MEMC_REQUEST_H -#define NGX_HTTP_MEMC_REQUEST_H - -#include -#include - -ngx_int_t ngx_http_memc_create_get_cmd_request(ngx_http_request_t *r); - -ngx_int_t ngx_http_memc_create_storage_cmd_request(ngx_http_request_t *r); - -ngx_int_t ngx_http_memc_create_noarg_cmd_request(ngx_http_request_t *r); - -ngx_int_t ngx_http_memc_create_flush_all_cmd_request(ngx_http_request_t *r); - -ngx_int_t ngx_http_memc_create_delete_cmd_request(ngx_http_request_t *r); - -ngx_int_t ngx_http_memc_create_incr_decr_cmd_request(ngx_http_request_t *r); - - -#endif /* NGX_HTTP_MEMC_REQUEST_H */ - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_response.c b/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_response.c deleted file mode 100644 index 5f702e7..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_response.c +++ /dev/null @@ -1,1914 +0,0 @@ - -#line 1 "src/ngx_http_memc_response.rl" - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include "ngx_http_memc_response.h" -#include "ngx_http_memc_module.h" - - -#ifdef s_char -#undef s_char -#endif - -#define s_char signed char - - - -#line 24 "src/ngx_http_memc_response.rl" - -#line 29 "src/ngx_http_memc_response.c" -static const char _memc_storage_key_offsets[] = { - 0, 0, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, - 19, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, - 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60 -}; - -static const char _memc_storage_trans_keys[] = { - 67, 69, 78, 83, 76, 73, 69, 78, - 84, 95, 69, 82, 82, 79, 82, 32, - 13, 10, 13, 82, 88, 82, 79, 82, - 13, 10, 73, 83, 84, 83, 13, 10, - 79, 84, 95, 70, 83, 79, 85, 78, - 68, 13, 10, 84, 79, 82, 69, 68, - 69, 84, 82, 86, 69, 82, 79, 82, - 69, 68, 13, 10, 0 -}; - -static const char _memc_storage_single_lengths[] = { - 0, 4, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, - 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 2, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 0 -}; - -static const char _memc_storage_range_lengths[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0 -}; - -static const unsigned char _memc_storage_index_offsets[] = { - 0, 0, 5, 7, 9, 11, 13, 15, - 17, 19, 21, 23, 25, 27, 29, 31, - 34, 37, 39, 41, 43, 45, 47, 49, - 51, 53, 55, 57, 59, 61, 63, 65, - 68, 70, 72, 74, 76, 78, 80, 82, - 84, 86, 88, 90, 93, 95, 97, 99, - 101, 103, 105, 107, 109, 111, 113 -}; - -static const char _memc_storage_trans_targs[] = { - 2, 16, 28, 43, 0, 3, 0, 4, - 0, 5, 0, 6, 0, 7, 0, 8, - 0, 9, 0, 10, 0, 11, 0, 12, - 0, 13, 0, 14, 0, 15, 14, 54, - 15, 14, 17, 22, 0, 18, 0, 19, - 0, 20, 0, 21, 0, 54, 0, 23, - 0, 24, 0, 25, 0, 26, 0, 27, - 0, 54, 0, 29, 0, 30, 0, 31, - 0, 32, 38, 0, 33, 0, 34, 0, - 35, 0, 36, 0, 37, 0, 54, 0, - 39, 0, 40, 0, 41, 0, 42, 0, - 26, 0, 44, 48, 0, 45, 0, 46, - 0, 47, 0, 7, 0, 49, 0, 50, - 0, 51, 0, 52, 0, 53, 0, 54, - 0, 0, 0 -}; - -static const char _memc_storage_trans_actions[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 4, - 0, 0, 0 -}; - -static const int memc_storage_start = 1; -static const int memc_storage_first_final = 54; -static const int memc_storage_error = 0; - - - -#line 25 "src/ngx_http_memc_response.rl" - - -#line 27 "src/ngx_http_memc_response.rl" - -#line 129 "src/ngx_http_memc_response.c" -static const char _memc_flush_all_key_offsets[] = { - 0, 0, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, - 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33 -}; - -static const short _memc_flush_all_trans_keys[] = { - 67, 69, 79, 83, 76, 73, 69, 78, - 84, 95, 69, 82, 82, 79, 82, 32, - 13, 10, 13, 82, 82, 79, 82, 13, - 10, 75, 13, 10, 69, 82, 86, 69, - 82, 0 -}; - -static const char _memc_flush_all_single_lengths[] = { - 0, 4, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 0 -}; - -static const char _memc_flush_all_range_lengths[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0 -}; - -static const char _memc_flush_all_index_offsets[] = { - 0, 0, 5, 7, 9, 11, 13, 15, - 17, 19, 21, 23, 25, 27, 29, 31, - 34, 36, 38, 40, 42, 44, 46, 48, - 50, 52, 54, 56, 58, 60, 62 -}; - -static const char _memc_flush_all_indicies[] = { - 0, 2, 3, 4, 1, 5, 1, 6, - 1, 7, 1, 8, 1, 9, 1, 10, - 1, 11, 1, 12, 1, 13, 1, 14, - 1, 15, 1, 16, 1, 17, 16, 18, - 17, 16, 19, 1, 20, 1, 21, 1, - 22, 1, 23, 1, 18, 1, 24, 1, - 25, 1, 26, 1, 27, 1, 28, 1, - 29, 1, 30, 1, 9, 1, 1, 0 -}; - -static const char _memc_flush_all_trans_targs[] = { - 2, 0, 16, 22, 25, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 30, 17, 18, 19, 20, 21, - 23, 24, 30, 26, 27, 28, 29 -}; - -static const char _memc_flush_all_trans_actions[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 2, 0, 0, 0, 0 -}; - -static const int memc_flush_all_start = 1; -static const int memc_flush_all_first_final = 30; -static const int memc_flush_all_error = 0; - - - -#line 28 "src/ngx_http_memc_response.rl" - - -#line 30 "src/ngx_http_memc_response.rl" - -#line 203 "src/ngx_http_memc_response.c" -static const char _memc_version_key_offsets[] = { - 0, 0, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, - 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 41, 43, 43, - 43 -}; - -static const short _memc_version_trans_keys[] = { - 67, 69, 83, 86, 76, 73, 69, 78, - 84, 95, 69, 82, 82, 79, 82, 32, - 13, 10, 13, 82, 82, 79, 82, 13, - 10, 69, 82, 86, 69, 82, 69, 82, - 83, 73, 79, 78, 32, 13, 13, 10, - 13, 10, 13, 13, 0 -}; - -static const char _memc_version_single_lengths[] = { - 0, 4, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 2, 2, 0, 0, - 1 -}; - -static const char _memc_version_range_lengths[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0 -}; - -static const char _memc_version_index_offsets[] = { - 0, 0, 5, 7, 9, 11, 13, 15, - 17, 19, 21, 23, 25, 27, 29, 31, - 34, 36, 38, 40, 42, 44, 46, 48, - 50, 52, 54, 56, 58, 60, 62, 64, - 66, 68, 70, 72, 74, 77, 80, 81, - 82 -}; - -static const char _memc_version_indicies[] = { - 0, 2, 3, 4, 1, 5, 1, 6, - 1, 7, 1, 8, 1, 9, 1, 10, - 1, 11, 1, 12, 1, 13, 1, 14, - 1, 15, 1, 16, 1, 17, 16, 18, - 17, 16, 19, 1, 20, 1, 21, 1, - 22, 1, 23, 1, 18, 1, 24, 1, - 25, 1, 26, 1, 27, 1, 9, 1, - 28, 1, 29, 1, 30, 1, 31, 1, - 32, 1, 33, 1, 34, 1, 36, 35, - 37, 35, 38, 37, 35, 39, 37, 35, - 35, 1, 37, 35, 0 -}; - -static const char _memc_version_trans_targs[] = { - 2, 0, 16, 22, 27, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 39, 17, 18, 19, 20, 21, - 23, 24, 25, 26, 28, 29, 30, 31, - 32, 33, 34, 35, 37, 36, 40, 38 -}; - -static const char _memc_version_trans_actions[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 2, 0 -}; - -static const int memc_version_start = 1; -static const int memc_version_first_final = 39; -static const int memc_version_error = 0; - - - -#line 31 "src/ngx_http_memc_response.rl" - - -#line 33 "src/ngx_http_memc_response.rl" - -#line 291 "src/ngx_http_memc_response.c" -static const char _memc_stats_key_offsets[] = { - 0, 0, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, - 18, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 41, 43, 45, 47, - 48, 50, 52, 52, 52 -}; - -static const short _memc_stats_trans_keys[] = { - 67, 69, 83, 76, 73, 69, 78, 84, - 95, 69, 82, 82, 79, 82, 32, 13, - 10, 13, 78, 82, 68, 13, 10, 82, - 79, 82, 13, 10, 69, 84, 82, 86, - 69, 82, 65, 84, 32, 13, 13, 10, - 13, 13, 69, 13, 78, 13, 68, 13, - 10, 13, 10, 13, 13, 69, 0 -}; - -static const char _memc_stats_single_lengths[] = { - 0, 3, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, - 2, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 2, 2, 2, 2, 1, - 2, 2, 0, 0, 2 -}; - -static const char _memc_stats_range_lengths[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0 -}; - -static const unsigned char _memc_stats_index_offsets[] = { - 0, 0, 4, 6, 8, 10, 12, 14, - 16, 18, 20, 22, 24, 26, 28, 30, - 33, 36, 38, 40, 42, 44, 46, 48, - 50, 52, 55, 57, 59, 61, 63, 65, - 67, 69, 71, 73, 76, 79, 82, 85, - 87, 90, 93, 94, 95 -}; - -static const char _memc_stats_indicies[] = { - 0, 2, 3, 1, 4, 1, 5, 1, - 6, 1, 7, 1, 8, 1, 9, 1, - 10, 1, 11, 1, 12, 1, 13, 1, - 14, 1, 15, 1, 16, 15, 17, 16, - 15, 18, 19, 1, 20, 1, 21, 1, - 22, 1, 23, 1, 24, 1, 25, 1, - 26, 1, 17, 1, 27, 28, 1, 29, - 1, 30, 1, 31, 1, 8, 1, 32, - 1, 33, 1, 34, 1, 36, 35, 37, - 35, 38, 37, 35, 37, 39, 35, 37, - 40, 35, 37, 41, 35, 42, 35, 43, - 37, 35, 44, 37, 35, 35, 1, 37, - 39, 35, 0 -}; - -static const char _memc_stats_trans_targs[] = { - 2, 0, 16, 25, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, - 15, 43, 17, 20, 18, 19, 43, 21, - 22, 23, 24, 26, 30, 27, 28, 29, - 31, 32, 33, 34, 41, 35, 36, 37, - 38, 39, 40, 44, 42 -}; - -static const char _memc_stats_trans_actions[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 2, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 2, 0 -}; - -static const int memc_stats_start = 1; -static const int memc_stats_first_final = 43; -static const int memc_stats_error = 0; - - - -#line 34 "src/ngx_http_memc_response.rl" - - -#line 36 "src/ngx_http_memc_response.rl" - -#line 384 "src/ngx_http_memc_response.c" -static const char _memc_delete_key_offsets[] = { - 0, 0, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, - 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49 -}; - -static const short _memc_delete_trans_keys[] = { - 67, 68, 69, 78, 83, 76, 73, 69, - 78, 84, 95, 69, 82, 82, 79, 82, - 32, 13, 10, 13, 69, 76, 69, 84, - 69, 68, 13, 10, 82, 82, 79, 82, - 13, 10, 79, 84, 95, 70, 79, 85, - 78, 68, 13, 10, 69, 82, 86, 69, - 82, 0 -}; - -static const char _memc_delete_single_lengths[] = { - 0, 5, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 0 -}; - -static const char _memc_delete_range_lengths[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0 -}; - -static const unsigned char _memc_delete_index_offsets[] = { - 0, 0, 6, 8, 10, 12, 14, 16, - 18, 20, 22, 24, 26, 28, 30, 32, - 35, 37, 39, 41, 43, 45, 47, 49, - 51, 53, 55, 57, 59, 61, 63, 65, - 67, 69, 71, 73, 75, 77, 79, 81, - 83, 85, 87, 89, 91, 93 -}; - -static const char _memc_delete_trans_targs[] = { - 2, 16, 24, 30, 40, 0, 3, 0, - 4, 0, 5, 0, 6, 0, 7, 0, - 8, 0, 9, 0, 10, 0, 11, 0, - 12, 0, 13, 0, 14, 0, 15, 14, - 45, 15, 14, 17, 0, 18, 0, 19, - 0, 20, 0, 21, 0, 22, 0, 23, - 0, 45, 0, 25, 0, 26, 0, 27, - 0, 28, 0, 29, 0, 45, 0, 31, - 0, 32, 0, 33, 0, 34, 0, 35, - 0, 36, 0, 37, 0, 38, 0, 39, - 0, 45, 0, 41, 0, 42, 0, 43, - 0, 44, 0, 7, 0, 0, 0 -}; - -static const char _memc_delete_trans_actions[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 3, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0 -}; - -static const int memc_delete_start = 1; -static const int memc_delete_first_final = 45; -static const int memc_delete_error = 0; - - - -#line 37 "src/ngx_http_memc_response.rl" - - -#line 39 "src/ngx_http_memc_response.rl" - -#line 473 "src/ngx_http_memc_response.c" -static const char _memc_incr_decr_key_offsets[] = { - 0, 0, 6, 10, 11, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, - 49 -}; - -static const short _memc_incr_decr_trans_keys[] = { - 67, 69, 78, 83, 48, 57, 13, 32, - 48, 57, 10, 13, 32, 76, 73, 69, - 78, 84, 95, 69, 82, 82, 79, 82, - 32, 13, 10, 13, 82, 82, 79, 82, - 13, 10, 79, 84, 95, 70, 79, 85, - 78, 68, 13, 10, 69, 82, 86, 69, - 82, 0 -}; - -static const char _memc_incr_decr_single_lengths[] = { - 0, 4, 2, 1, 2, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 0 -}; - -static const char _memc_incr_decr_range_lengths[] = { - 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0 -}; - -static const char _memc_incr_decr_index_offsets[] = { - 0, 0, 6, 10, 12, 15, 17, 19, - 21, 23, 25, 27, 29, 31, 33, 35, - 37, 39, 41, 44, 46, 48, 50, 52, - 54, 56, 58, 60, 62, 64, 66, 68, - 70, 72, 74, 76, 78, 80, 82, 84, - 86 -}; - -static const char _memc_incr_decr_indicies[] = { - 2, 3, 4, 5, 0, 1, 6, 7, - 0, 1, 8, 1, 6, 7, 1, 9, - 1, 10, 1, 11, 1, 12, 1, 13, - 1, 14, 1, 15, 1, 16, 1, 17, - 1, 18, 1, 19, 1, 20, 1, 21, - 20, 22, 21, 20, 23, 1, 24, 1, - 25, 1, 26, 1, 27, 1, 22, 1, - 28, 1, 29, 1, 30, 1, 31, 1, - 32, 1, 33, 1, 34, 1, 35, 1, - 36, 1, 37, 1, 38, 1, 39, 1, - 40, 1, 41, 1, 13, 1, 1, 0 -}; - -static const char _memc_incr_decr_trans_targs[] = { - 2, 0, 5, 19, 25, 35, 3, 4, - 40, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 40, 20, - 21, 22, 23, 24, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 40, 36, 37, - 38, 39 -}; - -static const char _memc_incr_decr_trans_actions[] = { - 1, 0, 1, 1, 1, 1, 1, 1, - 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 3, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 4, 1, 1, - 1, 1 -}; - -static const int memc_incr_decr_start = 1; -static const int memc_incr_decr_first_final = 40; -static const int memc_incr_decr_error = 0; - - - -#line 40 "src/ngx_http_memc_response.rl" - - -u_char ngx_http_memc_end[] = CRLF "END" CRLF; - - -static u_char *parse_memc_storage(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr); -static u_char *parse_memc_flush_all(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr); -static u_char *parse_memc_version(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr); -static u_char *parse_memc_stats(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr); -static u_char *parse_memc_delete(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr); -static u_char *parse_memc_incr_decr(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr); -static ngx_int_t ngx_http_memc_write_simple_response(ngx_http_request_t *r, - ngx_http_upstream_t *u, ngx_http_memc_ctx_t *ctx, - ngx_uint_t status, ngx_str_t *resp); - - -ngx_int_t -ngx_http_memc_process_simple_header(ngx_http_request_t *r) -{ - ngx_int_t rc; - int cs; - s_char *p; - s_char *pe; - s_char *orig; - ngx_str_t resp; - ngx_http_upstream_t *u; - ngx_http_memc_ctx_t *ctx; - ngx_uint_t status; - unsigned done = 0; - int error_state; - int final_state; - - status = NGX_HTTP_OK; - - dd("process simple cmd header"); - - ctx = ngx_http_get_module_ctx(r, ngx_http_memc_module); - - if (ctx->parser_state == NGX_ERROR) { - dd("reinit state"); - - if (ctx->is_storage_cmd) { - dd("init memc_storage machine..."); - - -#line 91 "src/ngx_http_memc_response.rl" - -#line 613 "src/ngx_http_memc_response.c" - { - cs = memc_storage_start; - } - -#line 92 "src/ngx_http_memc_response.rl" - - } else if (ctx->cmd == ngx_http_memc_cmd_flush_all) { - dd("init memc_flush_all machine..."); - - -#line 97 "src/ngx_http_memc_response.rl" - -#line 626 "src/ngx_http_memc_response.c" - { - cs = memc_flush_all_start; - } - -#line 98 "src/ngx_http_memc_response.rl" - - } else if (ctx->cmd == ngx_http_memc_cmd_version) { - dd("init memc_version machine..."); - - -#line 103 "src/ngx_http_memc_response.rl" - -#line 639 "src/ngx_http_memc_response.c" - { - cs = memc_version_start; - } - -#line 104 "src/ngx_http_memc_response.rl" - - } else if (ctx->cmd == ngx_http_memc_cmd_stats) { - dd("init memc_stats machine..."); - - -#line 109 "src/ngx_http_memc_response.rl" - -#line 652 "src/ngx_http_memc_response.c" - { - cs = memc_stats_start; - } - -#line 110 "src/ngx_http_memc_response.rl" - - } else if (ctx->cmd == ngx_http_memc_cmd_delete) { - dd("init memc_delete machine..."); - - -#line 115 "src/ngx_http_memc_response.rl" - -#line 665 "src/ngx_http_memc_response.c" - { - cs = memc_delete_start; - } - -#line 116 "src/ngx_http_memc_response.rl" - - } else if (ctx->cmd == ngx_http_memc_cmd_incr - || ctx->cmd == ngx_http_memc_cmd_decr) - { - dd("init memc_incr_decr machine..."); - - -#line 123 "src/ngx_http_memc_response.rl" - -#line 680 "src/ngx_http_memc_response.c" - { - cs = memc_incr_decr_start; - } - -#line 124 "src/ngx_http_memc_response.rl" - - } else { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "unrecognized memcached command in " - "ngx_http_memc_process_simple_header: \"%V\"", - &ctx->cmd_str); - - return NGX_ERROR; /* this results in 500 status */ - } - - } else { - cs = ctx->parser_state; - } - - u = r->upstream; - - orig = (s_char *) u->buffer.pos; - - p = (s_char *) u->buffer.pos; - pe = (s_char *) u->buffer.last; - - dd("buffer len: %d", (int) (pe - p)); - - if (ctx->is_storage_cmd) { - error_state = memc_storage_error; - final_state = memc_storage_first_final; - - p = (s_char *) parse_memc_storage(&cs, (u_char *) p, (u_char *) pe, - &status, &done); - - } else if (ctx->cmd == ngx_http_memc_cmd_flush_all) { - error_state = memc_flush_all_error; - final_state = memc_flush_all_first_final; - - p = (s_char *) parse_memc_flush_all(&cs, (u_char *) p, (u_char *) pe, - &status, &done); - - } else if (ctx->cmd == ngx_http_memc_cmd_version) { - error_state = memc_version_error; - final_state = memc_version_first_final; - - p = (s_char *) parse_memc_version(&cs, (u_char *) p, (u_char *) pe, - &status, &done); - - } else if (ctx->cmd == ngx_http_memc_cmd_stats) { - error_state = memc_stats_error; - final_state = memc_stats_first_final; - - p = (s_char *) parse_memc_stats(&cs, (u_char *) p, (u_char *) pe, - &status, &done); - - } else if (ctx->cmd == ngx_http_memc_cmd_delete) { - error_state = memc_delete_error; - final_state = memc_delete_first_final; - - p = (s_char *) parse_memc_delete(&cs, (u_char *) p, (u_char *) pe, - &status, &done); - - } else if (ctx->cmd == ngx_http_memc_cmd_incr - || ctx->cmd == ngx_http_memc_cmd_decr) - { - error_state = memc_incr_decr_error; - final_state = memc_incr_decr_first_final; - - p = (s_char *) parse_memc_incr_decr(&cs, (u_char *) p, (u_char *) pe, - &status, &done); - - } else { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "unrecognized memcached command in " - "ngx_http_memc_process_simple_header: \"%V\"", - &ctx->cmd_str); - - return NGX_ERROR; /* this results in 500 status */ - } - - ctx->parser_state = cs; - - resp.data = u->buffer.start; - resp.len = (u_char *) p - resp.data; - - u->buffer.pos = (u_char *) p; - - dd("machine state: %d (done: %d)", cs, done); - dd("memcached response: (len: %d) %s", (int) resp.len, resp.data); - - if (done || cs >= final_state) { - dd("memcached response parsed (resp.len: %d)", (int) resp.len); - - rc = ngx_http_memc_write_simple_response(r, u, ctx, status, &resp); - - return rc; - } - - if (cs == error_state) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "memcached sent invalid response for command \"%V\" " - "at pos %O: %V", &ctx->cmd_str, (off_t) (p - orig), &resp); - - status = NGX_HTTP_BAD_GATEWAY; - u->headers_in.status_n = status; - u->state->status = status; - - /* u->headers_in.status_n will be the final status */ - return NGX_OK; - } - - dd("we need more data to proceed (returned NGX_AGAIN)"); - - return NGX_AGAIN; -} - - -ngx_int_t -ngx_http_memc_empty_filter_init(void *data) -{ - ngx_http_memc_ctx_t *ctx = data; - ngx_http_upstream_t *u; - - u = ctx->request->upstream; - - u->length = 0; - - /* to persuade ngx_http_upstream_keepalive (if any) - to cache the connection if the status is neither - 200 nor 404. */ - if (u->headers_in.status_n == NGX_HTTP_CREATED) { - u->headers_in.status_n = NGX_HTTP_OK; - } - - return NGX_OK; -} - -ngx_int_t -ngx_http_memc_empty_filter(void *data, ssize_t bytes) -{ - ngx_http_memc_ctx_t *ctx = data; - ngx_http_upstream_t *u; - - u = ctx->request->upstream; - - /* recover the buffer for subrequests in memory */ - u->buffer.last += ctx->body_length; - - return NGX_OK; -} - - -ngx_int_t -ngx_http_memc_get_cmd_filter_init(void *data) -{ - ngx_http_memc_ctx_t *ctx = data; - - ngx_http_upstream_t *u; - - u = ctx->request->upstream; - - dd("filter init: u->length: %d", (int) u->length); - - u->length = u->headers_in.content_length_n + NGX_HTTP_MEMC_END; - - dd("filter init (2): u->length: %d", (int) u->length); - - return NGX_OK; -} - - -ngx_int_t -ngx_http_memc_get_cmd_filter(void *data, ssize_t bytes) -{ - ngx_http_memc_ctx_t *ctx = data; - - u_char *last; - ngx_buf_t *b; - ngx_chain_t *cl, **ll; - ngx_http_upstream_t *u; - - u = ctx->request->upstream; - b = &u->buffer; - - if (u->length == ctx->rest) { - - if (ngx_strncmp(b->last, - ngx_http_memc_end + NGX_HTTP_MEMC_END - ctx->rest, - bytes) != 0) - { - ngx_log_error(NGX_LOG_ERR, ctx->request->connection->log, 0, - "memcached sent invalid trailer"); - - u->length = 0; - ctx->rest = 0; - - return NGX_OK; - } - - u->length -= bytes; - ctx->rest -= bytes; - -#if defined(nginx_version) && nginx_version >= 1001004 - if (u->length == 0) { - u->keepalive = 1; - } -#endif - - return NGX_OK; - } - - for (cl = u->out_bufs, ll = &u->out_bufs; cl; cl = cl->next) { - ll = &cl->next; - } - - cl = ngx_chain_get_free_buf(ctx->request->pool, &u->free_bufs); - if (cl == NULL) { - return NGX_ERROR; - } - - cl->buf->flush = 1; - cl->buf->memory = 1; - - *ll = cl; - - last = b->last; - cl->buf->pos = last; - b->last += bytes; - cl->buf->last = b->last; - cl->buf->tag = u->output.tag; - - ngx_log_debug4(NGX_LOG_DEBUG_HTTP, ctx->request->connection->log, 0, - "memcached filter bytes:%z size:%z length:%z rest:%z", - bytes, b->last - b->pos, u->length, ctx->rest); - - if (bytes <= (ssize_t) (u->length - NGX_HTTP_MEMC_END)) { - u->length -= bytes; - return NGX_OK; - } - - last += u->length - NGX_HTTP_MEMC_END; - - if (ngx_strncmp(last, ngx_http_memc_end, b->last - last) != 0) { - ngx_log_error(NGX_LOG_ERR, ctx->request->connection->log, 0, - "memcached sent invalid trailer"); - -#if defined(nginx_version) && nginx_version >= 1001004 - b->last = last; - cl->buf->last = last; - u->length = 0; - ctx->rest = 0; - - return NGX_OK; -#endif - } - - ctx->rest -= b->last - last; - b->last = last; - cl->buf->last = last; - u->length = ctx->rest; - -#if defined(nginx_version) && nginx_version >= 1001004 - if (u->length == 0) { - u->keepalive = 1; - } -#endif - - return NGX_OK; -} - - -ngx_int_t -ngx_http_memc_process_get_cmd_header(ngx_http_request_t *r) -{ - ngx_http_memc_loc_conf_t *conf; - u_char *p, *len; - ngx_str_t line; - ngx_http_upstream_t *u; - ngx_http_memc_ctx_t *ctx; - ngx_http_variable_value_t *flags_vv; - - u = r->upstream; - - dd("process header: u->length: %u", (unsigned) u->length); - - for (p = u->buffer.pos; p < u->buffer.last; p++) { - if (*p == LF) { - goto found; - } - } - - return NGX_AGAIN; - -found: - - *p = '\0'; - - line.len = p - u->buffer.pos - 1; - line.data = u->buffer.pos; - - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "memcached: \"%V\"", &line); - - p = u->buffer.pos; - - ctx = ngx_http_get_module_ctx(r, ngx_http_memc_module); - - if (ngx_strncmp(p, "VALUE ", sizeof("VALUE ") - 1) == 0) { - - p += sizeof("VALUE ") - 1; - - if (ngx_strncmp(p, ctx->key.data, ctx->key.len) != 0) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "memcached sent invalid key in response \"%V\" " - "for key \"%V\"", - &line, &ctx->key); - - return NGX_HTTP_UPSTREAM_INVALID_HEADER; - } - - p += ctx->key.len; - - if (*p++ != ' ') { - goto no_valid; - } - - /* save flags */ - - flags_vv = ctx->memc_flags_vv; - - if (flags_vv == NULL) { - return NGX_ERROR; - } - - if (flags_vv->not_found) { - flags_vv->not_found = 0; - flags_vv->valid = 1; - flags_vv->no_cacheable = 0; - } - - flags_vv->data = p; - - while (*p) { - if (*p++ == ' ') { - flags_vv->len = p - 1 - flags_vv->data; - conf = ngx_http_get_module_loc_conf(r, ngx_http_memc_module); - - if (conf->flags_to_last_modified) { - r->headers_out.last_modified_time = - ngx_atotm(flags_vv->data, flags_vv->len); - } - - goto length; - } - } - - goto no_valid; - - length: - - len = p; - - while (*p && *p++ != CR) { /* void */ } - -#if defined(nginx_version) && nginx_version >= 1001004 - u->headers_in.content_length_n = ngx_atoof(len, p - len - 1); - if (u->headers_in.content_length_n == -1) { -#else - r->headers_out.content_length_n = ngx_atoof(len, p - len - 1); - if (r->headers_out.content_length_n == -1) { -#endif - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "memcached sent invalid length in response \"%V\" " - "for key \"%V\"", - &line, &ctx->key); - return NGX_HTTP_UPSTREAM_INVALID_HEADER; - } - - u->headers_in.status_n = NGX_HTTP_OK; - u->state->status = NGX_HTTP_OK; - u->buffer.pos = p + 1; - - return NGX_OK; - } - - if (ngx_strcmp(p, "END\x0d") == 0) { - ngx_log_error(NGX_LOG_INFO, r->connection->log, 0, - "key: \"%V\" was not found by memcached", &ctx->key); - - u->headers_in.status_n = NGX_HTTP_NOT_FOUND; - u->state->status = NGX_HTTP_NOT_FOUND; - -#if defined(nginx_version) && nginx_version >= 1001004 - u->keepalive = 1; -#endif - - return NGX_OK; - } - -no_valid: - - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "memcached sent invalid response: \"%V\"", &line); - - return NGX_HTTP_UPSTREAM_INVALID_HEADER; -} - - -static ngx_int_t -ngx_http_memc_write_simple_response(ngx_http_request_t *r, - ngx_http_upstream_t *u, ngx_http_memc_ctx_t *ctx, ngx_uint_t status, - ngx_str_t *resp) -{ - ngx_chain_t *cl, **ll; - - for (cl = u->out_bufs, ll = &u->out_bufs; cl; cl = cl->next) { - ll = &cl->next; - } - - cl = ngx_chain_get_free_buf(r->pool, &u->free_bufs); - if (cl == NULL) { - return NGX_ERROR; - } - - cl->buf->flush = 1; - cl->buf->memory = 1; - cl->buf->pos = resp->data; - cl->buf->last = cl->buf->pos + resp->len; - - *ll = cl; - - /* for subrequests in memory */ - u->buffer.pos = resp->data; - u->buffer.last = resp->data + resp->len; - ctx->body_length = resp->len; - -#if defined(nginx_version) && nginx_version >= 1001004 - u->headers_in.content_length_n = resp->len; - u->keepalive = 1; -#else - r->headers_out.content_length_n = resp->len; -#endif - - u->headers_in.status_n = status; - u->state->status = status; - - return NGX_OK; -} - - -static u_char * -parse_memc_storage(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr) -{ - int cs = *cs_addr; - - -#line 577 "src/ngx_http_memc_response.rl" - -#line 578 "src/ngx_http_memc_response.rl" - -#line 1143 "src/ngx_http_memc_response.c" - { - int _klen; - const char *_keys; - int _trans; - - if ( p == pe ) - goto _test_eof; - if ( cs == 0 ) - goto _out; -_resume: - _keys = _memc_storage_trans_keys + _memc_storage_key_offsets[cs]; - _trans = _memc_storage_index_offsets[cs]; - - _klen = _memc_storage_single_lengths[cs]; - if ( _klen > 0 ) { - const char *_lower = _keys; - const char *_mid; - const char *_upper = _keys + _klen - 1; - while (1) { - if ( _upper < _lower ) - break; - - _mid = _lower + ((_upper-_lower) >> 1); - if ( (*p) < *_mid ) - _upper = _mid - 1; - else if ( (*p) > *_mid ) - _lower = _mid + 1; - else { - _trans += (unsigned int)(_mid - _keys); - goto _match; - } - } - _keys += _klen; - _trans += _klen; - } - - _klen = _memc_storage_range_lengths[cs]; - if ( _klen > 0 ) { - const char *_lower = _keys; - const char *_mid; - const char *_upper = _keys + (_klen<<1) - 2; - while (1) { - if ( _upper < _lower ) - break; - - _mid = _lower + (((_upper-_lower) >> 1) & ~1); - if ( (*p) < _mid[0] ) - _upper = _mid - 2; - else if ( (*p) > _mid[1] ) - _lower = _mid + 2; - else { - _trans += (unsigned int)((_mid - _keys)>>1); - goto _match; - } - } - _trans += _klen; - } - -_match: - cs = _memc_storage_trans_targs[_trans]; - - if ( _memc_storage_trans_actions[_trans] == 0 ) - goto _again; - - switch ( _memc_storage_trans_actions[_trans] ) { - case 2: -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } - break; - case 1: -#line 4 "src/memc_common.rl" - { - dd("caught error..."); - dd("machine state: %d", cs); - - *status_addr = NGX_HTTP_BAD_GATEWAY; - } -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } - break; - case 4: -#line 31 "src/memc_common.rl" - { - dd("status set to 201"); - - *status_addr = NGX_HTTP_CREATED; - } -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } - break; - case 3: -#line 37 "src/memc_common.rl" - { - dd("status set to 404"); - - *status_addr = NGX_HTTP_NOT_FOUND; - } -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } - break; -#line 1256 "src/ngx_http_memc_response.c" - } - -_again: - if ( cs == 0 ) - goto _out; - if ( ++p != pe ) - goto _resume; - _test_eof: {} - _out: {} - } - -#line 579 "src/ngx_http_memc_response.rl" - - *cs_addr = cs; - - return p; -} - - -static u_char * -parse_memc_flush_all(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr) -{ - int cs = *cs_addr; - - -#line 593 "src/ngx_http_memc_response.rl" - -#line 594 "src/ngx_http_memc_response.rl" - -#line 1287 "src/ngx_http_memc_response.c" - { - int _klen; - const short *_keys; - int _trans; - - if ( p == pe ) - goto _test_eof; - if ( cs == 0 ) - goto _out; -_resume: - _keys = _memc_flush_all_trans_keys + _memc_flush_all_key_offsets[cs]; - _trans = _memc_flush_all_index_offsets[cs]; - - _klen = _memc_flush_all_single_lengths[cs]; - if ( _klen > 0 ) { - const short *_lower = _keys; - const short *_mid; - const short *_upper = _keys + _klen - 1; - while (1) { - if ( _upper < _lower ) - break; - - _mid = _lower + ((_upper-_lower) >> 1); - if ( (*p) < *_mid ) - _upper = _mid - 1; - else if ( (*p) > *_mid ) - _lower = _mid + 1; - else { - _trans += (unsigned int)(_mid - _keys); - goto _match; - } - } - _keys += _klen; - _trans += _klen; - } - - _klen = _memc_flush_all_range_lengths[cs]; - if ( _klen > 0 ) { - const short *_lower = _keys; - const short *_mid; - const short *_upper = _keys + (_klen<<1) - 2; - while (1) { - if ( _upper < _lower ) - break; - - _mid = _lower + (((_upper-_lower) >> 1) & ~1); - if ( (*p) < _mid[0] ) - _upper = _mid - 2; - else if ( (*p) > _mid[1] ) - _lower = _mid + 2; - else { - _trans += (unsigned int)((_mid - _keys)>>1); - goto _match; - } - } - _trans += _klen; - } - -_match: - _trans = _memc_flush_all_indicies[_trans]; - cs = _memc_flush_all_trans_targs[_trans]; - - if ( _memc_flush_all_trans_actions[_trans] == 0 ) - goto _again; - - switch ( _memc_flush_all_trans_actions[_trans] ) { - case 2: -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } - break; - case 1: -#line 4 "src/memc_common.rl" - { - dd("caught error..."); - dd("machine state: %d", cs); - - *status_addr = NGX_HTTP_BAD_GATEWAY; - } -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } - break; -#line 1375 "src/ngx_http_memc_response.c" - } - -_again: - if ( cs == 0 ) - goto _out; - if ( ++p != pe ) - goto _resume; - _test_eof: {} - _out: {} - } - -#line 595 "src/ngx_http_memc_response.rl" - - *cs_addr = cs; - - return p; -} - - -static u_char * -parse_memc_version(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr) -{ - int cs = *cs_addr; - - -#line 609 "src/ngx_http_memc_response.rl" - -#line 610 "src/ngx_http_memc_response.rl" - -#line 1406 "src/ngx_http_memc_response.c" - { - int _klen; - const short *_keys; - int _trans; - - if ( p == pe ) - goto _test_eof; - if ( cs == 0 ) - goto _out; -_resume: - _keys = _memc_version_trans_keys + _memc_version_key_offsets[cs]; - _trans = _memc_version_index_offsets[cs]; - - _klen = _memc_version_single_lengths[cs]; - if ( _klen > 0 ) { - const short *_lower = _keys; - const short *_mid; - const short *_upper = _keys + _klen - 1; - while (1) { - if ( _upper < _lower ) - break; - - _mid = _lower + ((_upper-_lower) >> 1); - if ( (*p) < *_mid ) - _upper = _mid - 1; - else if ( (*p) > *_mid ) - _lower = _mid + 1; - else { - _trans += (unsigned int)(_mid - _keys); - goto _match; - } - } - _keys += _klen; - _trans += _klen; - } - - _klen = _memc_version_range_lengths[cs]; - if ( _klen > 0 ) { - const short *_lower = _keys; - const short *_mid; - const short *_upper = _keys + (_klen<<1) - 2; - while (1) { - if ( _upper < _lower ) - break; - - _mid = _lower + (((_upper-_lower) >> 1) & ~1); - if ( (*p) < _mid[0] ) - _upper = _mid - 2; - else if ( (*p) > _mid[1] ) - _lower = _mid + 2; - else { - _trans += (unsigned int)((_mid - _keys)>>1); - goto _match; - } - } - _trans += _klen; - } - -_match: - _trans = _memc_version_indicies[_trans]; - cs = _memc_version_trans_targs[_trans]; - - if ( _memc_version_trans_actions[_trans] == 0 ) - goto _again; - - switch ( _memc_version_trans_actions[_trans] ) { - case 2: -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } - break; - case 1: -#line 4 "src/memc_common.rl" - { - dd("caught error..."); - dd("machine state: %d", cs); - - *status_addr = NGX_HTTP_BAD_GATEWAY; - } -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } - break; -#line 1494 "src/ngx_http_memc_response.c" - } - -_again: - if ( cs == 0 ) - goto _out; - if ( ++p != pe ) - goto _resume; - _test_eof: {} - _out: {} - } - -#line 611 "src/ngx_http_memc_response.rl" - - *cs_addr = cs; - - return p; -} - - -static u_char * -parse_memc_stats(int *cs_addr, u_char *p, u_char *pe, ngx_uint_t *status_addr, - unsigned *done_addr) -{ - int cs = *cs_addr; - - -#line 625 "src/ngx_http_memc_response.rl" - -#line 626 "src/ngx_http_memc_response.rl" - -#line 1525 "src/ngx_http_memc_response.c" - { - int _klen; - const short *_keys; - int _trans; - - if ( p == pe ) - goto _test_eof; - if ( cs == 0 ) - goto _out; -_resume: - _keys = _memc_stats_trans_keys + _memc_stats_key_offsets[cs]; - _trans = _memc_stats_index_offsets[cs]; - - _klen = _memc_stats_single_lengths[cs]; - if ( _klen > 0 ) { - const short *_lower = _keys; - const short *_mid; - const short *_upper = _keys + _klen - 1; - while (1) { - if ( _upper < _lower ) - break; - - _mid = _lower + ((_upper-_lower) >> 1); - if ( (*p) < *_mid ) - _upper = _mid - 1; - else if ( (*p) > *_mid ) - _lower = _mid + 1; - else { - _trans += (unsigned int)(_mid - _keys); - goto _match; - } - } - _keys += _klen; - _trans += _klen; - } - - _klen = _memc_stats_range_lengths[cs]; - if ( _klen > 0 ) { - const short *_lower = _keys; - const short *_mid; - const short *_upper = _keys + (_klen<<1) - 2; - while (1) { - if ( _upper < _lower ) - break; - - _mid = _lower + (((_upper-_lower) >> 1) & ~1); - if ( (*p) < _mid[0] ) - _upper = _mid - 2; - else if ( (*p) > _mid[1] ) - _lower = _mid + 2; - else { - _trans += (unsigned int)((_mid - _keys)>>1); - goto _match; - } - } - _trans += _klen; - } - -_match: - _trans = _memc_stats_indicies[_trans]; - cs = _memc_stats_trans_targs[_trans]; - - if ( _memc_stats_trans_actions[_trans] == 0 ) - goto _again; - - switch ( _memc_stats_trans_actions[_trans] ) { - case 2: -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } - break; - case 1: -#line 4 "src/memc_common.rl" - { - dd("caught error..."); - dd("machine state: %d", cs); - - *status_addr = NGX_HTTP_BAD_GATEWAY; - } -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } - break; -#line 1613 "src/ngx_http_memc_response.c" - } - -_again: - if ( cs == 0 ) - goto _out; - if ( ++p != pe ) - goto _resume; - _test_eof: {} - _out: {} - } - -#line 627 "src/ngx_http_memc_response.rl" - - *cs_addr = cs; - - return p; -} - - -static u_char * -parse_memc_delete(int *cs_addr, u_char *p, u_char *pe, ngx_uint_t *status_addr, - unsigned *done_addr) -{ - int cs = *cs_addr; - - -#line 641 "src/ngx_http_memc_response.rl" - -#line 642 "src/ngx_http_memc_response.rl" - -#line 1644 "src/ngx_http_memc_response.c" - { - int _klen; - const short *_keys; - int _trans; - - if ( p == pe ) - goto _test_eof; - if ( cs == 0 ) - goto _out; -_resume: - _keys = _memc_delete_trans_keys + _memc_delete_key_offsets[cs]; - _trans = _memc_delete_index_offsets[cs]; - - _klen = _memc_delete_single_lengths[cs]; - if ( _klen > 0 ) { - const short *_lower = _keys; - const short *_mid; - const short *_upper = _keys + _klen - 1; - while (1) { - if ( _upper < _lower ) - break; - - _mid = _lower + ((_upper-_lower) >> 1); - if ( (*p) < *_mid ) - _upper = _mid - 1; - else if ( (*p) > *_mid ) - _lower = _mid + 1; - else { - _trans += (unsigned int)(_mid - _keys); - goto _match; - } - } - _keys += _klen; - _trans += _klen; - } - - _klen = _memc_delete_range_lengths[cs]; - if ( _klen > 0 ) { - const short *_lower = _keys; - const short *_mid; - const short *_upper = _keys + (_klen<<1) - 2; - while (1) { - if ( _upper < _lower ) - break; - - _mid = _lower + (((_upper-_lower) >> 1) & ~1); - if ( (*p) < _mid[0] ) - _upper = _mid - 2; - else if ( (*p) > _mid[1] ) - _lower = _mid + 2; - else { - _trans += (unsigned int)((_mid - _keys)>>1); - goto _match; - } - } - _trans += _klen; - } - -_match: - cs = _memc_delete_trans_targs[_trans]; - - if ( _memc_delete_trans_actions[_trans] == 0 ) - goto _again; - - switch ( _memc_delete_trans_actions[_trans] ) { - case 2: -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } - break; - case 1: -#line 4 "src/memc_common.rl" - { - dd("caught error..."); - dd("machine state: %d", cs); - - *status_addr = NGX_HTTP_BAD_GATEWAY; - } -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } - break; - case 3: -#line 37 "src/memc_common.rl" - { - dd("status set to 404"); - - *status_addr = NGX_HTTP_NOT_FOUND; - } -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } - break; -#line 1744 "src/ngx_http_memc_response.c" - } - -_again: - if ( cs == 0 ) - goto _out; - if ( ++p != pe ) - goto _resume; - _test_eof: {} - _out: {} - } - -#line 643 "src/ngx_http_memc_response.rl" - - *cs_addr = cs; - - return p; -} - - -static u_char * -parse_memc_incr_decr(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr) -{ - int cs = *cs_addr; - - -#line 657 "src/ngx_http_memc_response.rl" - -#line 658 "src/ngx_http_memc_response.rl" - -#line 1775 "src/ngx_http_memc_response.c" - { - int _klen; - const short *_keys; - int _trans; - - if ( p == pe ) - goto _test_eof; - if ( cs == 0 ) - goto _out; -_resume: - _keys = _memc_incr_decr_trans_keys + _memc_incr_decr_key_offsets[cs]; - _trans = _memc_incr_decr_index_offsets[cs]; - - _klen = _memc_incr_decr_single_lengths[cs]; - if ( _klen > 0 ) { - const short *_lower = _keys; - const short *_mid; - const short *_upper = _keys + _klen - 1; - while (1) { - if ( _upper < _lower ) - break; - - _mid = _lower + ((_upper-_lower) >> 1); - if ( (*p) < *_mid ) - _upper = _mid - 1; - else if ( (*p) > *_mid ) - _lower = _mid + 1; - else { - _trans += (unsigned int)(_mid - _keys); - goto _match; - } - } - _keys += _klen; - _trans += _klen; - } - - _klen = _memc_incr_decr_range_lengths[cs]; - if ( _klen > 0 ) { - const short *_lower = _keys; - const short *_mid; - const short *_upper = _keys + (_klen<<1) - 2; - while (1) { - if ( _upper < _lower ) - break; - - _mid = _lower + (((_upper-_lower) >> 1) & ~1); - if ( (*p) < _mid[0] ) - _upper = _mid - 2; - else if ( (*p) > _mid[1] ) - _lower = _mid + 2; - else { - _trans += (unsigned int)((_mid - _keys)>>1); - goto _match; - } - } - _trans += _klen; - } - -_match: - _trans = _memc_incr_decr_indicies[_trans]; - cs = _memc_incr_decr_trans_targs[_trans]; - - if ( _memc_incr_decr_trans_actions[_trans] == 0 ) - goto _again; - - switch ( _memc_incr_decr_trans_actions[_trans] ) { - case 1: -#line 26 "src/memc_common.rl" - { - dd("state %d, left %d, reading char '%c'", cs, - (int) (pe - p), *p); - } - break; - case 3: -#line 4 "src/memc_common.rl" - { - dd("caught error..."); - dd("machine state: %d", cs); - - *status_addr = NGX_HTTP_BAD_GATEWAY; - } -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } -#line 26 "src/memc_common.rl" - { - dd("state %d, left %d, reading char '%c'", cs, - (int) (pe - p), *p); - } - break; - case 2: -#line 31 "src/memc_common.rl" - { - dd("status set to 201"); - - *status_addr = NGX_HTTP_CREATED; - } -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } -#line 26 "src/memc_common.rl" - { - dd("state %d, left %d, reading char '%c'", cs, - (int) (pe - p), *p); - } - break; - case 4: -#line 37 "src/memc_common.rl" - { - dd("status set to 404"); - - *status_addr = NGX_HTTP_NOT_FOUND; - } -#line 21 "src/memc_common.rl" - { - dd("done it!"); - *done_addr = 1; - } -#line 26 "src/memc_common.rl" - { - dd("state %d, left %d, reading char '%c'", cs, - (int) (pe - p), *p); - } - break; -#line 1904 "src/ngx_http_memc_response.c" - } - -_again: - if ( cs == 0 ) - goto _out; - if ( ++p != pe ) - goto _resume; - _test_eof: {} - _out: {} - } - -#line 659 "src/ngx_http_memc_response.rl" - - *cs_addr = cs; - - return p; -} diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_response.h b/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_response.h deleted file mode 100644 index aec26dc..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_response.h +++ /dev/null @@ -1,28 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef NGX_HTTP_MEMC_RESPONSE_H -#define NGX_HTTP_MEMC_RESPONSE_H - -#include -#include - -ngx_int_t ngx_http_memc_process_get_cmd_header(ngx_http_request_t *r); - -ngx_int_t ngx_http_memc_get_cmd_filter_init(void *data); - -ngx_int_t ngx_http_memc_get_cmd_filter(void *data, ssize_t bytes); - -ngx_int_t ngx_http_memc_process_simple_header(ngx_http_request_t *r); - -ngx_int_t ngx_http_memc_empty_filter_init(void *data); - -ngx_int_t ngx_http_memc_empty_filter(void *data, ssize_t bytes); - -ngx_int_t ngx_http_memc_process_flush_all_cmd_header(ngx_http_request_t *r); - -#endif /* NGX_HTTP_MEMC_RESPONSE_H */ - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_response.rl b/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_response.rl deleted file mode 100644 index 31f7c83..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_response.rl +++ /dev/null @@ -1,663 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include "ngx_http_memc_response.h" -#include "ngx_http_memc_module.h" - - -#ifdef s_char -#undef s_char -#endif - -#define s_char signed char - - -%% machine memc_storage; -%% write data; - -%% machine memc_flush_all; -%% write data; - -%% machine memc_version; -%% write data; - -%% machine memc_stats; -%% write data; - -%% machine memc_delete; -%% write data; - -%% machine memc_incr_decr; -%% write data; - - -u_char ngx_http_memc_end[] = CRLF "END" CRLF; - - -static u_char *parse_memc_storage(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr); -static u_char *parse_memc_flush_all(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr); -static u_char *parse_memc_version(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr); -static u_char *parse_memc_stats(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr); -static u_char *parse_memc_delete(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr); -static u_char *parse_memc_incr_decr(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr); -static ngx_int_t ngx_http_memc_write_simple_response(ngx_http_request_t *r, - ngx_http_upstream_t *u, ngx_http_memc_ctx_t *ctx, - ngx_uint_t status, ngx_str_t *resp); - - -ngx_int_t -ngx_http_memc_process_simple_header(ngx_http_request_t *r) -{ - ngx_int_t rc; - int cs; - s_char *p; - s_char *pe; - s_char *orig; - ngx_str_t resp; - ngx_http_upstream_t *u; - ngx_http_memc_ctx_t *ctx; - ngx_uint_t status; - unsigned done = 0; - int error_state; - int final_state; - - status = NGX_HTTP_OK; - - dd("process simple cmd header"); - - ctx = ngx_http_get_module_ctx(r, ngx_http_memc_module); - - if (ctx->parser_state == NGX_ERROR) { - dd("reinit state"); - - if (ctx->is_storage_cmd) { - dd("init memc_storage machine..."); - - %% machine memc_storage; - %% write init; - - } else if (ctx->cmd == ngx_http_memc_cmd_flush_all) { - dd("init memc_flush_all machine..."); - - %% machine memc_flush_all; - %% write init; - - } else if (ctx->cmd == ngx_http_memc_cmd_version) { - dd("init memc_version machine..."); - - %% machine memc_version; - %% write init; - - } else if (ctx->cmd == ngx_http_memc_cmd_stats) { - dd("init memc_stats machine..."); - - %% machine memc_stats; - %% write init; - - } else if (ctx->cmd == ngx_http_memc_cmd_delete) { - dd("init memc_delete machine..."); - - %% machine memc_delete; - %% write init; - - } else if (ctx->cmd == ngx_http_memc_cmd_incr - || ctx->cmd == ngx_http_memc_cmd_decr) - { - dd("init memc_incr_decr machine..."); - - %% machine memc_incr_decr; - %% write init; - - } else { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "unrecognized memcached command in " - "ngx_http_memc_process_simple_header: \"%V\"", - &ctx->cmd_str); - - return NGX_ERROR; /* this results in 500 status */ - } - - } else { - cs = ctx->parser_state; - } - - u = r->upstream; - - orig = (s_char *) u->buffer.pos; - - p = (s_char *) u->buffer.pos; - pe = (s_char *) u->buffer.last; - - dd("buffer len: %d", (int) (pe - p)); - - if (ctx->is_storage_cmd) { - error_state = memc_storage_error; - final_state = memc_storage_first_final; - - p = (s_char *) parse_memc_storage(&cs, (u_char *) p, (u_char *) pe, - &status, &done); - - } else if (ctx->cmd == ngx_http_memc_cmd_flush_all) { - error_state = memc_flush_all_error; - final_state = memc_flush_all_first_final; - - p = (s_char *) parse_memc_flush_all(&cs, (u_char *) p, (u_char *) pe, - &status, &done); - - } else if (ctx->cmd == ngx_http_memc_cmd_version) { - error_state = memc_version_error; - final_state = memc_version_first_final; - - p = (s_char *) parse_memc_version(&cs, (u_char *) p, (u_char *) pe, - &status, &done); - - } else if (ctx->cmd == ngx_http_memc_cmd_stats) { - error_state = memc_stats_error; - final_state = memc_stats_first_final; - - p = (s_char *) parse_memc_stats(&cs, (u_char *) p, (u_char *) pe, - &status, &done); - - } else if (ctx->cmd == ngx_http_memc_cmd_delete) { - error_state = memc_delete_error; - final_state = memc_delete_first_final; - - p = (s_char *) parse_memc_delete(&cs, (u_char *) p, (u_char *) pe, - &status, &done); - - } else if (ctx->cmd == ngx_http_memc_cmd_incr - || ctx->cmd == ngx_http_memc_cmd_decr) - { - error_state = memc_incr_decr_error; - final_state = memc_incr_decr_first_final; - - p = (s_char *) parse_memc_incr_decr(&cs, (u_char *) p, (u_char *) pe, - &status, &done); - - } else { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "unrecognized memcached command in " - "ngx_http_memc_process_simple_header: \"%V\"", - &ctx->cmd_str); - - return NGX_ERROR; /* this results in 500 status */ - } - - ctx->parser_state = cs; - - resp.data = u->buffer.start; - resp.len = (u_char *) p - resp.data; - - u->buffer.pos = (u_char *) p; - - dd("machine state: %d (done: %d)", cs, done); - dd("memcached response: (len: %d) %s", (int) resp.len, resp.data); - - if (done || cs >= final_state) { - dd("memcached response parsed (resp.len: %d)", (int) resp.len); - - rc = ngx_http_memc_write_simple_response(r, u, ctx, status, &resp); - - return rc; - } - - if (cs == error_state) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "memcached sent invalid response for command \"%V\" " - "at pos %O: %V", &ctx->cmd_str, (off_t) (p - orig), &resp); - - status = NGX_HTTP_BAD_GATEWAY; - u->headers_in.status_n = status; - u->state->status = status; - - /* u->headers_in.status_n will be the final status */ - return NGX_OK; - } - - dd("we need more data to proceed (returned NGX_AGAIN)"); - - return NGX_AGAIN; -} - - -ngx_int_t -ngx_http_memc_empty_filter_init(void *data) -{ - ngx_http_memc_ctx_t *ctx = data; - ngx_http_upstream_t *u; - - u = ctx->request->upstream; - - u->length = 0; - - /* to persuade ngx_http_upstream_keepalive (if any) - to cache the connection if the status is neither - 200 nor 404. */ - if (u->headers_in.status_n == NGX_HTTP_CREATED) { - u->headers_in.status_n = NGX_HTTP_OK; - } - - return NGX_OK; -} - -ngx_int_t -ngx_http_memc_empty_filter(void *data, ssize_t bytes) -{ - ngx_http_memc_ctx_t *ctx = data; - ngx_http_upstream_t *u; - - u = ctx->request->upstream; - - /* recover the buffer for subrequests in memory */ - u->buffer.last += ctx->body_length; - - return NGX_OK; -} - - -ngx_int_t -ngx_http_memc_get_cmd_filter_init(void *data) -{ - ngx_http_memc_ctx_t *ctx = data; - - ngx_http_upstream_t *u; - - u = ctx->request->upstream; - - dd("filter init: u->length: %d", (int) u->length); - - u->length = u->headers_in.content_length_n + NGX_HTTP_MEMC_END; - - dd("filter init (2): u->length: %d", (int) u->length); - - return NGX_OK; -} - - -ngx_int_t -ngx_http_memc_get_cmd_filter(void *data, ssize_t bytes) -{ - ngx_http_memc_ctx_t *ctx = data; - - u_char *last; - ngx_buf_t *b; - ngx_chain_t *cl, **ll; - ngx_http_upstream_t *u; - - u = ctx->request->upstream; - b = &u->buffer; - - if (u->length == ctx->rest) { - - if (ngx_strncmp(b->last, - ngx_http_memc_end + NGX_HTTP_MEMC_END - ctx->rest, - bytes) != 0) - { - ngx_log_error(NGX_LOG_ERR, ctx->request->connection->log, 0, - "memcached sent invalid trailer"); - - u->length = 0; - ctx->rest = 0; - - return NGX_OK; - } - - u->length -= bytes; - ctx->rest -= bytes; - -#if defined(nginx_version) && nginx_version >= 1001004 - if (u->length == 0) { - u->keepalive = 1; - } -#endif - - return NGX_OK; - } - - for (cl = u->out_bufs, ll = &u->out_bufs; cl; cl = cl->next) { - ll = &cl->next; - } - - cl = ngx_chain_get_free_buf(ctx->request->pool, &u->free_bufs); - if (cl == NULL) { - return NGX_ERROR; - } - - cl->buf->flush = 1; - cl->buf->memory = 1; - - *ll = cl; - - last = b->last; - cl->buf->pos = last; - b->last += bytes; - cl->buf->last = b->last; - cl->buf->tag = u->output.tag; - - ngx_log_debug4(NGX_LOG_DEBUG_HTTP, ctx->request->connection->log, 0, - "memcached filter bytes:%z size:%z length:%z rest:%z", - bytes, b->last - b->pos, u->length, ctx->rest); - - if (bytes <= (ssize_t) (u->length - NGX_HTTP_MEMC_END)) { - u->length -= bytes; - return NGX_OK; - } - - last += u->length - NGX_HTTP_MEMC_END; - - if (ngx_strncmp(last, ngx_http_memc_end, b->last - last) != 0) { - ngx_log_error(NGX_LOG_ERR, ctx->request->connection->log, 0, - "memcached sent invalid trailer"); - -#if defined(nginx_version) && nginx_version >= 1001004 - b->last = last; - cl->buf->last = last; - u->length = 0; - ctx->rest = 0; - - return NGX_OK; -#endif - } - - ctx->rest -= b->last - last; - b->last = last; - cl->buf->last = last; - u->length = ctx->rest; - -#if defined(nginx_version) && nginx_version >= 1001004 - if (u->length == 0) { - u->keepalive = 1; - } -#endif - - return NGX_OK; -} - - -ngx_int_t -ngx_http_memc_process_get_cmd_header(ngx_http_request_t *r) -{ - ngx_http_memc_loc_conf_t *conf; - u_char *p, *len; - ngx_str_t line; - ngx_http_upstream_t *u; - ngx_http_memc_ctx_t *ctx; - ngx_http_variable_value_t *flags_vv; - - u = r->upstream; - - dd("process header: u->length: %u", (unsigned) u->length); - - for (p = u->buffer.pos; p < u->buffer.last; p++) { - if (*p == LF) { - goto found; - } - } - - return NGX_AGAIN; - -found: - - *p = '\0'; - - line.len = p - u->buffer.pos - 1; - line.data = u->buffer.pos; - - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "memcached: \"%V\"", &line); - - p = u->buffer.pos; - - ctx = ngx_http_get_module_ctx(r, ngx_http_memc_module); - - if (ngx_strncmp(p, "VALUE ", sizeof("VALUE ") - 1) == 0) { - - p += sizeof("VALUE ") - 1; - - if (ngx_strncmp(p, ctx->key.data, ctx->key.len) != 0) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "memcached sent invalid key in response \"%V\" " - "for key \"%V\"", - &line, &ctx->key); - - return NGX_HTTP_UPSTREAM_INVALID_HEADER; - } - - p += ctx->key.len; - - if (*p++ != ' ') { - goto no_valid; - } - - /* save flags */ - - flags_vv = ctx->memc_flags_vv; - - if (flags_vv == NULL) { - return NGX_ERROR; - } - - if (flags_vv->not_found) { - flags_vv->not_found = 0; - flags_vv->valid = 1; - flags_vv->no_cacheable = 0; - } - - flags_vv->data = p; - - while (*p) { - if (*p++ == ' ') { - flags_vv->len = p - 1 - flags_vv->data; - conf = ngx_http_get_module_loc_conf(r, ngx_http_memc_module); - - if (conf->flags_to_last_modified) { - r->headers_out.last_modified_time = - ngx_atotm(flags_vv->data, flags_vv->len); - } - - goto length; - } - } - - goto no_valid; - - length: - - len = p; - - while (*p && *p++ != CR) { /* void */ } - -#if defined(nginx_version) && nginx_version >= 1001004 - u->headers_in.content_length_n = ngx_atoof(len, p - len - 1); - if (u->headers_in.content_length_n == -1) { -#else - r->headers_out.content_length_n = ngx_atoof(len, p - len - 1); - if (r->headers_out.content_length_n == -1) { -#endif - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "memcached sent invalid length in response \"%V\" " - "for key \"%V\"", - &line, &ctx->key); - return NGX_HTTP_UPSTREAM_INVALID_HEADER; - } - - u->headers_in.status_n = NGX_HTTP_OK; - u->state->status = NGX_HTTP_OK; - u->buffer.pos = p + 1; - - return NGX_OK; - } - - if (ngx_strcmp(p, "END\x0d") == 0) { - ngx_log_error(NGX_LOG_INFO, r->connection->log, 0, - "key: \"%V\" was not found by memcached", &ctx->key); - - u->headers_in.status_n = NGX_HTTP_NOT_FOUND; - u->state->status = NGX_HTTP_NOT_FOUND; - -#if defined(nginx_version) && nginx_version >= 1001004 - u->keepalive = 1; -#endif - - return NGX_OK; - } - -no_valid: - - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "memcached sent invalid response: \"%V\"", &line); - - return NGX_HTTP_UPSTREAM_INVALID_HEADER; -} - - -static ngx_int_t -ngx_http_memc_write_simple_response(ngx_http_request_t *r, - ngx_http_upstream_t *u, ngx_http_memc_ctx_t *ctx, ngx_uint_t status, - ngx_str_t *resp) -{ - ngx_chain_t *cl, **ll; - - for (cl = u->out_bufs, ll = &u->out_bufs; cl; cl = cl->next) { - ll = &cl->next; - } - - cl = ngx_chain_get_free_buf(r->pool, &u->free_bufs); - if (cl == NULL) { - return NGX_ERROR; - } - - cl->buf->flush = 1; - cl->buf->memory = 1; - cl->buf->pos = resp->data; - cl->buf->last = cl->buf->pos + resp->len; - - *ll = cl; - - /* for subrequests in memory */ - u->buffer.pos = resp->data; - u->buffer.last = resp->data + resp->len; - ctx->body_length = resp->len; - -#if defined(nginx_version) && nginx_version >= 1001004 - u->headers_in.content_length_n = resp->len; - u->keepalive = 1; -#else - r->headers_out.content_length_n = resp->len; -#endif - - u->headers_in.status_n = status; - u->state->status = status; - - return NGX_OK; -} - - -static u_char * -parse_memc_storage(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr) -{ - int cs = *cs_addr; - - %% machine memc_storage; - %% include "memc_storage.rl"; - %% write exec; - - *cs_addr = cs; - - return p; -} - - -static u_char * -parse_memc_flush_all(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr) -{ - int cs = *cs_addr; - - %% machine memc_flush_all; - %% include "memc_flush_all.rl"; - %% write exec; - - *cs_addr = cs; - - return p; -} - - -static u_char * -parse_memc_version(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr) -{ - int cs = *cs_addr; - - %% machine memc_version; - %% include "memc_version.rl"; - %% write exec; - - *cs_addr = cs; - - return p; -} - - -static u_char * -parse_memc_stats(int *cs_addr, u_char *p, u_char *pe, ngx_uint_t *status_addr, - unsigned *done_addr) -{ - int cs = *cs_addr; - - %% machine memc_stats; - %% include "memc_stats.rl"; - %% write exec; - - *cs_addr = cs; - - return p; -} - - -static u_char * -parse_memc_delete(int *cs_addr, u_char *p, u_char *pe, ngx_uint_t *status_addr, - unsigned *done_addr) -{ - int cs = *cs_addr; - - %% machine memc_delete; - %% include "memc_delete.rl"; - %% write exec; - - *cs_addr = cs; - - return p; -} - - -static u_char * -parse_memc_incr_decr(int *cs_addr, u_char *p, u_char *pe, - ngx_uint_t *status_addr, unsigned *done_addr) -{ - int cs = *cs_addr; - - %% machine memc_incr_decr; - %% include "memc_incr_decr.rl"; - %% write exec; - - *cs_addr = cs; - - return p; -} diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_util.c b/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_util.c deleted file mode 100644 index dd19643..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_util.c +++ /dev/null @@ -1,161 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include "ngx_http_memc_util.h" - -ngx_http_memc_cmd_t -ngx_http_memc_parse_cmd(u_char *data, size_t len, ngx_flag_t *is_storage_cmd) -{ - switch (len) { - - case 3: - if (ngx_http_memc_strcmp_const(data, "set") == 0) { - *is_storage_cmd = 1; - return ngx_http_memc_cmd_set; - } - - if (ngx_http_memc_strcmp_const(data, "add") == 0) { - *is_storage_cmd = 1; - return ngx_http_memc_cmd_add; - } - - /* - if (ngx_str3cmp(data, 'c', 'a', 's')) { - *is_storage_cmd = 1; - return ngx_http_memc_cmd_cas; - } - */ - - if (ngx_http_memc_strcmp_const(data, "get") == 0) { - return ngx_http_memc_cmd_get; - } - - break; - - case 4: - /* - if (ngx_str4cmp(data, 'g', 'e', 't', 's')) { - return ngx_http_memc_cmd_gets; - } - */ - - if (ngx_http_memc_strcmp_const(data, "incr") == 0) { - return ngx_http_memc_cmd_incr; - } - - if (ngx_http_memc_strcmp_const(data, "decr") == 0) { - return ngx_http_memc_cmd_decr; - } - - break; - - case 5: - if (ngx_http_memc_strcmp_const(data, "stats") == 0) { - return ngx_http_memc_cmd_stats; - } - - break; - - case 6: - if (ngx_http_memc_strcmp_const(data, "append") == 0) { - *is_storage_cmd = 1; - return ngx_http_memc_cmd_append; - } - - if (ngx_http_memc_strcmp_const(data, "delete") == 0) { - return ngx_http_memc_cmd_delete; - } - - break; - - case 7: - if (ngx_http_memc_strcmp_const(data, "replace") == 0) { - *is_storage_cmd = 1; - return ngx_http_memc_cmd_replace; - } - - if (ngx_http_memc_strcmp_const(data, "prepend") == 0) { - *is_storage_cmd = 1; - return ngx_http_memc_cmd_prepend; - } - - if (ngx_http_memc_strcmp_const(data, "version") == 0) { - return ngx_http_memc_cmd_version; - } - - break; - - case 9: - if (ngx_http_memc_strcmp_const(data, "flush_all") == 0) { - return ngx_http_memc_cmd_flush_all; - } - - /* - if (ngx_str9cmp(data, 'v', 'e', 'r', 'b', 'o', 's', 'i', 't', 'y')) - { - return ngx_http_memc_cmd_verbosity; - } - */ - - break; - - default: - break; - } - - return ngx_http_memc_cmd_unknown; -} - - -ngx_http_upstream_srv_conf_t * -ngx_http_memc_upstream_add(ngx_http_request_t *r, ngx_url_t *url) -{ - ngx_http_upstream_main_conf_t *umcf; - ngx_http_upstream_srv_conf_t **uscfp; - ngx_uint_t i; - - umcf = ngx_http_get_module_main_conf(r, ngx_http_upstream_module); - - uscfp = umcf->upstreams.elts; - - for (i = 0; i < umcf->upstreams.nelts; i++) { - - if (uscfp[i]->host.len != url->host.len - || ngx_strncasecmp(uscfp[i]->host.data, url->host.data, - url->host.len) != 0) - { - dd("upstream_add: host not match"); - continue; - } - - if (uscfp[i]->port != url->port) { - dd("upstream_add: port not match: %d != %d", - (int) uscfp[i]->port, (int) url->port); - continue; - } - -#if (nginx_version < 1011006) - if (uscfp[i]->default_port && url->default_port - && uscfp[i]->default_port != url->default_port) - { - dd("upstream_add: default_port not match"); - continue; - } -#endif - - return uscfp[i]; - } - - dd("No upstream found: %.*s", (int) url->host.len, url->host.data); - - return NULL; -} - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_util.h b/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_util.h deleted file mode 100644 index e83fbbb..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/src/ngx_http_memc_util.h +++ /dev/null @@ -1,33 +0,0 @@ - -/* - * Copyright (C) Yichun Zhang (agentzh) - */ - - -#ifndef NGX_HTTP_MEMC_UTIL_H -#define NGX_HTTP_MEMC_UTIL_H - -#include -#include -#include "ngx_http_memc_module.h" - -#ifndef NGX_UINT32_LEN -#define NGX_UINT32_LEN (NGX_INT32_LEN - 1) -#endif - -#ifndef NGX_UINT64_LEN -#define NGX_UINT64_LEN (NGX_INT64_LEN - 1) -#endif - -#define ngx_http_memc_strcmp_const(a, b) \ - ngx_strncmp(a, b, sizeof(b) - 1) - -ngx_http_memc_cmd_t ngx_http_memc_parse_cmd(u_char *data, size_t len, - ngx_flag_t *is_storage_cmd); - -ngx_http_upstream_srv_conf_t *ngx_http_memc_upstream_add( - ngx_http_request_t *r, ngx_url_t *url); - - -#endif /* NGX_HTTP_MEMC_UTIL_H */ - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/bugs.t b/modules_deb/libnginx-mod-http-memc-0.20/t/bugs.t deleted file mode 100644 index a39260d..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/bugs.t +++ /dev/null @@ -1,240 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_diff; -no_shuffle(); -no_long_string(); - -run_tests(); - -__DATA__ - -=== TEST 1: set only ---- http_config - upstream mc { - server 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } - ---- config - location = "/set" { - set $memc_cmd 'set'; - set $memc_key 'jalla'; - set $memc_value 'myvalue'; - set $memc_exptime 24; - memc_pass mc; - } - - - location = "/get" { - set $memc_cmd 'get'; - set $memc_key 'jalla'; - memc_pass mc; - } - - location = "/delete" { - set $memc_cmd 'delete'; - set $memc_key 'jalla'; - memc_pass mc; - } - location = "/flush" { - echo_location /get; - #echo ""; - echo_location /delete; - } ---- request - GET /flush ---- response_body eval -"STORED\r\n" ---- error_code: 201 ---- SKIP - - - -=== TEST 2: set in a subrequest issued from an output filter ---- config - location /memc { - set $memc_cmd 'set'; - set $memc_key 'foo'; - set $memc_value 'blah'; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } - location /main { - default_type 'text/html'; - add_before_body '/memc'; - echo '~~'; - add_after_body '/memc'; - } ---- request -GET /main ---- response_body eval -"STORED\r -~~ -STORED\r -" - - - -=== TEST 3: reuse request body ---- config - location /main { - echo_read_request_body; - - echo 'flush_all'; - echo_location '/memc?cmd=flush_all'; - - echo 'set foo'; - echo_subrequest POST '/memc?key=foo&cmd=set'; - - echo 'set bar'; - echo_subrequest POST '/memc?key=bar&cmd=set'; - - echo 'get bar'; - echo_location '/memc?key=bar&cmd=get'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - #set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request -POST /main -Hello ---- response_body eval -"flush_all -status: 200 -exptime: -OK\r -set foo -status: 201 -exptime: 0 -STORED\r -set bar -status: 201 -exptime: 0 -STORED\r -get bar -status: 200 -exptime: -Helloget foo -status: 200 -exptime: -Hello" - - - -=== TEST 4: zero buf when $memc_value is empty -http://github.com/agentzh/memc-nginx-module/issues#issue/2 ---- config - location /memc { - set $memc_cmd 'set'; - set $memc_key 'foo'; - set $memc_value ''; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request -GET /memc ---- response_body eval -"STORED\r -" ---- error_code: 201 - - - -=== TEST 5: zero buf when $memc_value is empty -http://github.com/agentzh/memc-nginx-module/issues#issue/2 ---- config - location /memc { - set $memc_cmd 'set'; - set $memc_key 'foo'; - set $memc_value ''; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request -GET /memc ---- response_body eval -"STORED\r -" ---- error_code: 201 - - - -=== TEST 6: set too long keys ---- config - location /memc { - set $memc_cmd 'set'; - set $memc_key 'foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo'; - set $memc_value 'hi'; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request -GET /memc ---- response_body eval -"CLIENT_ERROR bad command line format\r -" ---- error_code: 502 - - - -=== TEST 7: get too long keys ---- config - location /memc { - set $memc_cmd 'get'; - set $memc_key 'foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo'; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request -GET /memc ---- response_body_like: 502 Bad Gateway ---- error_code: 502 - - - -=== TEST 8: set only ---- config - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $echo_request_body; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request -POST /memc?key=foo&cmd=set -hello, world ---- response_body eval -"STORED\r\n" ---- error_code: 201 ---- SKIP - - - -=== TEST 9: get ---- config - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request -GET /memc?key=foo&cmd=get ---- response_body -hello, world ---- error_code: 200 ---- SKIP - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/cmd.t b/modules_deb/libnginx-mod-http-memc-0.20/t/cmd.t deleted file mode 100644 index 327a0c7..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/cmd.t +++ /dev/null @@ -1,144 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => repeat_each() * (2 * blocks() + 3); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: bad cmd ---- config - location /foo { - set $memc_cmd blah; - set $memc_key foo; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /foo ---- response_body_like: 400 Bad Request ---- error_code: 400 ---- error_log -ngx_memc: unknown $memc_cmd "blah" - - - -=== TEST 2: no default value for $memc_cmd for method COPY ---- config - location /foo { - set $memc_key foo; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - COPY /foo ---- response_body_like: 400 Bad Request ---- error_code: 400 ---- error_log -ngx_memc: $memc_cmd variable not found for HTTP COPY requests - - - -=== TEST 3: bad cmd (case sensitive) ---- config - location /foo { - set $memc_cmd GET; - set $memc_key foo; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /foo ---- response_body_like: 400 Bad Request ---- error_code: 400 - - - -=== TEST 4: explicit $memc_cmd in non-empty cmds_allowed list ---- config - location /allow { - set $memc_cmd version; - memc_cmds_allowed get version; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /allow ---- response_body_like: ^VERSION \d+(\.\d+)+.*?\r\n$ - - - -=== TEST 5: explicit $memc_cmd in non-empty cmds_allowed list (in first) ---- config - location /allow { - set $memc_cmd version; - memc_cmds_allowed version get; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /allow ---- response_body_like: ^VERSION \d+(\.\d+)+.*?\r\n$ - - - -=== TEST 6: explicit $memc_cmd NOT in non-empty cmds_allowed list ---- config - location /allow { - set $memc_cmd version; - memc_cmds_allowed set get add delete; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /allow ---- response_body_like: 403 Forbidden ---- error_code: 403 ---- error_log -ngx_memc: memcached command "version" not allowed - - - -=== TEST 7: implicit $memc_cmd NOT in non-empty cmds_allowed list ---- config - location /allow { - memc_cmds_allowed set add delete version; - - set $memcached_key foo; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /allow ---- response_body_like: 403 Forbidden ---- error_code: 403 - - - -=== TEST 8: $memc_cmd has its default values when it's an empty string ---- config - location /main { - echo_read_request_body; - echo 'set big2'; - echo_subrequest PUT '/memc?key=big2'; - - echo 'get big2'; - echo_location '/memc?key=big2&cmd=get'; - } - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request -POST /main -nice to meet you! ---- response_body eval -"set big2 -STORED\r -get big2 -nice to meet you!" - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/core-bugs.t b/modules_deb/libnginx-mod-http-memc-0.20/t/core-bugs.t deleted file mode 100644 index a9a580c..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/core-bugs.t +++ /dev/null @@ -1,55 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -#repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -no_shuffle(); - -#no_diff; -#no_long_string(); - -run_tests(); - -__DATA__ - -=== TEST 1: bug in nginx core? (1) ---- http_config - upstream foo { - server 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- config - location /set { - set $memc_key foo; - set $memc_cmd set; - set $memc_value '[["mafiaclans.eu", 12], ["picfu.net", 5], ["www.test.com", 0], ["www.ayom.com", 0], ["www.21dezember2012.org", 0], ["the-indie.ch", 0], ["spiele-check.de", 0], ["online-right-now.net", 0], ["google.com", 0]]'; - memc_pass foo; - } ---- request -GET /set ---- response_body eval -"STORED\r\n" ---- error_code: 201 - - - -=== TEST 2: bug in nginx core? (2) ---- http_config - upstream foo { - server 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- config - location /get { - set $memcached_key foo; - memcached_pass foo; - } ---- request -GET /get ---- response_body eval -qq{[["mafiaclans.eu", 12], ["picfu.net", 5], ["www.test.com", 0], ["www.ayom.com", 0], ["www.21dezember2012.org", 0], ["the-indie.ch", 0], ["spiele-check.de", 0], ["online-right-now.net", 0], ["google.com", 0]]} - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/delete.t b/modules_deb/libnginx-mod-http-memc-0.20/t/delete.t deleted file mode 100644 index 9fccf37..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/delete.t +++ /dev/null @@ -1,140 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => repeat_each() * 2 * blocks(); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: delete non-existent item ---- config - location /main { - echo 'flush_all'; - echo_location '/memc?cmd=flush_all'; - - echo 'delete foo'; - echo_location '/memc?key=foo&cmd=delete'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body_like -^flush_all -status: 200 -exptime: -OK\r -delete foo -status: 404 -exptime: -.*?404 Not Found.*$ - - - -=== TEST 2: set and delete and set ---- config - location /main { - echo 'set foo bar'; - echo_location '/memc?cmd=set&key=foo&val=bar'; - - echo 'delete foo'; - echo_location '/memc?key=foo&cmd=delete'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body_like -^set foo bar -status: 201 -exptime: 0 -STORED\r -delete foo -status: 200 -exptime: -DELETED\r -get foo -status: 404 -exptime: -.*?404 Not Found.*$ - - - -=== TEST 3: set and delete and set (with exptime) ---- config - location /main { - echo 'set foo bar'; - echo_location '/memc?cmd=set&key=foo&val=bar'; - - echo 'delete foo 1'; - echo_location '/memc?key=foo&cmd=delete&exptime=1'; - - echo 'add foo cat'; - echo_location '/memc?key=foo&cmd=add&val=cat'; - - echo_blocking_sleep 1.6; - - echo 'add foo cat - 2nd'; - echo_location '/memc?key=foo&cmd=add&val=cat'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body eval -"set foo bar -status: 201 -exptime: 0 -STORED\r -delete foo 1 -status: 200 -exptime: 1 -DELETED\r -add foo cat -status: 200 -exptime: 0 -NOT_STORED\r -add foo cat - 2nd -status: 201 -exptime: 0 -STORED\r -" ---- SKIP - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/errors.t b/modules_deb/libnginx-mod-http-memc-0.20/t/errors.t deleted file mode 100644 index 1cda000..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/errors.t +++ /dev/null @@ -1,45 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => repeat_each() * 2 * blocks(); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: empty pass -little-endian systems only - ---- config - location /memc { - set $memc_key foo; - set $backend "not-exist"; - memc_pass $backend; - } ---- request -GET /memc ---- error_code: 500 ---- response_body_like: 500 Internal Server Error - - - -=== TEST 2: connection refused -little-endian systems only - ---- config - location /memc { - set $memc_key foo; - set $backend "not-exist"; - memc_pass 127.0.0.1:1; - } ---- request -GET /memc ---- error_code: 502 ---- response_body_like: 502 Bad Gateway - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/eval.t b/modules_deb/libnginx-mod-http-memc-0.20/t/eval.t deleted file mode 100644 index 8736de7..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/eval.t +++ /dev/null @@ -1,118 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; # skip_all => 'ngx_memc storage commands do not work with the ngx_eval module'; - -repeat_each(2); - -plan tests => repeat_each() * 2 * blocks(); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -no_long_string(); -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: set in eval (NO subrequest in memory) ---- http_config - upstream mc { - server 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } - ---- config - location = /main { - echo_location /eval; - echo_location /eval; - } - location = /eval { - eval_subrequest_in_memory off; - eval_override_content_type text/plain; - eval $res { - default_type 'text/plain'; - set $memc_cmd 'set'; - set $memc_key 'foo'; - set $memc_value 'myvalue'; - set $memc_exptime 24; - memc_pass mc; - } - echo [$res]; - } - ---- request - GET /eval ---- response_body -[STORED] ---- timeout: 30 ---- error_code: 200 - - - -=== TEST 2: set in eval (subrequest in memory) ---- http_config - upstream mc { - server 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } - ---- config - location = /main { - echo_location /eval; - echo_location /eval; - } - location = /eval { - eval_subrequest_in_memory on; - eval_override_content_type text/plain; - eval $res { - default_type 'text/plain'; - set $memc_cmd 'set'; - set $memc_key 'foo'; - set $memc_value 'myvalue'; - set $memc_exptime 24; - memc_pass mc; - } - echo [$res]; - } - ---- request - GET /eval ---- response_body -[STORED] ---- timeout: 30 ---- error_code: 200 - - - -=== TEST 3: set in eval (subrequest in memory) ---- http_config - upstream mc { - server 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } - ---- config - location = /main { - echo_location /get; - echo_location /del?foo; - } - location = /get { - set $memc_cmd get; - set $memc_key foo; - memc_pass mc; - } - location = /del { - eval $res { - set $memc_cmd delete; - set $memc_key $query_string; - memc_pass mc; - } - return 200; - } ---- request - GET /main ---- response_body -[STORED] ---- timeout: 30 ---- error_code: 200 ---- SKIP - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/exptime.t b/modules_deb/libnginx-mod-http-memc-0.20/t/exptime.t deleted file mode 100644 index 0a62190..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/exptime.t +++ /dev/null @@ -1,166 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (2 * blocks() + 1); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: set exptime ---- config - location /exptime { - echo 'flush_all'; - echo_location '/memc?cmd=flush_all'; - - echo 'set foo BAR'; - echo_subrequest PUT '/memc?key=foo&exptime=1' -b BAR; - - echo 'get foo - 0 sec'; - echo_location '/memc?key=foo'; - echo; - - echo_blocking_sleep 1.1; - - echo 'get foo - 1.1 sec'; - echo_location '/memc?key=foo'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /exptime ---- response_body_like -^flush_all -status: 200 -exptime: -OK\r -set foo BAR -status: 201 -exptime: 1 -STORED\r -get foo - 0 sec -status: 200 -exptime: -BAR -get foo - 1\.1 sec -status: 404 -exptime: -.*?404 Not Found.*$ - - - -=== TEST 2: test empty flags (default to 0) ---- config - location /flags { - echo 'set foo BAR (exptime: EMPTY)'; - echo_subrequest PUT '/memc?key=foo' -b BAR; - - echo_blocking_sleep 1; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - } - - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_key $arg_key; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /flags ---- response_body eval -"set foo BAR (exptime: EMPTY) -status: 201 -exptime: 0 -STORED\r -get foo -status: 200 -exptime: -BAR" - - - -=== TEST 3: invalid exptime in set ---- config - location /allow { - set $memc_cmd 'set'; - set $memc_key 'foo'; - set $memc_value 'nice'; - set $memc_exptime 'my invalid'; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /allow ---- response_body_like: 400 Bad Request ---- error_code: 400 ---- error_log -variable "$memc_exptime" takes invalid value: my invalid, - - - -=== TEST 4: invalid exptime in flush_all ---- config - location /allow { - set $memc_cmd 'flush_all'; - set $memc_key 'foo'; - set $memc_value 'nice'; - set $memc_exptime 'invalid'; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /allow ---- response_body_like: 400 Bad Request ---- error_code: 400 - - - -=== TEST 5: invalid exptime in delete ---- config - location /allow { - set $memc_cmd 'delete'; - set $memc_key 'foo'; - set $memc_value 'nice'; - set $memc_exptime 'invalid'; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /allow ---- response_body_like: 400 Bad Request ---- error_code: 400 - - - -=== TEST 6: set negative exptime ---- config - location /allow { - set $memc_cmd 'set'; - set $memc_key 'sun'; - set $memc_value 'tree'; - set $memc_exptime '-1'; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /allow ---- response_body_like: 400 Bad Request ---- error_code: 400 - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/flags.t b/modules_deb/libnginx-mod-http-memc-0.20/t/flags.t deleted file mode 100644 index aa2b29b..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/flags.t +++ /dev/null @@ -1,263 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (2 * blocks() + 3); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_diff; -no_shuffle; - -run_tests(); - -__DATA__ - -=== TEST 1: set flags and get flags ---- config - location /flags { - echo 'set foo BAR (flag: 1234567890)'; - echo_subrequest PUT '/memc?key=foo&flags=1234567890' -b BAR; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "flags: $memc_flags"; - - set $memc_key $arg_key; - set $memc_flags $arg_flags; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /flags ---- response_body eval -"set foo BAR (flag: 1234567890) -status: 201 -flags: 1234567890 -STORED\r -get foo -status: 200 -flags: 1234567890 -BAR" - - - -=== TEST 2: test empty flags (default to 0) ---- config - location /flags { - echo 'set foo BAR (flag: EMPTY)'; - echo_subrequest PUT '/memc?key=foo' -b BAR; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - } - - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "flags: $memc_flags"; - - set $memc_key $arg_key; - set $memc_flags $arg_flags; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /flags ---- response_body eval -"set foo BAR (flag: EMPTY) -status: 201 -flags: 0 -STORED\r -get foo -status: 200 -flags: 0 -BAR" - - - -=== TEST 3: test empty flags (default to 0) (another form) ---- config - location /flags { - echo 'set foo BAR (flag: EMPTY)'; - echo_subrequest PUT '/memc?key=foo&flags=' -b BAR; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - } - - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "flags: $memc_flags"; - - set $memc_key $arg_key; - set $memc_flags $arg_flags; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /flags ---- response_body eval -"set foo BAR (flag: EMPTY) -status: 201 -flags: 0 -STORED\r -get foo -status: 200 -flags: 0 -BAR" - - - -=== TEST 4: add flags and get flags ---- config - location /flags { - echo 'flush_all'; - echo_subrequest GET '/memc?cmd=flush_all'; - - echo 'add foo BAR (flag: 54321)'; - echo_subrequest POST '/memc?key=foo&flags=54321' -b BAR; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "flags: $memc_flags"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_flags $arg_flags; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /flags ---- response_body eval -"flush_all -status: 200 -flags: -OK\r -add foo BAR (flag: 54321) -status: 201 -flags: 54321 -STORED\r -get foo -status: 200 -flags: 54321 -BAR" - - - -=== TEST 5: set invalid flags ---- config - location /allow { - set $memc_cmd 'set'; - set $memc_key 'foo'; - set $memc_value 'nice'; - set $memc_flags 'invalid'; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /allow ---- response_body_like: 400 Bad Request ---- error_code: 400 ---- error_log -variable "$memc_flags" takes invalid value: invalid, - - - -=== TEST 6: set negative flags ---- config - location /allow { - set $memc_cmd 'set'; - set $memc_key 'sun'; - set $memc_value 'tree'; - set $memc_flags '-1'; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /allow ---- response_body_like: 400 Bad Request ---- error_code: 400 - - - -=== TEST 7: set flags and get flags in http time ---- config - location /flags { - echo 'set foo BAR (flag: 1264680563)'; - echo_subrequest PUT '/memc?key=foo&flags=1264680563' -b BAR; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "flags: $memc_flags $memc_flags_as_http_time"; - - set $memc_key $arg_key; - set $memc_flags $arg_flags; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /flags ---- response_body eval -"set foo BAR (flag: 1264680563) -status: 201 -flags: 1264680563 Thu, 28 Jan 2010 12:09:23 GMT -STORED\r -get foo -status: 200 -flags: 1264680563 Thu, 28 Jan 2010 12:09:23 GMT -BAR" - - - -=== TEST 8: last-modified (conditional GET) ---- SKIP ---- config - location /memc { - set $memc_key $arg_key; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - - memc_flags_to_last_modified on; - add_header X-Flags $memc_flags; - } ---- request - GET /memc?key=foo ---- more_headers -If-Modified-Since: Thu, 28 Jan 2010 12:09:23 GMT ---- response_headers -Last-Modified: Thu, 28 Jan 2010 12:09:23 GMT -X-Flags: 1264680563 ---- error_code: 304 ---- response_body: - - - -=== TEST 9: last-modified (unconditional GET) ---- config - location /memc { - set $memc_key $arg_key; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - - memc_flags_to_last_modified on; - add_header X-Flags $memc_flags; - } ---- request - GET /memc?key=foo ---- response_headers -Last-Modified: Thu, 28 Jan 2010 12:09:23 GMT -X-Flags: 1264680563 ---- error_code: 200 ---- response_body: BAR - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/flush-all.t b/modules_deb/libnginx-mod-http-memc-0.20/t/flush-all.t deleted file mode 100644 index aeea8dc..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/flush-all.t +++ /dev/null @@ -1,120 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => repeat_each() * 2 * blocks(); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: flush_all ---- config - location /flush { - set $memc_cmd flush_all; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /flush ---- response_body eval -"OK\r -" - - - -=== TEST 2: set and flush and get ---- config - location /main { - echo 'set foo blah'; - echo_location '/memc?key=foo&cmd=set&val=blah'; - - echo 'flush_all'; - echo_location '/memc?cmd=flush_all'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body_like -^set foo blah -status: 201 -STORED\r -flush_all -status: 200 -OK\r -get foo -status: 404.*?404 Not Found.*$ - - - -=== TEST 3: set exptime ---- config - location /exptime { - echo 'flush_all'; - echo_location '/memc?cmd=flush_all'; - - echo 'set foo BAR'; - echo_subrequest PUT '/memc?key=foo' -b BAR; - - echo 'flush_all exptime=2'; - echo_location '/memc?cmd=flush_all&exptime=2'; - - echo 'get foo - 0 sec'; - echo_location '/memc?key=foo'; - echo; - - echo_blocking_sleep 2; - - echo 'get foo - 2 sec'; - echo_location '/memc?key=foo'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /exptime ---- response_body_like -flush_all -status: 200 -exptime: -OK\r -set foo BAR -status: 201 -exptime: 0 -STORED\r -flush_all exptime=2 -status: 200 -exptime: 2 -OK\r -get foo - 0 sec -status: 200 -exptime: -BAR -get foo - 2 sec -status: 404 -exptime: -.*?404 Not Found.*$ ---- timeout: 3 - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/if.t b/modules_deb/libnginx-mod-http-memc-0.20/t/if.t deleted file mode 100644 index 89c5859..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/if.t +++ /dev/null @@ -1,30 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => repeat_each() * (3 * blocks()); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: bad cmd ---- config - location /foo { - if ($uri ~* 'foo') { - set $memc_cmd flush_all; - } - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /foo ---- response_body eval -"OK\r\n" ---- no_error_log -[error] - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/incr-decr.t b/modules_deb/libnginx-mod-http-memc-0.20/t/incr-decr.t deleted file mode 100644 index 8412ec9..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/incr-decr.t +++ /dev/null @@ -1,292 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (2 * blocks() + 1); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: value required for incr ---- config - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /memc?cmd=incr&key=foo ---- response_body_like: 400 Bad Request ---- error_code: 400 - - - -=== TEST 2: invalid value for incr ---- config - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /memc?cmd=incr&key=foo&val=nice ---- response_body_like: 400 Bad Request ---- error_code: 400 ---- error_log -variable "$memc_value" is invalid for incr/decr: nice, - - - -=== TEST 3: invalid value (negative intenger) for incr ---- config - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /memc?cmd=incr&key=foo&val=-5 ---- response_body_like: 400 Bad Request ---- error_code: 400 - - - -=== TEST 4: key required for incr ---- config - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /memc?cmd=incr&val=2 ---- response_body_like: 400 Bad Request ---- error_code: 400 ---- SKIP ---- TODO - - - -=== TEST 5: incr ---- config - location /main { - echo 'set foo 32'; - echo_location '/memc?cmd=set&key=foo&val=32'; - - echo 'incr 51'; - echo_location '/memc?key=foo&cmd=incr&val=51'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body eval -"set foo 32 -status: 201 -exptime: 0 -STORED\r -incr 51 -status: 201 -exptime: -83\r -get foo -status: 200 -exptime: -83" - - - -=== TEST 6: decr ---- config - location /main { - echo 'set foo 32'; - echo_location '/memc?cmd=set&key=foo&val=32'; - - echo 'decr 13'; - echo_location '/memc?key=foo&cmd=decr&val=13'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body eval -"set foo 32 -status: 201 -exptime: 0 -STORED\r -decr 13 -status: 201 -exptime: -19\r -get foo -status: 200 -exptime: -19" - - - -=== TEST 7: incr an non-existent key ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'incr 51'; - echo_location '/memc?key=foo&cmd=incr&val=51'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body_like -^flush all -status: 200 -exptime: -OK\r -incr 51 -status: 404 -exptime: -.*?404 Not Found.*$ - - - -=== TEST 8: decr ---- config - location /main { - echo 'set foo 32'; - echo_location '/memc?cmd=set&key=foo&val=32'; - - echo 'decr 13'; - echo_location '/memc?key=foo&cmd=decr&val=13'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body eval -"set foo 32 -status: 201 -exptime: 0 -STORED\r -decr 13 -status: 201 -exptime: -19\r -get foo -status: 200 -exptime: -19" - - - -=== TEST 9: incr an non-existent key (with fallback) ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'incr 51'; - echo_location '/memc?key=foo&cmd=incr&val=51'; - } - - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - - error_page 404 = /set_and_incr?$query_string; - } - - location /set_and_incr { - internal; - - echo_location /memc?cmd=add&key=$arg_key&val=0; - echo_location /memc?$query_string; - } ---- request - GET /main ---- response_body eval -"flush all -status: 200 -exptime: -OK\r -incr 51 -status: 201 -exptime: 0 -STORED\r -status: 201 -exptime: -51\r -" - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/keepalive.t b/modules_deb/libnginx-mod-http-memc-0.20/t/keepalive.t deleted file mode 100644 index e1292e6..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/keepalive.t +++ /dev/null @@ -1,41 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: keepalive ---- http_config - upstream backend { - server 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - #server 127.0.0.1:11985; - #server 127.0.0.1:11986; - keepalive 2; - #hash $arg_key; - } - ---- config - location /memc { - set $memc_cmd set; - set $memc_key $arg_key; - set $memc_value 'value'; - memc_pass backend; - } ---- request - GET /memc?key=dog ---- response_body eval -"STORED\r -" ---- error_code: 201 - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/keepalive/incr-decr.t b/modules_deb/libnginx-mod-http-memc-0.20/t/keepalive/incr-decr.t deleted file mode 100644 index b03f1e8..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/keepalive/incr-decr.t +++ /dev/null @@ -1,306 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * 2 * blocks(); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -our $http_config = <<'_EOC_'; - upstream foo { - server 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - keepalive 1; - } -_EOC_ - -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: value required for incr ---- http_config eval: $::http_config ---- config - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass foo; - } ---- request - GET /memc?cmd=incr&key=foo ---- response_body_like: 400 Bad Request ---- error_code: 400 - - - -=== TEST 2: invalid value for incr ---- http_config eval: $::http_config ---- config - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass foo; - } ---- request - GET /memc?cmd=incr&key=foo&val=nice ---- response_body_like: 400 Bad Request ---- error_code: 400 - - - -=== TEST 3: invalid value (negative intenger) for incr ---- http_config eval: $::http_config ---- config - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass foo; - } ---- request - GET /memc?cmd=incr&key=foo&val=-5 ---- response_body_like: 400 Bad Request ---- error_code: 400 - - - -=== TEST 4: key required for incr ---- http_config eval: $::http_config ---- config - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass foo; - } ---- request - GET /memc?cmd=incr&val=2 ---- response_body_like: 400 Bad Request ---- error_code: 400 ---- SKIP ---- TODO - - - -=== TEST 5: incr ---- http_config eval: $::http_config ---- config - location /main { - echo 'set foo 32'; - echo_location '/memc?cmd=set&key=foo&val=32'; - - echo 'incr 51'; - echo_location '/memc?key=foo&cmd=incr&val=51'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass foo; - } ---- request - GET /main ---- response_body eval -"set foo 32 -status: 201 -exptime: 0 -STORED\r -incr 51 -status: 201 -exptime: -83\r -get foo -status: 200 -exptime: -83" - - - -=== TEST 6: decr ---- http_config eval: $::http_config ---- config - location /main { - echo 'set foo 32'; - echo_location '/memc?cmd=set&key=foo&val=32'; - - echo 'decr 13'; - echo_location '/memc?key=foo&cmd=decr&val=13'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass foo; - } ---- request - GET /main ---- response_body eval -"set foo 32 -status: 201 -exptime: 0 -STORED\r -decr 13 -status: 201 -exptime: -19\r -get foo -status: 200 -exptime: -19" - - - -=== TEST 7: incr an non-existent key ---- http_config eval: $::http_config ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'incr 51'; - echo_location '/memc?key=foo&cmd=incr&val=51'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass foo; - } ---- request - GET /main ---- response_body_like -^flush all -status: 200 -exptime: -OK\r -incr 51 -status: 404 -exptime: -.*?404 Not Found.*$ - - - -=== TEST 8: decr ---- http_config eval: $::http_config ---- config - location /main { - echo 'set foo 32'; - echo_location '/memc?cmd=set&key=foo&val=32'; - - echo 'decr 13'; - echo_location '/memc?key=foo&cmd=decr&val=13'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass foo; - } ---- request - GET /main ---- response_body eval -"set foo 32 -status: 201 -exptime: 0 -STORED\r -decr 13 -status: 201 -exptime: -19\r -get foo -status: 200 -exptime: -19" - - - -=== TEST 9: incr an non-existent key (with fallback) ---- http_config eval: $::http_config ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'incr 51'; - echo_location '/memc?key=foo&cmd=incr&val=51'; - } - - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass foo; - - error_page 404 = /set_and_incr?$query_string; - } - - location /set_and_incr { - internal; - - echo_location /memc?cmd=add&key=$arg_key&val=0; - echo_location /memc?$query_string; - } ---- request - GET /main ---- response_body eval -"flush all -status: 200 -exptime: -OK\r -incr 51 -status: 201 -exptime: 0 -STORED\r -status: 201 -exptime: -51\r -" - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/keepalive/storage.t b/modules_deb/libnginx-mod-http-memc-0.20/t/keepalive/storage.t deleted file mode 100644 index 69c2116..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/keepalive/storage.t +++ /dev/null @@ -1,749 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (2 * blocks() - 1); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -our $http_config = <<'_EOC_'; - upstream foo { - server 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - keepalive 1; - } -_EOC_ - -#no_shuffle(); - -#no_diff; - -log_level('warn'); - -run_tests(); - -__DATA__ - -=== TEST 1: set only ---- http_config eval: $::http_config ---- config - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - memc_pass foo; - } ---- request - GET /memc?key=foo&cmd=set&val=blah ---- response_body eval -"STORED\r\n" ---- error_code: 201 - - - -=== TEST 2: set and get ---- http_config eval: $::http_config ---- config - location /main { - echo 'set foo blah'; - echo_location '/memc?key=foo&cmd=set&val=blah'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - memc_pass foo; - } ---- request - GET /main ---- response_body eval -"set foo blah -STORED\r -get foo -blah" - - - -=== TEST 3: set UTF-8 and get UTF-8 ---- http_config eval: $::http_config ---- config - location /main { - echo 'set foo 你好'; - echo_location '/memc?key=foo&cmd=set&val=你好'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - memc_pass foo; - } ---- request - GET /main ---- response_body eval -"set foo 你好 -STORED\r -get foo -你好" - - - -=== TEST 4: set and get empty values ---- http_config eval: $::http_config ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'set foo blah'; - echo_location '/memc?key=foo&cmd=set&val='; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - memc_pass foo; - } ---- request - GET /main ---- response_body eval -"flush all -OK\r -set foo blah -STORED\r -get foo -" - - - -=== TEST 5: add ---- http_config eval: $::http_config ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'add foo blah'; - echo_location '/memc?key=foo&cmd=add&val=added'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass foo; - } ---- request - GET /main ---- response_body eval -"flush all -status: 200 -OK\r -add foo blah -status: 201 -STORED\r -get foo -status: 200 -added" - - - -=== TEST 6: set using POST ---- http_config eval: $::http_config ---- config - location /main { - echo_read_request_body; - - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'set foo'; - echo_subrequest POST '/memc?key=foo&cmd=set'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - #set $memc_value $arg_val; - - memc_pass foo; - } ---- request -POST /main -hello, world ---- response_body eval -"flush all -status: 200 -OK\r -set foo -status: 201 -STORED\r -get foo -status: 200 -hello, world" - - - -=== TEST 7: default REST interface when no $memc_cmd is set ---- http_config eval: $::http_config ---- config - location /main { - echo_read_request_body; - - echo 'set foo FOO'; - echo_subrequest PUT '/memc?key=foo' -b FOO; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - echo; - - echo 'set foo BAR'; - echo_subrequest PUT '/memc?key=foo' -b BAR; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - echo; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_key $arg_key; - #set $memc_value $arg_val; - - memc_pass foo; - } ---- request -GET /main ---- response_body eval -"set foo FOO -status: 201 -STORED\r -get foo -status: 200 -FOO -set foo BAR -status: 201 -STORED\r -get foo -status: 200 -BAR -" - - - -=== TEST 8: default REST interface when no $memc_cmd is set (read client req body) ---- http_config eval: $::http_config ---- config - location /main { - echo_read_request_body; - - echo 'set foo '; - echo_subrequest PUT '/memc?key=foo'; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - echo; - - echo 'set foo BAR'; - echo_subrequest PUT '/memc?key=foo' -b BAR; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - echo; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_key $arg_key; - #set $memc_value $arg_val; - - memc_pass foo; - } ---- request -POST /main -rock ---- response_body eval -"set foo -status: 201 -STORED\r -get foo -status: 200 -rock -set foo BAR -status: 201 -STORED\r -get foo -status: 200 -BAR -" - - - -=== TEST 9: default REST interface when no $memc_cmd is set (read client req body) ---- http_config eval: $::http_config ---- config - location /main { - echo_read_request_body; - - echo 'set foo '; - echo_subrequest PUT '/memc?key=foo'; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - echo; - - echo 'add foo BAR'; - echo_subrequest POST '/memc?key=foo' -b BAR; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - echo; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_key $arg_key; - #set $memc_value $arg_val; - - memc_pass foo; - } ---- request -POST /main -howdy ---- response_body eval -"set foo -status: 201 -STORED\r -get foo -status: 200 -howdy -add foo BAR -status: 200 -NOT_STORED\r -get foo -status: 200 -howdy -" - - - -=== TEST 10: test replace (stored) (without sleep) ---- http_config eval: $::http_config ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - #echo_sleep 0.001; - - echo 'add foo blah'; - echo_location '/memc?key=foo&cmd=add&val=added'; - - echo 'replace foo bah'; - echo_location '/memc?key=foo&cmd=replace&val=bah'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass foo; - } ---- request - GET /main ---- response_body eval -"flush all -status: 200 -OK\r -add foo blah -status: 201 -STORED\r -replace foo bah -status: 201 -STORED\r -get foo -status: 200 -bah" - - - -=== TEST 11: test replace (stored) (with sleep) ---- http_config eval: $::http_config ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - echo_blocking_sleep 0.001; - - echo 'add foo blah'; - echo_location '/memc?key=foo&cmd=add&val=added'; - #echo_sleep 0.001; - - echo 'replace foo bah'; - echo_location '/memc?key=foo&cmd=replace&val=bah'; - #echo_sleep 0.001; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass foo; - } ---- request - GET /main ---- response_body eval -"flush all -status: 200 -OK\r -add foo blah -status: 201 -STORED\r -replace foo bah -status: 201 -STORED\r -get foo -status: 200 -bah" - - - -=== TEST 12: test replace (not stored) ---- http_config eval: $::http_config ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'replace foo bah'; - echo_location '/memc?key=foo&cmd=replace&val=bah'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass foo; - } ---- request - GET /main ---- response_body_like -flush all -status: 200 -OK\r -replace foo bah -status: 200 -NOT_STORED\r -get foo -status: 404.*?404 Not Found.*$ - - - -=== TEST 13: test append (stored) ---- http_config eval: $::http_config ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'add foo hello'; - echo_location '/memc?key=foo&cmd=add&val=hello'; - - echo 'append foo ,world'; - echo_location '/memc?key=foo&cmd=append&val=,world'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass foo; - } ---- request - GET /main ---- response_body eval -"flush all -status: 200 -OK\r -add foo hello -status: 201 -STORED\r -append foo ,world -status: 201 -STORED\r -get foo -status: 200 -hello,world" - - - -=== TEST 14: test append (not stored) ---- http_config eval: $::http_config ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'append foo ,world'; - echo_location '/memc?key=foo&cmd=append&val=,world'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass foo; - } ---- request - GET /main ---- response_body_like -flush all -status: 200 -OK\r -append foo ,world -status: 200 -NOT_STORED\r -get foo -status: 404.*?404 Not Found.*$ - - - -=== TEST 15: test prepend (stored) ---- http_config eval: $::http_config ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'add foo hello'; - echo_location '/memc?key=foo&cmd=add&val=hello'; - - echo 'prepend foo world,'; - echo_location '/memc?key=foo&cmd=prepend&val=world,'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass foo; - } ---- request - GET /main ---- response_body eval -"flush all -status: 200 -OK\r -add foo hello -status: 201 -STORED\r -prepend foo world, -status: 201 -STORED\r -get foo -status: 200 -world,hello" - - - -=== TEST 16: test prepend (not stored) ---- http_config eval: $::http_config ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'prepend foo world,'; - echo_location '/memc?key=foo&cmd=prepend&val=world,'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass foo; - } ---- request - GET /main ---- response_body_like -flush all -status: 200 -OK\r -prepend foo world, -status: 200 -NOT_STORED\r -get foo -status: 404.*?404 Not Found.*$ - - - -=== TEST 17: set and get big value ---- http_config eval: $::http_config ---- config - location /big { - echo_read_request_body; - - client_body_buffer_size 1k; - client_max_body_size 100k; - - echo 'set big'; - echo_subrequest POST '/memc?key=big&cmd=set'; - - echo 'get big'; - echo_location '/memc?key=big&cmd=get'; - } - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - memc_pass foo; - } ---- request eval -"POST /big\n" . - 'a' x (1024 * 1) . 'efg' - ---- response_body eval -"set big -STORED\r -get big -" . 'a' x (1024 * 1) . 'efg' ---- timeout: 5 - - - -=== TEST 18: set and get too big values ---- http_config eval: $::http_config ---- config - location /big { - client_body_buffer_size 1k; - client_max_body_size 100k; - - echo 'set big'; - echo_subrequest POST '/memc?key=big&cmd=set'; - - echo 'get big'; - echo_location '/memc?key=big&cmd=get'; - } - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - memc_pass foo; - } ---- request eval -"POST /big\n" . - 'a' x (1024 * 100) . 'efg' ---- ignore_response ---- error_log -client intended to send too large body: 102403 bytes ---- timeout: 5 - - - -=== TEST 19: replace non-existent item ---- http_config eval: $::http_config ---- config - location /main { - echo 'flush_all'; - echo_location '/memc?cmd=flush_all'; - - echo 'replace foo bar'; - echo_location '/memc?key=foo&cmd=replace&val=bar'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass foo; - } ---- request - GET /main ---- response_body eval -"flush_all -status: 200 -exptime: -OK\r -replace foo bar -status: 200 -exptime: 0 -NOT_STORED\r -" - - - -=== TEST 20: eval + memc ---- http_config eval: $::http_config ---- config - location /main { - eval $data { - proxy_pass $scheme://127.0.0.1:$server_port/foo; - } - set $memc_cmd set; - set $memc_key /foo; - set $memc_value $data; - memc_pass foo; - } - location /foo { - echo hello; - } ---- request - GET /main ---- response_body ---- SKIP - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/stats.t b/modules_deb/libnginx-mod-http-memc-0.20/t/stats.t deleted file mode 100644 index f412b42..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/stats.t +++ /dev/null @@ -1,45 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(1); - -plan tests => repeat_each() * 2 * blocks(); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_diff; -log_level('error'); - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- timeout: 5 ---- config - location /stats { - set $memc_cmd stats; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /stats ---- response_body_like: ^(?:STAT [^\r]*\r\n)*END\r\n$ - - - -=== TEST 2: timeout ---- config - memc_connect_timeout 10ms; - memc_send_timeout 10ms; - location /stats { - set $memc_cmd stats; - memc_pass 127.0.0.2:12345; - } ---- request - GET /stats ---- response_body_like: 504 Gateway Time-out ---- timeout: 1 ---- error_code: 504 - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/storage.t b/modules_deb/libnginx-mod-http-memc-0.20/t/storage.t deleted file mode 100644 index ee0706b..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/storage.t +++ /dev/null @@ -1,740 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * 2 * blocks(); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_shuffle(); - -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: set only ---- config - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /memc?key=foo&cmd=set&val=blah ---- response_body eval -"STORED\r\n" ---- error_code: 201 - - - -=== TEST 2: set and get ---- config - location /main { - echo 'set foo blah'; - echo_location '/memc?key=foo&cmd=set&val=blah'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body eval -"set foo blah -STORED\r -get foo -blah" - - - -=== TEST 3: set UTF-8 and get UTF-8 ---- config - location /main { - echo 'set foo 你好'; - echo_location '/memc?key=foo&cmd=set&val=你好'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body eval -"set foo 你好 -STORED\r -get foo -你好" - - - -=== TEST 4: set and get empty values ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'set foo blah'; - echo_location '/memc?key=foo&cmd=set&val='; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body eval -"flush all -OK\r -set foo blah -STORED\r -get foo -" - - - -=== TEST 5: add ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'add foo blah'; - echo_location '/memc?key=foo&cmd=add&val=added'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body eval -"flush all -status: 200 -OK\r -add foo blah -status: 201 -STORED\r -get foo -status: 200 -added" - - - -=== TEST 6: set using POST ---- config - location /main { - echo_read_request_body; - - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'set foo'; - echo_subrequest POST '/memc?key=foo&cmd=set'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - #set $memc_value $arg_val; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request -POST /main -hello, world ---- response_body eval -"flush all -status: 200 -OK\r -set foo -status: 201 -STORED\r -get foo -status: 200 -hello, world" - - - -=== TEST 7: default REST interface when no $memc_cmd is set ---- config - location /main { - echo 'set foo FOO'; - echo_subrequest PUT '/memc?key=foo' -b FOO; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - echo; - - echo 'set foo BAR'; - echo_subrequest PUT '/memc?key=foo' -b BAR; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - echo; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_key $arg_key; - #set $memc_value $arg_val; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request -GET /main ---- response_body eval -"set foo FOO -status: 201 -STORED\r -get foo -status: 200 -FOO -set foo BAR -status: 201 -STORED\r -get foo -status: 200 -BAR -" - - - -=== TEST 8: default REST interface when no $memc_cmd is set (read client req body) ---- config - location /main { - echo_read_request_body; - echo 'set foo '; - echo_subrequest PUT '/memc?key=foo'; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - echo; - - echo 'set foo BAR'; - echo_subrequest PUT '/memc?key=foo' -b BAR; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - echo; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_key $arg_key; - #set $memc_value $arg_val; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request -POST /main -rock ---- response_body eval -"set foo -status: 201 -STORED\r -get foo -status: 200 -rock -set foo BAR -status: 201 -STORED\r -get foo -status: 200 -BAR -" - - - -=== TEST 9: default REST interface when no $memc_cmd is set (read client req body) ---- config - location /main { - echo_read_request_body; - echo 'set foo '; - echo_subrequest PUT '/memc?key=foo'; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - echo; - - echo 'add foo BAR'; - echo_subrequest POST '/memc?key=foo' -b BAR; - - echo 'get foo'; - echo_subrequest GET '/memc?key=foo'; - echo; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_key $arg_key; - #set $memc_value $arg_val; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request -POST /main -howdy ---- response_body eval -"set foo -status: 201 -STORED\r -get foo -status: 200 -howdy -add foo BAR -status: 200 -NOT_STORED\r -get foo -status: 200 -howdy -" - - - -=== TEST 10: test replace (stored) (without sleep) ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - #echo_sleep 0.001; - - echo 'add foo blah'; - echo_location '/memc?key=foo&cmd=add&val=added'; - - echo 'replace foo bah'; - echo_location '/memc?key=foo&cmd=replace&val=bah'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body eval -"flush all -status: 200 -OK\r -add foo blah -status: 201 -STORED\r -replace foo bah -status: 201 -STORED\r -get foo -status: 200 -bah" - - - -=== TEST 11: test replace (stored) (with sleep) ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - echo_blocking_sleep 0.001; - - echo 'add foo blah'; - echo_location '/memc?key=foo&cmd=add&val=added'; - #echo_sleep 0.001; - - echo 'replace foo bah'; - echo_location '/memc?key=foo&cmd=replace&val=bah'; - #echo_sleep 0.001; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body eval -"flush all -status: 200 -OK\r -add foo blah -status: 201 -STORED\r -replace foo bah -status: 201 -STORED\r -get foo -status: 200 -bah" - - - -=== TEST 12: test replace (not stored) ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'replace foo bah'; - echo_location '/memc?key=foo&cmd=replace&val=bah'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body_like -flush all -status: 200 -OK\r -replace foo bah -status: 200 -NOT_STORED\r -get foo -status: 404.*?404 Not Found.*$ - - - -=== TEST 13: test append (stored) ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'add foo hello'; - echo_location '/memc?key=foo&cmd=add&val=hello'; - - echo 'append foo ,world'; - echo_location '/memc?key=foo&cmd=append&val=,world'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body eval -"flush all -status: 200 -OK\r -add foo hello -status: 201 -STORED\r -append foo ,world -status: 201 -STORED\r -get foo -status: 200 -hello,world" - - - -=== TEST 14: test append (not stored) ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'append foo ,world'; - echo_location '/memc?key=foo&cmd=append&val=,world'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body_like -flush all -status: 200 -OK\r -append foo ,world -status: 200 -NOT_STORED\r -get foo -status: 404.*?404 Not Found.*$ - - - -=== TEST 15: test prepend (stored) ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'add foo hello'; - echo_location '/memc?key=foo&cmd=add&val=hello'; - - echo 'prepend foo world,'; - echo_location '/memc?key=foo&cmd=prepend&val=world,'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body eval -"flush all -status: 200 -OK\r -add foo hello -status: 201 -STORED\r -prepend foo world, -status: 201 -STORED\r -get foo -status: 200 -world,hello" - - - -=== TEST 16: test prepend (not stored) ---- config - location /main { - echo 'flush all'; - echo_location '/memc?cmd=flush_all'; - - echo 'prepend foo world,'; - echo_location '/memc?key=foo&cmd=prepend&val=world,'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body_like -flush all -status: 200 -OK\r -prepend foo world, -status: 200 -NOT_STORED\r -get foo -status: 404.*?404 Not Found.*$ - - - -=== TEST 17: set and get big value ---- config - location /big { - client_body_buffer_size 1k; - client_max_body_size 100k; - - echo_read_request_body; - echo 'set big'; - echo_subrequest POST '/memc?key=big&cmd=set'; - - echo 'get big'; - echo_location '/memc?key=big&cmd=get'; - } - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request eval -"POST /big\n" . - 'a' x (1024 * 1) . 'efg' - ---- response_body eval -"set big -STORED\r -get big -" . 'a' x (1024 * 1) . 'efg' ---- timeout: 2 - - - -=== TEST 18: set and get too big values ---- config - location /big { - client_body_buffer_size 1k; - client_max_body_size 100k; - - echo 'set big'; - echo_subrequest POST '/memc?key=big&cmd=set'; - - echo 'get big'; - echo_location '/memc?key=big&cmd=get'; - } - location /memc { - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request eval -"POST /big\n" . - 'a' x (1024 * 100) . 'efg' - ---- response_body_like: 413 Request Entity Too Large ---- error_code: 413 ---- timeout: 10 - - - -=== TEST 19: replace non-existent item ---- config - location /main { - echo 'flush_all'; - echo_location '/memc?cmd=flush_all'; - - echo 'replace foo bar'; - echo_location '/memc?key=foo&cmd=replace&val=bar'; - } - location /memc { - echo_before_body "status: $echo_response_status"; - echo_before_body "exptime: $memc_exptime"; - - set $memc_cmd $arg_cmd; - set $memc_key $arg_key; - set $memc_value $arg_val; - set $memc_exptime $arg_exptime; - - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body eval -"flush_all -status: 200 -exptime: -OK\r -replace foo bar -status: 200 -exptime: 0 -NOT_STORED\r -" - - - -=== TEST 20: eval + memc ---- config - location /main { - eval $data { - proxy_pass $scheme://127.0.0.1:$server_port/foo; - } - set $memc_cmd set; - set $memc_key /foo; - set $memc_value $data; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } - location /foo { - echo hello; - } ---- request - GET /main ---- response_body ---- SKIP - - - -=== TEST 21: set and get (binary data containing \0) ---- config - location /main { - echo 'set foo blah'; - echo_location '/memc?key=foo&cmd=set&val=blah%00blah'; - - echo 'get foo'; - echo_location '/memc?key=foo&cmd=get'; - } - location /memc { - set $memc_cmd $arg_cmd; - set_unescape_uri $memc_key $arg_key; - set_unescape_uri $memc_value $arg_val; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /main ---- response_body eval -"set foo blah -STORED\r -get foo -blah\0blah" - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/upstream.t b/modules_deb/libnginx-mod-http-memc-0.20/t/upstream.t deleted file mode 100644 index a50fcac..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/upstream.t +++ /dev/null @@ -1,78 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * 2 * blocks(); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: sanity ---- http_config - upstream backend { - server 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - server 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } - ---- config - location /stats { - set $memc_cmd stats; - memc_pass backend; - } ---- request - GET /stats ---- response_body_like: ^(?:STAT [^\r]*\r\n)*END\r\n$ ---- timeout: 3 - - - -=== TEST 2: sanity ---- http_config - upstream backend { - server 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - server 127.0.0.1:11985; - server 127.0.0.1:11986; - #keepalive 2; - #hash $arg_key; - } - ---- config - location /memc { - set $memc_cmd set; - set $memc_key $arg_key; - set $memc_value 'value'; - memc_pass backend; - } ---- request - GET /memc?key=dog ---- response_body ---- error_code: 201 ---- timeout: 3 ---- SKIP - - - -=== TEST 3: sanity with dynamic backend ---- http_config - upstream backend { - server 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } - ---- config - location /stats { - set $memc_cmd stats; - memc_pass $arg_target; - } ---- request - GET /stats?target=backend ---- response_body_like: ^(?:STAT [^\r]*\r\n)*END\r\n$ ---- timeout: 3 - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/used.t b/modules_deb/libnginx-mod-http-memc-0.20/t/used.t deleted file mode 100644 index 4e7b2ae..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/used.t +++ /dev/null @@ -1,67 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => repeat_each() * (4 * blocks()); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: module not used ---- config - location /t { - content_by_lua ' - local v = ngx.var - ngx.say(v.memc_cmd, v.memc_exptime, v.memc_value, v.memc_key, v.memc_flags) - '; - } ---- request - GET /t ---- stap -F(ngx_http_memc_add_variable) { - printf("memc add variable \"%s\"\n", user_string_n($name->data, $name->len)) -} ---- stap_out ---- response_body -nilnilnilnilnil ---- no_error_log -[error] - - - -=== TEST 2: module used ---- config - location /t { - content_by_lua ' - local v = ngx.var - ngx.say(v.memc_cmd, v.memc_exptime, v.memc_value, v.memc_key, v.memc_flags) - '; - } - location /bah { - set $memc_key foo; - memc_pass 127.0.0.1:11211; - } ---- request - GET /t ---- stap -F(ngx_http_memc_add_variable) { - printf("memc add variable \"%s\"\n", user_string_n($name->data, $name->len)) -} ---- stap_out -memc add variable "memc_key" -memc add variable "memc_cmd" -memc add variable "memc_flags" -memc add variable "memc_exptime" -memc add variable "memc_value" - ---- response_body -nilnilnilnilnil ---- no_error_log -[error] - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/t/version.t b/modules_deb/libnginx-mod-http-memc-0.20/t/version.t deleted file mode 100644 index ae26ec8..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/t/version.t +++ /dev/null @@ -1,25 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -plan tests => repeat_each() * 2 * blocks(); - -$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; - -#no_diff; - -run_tests(); - -__DATA__ - -=== TEST 1: the "version" command ---- config - location /ver { - set $memc_cmd version; - memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT; - } ---- request - GET /ver ---- response_body_like: ^VERSION \d+(\.\d+)+.*?\r\n$ - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/util/build.sh b/modules_deb/libnginx-mod-http-memc-0.20/util/build.sh deleted file mode 100755 index 7defa6e..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/util/build.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -# this file is mostly meant to be used by the author himself. - -ragel -I src -T1 src/ngx_http_memc_response.rl || exit 1 -util/fix-clang-warnings - -if [ $? != 0 ]; then - echo 'Failed to generate the memcached response parser.' 1>&2 - exit 1; -fi - -root=`pwd` -version=$1 -home=~ -force=$2 - -ngx-build $force $version \ - --with-ld-opt="-L$PCRE_LIB -Wl,-rpath,$PCRE_LIB:$LIBDRIZZLE_LIB:/usr/local/lib" \ - --with-cc-opt="-O2" \ - --with-http_addition_module \ - --without-mail_pop3_module \ - --without-mail_imap_module \ - --without-mail_smtp_module \ - --without-http_upstream_ip_hash_module \ - --without-http_empty_gif_module \ - --without-http_referer_module \ - --without-http_autoindex_module \ - --without-http_auth_basic_module \ - --without-http_userid_module \ - --add-module=$root $opts \ - --add-module=$root/../ndk-nginx-module \ - --add-module=$root/../eval-nginx-module \ - --add-module=$root/../echo-nginx-module \ - --add-module=$root/../set-misc-nginx-module \ - --add-module=$root/../lua-nginx-module \ - --with-select_module \ - --with-poll_module \ - --with-debug - #--add-module=$home/work/nginx/nginx_upstream_hash-0.3 \ - #--without-http_ssi_module # we cannot disable ssi because echo_location_async depends on it (i dunno why?!) - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/util/fix-clang-warnings b/modules_deb/libnginx-mod-http-memc-0.20/util/fix-clang-warnings deleted file mode 100755 index 6b1bda6..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/util/fix-clang-warnings +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env perl - -use strict; -use warnings; -use File::Temp 'tempfile'; - -my $infile = "src/ngx_http_memc_response.c"; -my ($out, $outfile) = tempfile(); -open my $in, $infile - or die "Cannot open $infile for reading: $!\n"; -my $hits = 0; -while (<$in>) { - if (/ \b memc_ (?: storage | flush_all | version | stats | delete | incr_decr ) - _en_main \b /x) - { - #warn "HIT!"; - $hits++; - next; - } - print $out $_; -} -close $in; -close $out; -if ($hits) { - my $cmd = "cp $outfile $infile"; - system($cmd) == 0 - or die "Cannot run command \"$cmd\": $!"; -} -#die; - -__END__ - -This script is to fix the following clang warnings when using Ragel 6.8/6.9/etc: - -src/ngx_http_memc_response.c:33:18: error: unused variable 'memc_storage_en_main' [-Werror,-Wunused-const-variable] -static const int memc_storage_en_main = 1; - ^ -src/ngx_http_memc_response.c:46:18: error: unused variable 'memc_flush_all_en_main' [-Werror,-Wunused-const-variable] -static const int memc_flush_all_en_main = 1; - ^ -src/ngx_http_memc_response.c:59:18: error: unused variable 'memc_version_en_main' [-Werror,-Wunused-const-variable] -static const int memc_version_en_main = 1; - ^ -src/ngx_http_memc_response.c:72:18: error: unused variable 'memc_stats_en_main' [-Werror,-Wunused-const-variable] -static const int memc_stats_en_main = 1; - ^ -src/ngx_http_memc_response.c:85:18: error: unused variable 'memc_delete_en_main' [-Werror,-Wunused-const-variable] -static const int memc_delete_en_main = 1; - ^ -src/ngx_http_memc_response.c:98:18: error: unused variable 'memc_incr_decr_en_main' [-Werror,-Wunused-const-variable] -static const int memc_incr_decr_en_main = 1; - ^ -6 errors generated. diff --git a/modules_deb/libnginx-mod-http-memc-0.20/util/update-readme.sh b/modules_deb/libnginx-mod-http-memc-0.20/util/update-readme.sh deleted file mode 100755 index fd9c9d8..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/util/update-readme.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -perl util/wiki2pod.pl doc/readme.wiki > /tmp/a.pod \ - && pod2text /tmp/a.pod > README \ - && perl -i -pe 's{(https?://.*?)>}{$1 >}g' README - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/util/wiki2pod.pl b/modules_deb/libnginx-mod-http-memc-0.20/util/wiki2pod.pl deleted file mode 100644 index cdd33a2..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/util/wiki2pod.pl +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env perl - -use strict; -use warnings; -use bytes; - -my @nl_counts; -my $last_nl_count_level; - -my @bl_counts; -my $last_bl_count_level; - -sub fmt_pos ($) { - (my $s = $_[0]) =~ s{\#(.*)}{/"$1"}; - $s; -} - -sub fmt_mark ($$) { - my ($tag, $s) = @_; - my $max_level = 0; - while ($s =~ /([<>])\1*/g) { - my $level = length $&; - if ($level > $max_level) { - $max_level = $level; - } - } - - my $times = $max_level + 1; - if ($times > 1) { - $s = " $s "; - } - return $tag . ('<' x $times) . $s . ('>' x $times); -} - -print "=encoding utf-8\n\n"; - -while (<>) { - if ($. == 1) { - # strip the leading U+FEFF byte in MS-DOS text files - my $first = ord(substr($_, 0, 1)); - #printf STDERR "0x%x", $first; - #my $second = ord(substr($_, 2, 1)); - #printf STDERR "0x%x", $second; - if ($first == 0xEF) { - substr($_, 0, 1, ''); - #warn "Hit!"; - } - } - s{\[(http[^ \]]+) ([^\]]*)\]}{$2 (L<$1>)}gi; - s{ \[\[ ( [^\]\|]+ ) \| ([^\]]*) \]\] }{"L<$2|" . fmt_pos($1) . ">"}gixe; - s{(.*?)}{fmt_mark('C', $1)}gie; - s{'''(.*?)'''}{fmt_mark('B', $1)}ge; - s{''(.*?)''}{fmt_mark('I', $1)}ge; - if (s{^\s*<[^>]+>\s*$}{}) { - next; - } - - if (/^\s*$/) { - print "\n"; - next; - } - -=begin cmt - - if ($. == 1) { - warn $_; - for my $i (0..length($_) - 1) { - my $chr = substr($_, $i, 1); - warn "chr ord($i): ".ord($chr)." \"$chr\"\n"; - } - } - -=end cmt -=cut - - if (/(=+) (.*) \1$/) { - #warn "HERE! $_" if $. == 1; - my ($level, $title) = (length $1, $2); - collapse_lists(); - - print "\n=head$level $title\n\n"; - } elsif (/^(\#+) (.*)/) { - my ($level, $txt) = (length($1) - 1, $2); - if (defined $last_nl_count_level && $level != $last_nl_count_level) { - print "\n=back\n\n"; - } - $last_nl_count_level = $level; - $nl_counts[$level] ||= 0; - if ($nl_counts[$level] == 0) { - print "\n=over\n\n"; - } - $nl_counts[$level]++; - print "\n=item $nl_counts[$level].\n\n"; - print "$txt\n"; - } elsif (/^(\*+) (.*)/) { - my ($level, $txt) = (length($1) - 1, $2); - if (defined $last_bl_count_level && $level != $last_bl_count_level) { - print "\n=back\n\n"; - } - $last_bl_count_level = $level; - $bl_counts[$level] ||= 0; - if ($bl_counts[$level] == 0) { - print "\n=over\n\n"; - } - $bl_counts[$level]++; - print "\n=item *\n\n"; - print "$txt\n"; - } else { - collapse_lists(); - print; - } -} - -collapse_lists(); - -sub collapse_lists { - while (defined $last_nl_count_level && $last_nl_count_level >= 0) { - print "\n=back\n\n"; - $last_nl_count_level--; - } - undef $last_nl_count_level; - undef @nl_counts; - - while (defined $last_bl_count_level && $last_bl_count_level >= 0) { - print "\n=back\n\n"; - $last_bl_count_level--; - } - undef $last_bl_count_level; - undef @bl_counts; -} - diff --git a/modules_deb/libnginx-mod-http-memc-0.20/valgrind.suppress b/modules_deb/libnginx-mod-http-memc-0.20/valgrind.suppress deleted file mode 100644 index a10fd57..0000000 --- a/modules_deb/libnginx-mod-http-memc-0.20/valgrind.suppress +++ /dev/null @@ -1,93 +0,0 @@ -{ - - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_event_process_init -} -{ - - Memcheck:Param - epoll_ctl(event) - fun:epoll_ctl - fun:ngx_epoll_add_event -} -{ - - Memcheck:Param - epoll_ctl(event) - fun:epoll_ctl - fun:ngx_epoll_add_connection -} -{ - - Memcheck:Cond - fun:index - fun:expand_dynamic_string_token - fun:_dl_map_object - fun:map_doit - fun:_dl_catch_error - fun:do_preload - fun:dl_main -} -{ - - Memcheck:Param - epoll_ctl(event) - fun:epoll_ctl - fun:ngx_epoll_init - fun:ngx_event_process_init -} -{ - - Memcheck:Param - epoll_ctl(event) - fun:epoll_ctl - fun:ngx_epoll_notify_init - fun:ngx_epoll_init -} -{ - - Memcheck:Param - epoll_ctl(event) - fun:epoll_ctl - fun:ngx_epoll_test_rdhup -} -{ - - Memcheck:Leak - match-leak-kinds: definite - fun:malloc - fun:ngx_alloc - fun:ngx_set_environment - fun:ngx_single_process_cycle -} -{ - - Memcheck:Leak - match-leak-kinds: definite - fun:malloc - fun:ngx_alloc - fun:ngx_set_environment - fun:ngx_worker_process_init - fun:ngx_worker_process_cycle -} -{ - - Memcheck:Param - epoll_pwait(sigmask) - fun:epoll_pwait - fun:epoll_wait - fun:ngx_epoll_process_events - fun:ngx_process_events_and_timers -} -{ - - Memcheck:Param - epoll_pwait(sigmask) - fun:epoll_pwait - fun:epoll_wait - fun:ngx_epoll_test_rdhup - fun:ngx_epoll_init - fun:ngx_event_process_init -} diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/.gitignore b/modules_deb/libnginx-mod-http-ndk-0.3.4/.gitignore deleted file mode 100644 index 0fd79d0..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -tags -cscope.* -*~ -*.swp diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/LICENSE b/modules_deb/libnginx-mod-http-ndk-0.3.4/LICENSE deleted file mode 100644 index e1a5221..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (c) 2010-2018, Marcus Clyne - -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 THE COPYRIGHT HOLDER 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) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/README.md b/modules_deb/libnginx-mod-http-ndk-0.3.4/README.md deleted file mode 100644 index d9d3972..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/README.md +++ /dev/null @@ -1,254 +0,0 @@ -Name -==== - -Nginx Development Kit (NDK) - -Table of Contents -================= - -* [Name](#name) -* [Synopsis](#synopsis) -* [Status](#status) -* [Features](#features) -* [Design](#design) - * [modular](#modular) - * [auto-generated & easily extensible](#auto-generated--easily-extensible) -* [Usage for users](#usage-for-users) - * [Building as a dynamic module](#building-as-a-dynamic-module) -* [Usage for developers](#usage-for-developers) - * [Warning: using NDK_ALL](#warning-using-ndk_all) -* [Modules using NDK](#modules-using-ndk) -* [TODO](#todo) -* [License](#license) -* [Contributing / Feedback](#contributing--feedback) -* [Authors](#authors) -* [Special Thanks](#special-thanks) - -Synopsis -======== - -The NDK is an Nginx module that is designed to extend the core functionality of the -excellent Nginx webserver in a way that can be used as a basis of other Nginx modules. - -It has functions and macros to deal with generic tasks that don't currently have -generic code as part of the core distribution. The NDK itself adds few features -that are seen from a user's point of view - it's just designed to help reduce the -code that Nginx module developers need to write. - -Nginx module developers wishing to use any of the features in the NDK should specify -that the NDK is a dependency of their module, and that users will need to compile -it as well when they compile their own modules. They will also need to declare in -their own modules which features of the NDK they wish to use (explained below). - -If you are not an Nginx module developer, then the only useful part of this project -will be the 'usage for users' section below. - -[Back to TOC](#table-of-contents) - -Status -====== - -The NDK is now considered to be stable. It is already being used in quite a few third -party modules (see list below). - -[Back to TOC](#table-of-contents) - -Features -======== - -* additional conf_set functions for regexes, complex/script values, paths... -* macros to simplify tasks like checking for NULL values when doing ngx_array_push -* patches to the main source code -* ngx_auto_lib_core generic external library handler is included (see separate readme) - -[Back to TOC](#table-of-contents) - -Design -====== - -modular -------- - -The kit itself is designed in a modular way, so that only the required code is compiled. -It's possible to add just a single NDK module, a few or all of them. - -[Back to TOC](#table-of-contents) - -auto-generated & easily extensible ----------------------------------- - -Many of the macros available in the NDK are auto-generated from simple configuration -files. This makes creating similar macros for your own code very simple - it's usually -just the case of adding an extra line to a config file and re-running the build script. - -[Back to TOC](#table-of-contents) - -Usage for users -=============== - -If another Nginx module you wish to use specifies that the NDK is a dependency, you -will need to do the following : - -1. download the source (https://github.com/simpl/ngx_devel_kit) -2. unpack the source (tar -xzf $name) -3. compile Nginx with the following extra option `--add-module=/path/to/ngx_devel_kit`. - -e.g. - -```bash -./configure --add-module=/path/to/ngx_devel_kit \ - --add-module=/path/to/another/module -``` - -[Back to TOC](#table-of-contents) - -Building as a dynamic module ----------------------------- - -Starting from NGINX 1.9.11, you can also compile this module as a dynamic module, by using the `--add-dynamic-module=PATH` option instead of `--add-module=PATH` on the -`./configure` command line above. And then you can explicitly load the module in your `nginx.conf` via the [load_module](http://nginx.org/en/docs/ngx_core_module.html#load_module) -directive, for example, - -```nginx -load_module /path/to/modules/ndk_http_module.so; -load_module /path/to/another/module.so; -``` - -[Back to TOC](#table-of-contents) - -Usage for developers -==================== - -To use the NDK in your own module, you need to add the following: - -1. add this line to your module - -```C -#include -``` - -Note: since the NDK includes the following lines - -```C -#include -#include -#include -``` - -you can replace these with the single include above. -2. add the following line in the config file for your module: - -```bash -have=NDK_[module_name] . auto/have -``` - -for each NDK module that you wish to use (you need to include auto/have multiple -times if you wish to use multiple NDK modules. - -Note: the old method of setting - -```config -CFLAGS="$CFLAGS -DNDK_[module_name]" -``` - -is now deprecated. It will still work, but results in unnecessary lines being -displayed when compiling Nginx. - -[Back to TOC](#table-of-contents) - -Warning: Using NDK_ALL ----------------------- - -You can also set `NDK_ALL` to include all the NDK modules. This is primarily as -a convenience in the early stages of development of another module. However, - -DO NOT LEAVE `NDK_ALL` IN YOUR CONFIG FILE WHEN PUBLISHING - -Although the NDK is fairly small now, it could in time become a large repository -of code that would, if using NDK_ALL, result in considerably more code being compiled -than is necessary. - -[Back to TOC](#table-of-contents) - -Modules using NDK -================= - -The following 3rd-party modules make use of NDK. - -* [ngx_http_lua_module](https://github.com/openresty/lua-nginx-module#readme) -* [ngx_http_set_misc_module](https://github.com/openresty/set-misc-nginx-module#readme) -* [ngx_http_encrypted_session_module](https://github.com/openresty/encrypted-session-nginx-module#readme) -* [ngx_http_form_input_module](https://github.com/calio/form-input-nginx-module#readme) -* [ngx_http_iconv_module](https://github.com/calio/iconv-nginx-module#readme) -* [ngx_http_array_var_module](https://github.com/openresty/array-var-nginx-module#readme) - -If you would like to add your module to this list, please let us know. - -[Back to TOC](#table-of-contents) - -TODO -==== - -* documentation for modules that don't already have it -* additional phase-handler functions -* generically testing for needing to add a handler -* remove dependency of set_var on OpenSSL being compiled in -* for backward compatability, add the ndk_macros - -[Back to TOC](#table-of-contents) - -License -======= - -Copyright (c) 2010-2018, Marcus Clyne - -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are -permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of -conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, this list of -conditions and the following disclaimer in the documentation and/or other materials -provided with the distribution. -3. Neither the name of the copyright holder nor the names of its contributors may be used -to endorse or promote products derived from this software without specific prior -written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 THE -COPYRIGHT HOLDER 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) HOWEVER CAUSED -AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -[Back to TOC](#table-of-contents) - -Contributing / Feedback -======================= - -If you are an Nginx module developer, and have developed some functions that are -generic in nature (or would be easily adapted to be so), then please send them to -me at the address below, and I'll addmclyne to the kit. - -[Back to TOC](#table-of-contents) - -Author -====== - -[Marcus Clyne](https://github.com/mclyne) - -[Back to TOC](#table-of-contents) - - -Special Thanks -============== - -A special thanks goes to [Yichun Zhang](https://github.com/agentzh) for helping to maintain -this module. - -[Back to TOC](#table-of-contents) diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/README_AUTO_LIB.md b/modules_deb/libnginx-mod-http-ndk-0.3.4/README_AUTO_LIB.md deleted file mode 100644 index f2c3371..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/README_AUTO_LIB.md +++ /dev/null @@ -1,394 +0,0 @@ -Nginx Auto Lib Core -=================== - -Nginx Auto Lib Core is a generic external library-handler that has been designed to -facilitate the inclusion of external libraries in modules for the Nginx web server. -It has been written both for the benefit of Nginx module developers and for the end -users of those Nginx modules, and can provide a consistent, intelligent, flexible -cross-platform way to include external libraries. - -Any developers of Nginx modules are encouraged to use Auto Lib Core to handle library -dependencies for their modules rather than writing their own custom handler from scratch. - -Note : The latest version can be found [here](https://github.com/simplresty/ngx_auto_lib). - - -Information for end users -========================= - -To include external libraries using Auto Lib to you may need or wish to export some -variables before you run configure. e.g. - -$ export MOZJS=/path/to/mozjs -$ export MOZJS_SHARED=NO -$ ./configure ... - -In all cases below [PFX] should be replaced with the name of the library (e.g. MOZJS). The -specific value for [PFX] should be mentioned in the README file for the module that -uses Auto Lib Core. - - -Search order for paths ----------------------- - -(1) [PFX]_INC and [PFX]_LIB -(2) [PFX] (source or install dir) -(3) any dirs under [PFX]_BASE (see below) -(4) any dirs under the parent directory of the Nginx source dir beginning with '[pfx]-' -(5) standard system paths (including /usr/local, /usr, /opt/local, /opt, /usr/pkg) - -If any of 1-3 are specified, then any set values will be searched, and the the Nginx -source's parent directory and system paths are not searched unless [PFX]_SEARCH_[PLACE] -variable is set to YES, where PLACE ::= PARENT | SYSTEM. e.g. - -$ export OPENSSL_LIB=/path/to/openssl/lib -$ export OPENSSL_INC=/path/to/openssl/inc -$ ./configure - -will search only in the lib and include paths specified, and - -$ export OPENSSL_LIB=/path/to/openssl/lib -$ export OPENSSL_INC=/path/to/openssl/inc -$ export OPENSSL_BASE=/path/to/openssl/base -$ export OPENSSL_SEARCH_PARENT=YES -$ ./configure --with-openssl=/path/to/openssl - -will search first in the lib & inc dirs specified, then in /path/to/openssl, then will -look for directories in /path/to/openssl/base and then in the Nginx source parent -directory, but will skip checking the system paths. - -Note : apart from system paths, all dirs are checked as both source and install directories, -so static versions of installed OpenSSL, PCRE, Zlib etc libraries can be used with Nginx -if desired. - - -Specifying a path to find a library ------------------------------------ - -If the version of a library you wish to include is in any of the standard paths (e.g. -/usr/local, /usr ...), you will not need to specify a path to include the library. - -If you do wish to specify a specific path, in most cases just specifying -[PFX]=/path/to/library will be sufficient. e.g. - -$ export MOZJS=/path/to/mozjs -$ ./configure ... - -The path can be either a source directory or an install directory. Auto Lib will search - - -Searching under base paths --------------------------- - -Rather than specifying a specific path to find new libraries in non-standard locations, -you may wish to specify a base path (or just let Auto Lib search the directory that the -Nginx source is located in). This will then automatically find the most recent versions -of libraries and check them before older versions. - -e.g. - -You have installations - -/openssl/version/0.9.8m -/openssl/version/1.0.0a -... - -$ export OPENSSL_BASE=/openssl/version -$ ./configure ... - -Any directories under /openssl/version will be searched IN REVERSE ORDER, i.e. most recent -version first. Here /openssl/version/1.0.0a would be searched before /openssl/version/0.9.8m. - -If [PFX]_BASE_SEARCH_PREFIX=YES, then only directories beginning with '[pfx]-' are searched. -If [PFX]_BASE_SEARCH_PREFIX=something, then only directories beginning with 'something' are -searched. - -When searching under [PFX]_BASE no prefix is added to the search, but when searching under -the directory that the Nginx source is located in, the prefix [pfx]- is automatically added. - -Note : there is currently a minor bug (due to the implementation of the 'sort' command) -means versions that include hyphens (e.g. 1.0.0-beta5) are checked before versions like -1.0.0a. This will be fixed soon, and searching of -build folders before normal source ones -will be added too. - - - -Shared or static? ------------------ - -The default for most libraries is to look for shared libraries, though this can be overridden -by the user by setting [PFX]_SHARED=NO. - -In the near future the default action will be to look for shared libraries then to look -for static libraries in each directory searched unless one of [PFX]_SHARED and/or -[PFX]_STATIC = NO. If both are set to NO, then Auto Lib will not be used at all. - - - -Variables that users can set to help find libraries ---------------------------------------------------- - -[PFX] Location of dir where the library can be found (PATH, see below) -[PFX]_INC Include dir for library headers (PATH) -[PFX]_LIB Lib dir for library archive/shared objects (PATH) -[PFX]_BASE Base dir under which to search for other dirs (PATH) -[PFX]_SEARCH_LIB_INC Search in [PFX]_INC and [PFX]_LIB if set (YES|NO, def=YES) -[PFX]_SEARCH_DIR Search [PFX] if set (YES|NO, def=YES) -[PFX]_SEARCH_BASE Search under [PFX]_BASE if set (YES|NO, def=YES) -[PFX]_SEARCH_PARENT Search under the dir that the Nginx source is in (YES|NO, see above) -[PFX]_SEARCH_SYSTEM Search in standard system paths (YES|NO, see above) -[PFX]_SHARED Use shared library rather than static (YES|NO, def=YES) -[PFX]_SYSTEM_DIRS System dirs to search in (PATHS, space-separated, overrides the defaults) -USE_[PFX] Whether or not to install the library (YES|NO, def=YES) - - -Note : for libraries that have configure options (e.g. --with-openssl=/path), the [PFX] -variable is set automatically by configure, so will not be used if exported. - - - -Information for module developers -================================= - -How Auto Lib Core works ------------------------ - -Auto Lib Core works as an interface layer between the module and the auto/feature part of -the Nginx source. This is the file that results in the 'checking for ...' lines that you -see when you call ./configure. - -auto/feature works by using a few key variables (see below) to generate some C code, trying -to compile it to see if it works and optionally running the code. This output file is called -autotest.c (located under the objs/ directory whilst configure is running, but is deleted -after each call to auto/feature). - -Normally, whenever an external library is required, a module developer will write a number -of calls to auto/feature manually in their config files - e.g. to check under a range of -different possible locations to find a library. Apart from being tedious, this is obviously -potentially error-prone. - -Auto Lib Core will automatically generate all the calls to auto/feature for you, and will -take into account different operating systems etc in a consistent way, 'intelligent' way. - - -Including Nginx Auto Lib Core with custom modules -------------------------------------------------- - -Option 1 : - -- include ngx_auto_lib_core in the same directory that your module config file is - located -- add the following line to your config file - - . $ngx_addon_dir/ngx_auto_lib_core - -NOTE : if you want to include the file in a different directory to your config -file, you will need to change both the include line in your config file AND -the line in the ngx_auto_lib_core file that points to the file (it's the line that -has $ngx_addon_dir/ngx_auto_lib_core in it) - -Option 2 : - -- make the Nginx Development Kit (github.com/simpl-it/ngx_devel_kit) a dependency - for your module (Auto Lib Core is included automatically with it) - - -Recommended way of including Auto Lib Core ------------------------------------------- - -If the Nginx Development Kit (NDK) is already a dependency for your module, then you do -not need to do anything - just follow the 'using Auto Lib Core' instructions below. - -If the NDK is not a dependency for your module, then it is recommended to include a -copy of ngx_auto_lib_core with your module, but to recommend to users of your module -to include the NDK when compiling. If the module is not required for anything else, this -will not make any difference to the Nginx binary that they compile, but will mean they -will get the latest version of Auto Lib Core (which probably won't change much anyway, -but you never know). - -You will also probably want to include a copy of this readme file for Auto Lib Core -(at least the user section), and mention what the relevant [PFX] you use for your module -is in your module's readme file so that users will know what to write for any variables -that they might use to control the search paths for libraries (see above user section). - - -Using Auto Lib Core -------------------- - -To use Auto Lib Core, you should do the following in your config file for each -external library that you want to include : - -1 - Call ngx_auto_lib_init -2 - Define any variables used for testing -3 - Define any hooks (custom functions) -4 - Call ngx_auto_lib_run - - -Calling ngx_auto_lib_init() and ngx_auto_lib_run() --------------------------------------------------- - -You can pass either one or two variables to ngx_auto_lib_init(). The first is the name of -the library as it will appear when running ./configure, the second is the prefix that is -used for internal variables and looking for directory prefixes. If the second is not -specified, it defaults to the first. - -The init function resets all key variables and functions, so it must be called before -setting any other variables or functions that are to be used as hooks (see the notes below). - -ngx_auto_lib_run() should be called in the config files after all the variables and hooks -have been defined. This will then run through all the tests to try to find the external -library. - - -Variables you can set in your config files ------------------------------------------- - -All the variables that you set in Auto Lib Core are similar to the ones you set for -including libraries in the normal way. - - name description ----------------------------------------------------------------------------------------- - -core variables (i.e. the ones in the core Nginx source) - -ngx_feature_inc_path CFLAGS and include path info (including -I) -ngx_feature_incs Include/define code inserted before main() in autotest.c -ngx_feature_libs External libraries to add (see below) -ngx_feature_path Space-separated include path -ngx_feature_run Whether to run the autotest binary (default = no) -ngx_feature_test C-code inserted inside main() in autotest.c - -extended variables (only work in NALC) : - -ngx_feature_add_libs Add libraries (but do not add include files) -ngx_feature_add_path Add extra directories to include path -ngx_feature_build_dirs Sub dirs that builds might be found -ngx_feature_build_inc_dirs Sub dirs that include files might be found -ngx_feature_build_lib_dirs Sub dirs that lib files might be found -ngx_feature_check_macros_defined Lib required only if one of these macros is defined -ngx_feature_check_macros_non_zero Lib required only if one of these macros is non-zero -ngx_feature_defines Define these macros if the library is found -ngx_feature_deps Deps to add (e.g. to CORE_DEPS) if the library is found -ngx_feature_exit_if_not_found Quit configure if the library is not found -ngx_feature_haves Set these macros to 1 if the library is found -ngx_feature_inc_names Names for include files (not including the .h) -ngx_feature_lib_files Add these files under the lib dir for static inclusions -ngx_feature_lib_names Names for lib files (not including -l or .a) -ngx_feature_modules Modules to add if the library is found -ngx_feature_srcs Sources to add (e.g. to ADDON_SRCS) if the lib is found -ngx_feature_shared If set to 'no', then only use static lib versions -ngx_feature_test_libs Add these libs when testing, but not to the final binary -ngx_feature_variables Set these variables if the library is found - -standard variables that are completely over-written (i.e. they won't work with NALC) : - -ngx_feature_name Message that is displayed after 'checking for' in configure - - -Using these variables ---------------------- - -You do not need to set most of these variables, since 'intelligent' guesses are made that -will work for most cases. With the exception of ngx_feature_test, you should generally use -the extended variables rather than the core ones, since sensible core variables will be -automatically generated from them, and will work for both static and shared libraries. - - -Variable defaults ------------------ - -ngx_feature_incs for i in $ngx_feature_inc_names { #include <$i.h> } -ngx_feature_libs for l in $ngx_feature_lib_names { -l$l or $LIB/lib$l.a } - + $ngx_feature_add_libs -ngx_feature_inc_names $ngx_feature_lib_names -ngx_feature_lib_names $pfx -pfx str_to_lower (if two variables are passed to ngx_auto_lib_init, then - then $2, otherwise, $1) - -The easiest way to understand how all the defaults work is probably to look at the source code -of ngx_auto_lib_test_setup() and to look at the examples in the standard Nginx Auto Lib module -which has code for OpenSSL, PCRE, Zlib, MD5 and SHA1. - - -Hooks ------ - -To facilitate using Auto Lib Core in a flexible way, a number of 'hooks' have been -placed in the testing cycle. These hooks are implemented as functions that you define -in your config file which are called if required by the core library. In the core -library they are left as empty functions that return either 0 or 1. Any functions -you write will - -Note : ngx_auto_lib_init() resets the variables and functions each time it is called, so -you must DEFINE HOOKS AFTER YOU CALL ngx_auto_lib_init. - -Note : an update on what hooks are available will be added later. To see what hooks are -available, just look in the source code of ngx_auto_lib_core for any functions that just -return 0 or 1. - -See the MD5 and SHA1 libraries of Nginx Auto Lib module for examples. - - - -Checking that a library is required ------------------------------------ - -Although in most cases Auto Lib Core will be used where external libraries are -definitely required (for a module to work), this may not always be the case. In the -standard Nginx Auto Lib module (github.com/simpl-it/ngx_auto_lib) - which is designed -to improve the inclusion of OpenSSL, PCRE and Zlib libraries and increase compilation -speed where possible - the libraries are not always required, so checks are made to -see if it is necessary. - - - -How Auto Lib Core checks if a library is required - ngx_auto_lib_check_require() ------------------------------------------------------------------------------------- - -- search for USE_[PFX]=YES (it is set to YES by default for most modules) -- search for any external libraries that have been included in the CORE_LIBS or ADDON_LIBS - variables that use the same lib name as any set in ngx_feature_lib_names -- search for any macros that have been defined either in the CFLAGS variable or using - auto/have or auto/define as set in the ngx_feature_check_macros_defined and - ngx_feature_ngx_macros_non_zero variables -- any custom checks implemented by creating an ngx_auto_lib_check hook function (which - should return 0 if the library is required and return 1 at the end if the module is - not required) - - - -Guaranteeing that the correct version of a shared library is linked at run time -------------------------------------------------------------------------------- - -Sometimes users will want to use shared libraries that are in non-standard locations -that the linker may have a problem in locating at run time - even if the correct -linker path (-L/path/to/lib) is supplied when checking. To make sure that the linker -can find the library at run time, and to make sure that the linker will use the correct -version of a library if the library is also located in a standard directory, a run path -is added to the linker flags (using -Wl,--rpath -Wl,/path/to/lib/dir). In most cases this -will guarantee that the correct library is used when linking - though care should be taken -by any users specifying specific paths for libraries that the correct version of the -library has been linked at run time (e.g. using ldd etc). - -As an additional check when running auto/feature, as well as the compilation of the -autotest.c file, a check is made by ldd to see that the path of the shared library -that the linker links to is the same as the one specified. This is done because - - -To do ------ - -- Change how library paths are searched to include both shared and static libraries -- Touch up documentation - - -License -------- - - BSD - - -Copyright ---------- - - [Marcus Clyne](https://github.com/mclyne) (c) 2010 diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/actions/array b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/actions/array deleted file mode 100644 index 04cd889..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/actions/array +++ /dev/null @@ -1,10 +0,0 @@ - -array_create (a,pl,n,sz) a = %1%_array_create (pl,n,sz); if (a == NULL) %A% -array_init (a,pl,n,sz) if (%1%_array_init (a,pl,n,sz) == %E%) %A% -array_push (p,a) p = %1%_array_push (a); if (p == NULL) %A% -array_push_clean (p,a) p = %1%_array_push (a); if (p == NULL) %A%; %2%_zerop (p) -array_push_n (p,a,n) p = %1%_array_push_n (a,n); if (p == NULL) %A% -array_push_n_clean (p,a,n) p = %1%_array_push_n (a,n); if (p == NULL) %A%; %2%_zeropn (p,n) - - - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/actions/palloc b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/actions/palloc deleted file mode 100644 index 6d430bd..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/actions/palloc +++ /dev/null @@ -1,8 +0,0 @@ - -palloc (p,pl,sz) p = %1%_palloc (pl,sz); if (p == NULL) %A% -pallocp (p,pl) %2%_pallocp (p,pl); if (p == NULL) %A% -pallocpn (p,pl,n) %2%_pallocpn (p,pl,n); if (p == NULL) %A% -pcalloc (p,pl,sz) p = %1%_pcalloc (pl,sz); if (p == NULL) %A% -pcallocp (p,pl) %2%_pcallocp (p,pl); if (p == NULL) %A% -pcallocpn (p,pl,n) %2%_pcallocpn (p,pl,n); if (p == NULL) %A% - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/build b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/build deleted file mode 100644 index feb84b3..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/build +++ /dev/null @@ -1,597 +0,0 @@ -#! /bin/bash - -cd `dirname $0` - -if [ $# -eq 2 ]; -then - if [ `expr $2 : /` -eq 1 ]; - then - output_dir=$2 - else - output_dir=$1/$2 - fi -else - output_dir=../objs -fi - -list_file=data/action_list -types_file=data/action_types -reps_file=data/action_replacements -prefix_file=data/prefixes -header_file=data/header_files -optional_modules_file=data/modules_optional -headers_file=data/headers -module_dependencies_file=data/module_dependencies -conf_macros_file=data/conf_macros -conf_locs_file=data/conf_locs -conf_args_file=data/conf_args - -autogen_notice=text/autogen - -actions_dir=actions -srcs_dir=src -include_prefix= -file_prefix=ndk_ -auto_file_name=config -auto_includes_name=includes - -conf_merge_filename=conf_merge.h -conf_cmd_basic_filename=conf_cmd_basic.h -conf_cmd_extra_filename=conf_cmd_extra.h - - -spacer=¬ - -sed_delete_empty_lines='t_NEL;d;:_NEL' - - -function trim_lines { - sed -e '/./,$!d' -e :a -e '/^\n*$/{$d;N;ba' -e '}' -} - - -function strtoupper { - [ $# -eq 1 ] || return 1 - local _str _cu _cl _x - _cu=(A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) - _cl=(a b c d e f g h i j k l m n o p q r s t u v w x y z) - _str=$1 - for ((_x=0;_x<${#_cl[*]};_x++)); do - _str=${_str//${_cl[$_x]}/${_cu[$_x]}} - done - echo $_str -} - - -function sed_pad_right { - len=$1 - spacer=$2 - prefix=_PR$3 - - # returns a SED script that pads out (spaces) to the right to alignment $len - # this script should be used inside a call to sed - # NOTE : a spacer character $spacer should have already been written into the parsed string - - echo "t${prefix}a;:${prefix}a;s/^[^$spacer]{$len}/&/;\ -t${prefix}b;s/^[^$spacer]*/& /;t${prefix}a;:${prefix}b;s/$spacer/ /" -} - - -function sed_pad_left { - - len=$1 - spacer=$2 - prefix=_PL$3 - - # echo "t${prefix}a;:${prefix}a;s/^[^$spacer]{$len}/& /;t${prefix}a" # NOT CORRECT? -} - - -function add_notice { - - echo > $1 - cat $autogen_notice | trim_lines >> $1 - echo >> $1 - echo >> $1 -} - -function add_non_generated_content { - - file=src/$1.h - [ ! -f $file ] && return - - echo "/* Non-generated macros */" >> $2 - echo >> $2 - - cat $file | trim_lines >> $2 - - echo >> $2 - echo >> $2 -} - - -function add_action_macros { - - list_file=$actions_dir/$1 - - [ ! -f $list_file ] && return - - out=$2 - - - # alignment settings - - align1=20 - align2=35 - align3=62 - base_shrink=12 - define="#define " - - - - # base macros - - echo "/* base action macro macros */" >> $out - echo >> $out - - cat $list_file | trim_lines | sed -r \ - -e "s/^[ ]*([a-zA-Z0-9_]+)([ ]*)\(([a-zA-Z0-9_,]+)\)([ ]*)(.*)/$define%2%_\1_ac(\3,ac)\2\4 {\5;}/" \ - -e "s/[ ]{$base_shrink}\{/\{/" \ - -e 's/%A%/ac/g' \ - >> $out - - echo >> $out - echo >> $out - - - - # generated macros - - echo "/* generated action macros */" >> $out - echo >> $out - - cat -s $list_file | while read list_line; do - - [ "x`echo $list_line`" = 'x' ] && continue - - cat $types_file | while read type_line; do - - [ "x`echo $type_line`" = 'x' ] && continue - - #ext=`echo $type_line | grep -E '^[a-zA-Z0-9_]+' | cut -d " " -f1` - ext=`echo $type_line | sed -r 's/^([a-zA-Z0-9_]+).*/\1/'` - params=`echo $type_line | sed -r 's/^[a-zA-Z0-9_]+[ ]*\((.*)\).*/\1/;ta;d;:a'` - act=`echo $type_line | sed -r 's/^[a-zA-Z0-9_]+[ ]*(\(.*\))?(.*)/\2/'` - [ "x$params" != "x" ] && params=",$params" - - echo $list_line | sed -r \ - -e "s/^([a-zA-Z0-9_]+)[ ]*\(([a-zA-Z0-9_,]+)\).*/%2%_\1_$ext(\2$params)$spacer%2%_\1_ac$spacer(\2,$act)/" \ - -e 's/[ ]*,[ ]*/,/g' \ - -e "`sed_pad_right $align2 $spacer 1`" \ - -e "`sed_pad_right $align3 $spacer 2`" \ - -e "s/.*/$define&/" \ - >> $out - done - echo >> $out - done -} - - -function replace_prefixes { - - temp=.temp - - file=`cat $prefix_file` - - prefix1= - prefix2= - - for prefix in $file ; do - [ "x$prefix2" != "x" ] && echo "Too many prefixes in prefix file $prefix_file" && exit 1 - [ "x$prefix1" != "x" ] && prefix2=$prefix && continue - prefix1=$prefix - done - - sed -r "s/%1%/$prefix1/g;s/%2%/$prefix2/g" < $1 > $temp - - mv -f $temp $1 -} - - -function replace_other_strings { - - temp=.temp - - cat $reps_file | while read line; do - - rep1= - rep2= - - for rep in $line ; do - [ "x$rep2" != "x" ] && echo "Too many replacments in replacements file $reps_file" && exit 1 - [ "x$rep1" != "x" ] && rep2=$rep && continue - rep1=$rep - done - - sed -r "s/%$rep1%/$rep2/g" < $1 > $temp - mv -f $temp $1 - done -} - - -function generate_header_file { - - name=$1 - out=$output_dir/$file_prefix$name.h - - add_notice $out - add_non_generated_content $name $out - add_action_macros $name $out - replace_prefixes $out - replace_other_strings $out -} - - -function add_auto_include { - echo "#include <${file_prefix}$2>" >> $1 -} - - -function add_include { - echo "#include <${include_prefix}${file_prefix}$2>" >> $1 -} - - -function generate_non_optional_h_includes { - - # TODO : split into auto-generated and non-auto-generated ones - - echo "/* non-optional includes */" >> $1 - echo >> $1 - - for mod in `cat $headers_file | sort`; do - - add_auto_include $1 $mod.h - done - - echo >> $1 - echo >> $1 -} - - -function generate_include_all_includes { - - echo "/* include all optional modules */" >> $1 - echo >> $1 - echo "#ifdef NDK_ALL" >> $1 - echo >> $1 - - modules=`cat $optional_modules_file | sed 's/*//g' | sort` - - for mod in $modules; do - def="NDK_`strtoupper $mod`" - echo "#ifndef $def" >> $1 - echo "#define $def 1" >> $1 - echo "#endif" >> $1 - done - - echo >> $1 - echo "#endif" >> $1 - echo >> $1 - echo >> $1 -} - - -function generate_dependent_includes { - - echo "/* module dependencies */" >> $1 - echo >> $1 - - cat $module_dependencies_file | while read line; do - - first=1 - - for mod in $line; do - - def="NDK_`strtoupper $mod`" - - if [ $first = 1 ] ; then - - echo "#ifdef $def" >> $1 - first=0 - else - echo "#ifndef $def" >> $1 - echo "#define $def 1" >> $1 - echo "#endif" >> $1 - fi - done - - [ $first = 0 ] && echo "#endif" >> $1 - done - - echo >> $1 - echo >> $1 -} - - - -function generate_optional_h_includes { - - echo "/* optional includes */" >> $1 - echo >> $1 - - for mod in $modules; do - def="NDK_`strtoupper $mod`" - echo "#if ($def)" >> $1 - add_include $1 $mod.h - echo "#endif" >> $1 - done - - echo >> $1 - echo >> $1 -} - - - - - -function generate_conf_merge_macros_file { - - file=$conf_merge_filename - out_file=${file_prefix}$file - out=$output_dir/$out_file - - add_notice $out - - echo "/* conf-merge-value macros */" >> $out - echo >> $out - - cat $srcs_dir/$file | trim_lines >> $out - echo >> $out - echo >> $out - - echo "/* conf-merge-prop macros */" >> $out - echo >> $out - - echo "#define ndk_conf_merge_prop(prop,default)\\" >> $out - echo " ndk_conf_merge_value\\" >> $out - echo " (conf->prop, prev->prop, default)" >> $out - echo >> $out - - # loads macros, removes empty elements, sorts and translates to merge-prop macros - - cat $conf_macros_file | sed -r 's/^[A-Z0-9_]+[ ]*[A-Z0-9_]+[ ]*([a-z0-9_]+).*$/\1/;ta;d;:a' \ - | sort | sed -r \ - 's/(.*)/#define ndk_conf_merge_\1_prop(prop,default,...)\\\ - ndk_conf_merge_\1_value\\\ - (conf->prop, prev->prop, default,##__VA_ARGS__)\ - /' \ - >> $out - - add_auto_include $1 $file -} - - - - -function generate_conf_cmd_basic_file { - - temp=.rep - file=$conf_cmd_basic_filename - out_file=${file_prefix}$file - out=$output_dir/$out_file - - align1=35 - - # initial text - - add_notice $out - - - # add ndk bitmasks - - echo "/* conf cmd core values/bitmasks */" >> $out - echo >> $out - - - cat $conf_args_file | sort | trim_lines | sed -r \ - -e "s/^([A-Z0-9_]+)/${define}NDK_\1${spacer}NGX_\1/" \ - -e $sed_delete_empty_lines \ - -e "`sed_pad_right $align1 $spacer`" \ - >> $out - - echo >> $out - echo >> $out - - - # add additional bitmasks stored in file - - echo "/* conf cmd bitmasks */" >> $out - echo >> $out - - cat $srcs_dir/$conf_cmd_basic_filename | trim_lines >> $out - - echo >> $out - echo >> $out - - echo "/* conf cmd basic macros */" >> $out - echo >> $out - - - # build replacement string - - echo -n "s/^([A-Z0-9_]+)$/" > $temp - - cat $conf_locs_file | sed \ - -r -e 's/^([A-Z0-9_]+) *([A-Z0-9_]+).*/#define NDK_\1_CONF_\\1\(name,func,off1,off2,post)\\\\\\\ - {ngx_string (name),\\\\\\\ - NGX_CONF_\\1|NDK_\1_CONF,\\\\\\\ - func, off1, off2, post},\\\ -\\/' -e $sed_delete_empty_lines \ - >> $temp - - echo -n "/;$sed_delete_empty_lines" >> $temp - - - # apply the replacement string to the - - cat $conf_args_file | sort | trim_lines | sed -rf $temp >> $out - rm -f $temp - - add_auto_include $1 $file -} - - - -function generate_conf_cmd_extra_file { - - temp=.rep - file=$conf_cmd_extra_filename - out=$output_dir/${file_prefix}$file - - align1=35 - - # initial text - - add_notice $out - - echo "/* conf command macros */" >> $out - echo >> $out - - - # build replacement string - - echo -n 's/^([A-Z0-9_]+)[ ]*([A-Z0-9_]+)[ ]*([a-z0-9_]+).*$/' > $temp - - cat $conf_locs_file | sed \ - -r -e 's/^([A-Z0-9_]+)[ ]*([A-Z0-9_]+)[ ]*([a-zA-Z0-9_]+)/#define NDK_\1_CONF_\\1(name,p,post\)\\\\\\\ - NDK_\1_CONF_\\2\\\\\\\ - (name,\\\\\\\ - ndk_conf_set_\\3_slot,\\\\\\\ - NGX_\2_CONF_OFFSET,\\\\\\\ - offsetof (ndk_module_\3_conf_t, p),\\\\\\\ - post)\\\ -\\/' -e $sed_delete_empty_lines \ - >> $temp - - echo -n "/;$sed_delete_empty_lines" >> $temp - #echo -n ";`sed_pad_right 60 $spacer`" >> $temp - - - # apply the replacement string to the - - cat $conf_macros_file | sort | trim_lines | sed -rf $temp -e "`sed_pad_right 60 $spacer`" >> $out - rm -f $temp - - add_auto_include $1 $file -} - - - -function generate_auto_generated_h_includes { - - echo "/* auto-generated headers */" >> $1 - echo >> $1 - - for name in `cat $header_file | sort` ; do - - generate_header_file $name - add_auto_include $1 $name.h - done - - generate_conf_merge_macros_file $1 - generate_conf_cmd_basic_file $1 - generate_conf_cmd_extra_file $1 - - echo >> $1 - echo >> $1 -} - - - -function generate_optional_c_includes { - - echo "/* optional includes */" >> $1 - echo >> $1 - - modules=`cat $optional_modules_file | sed 's/*//g' | sort` - - for mod in $modules; do - def="NDK_`strtoupper "$mod"`" - echo "#if ($def)" >> $1 - add_include $1 $mod.c - echo "#endif" >> $1 - done - - echo >> $1 - echo >> $1 -} - - -function generate_commands { - - echo "/* module commands */" >> $1 - echo >> $1 - echo "static ngx_command_t ndk_http_commands[] = {" >> $1 - - cat $optional_modules_file | sort | while read line; do - - cmds=`echo "$line" | grep -E '\*'` - - [ "x$cmds" = "x" ] && continue - - mod=`echo "$line" | grep -E '^[a-zA-Z0-9_]+' | cut -d " " -f1` - up=`strtoupper $mod` - def="NDK_$up" - defcmd="NDK_${up}_CMDS" - - echo "#if ($def)" >> $1 - echo "#define $defcmd 1" >> $1 - add_include $1 $mod.h - echo "#undef $defcmd" >> $1 - echo "#endif" >> $1 - - done - - echo -e " ngx_null_command\n};" >> $1 -} - - -function generate_all_h_files { - - out=$output_dir/${file_prefix}$auto_file_name.h - - add_notice $out - - generate_include_all_includes $out - generate_dependent_includes $out - - out=$output_dir/${file_prefix}$auto_includes_name.h - - generate_optional_h_includes $out - generate_non_optional_h_includes $out - generate_auto_generated_h_includes $out $list -} - - -function generate_all_c_files { - - out=$output_dir/${file_prefix}$auto_file_name.c - - add_notice $out - generate_optional_c_includes $out - generate_commands $out -} - - - -function generate_all_files { - - mkdir -p $output_dir - rm -f $output_dir/* - - generate_all_h_files - generate_all_c_files -} - -generate_all_files diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/action_replacements b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/action_replacements deleted file mode 100644 index f419bc3..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/action_replacements +++ /dev/null @@ -1,5 +0,0 @@ - -OK NGX_OK -E NGX_ERROR -CE NGX_CONF_ERROR -COK NGX_CONF_OK diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/action_types b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/action_types deleted file mode 100644 index 284a5cb..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/action_types +++ /dev/null @@ -1,12 +0,0 @@ -r0 return 0 -r1 return 1 -r_1 return -1 -rok return %OK% -rce return %CE% -rcok return %COK% -re return %E% -rn return NULL -rse {ngx_script_error (e); return;} -sce {ngx_script_configure_error (c); return;} -g(_lb) goto _lb -ge goto error diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/conf_args b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/conf_args deleted file mode 100644 index 752b533..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/conf_args +++ /dev/null @@ -1,22 +0,0 @@ - -TAKE1 -TAKE2 -TAKE3 -TAKE4 -TAKE5 -TAKE6 -TAKE7 -TAKE8 -TAKE12 -TAKE13 -TAKE23 -TAKE123 -TAKE1234 -1MORE -2MORE -ANY -FLAG -BLOCK -MULTI -ARGS_NUMBER - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/conf_locs b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/conf_locs deleted file mode 100644 index f5352c3..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/conf_locs +++ /dev/null @@ -1,25 +0,0 @@ - -HTTP_MAIN HTTP_MAIN main -HTTP_SRV HTTP_SRV srv -HTTP_SIF HTTP_SRV srv -HTTP_LOC HTTP_LOC loc -HTTP_LIF HTTP_LOC loc - -HTTP_MAIN_SRV HTTP_SRV srv -HTTP_MAIN_SIF HTTP_SRV srv -HTTP_MAIN_LOC HTTP_LOC loc -HTTP_MAIN_LIF HTTP_LOC loc - -HTTP_SRV_LOC HTTP_LOC loc -HTTP_SRV_LIF HTTP_LOC loc -HTTP_SIF_LOC HTTP_LOC loc -HTTP_SIF_LIF HTTP_LOC loc - -HTTP_MAIN_SRV_LOC HTTP_LOC loc -HTTP_MAIN_SRV_LIF HTTP_LOC loc -HTTP_MAIN_SIF_LOC HTTP_LOC loc -HTTP_MAIN_SRV_SIF_LOC HTTP_LOC loc -HTTP HTTP_LOC loc -HTTP_UPS HTTP_LOC loc -HTTP_ANY HTTP_LOC loc -ANY HTTP_LOC loc diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/conf_macros b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/conf_macros deleted file mode 100644 index f42206a..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/conf_macros +++ /dev/null @@ -1,35 +0,0 @@ - -BITMASK 1MORE bitmask -BUFS TAKE1 bufs -COMPLEX_KEYVAL TAKE2 http_complex_keyval -COMPLEX_PATH TAKE1 http_complex_path -COMPLEX_VALUE TAKE1 http_complex_value -COMPLEX_VALUE_ARRAY 1MORE http_complex_value_array -ENCODING TAKE1 encoding -ENUM TAKE1 enum -FALSE NOARGS false -FULL_PATH TAKE1 full_path -KEYVAL TAKE2 keyval -KEYVAL1 TAKE2 keyval1 -MSEC TAKE1 msec -NULL NOARGS null -NUM TAKE1 num -NUM64 TAKE1 num64 -NUM_FLAG TAKE1 num_flag -ONOFF FLAG flag -OFF TAKE1 off -PATH TAKE1 split_path -REXEX TAKE1 regex -REGEX_CL TAKE1 regex_caseless -REGEX_ARRAY 1MORE regex_array -REGEX_ARRAY_CL 1MORE regex_array_caseless -PTR NOARGS ptr -SEC TAKE1 sec -SEC_FLAG TAKE2 sec_flag -SIZE TAKE1 size -STR TAKE1 str -STR_ARRAY 1MORE str_array_multi -STR_ARRAY1 TAKE1 str_array -TRUE NOARGS true - - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/contexts b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/contexts deleted file mode 100644 index e7e8ff0..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/contexts +++ /dev/null @@ -1,22 +0,0 @@ - -MAIN -SRV -SIF -LOC -LIF - -MAIN_SRV -MAIN_SIF -MAIN_LOC -MAIN_LIF -SRV_LOC -SRV_LIF -SIF_LOC -SIF_LIF - -MAIN_SRV_LOC -MAIN_SRV_LIF -MAIN_SIF_LOC -MAIN_SIF_LIF -ANY_MAIN - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/header_files b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/header_files deleted file mode 100644 index aa0f11c..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/header_files +++ /dev/null @@ -1,3 +0,0 @@ -array -palloc - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/headers b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/headers deleted file mode 100644 index 7583cb9..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/headers +++ /dev/null @@ -1,4 +0,0 @@ -http_headers -log -parse -string_util diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/module_dependencies b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/module_dependencies deleted file mode 100644 index a179316..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/module_dependencies +++ /dev/null @@ -1,5 +0,0 @@ -complex_path complex_value path -conf_file string -hash string -set_var rewrite -upstream_list http_create_main_conf diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/modules_optional b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/modules_optional deleted file mode 100644 index bbd6ec5..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/modules_optional +++ /dev/null @@ -1,15 +0,0 @@ -buf -complex_path -complex_value -conf_file -encoding -hash -http -path -process -regex -rewrite -set_var -string -upstream_list * -uri diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/prefixes b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/prefixes deleted file mode 100644 index ee53474..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/data/prefixes +++ /dev/null @@ -1,2 +0,0 @@ -ngx -ndk diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/src/array.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/src/array.h deleted file mode 100644 index a583759..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/src/array.h +++ /dev/null @@ -1,7 +0,0 @@ - -#define %2%_array_count(a) ((a)->nelts) -#define %2%_array_get_first(a) ((a)->elts) -#define %2%_array_get_index(a,n) ((void*) ((char*) (a)->elts + (a)->size * n)) -#define %2%_array_get_last(a) ((void*) ((char*) (a)->elts + (a)->size * ((a)->nelts - 1))) -#define %2%_array_get_reverse_index(a,n) ((void*) ((char*) (a)->elts + (a)->size * ((a)->nelts - 1 - n))) -#define %2%_array_push_clean(p,a) {p = %1%_array_push (a); %2%_zerop (p);} diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/src/conf_cmd_basic.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/src/conf_cmd_basic.h deleted file mode 100644 index 38743a6..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/src/conf_cmd_basic.h +++ /dev/null @@ -1,43 +0,0 @@ - -/* TODO : finish this */ - -#define NDK_HTTP_MAIN_CONF NGX_HTTP_MAIN_CONF -#define NDK_HTTP_SRV_CONF NGX_HTTP_SRV_CONF -#define NDK_HTTP_SIF_CONF NGX_HTTP_SIF_CONF -#define NDK_HTTP_LOC_CONF NGX_HTTP_LOC_CONF -#define NDK_HTTP_LIF_CONF NGX_HTTP_LIF_CONF -#define NDK_HTTP_UPS_CONF NGX_HTTP_UPS_CONF -#define NDK_MAIN_CONF NGX_MAIN_CONF -#define NDK_ANY_CONF NGX_ANY_CONF - - -/* compound locations */ - -#define NDK_HTTP_MAIN_SRV_CONF NDK_HTTP_MAIN_CONF|NDK_HTTP_SRV_CONF -#define NDK_HTTP_MAIN_SIF_CONF NDK_HTTP_MAIN_CONF|NDK_HTTP_SRV_SIF_CONF -#define NDK_HTTP_MAIN_LOC_CONF NDK_HTTP_MAIN_CONF|NDK_HTTP_LOC_CONF -#define NDK_HTTP_MAIN_LIF_CONF NDK_HTTP_MAIN_CONF|NDK_HTTP_LOC_LIF_CONF - -#define NDK_HTTP_SRV_SIF_CONF NDK_HTTP_SRV_CONF|NDK_HTTP_SIF_CONF -#define NDK_HTTP_SRV_LOC_CONF NDK_HTTP_SRV_CONF|NDK_HTTP_LOC_CONF -#define NDK_HTTP_SRV_LOC_LIF_CONF NDK_HTTP_SRV_CONF|NDK_HTTP_LOC_LIF_CONF -#define NDK_HTTP_SRV_SIF_LOC_CONF NDK_HTTP_SRV_SIF_CONF|NDK_HTTP_LOC_CONF -#define NDK_HTTP_SRV_SIF_LOC_LIF_CONF NDK_HTTP_SRV_SIF_CONF|NDK_HTTP_LOC_LIF_CONF - -#define NDK_HTTP_LOC_LIF_CONF NDK_HTTP_LOC_CONF|NDK_HTTP_LIF_CONF - -#define NDK_HTTP_MAIN_SRV_LOC_CONF NDK_HTTP_MAIN_CONF|NDK_HTTP_SRV_LOC_CONF -#define NDK_HTTP_MAIN_SRV_LIF_CONF NDK_HTTP_MAIN_CONF|NDK_HTTP_SRV_LIF_CONF -#define NDK_HTTP_MAIN_SIF_LOC_CONF NDK_HTTP_MAIN_CONF|NDK_HTTP_SIF_LOC_CONF -#define NDK_HTTP_MAIN_SRV_SIF_LOC_LIF_CONF NDK_HTTP_SRV_SIF_LOC_LIF_CONF|NDK_MAIN_CONF -#define NDK_HTTP_CONF NDK_HTTP_MAIN_SRV_SIF_LOC_LIF_CONF -#define NDK_HTTP_ANY_CONF NDK_HTTP_CONF|NDK_HTTP_UPS_CONF - - -/* property offsets NOTE : ngx_module_main_conf_t etc should be defined in the module's .c file before the commands */ - -#define NDK_HTTP_MAIN_CONF_PROP(p) NGX_HTTP_MAIN_CONF_OFFSET, offsetof (ndk_module_main_conf_t, p) -#define NDK_HTTP_SRV_CONF_PROP(p) NGX_HTTP_SRV_CONF_OFFSET, offsetof (ndk_module_srv_conf_t, p) -#define NDK_HTTP_LOC_CONF_PROP(p) NGX_HTTP_LOC_CONF_OFFSET, offsetof (ndk_module_loc_conf_t, p) - - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/src/conf_merge.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/src/conf_merge.h deleted file mode 100644 index 1e3ba70..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/src/conf_merge.h +++ /dev/null @@ -1,78 +0,0 @@ - -/* TODO : check that all the main types have a corresponding merge function */ - -#define ndk_conf_merge_value ngx_conf_merge_value -#define ndk_conf_merge_off_value ngx_conf_merge_off_value -#define ndk_conf_merge_ptr_value ngx_conf_merge_ptr_value -#define ndk_conf_merge_str_value ngx_conf_merge_str_value -#define ndk_conf_merge_size_value ngx_conf_merge_size_value - - -#define ndk_conf_merge_keyval_value(conf,prev,default) \ - \ - conf = prev ? prev : default; - -#define ndk_conf_merge_str_array_value(conf,prev,val1,...) \ - \ - if (conf == NGX_CONF_UNSET_PTR) { \ - if (prev == NGX_CONF_UNSET_PTR) { \ - if (val1 == NULL) { \ - conf = NULL; \ - } else { \ - char * elts[] = {val1,##__VA_ARGS__}; \ - int n = sizeof(elts)/sizeof(char*); \ - \ - conf = ndk_str_array_create (cf->pool, elts, n); \ - \ - if (conf == NULL) \ - return NGX_CONF_ERROR; \ - } \ - } else { \ - conf = prev; \ - } \ - } - -#define ndk_conf_merge_http_complex_value_value(conf,prev,default) \ - \ - if (!conf.str.len) { \ - if (prev.str.len) { \ - conf = prev; \ - } else { \ - conf.str.data = (u_char *) default; \ - conf.str.len = sizeof (default) - 1; \ - \ - if (ndk_http_complex_value_compile (cf, &conf)) \ - return NGX_CONF_ERROR; \ - } \ - } - -#define ndk_conf_merge_http_complex_value_array_value(conf,prev,val1,...) \ - \ - if (conf == NGX_CONF_UNSET_PTR) { \ - if (prev == NGX_CONF_UNSET_PTR) { \ - if (val1 == NULL) \ - conf = NULL; \ - else { \ - char * elts[] = {val1,##__VA_ARGS__}; \ - int n = sizeof(elts)/sizeof(char*); \ - \ - conf = ndk_http_complex_value_array_create (cf, elts, n); \ - \ - if (conf == NULL) \ - return NGX_CONF_ERROR; \ - } \ - } else { \ - conf = prev; \ - } \ - } - -#define ndk_conf_merge_http_complex_path_value(conf,prev,...) \ - ndk_conf_merge_http_complex_value_array_value (conf.a, prev.a, __VA_ARGS__) - -#define ndk_conf_merge_split_path_value(conf,prev,path) \ - \ - if (conf == NGX_CONF_UNSET_PTR) { \ - conf = (prev == NGX_CONF_UNSET_PTR ? \ - ndk_split_path_create_raw (cf, path) : prev); \ - } - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/src/palloc.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/src/palloc.h deleted file mode 100644 index 798e360..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/src/palloc.h +++ /dev/null @@ -1,6 +0,0 @@ - -#define %2%_pallocp(p,pl) p = %1%_palloc (pl,sizeof(*p)) -#define %2%_pallocpn(p,pl,n) p = %1%_palloc (pl,sizeof(*p)*(n)) - -#define %2%_pcallocp(p,pl) p = %1%_pcalloc (pl,sizeof(*p)) -#define %2%_pcallocpn(p,pl,n) p = %1%_pcalloc (pl,sizeof(*p)*(n)) diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/text/autogen b/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/text/autogen deleted file mode 100644 index 6a244c2..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/auto/text/autogen +++ /dev/null @@ -1,12 +0,0 @@ - -/* - * 2010 (C) Marcus Clyne - * - * DO NOT EDIT THIS FILE MANUALLY - * ------------------------------ - * This file has been generated automatically from scripts in the $base/auto dir and - * data in the $base/auto/data dir. If you wish to edit the output of this file, then - * you should edit these files instead. - * -*/ - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/config b/modules_deb/libnginx-mod-http-ndk-0.3.4/config deleted file mode 100644 index 8cb7ad0..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/config +++ /dev/null @@ -1,65 +0,0 @@ - -############### -## FUNCTIONS ## -############### - -# TODO : provide information about checking versions of sed etc -# TODO : an optional patch function - -ndk_generate_files() { - echo "building Nginx Development Kit utility functions and macros ..." - - autobuild="$ngx_addon_dir/auto/build" - chmod +x $autobuild - $autobuild `pwd` $NGX_OBJS/addon/ndk || exit 1 -} - -ndk_get_nginx_version() { - # We get the Nginx version number from the string form rather than - # nginx_version because it is available in more (every?) version - - cat src/core/nginx.h | - grep '#define NGINX_VERSION' | - sed -r \ - -e 's/[^0-9.]*([0-9.]+).*/\1/' \ - -e 's/([0-9]+\.[0-9]+\.)([0-9]{1})$/\100\2/' \ - -e 's/([0-9]+\.[0-9]+\.)([0-9]{2})$/\10\2/' \ - -e 's/\.//g' \ - -e 's/^0+(.*)/\1/' -} - -##################### -## CONFIG SETTINGS ## -##################### - -ngx_addon_name=ngx_devel_kit -ngx_objs_dirs="$ngx_addon_dir/objs $NGX_OBJS/addon/ndk" - -NDK_SRCS="$ngx_addon_dir/src/ndk.c" -NDK_DEPS="$ngx_addon_dir/src/ndk.h" -NDK_INCS="$ngx_addon_dir/src $ngx_objs_dirs" - -CORE_INCS="$CORE_INCS $ngx_objs_dirs" -HTTP_INCS="$HTTP_INCS $ngx_addon_dir/src $ngx_objs_dir" - -if test -n "$ngx_module_link"; then - ngx_module_type=HTTP - ngx_module_name="ndk_http_module" - ngx_module_srcs="$NDK_SRCS" - ngx_module_deps="$NDK_DEPS" - ngx_module_incs="$NDK_INCS" - - . auto/module -else - HTTP_MODULES="$HTTP_MODULES ndk_http_module" - NGX_ADDON_SRCS="$NGX_ADDON_SRCS $NDK_SRCS" - NGX_ADDON_DEPS="$NGX_ADDON_SRCS $NDK_DEPS" -fi - -have=NDK . auto/have - -############## -## INCLUDES ## -############## - -. $ngx_addon_dir/ngx_auto_lib_core diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/changelog b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/changelog deleted file mode 100644 index 93ab9b1..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/changelog +++ /dev/null @@ -1,58 +0,0 @@ -libnginx-mod-http-ndk (1:0.3.4-2) unstable; urgency=medium - - * d/control: bump Standards-Version: 4.7.2, no changes - - -- Jan Mojžíš Fri, 11 Apr 2025 14:27:01 +0200 - -libnginx-mod-http-ndk (1:0.3.4-1) unstable; urgency=medium - - * New upstream version 0.3.4 - * d/{control,copyright}: update my email to "janmojzis@debian.org" - * d/copyright: bump debian/* copyright year - * d/watch: use more generic template - * d/control: bump Standards-Version: 4.7.0, no changes - * d/gbp.conf: add [pull] track-missing = True - - -- Jan Mojžíš Fri, 21 Mar 2025 08:50:27 +0100 - -libnginx-mod-http-ndk (1:0.3.3-1) unstable; urgency=medium - - * New upstream version 0.3.3 - - -- Jan Mojžíš Mon, 18 Dec 2023 16:23:15 +0100 - -libnginx-mod-http-ndk (1:0.3.2-5) unstable; urgency=medium - - * d/control: remove Build-Depends nginx-abi-1.24.0-1 - - -- Jan Mojžíš Sat, 07 Oct 2023 15:31:27 +0200 - -libnginx-mod-http-ndk (1:0.3.2-4) unstable; urgency=medium - - * NEW ABI: rebuild with nginx-abi-1.24.0-1 - - -- Jan Mojžíš Tue, 27 Jun 2023 23:16:39 +0200 - -libnginx-mod-http-ndk (1:0.3.2-3) unstable; urgency=medium - - * d/t/generic rework. The test now checks module after - installation/reload/restart. - * d/control: bump Standards-Version: 4.6.2, no changes - * d/gbb.conf: switched to debian branch main (debian-branch = main) - * d/copyright: bump my copyright year - * NEW ABI: rebuild with nginx-abi-1.22.1-7 - - -- Jan Mojžíš Mon, 13 Feb 2023 12:56:32 +0100 - -libnginx-mod-http-ndk (1:0.3.2-2) unstable; urgency=medium - - * d/rules: enabled NDK upstream list module NDK_UPSTREAM_LIST - * d/control: added Multi-Arch: foreign - - -- Jan Mojžíš Tue, 06 Dec 2022 17:28:22 +0100 - -libnginx-mod-http-ndk (1:0.3.2-1) experimental; urgency=medium - - * Initial release. (Closes: 1024150) - - -- Jan Mojžíš Wed, 30 Nov 2022 14:46:55 +0100 diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/control b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/control deleted file mode 100644 index b5eec8e..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/control +++ /dev/null @@ -1,47 +0,0 @@ -Source: libnginx-mod-http-ndk -Section: httpd -Priority: optional -Maintainer: Debian Nginx Maintainers -Uploaders: Jan Mojžíš , -Build-Depends: debhelper-compat (= 13), - dh-sequence-nginx, -Standards-Version: 4.7.2 -Homepage: https://github.com/simpl/ngx_devel_kit -Vcs-Git: https://salsa.debian.org/nginx-team/libnginx-mod-http-ndk.git -Vcs-Browser: https://salsa.debian.org/nginx-team/libnginx-mod-http-ndk -Rules-Requires-Root: no - -Package: libnginx-mod-http-ndk -Architecture: any -Multi-Arch: foreign -Depends: ${misc:Depends}, - ${shlibs:Depends}, -Recommends: nginx, -Description: Nginx Development Kit module - The NDK is an Nginx module that is designed to extend the core functionality of - the excellent Nginx webserver in a way that can be used as a basis of other - Nginx modules. - . - It has functions and macros to deal with generic tasks that don't currently - have generic code as part of the core distribution. The NDK itself adds few - features that are seen from a user's point of view - it's just designed to help - reduce the code that Nginx module developers need to write. - -Package: libnginx-mod-http-ndk-dev -Architecture: all -Multi-Arch: foreign -Depends: libnginx-mod-http-ndk (<< ${source:Version}.1~), - libnginx-mod-http-ndk (>= ${source:Version}), - ${misc:Depends}, - ${shlibs:Depends}, -Description: Nginx Development Kit module - development files - The NDK is an Nginx module that is designed to extend the core functionality of - the excellent Nginx webserver in a way that can be used as a basis of other - Nginx modules. - . - This package provides development headers and necessary config scripts - for the Nginx development kit module, useful to develop and link third party - additions to the Debian nginx web/proxy server packages using Nginx - development kit module. - . - Development files. diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/copyright b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/copyright deleted file mode 100644 index 50da8f9..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/copyright +++ /dev/null @@ -1,155 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: ngx_devel_kit -Upstream-Contact: Marcus Clyne -Source: https://github.com/simpl/ngx_devel_kit - -Files: * -Copyright: 2010-2018, Marcus Clyne -License: BSD-3-clause - -Files: auto/text/* -Copyright: Marcus Clyne -License: BSD-3-clause - -Files: debian/* -Copyright: 2022, Miao Wang - 2022 - 2025, Jan Mojzis -License: BSD-3-clause - -Files: docs/patches/* -Copyright: Brian Moran - bmoran@onehub.com -License: BSD-3-clause - -Files: examples/* -Copyright: Marcus Clyne -License: BSD-3-clause - -Files: examples/http/* -Copyright: 2010-2018, Marcus Clyne -License: BSD-3-clause - -Files: examples/http/set_var/ngx_http_set_var_examples_module.c -Copyright: Marcus Clyne -License: BSD-3-clause - -Files: notes/* -Copyright: 2010, Marcus Clyne, Simpl (simpl.it) -License: BSD-3-clause - -Files: notes/CHANGES -Copyright: 2010-2018, Marcus Clyne -License: BSD-3-clause - -Files: objs/* -Copyright: Marcus Clyne -License: BSD-3-clause - -Files: objs/ndk_includes.h -Copyright: 2010-2018, Marcus Clyne -License: BSD-3-clause - -Files: patches/expose_rewrite_functions -Copyright: Marcus Clyne -License: BSD-3-clause - -Files: src/hash/* -Copyright: 1995-1998, Eric Young (eay@cryptsoft.com) -License: SSLeay - -Files: src/hash/murmurhash2.c -Copyright: Austin Appleby -License: BSD-3-clause - -Files: src/ndk.c - src/ndk.h - src/ndk_set_var.h -Copyright: Marcus Clyne -License: BSD-3-clause - -License: BSD-3-clause - All rights reserved. - . - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this - software without specific prior written permission. - . - THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 THE REGENTS 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) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -License: SSLeay - This software is Copyright (c) 2022 by X. Ample. - . - This is free software, licensed under: - . - Original SSLeay License - . - Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) All rights reserved. - . - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - . - This library is free for commercial and non-commercial use as long as - the following conditions are aheared to. The following conditions - apply to all code found in this distribution, be it the RC4, RSA, - lhash, DES, etc., code; not just the SSL code. The SSL documentation - included with this distribution is covered by the same copyright terms - except that the holder is Tim Hudson (tjh@cryptsoft.com). - . - Copyright remains Eric Young’s, and as such any Copyright notices in the code - are not to be removed. If this package is used in a product, Eric Young - should be given attribution as the author of the parts of the library used. - This can be in the form of a textual message at program startup or in - documentation (online or textual) provided with the package. - . - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - . - 1. Redistributions of source code must retain the copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - “This product includes cryptographic software written by - Eric Young (eay@cryptsoft.com)” - The word ‘cryptographic’ can be left out if the rouines from the library - being used are not cryptographic related :-). - 4. If you include any Windows specific code (or a derivative thereof) from - the apps directory (application code) you must include an - acknowledgement: “This product includes software written by Tim Hudson - (tjh@cryptsoft.com)” - . - THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ‘‘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 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) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - . - The licence and distribution terms for any publically available version or - derivative of this code cannot be changed. i.e. this code cannot simply be - copied and put under another distribution licence - [including the GNU Public Licence.] diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/copyright-scan-patterns.yml b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/copyright-scan-patterns.yml deleted file mode 100644 index 044c11d..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/copyright-scan-patterns.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -ignore: - pattern: - - README_AUTO_LIB\.md diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/fix.scanned.copyright b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/fix.scanned.copyright deleted file mode 100644 index b5e57b8..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/fix.scanned.copyright +++ /dev/null @@ -1 +0,0 @@ -! copyright Files:"docs/patches/*" Copyright=~s/\s\(.*// diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/gbp.conf b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/gbp.conf deleted file mode 100644 index 97cd209..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/gbp.conf +++ /dev/null @@ -1,12 +0,0 @@ -[DEFAULT] -debian-branch = main -upstream-branch = upstream -upstream-tag = upstream/%(version)s -pristine-tar = True -sign-tags = True - -[import-orig] -merge-mode = replace - -[pull] -track-missing = True diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/libnginx-mod-http-ndk-dev.install b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/libnginx-mod-http-ndk-dev.install deleted file mode 100644 index d9988f1..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/libnginx-mod-http-ndk-dev.install +++ /dev/null @@ -1,5 +0,0 @@ -debian/build-src/auto usr/share/nginx-ndk/src/ -debian/build-src/config usr/share/nginx-ndk/src/ -debian/build-src/ngx_auto_lib_core usr/share/nginx-ndk/src/ -debian/build-src/objs usr/share/nginx-ndk/src/ -debian/build-src/src usr/share/nginx-ndk/src/ diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/libnginx-mod-http-ndk.install b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/libnginx-mod-http-ndk.install deleted file mode 100644 index c7a20b4..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/libnginx-mod-http-ndk.install +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/nginx/modules/ndk_http_module.so diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/libnginx-mod-http-ndk.nginx b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/libnginx-mod-http-ndk.nginx deleted file mode 100644 index ec2f484..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/libnginx-mod-http-ndk.nginx +++ /dev/null @@ -1 +0,0 @@ -mod debian/mod-http-ndk.conf 10 diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/mod-http-ndk.conf b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/mod-http-ndk.conf deleted file mode 100644 index 3908af6..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/mod-http-ndk.conf +++ /dev/null @@ -1 +0,0 @@ -load_module modules/ndk_http_module.so; diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/rules b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/rules deleted file mode 100755 index 42e9c85..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/rules +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/make -f - -export DEB_BUILD_MAINT_OPTIONS = hardening=+all - -BUILDDIR_SRC = $(CURDIR)/debian/build-src -DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) -objdir = $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE) - -%: - dh $@ - -override_dh_auto_configure: - dh_auto_configure --buildsystem=nginx_mod - for have in NDK_SET_VAR NDK_UPSTREAM_LIST; do \ - ( \ - echo "#ifndef $$have"; \ - echo "#define $$have 1"; \ - echo "#endif"; \ - echo; \ - ) >> $(objdir)/ngx_auto_config.h; \ - done - -override_dh_auto_build: build.src - dh_auto_build --buildsystem=nginx_mod - -build.src: - mkdir -p $(BUILDDIR_SRC) - cp -Pa $(CURDIR)/auto config ngx_auto_lib_core $(BUILDDIR_SRC)/ - for i in src objs; do \ - find $(CURDIR)/$$i -type f -name '*.h' -printf "$$i/%P\0" | tar -C $(CURDIR) --null --files-from - -c | tar -C $(BUILDDIR_SRC)/ -x; \ - done - -override_dh_clean: - rm -rf $(BUILDDIR_SRC) - dh_clean diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/source/format b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/source/format deleted file mode 100644 index 163aaf8..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/tests/control b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/tests/control deleted file mode 100644 index ca20b9f..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/tests/control +++ /dev/null @@ -1,6 +0,0 @@ -Tests: generic -Restrictions: allow-stderr isolation-container needs-root -Depends: curl, - nginx, - nginx-core, - @, diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/tests/generic b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/tests/generic deleted file mode 100644 index a14fc80..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/tests/generic +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -# version 20221215 - -# generic test that only verifies that nginx is running with the given -# libnginx-... module -# - after installation -# - after nginx reload -# - after nginx restart - -EX=0 -CURL_CMD="curl --max-time 60 --silent --fail -o /dev/null" - -#change directory to $AUTOPKGTEST_TMP -cd "${AUTOPKGTEST_TMP}" - -echo -n "curl after installation: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx reload ... " -if invoke-rc.d nginx reload; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - - -echo -n "curl after reload: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx restart ... " -if invoke-rc.d nginx restart; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - -echo -n "curl after restart: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -if [ ${EX} -ne 0 ]; then - echo "=== journalctl ===" - journalctl -n all -xu nginx.service || : - - echo "=== error.log ===" - if [ `wc -l /var/log/nginx/error.log | cut -d ' ' -f1` -gt 100 ]; then - head -n 50 /var/log/nginx/error.log - echo '...' - tail -n 50 /var/log/nginx/error.log - else - cat /var/log/nginx/error.log - fi -fi - -exit ${EX} diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/upstream/metadata b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/upstream/metadata deleted file mode 100644 index 51ef420..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/upstream/metadata +++ /dev/null @@ -1,4 +0,0 @@ ---- -Bug-Database: https://github.com/simpl/ngx_devel_kit/issues -Bug-Submit: https://github.com/simpl/ngx_devel_kit/issues/new -Repository-Browse: https://github.com/simpl/ngx_devel_kit \ No newline at end of file diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/watch b/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/watch deleted file mode 100644 index e0b5b75..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/debian/watch +++ /dev/null @@ -1,6 +0,0 @@ -version=4 -opts="\ -uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha|a|b)\d*)$/$1~$2/,\ -" \ -https://github.com/simpl/ngx_devel_kit/tags \ -(?:.*?/)?v?@ANY_VERSION@@ARCHIVE_EXT@ diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/core/action_macros b/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/core/action_macros deleted file mode 100644 index 802eb1f..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/core/action_macros +++ /dev/null @@ -1,63 +0,0 @@ - - GENERAL NOTES - ------------- - - These functions and macros have been provided as a tool for Nginx module developers. They have - been created with four main purposes: - - - to speed up code-writing - - to reduce the code you have to read on file - - to add additional generic functionality similar to exising Nginx functions - - to reduce code errors - - Most of the utility macros are just wrappers around commonly used code, especially checking for - NULL and returning a value, zeroing data etc. The functions add things like extra conf_set_X_slot - functions that don't exist in the standard Nginx distribution, but which might be useful in more - than one module. - - A consistent approach has been taken to creating the macros, so that in theory you should be able - to 'know' the macro name from using the few rules below and your knowledge of the existing Nginx - functions. As much as possible, the ordering of variables used within the underlying functions - remain the same, to reduce the learning time. Also, a constent naming pattern has been used to - make it easier to read the macros above. - - Obviously not all programmers will want to use all or any of these macros, but they are provided - as a tool for those who wish to use them. - - If you have any comments about them, including any additions or errors please let me know at - 'eugaia at gmail dot com'. I don't promise to include all additions people send, but if they seem - like they could be of use to multiple developers, I will. - - - UTILITY MACRO PARAMS - -------------------- - p pointer - used to set the result of a function to a pointer - a array - pl pool - n multiplication factor - for allocating multiple pointers & pushing 'n' elts in arrays etc - sz size - l log - rv return value - - - - UTILITY MACRO FUNCTION SUFFIXES - ------------------------------- - - - general - - p p = [FUNCTION] () - _r [ if result of function is NULL | NGX_ERROR (as appropriate) ] return rv - _rce rv = NGX_CONF_ERROR - _re rv = NGX_ERROR - _rn rv = NULL - - - (p)(c)alloc functions - - p p = [function] (pool, sizeof (*p)) - pn p = [function] (pool, sizeof (*p) * n) - - - UTILITY MACRO PARAMS ORDER - -------------------------- - p, pl|a, sz|n, l, rv diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/core/conf_cmds b/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/core/conf_cmds deleted file mode 100644 index 70978b1..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/core/conf_cmds +++ /dev/null @@ -1,62 +0,0 @@ - -Conf command macros -------------------- - -The build script generates a large number of macros for reducing the code required for command -definitions. - -There are basically three types of macros : - -- combination bitmasks - - e.g. NDK_HTTP_MAIN_SRV_CONF = (NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF) - -- base command structures - - e.g. NDK_HTTP_MAIN_CONF_TAKE1 - -- conf-set command structures - - e.g. NDK_HTTP_CONF_STR - - -Combination bitmasks --------------------- - -Basically combinations of existing bitmasks for locations, with general > specific order - -NDK_HTTP_CONF = (NGX_HTTP_MAIN_CONF | NGX_HTTP_SVR_CONF | NGX_HTTP_SIF_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF) - - -Base command structures ------------------------ - -These macros are basically there as wrappers for the conf-set command structures, and but incorporate -the bitmask element into the name of the macro. - - -Conf-set command structures ---------------------------- - -These macros simplify creating commands that use any of the build-in conf-set functions or any of those -added by the NDK. - -e.g. NGX_HTTP_MAIN_SRV_STR ("name", prop, NULL) - -where prop is the name of the property that is a ngx_str_t. Whether this is in the loc conf, main conf -or svr conf is generated automatically in by the macro. - -NOTE : you need to set the following if they will be used (using macro definitions) : - -ndk_module_main_conf_t -ndk_module_srv_conf_t -ndk_module_loc_conf_t - -e.g - -#define ndk_module_loc_conf_t ngx_http_my_module_loc_conf_t - - -TODO ----- -Much better documentation for this diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/modules/set_var b/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/modules/set_var deleted file mode 100644 index 6be5c0f..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/modules/set_var +++ /dev/null @@ -1,124 +0,0 @@ - -set var tools -============= - -OVERVIEW --------- -This collection of tools is designed to make it easier to set Nginx variables -using a common interface. It works by plugging into and extending the features -of the internal rewrite module, and operations performed by this module are -therefore done at the rewrite phase of handling. - - -ADVANTAGES OF USING THIS MODULE -------------------------------- - -- simple interface - you don't have to worry about lots of http script compiling -- it plugs into the rewrite module, so setting (and getting) vars will happen - in the order you expect based on how they appear in the configuration file -- you do not have to worry about overriding the v->get_handler (useful if - a variable of a specific name could be set in multiple different ways) - - -WHEN TO USE THIS AND WHEN TO USE v->get_handler = my_func ---------------------------------------------------------- - -- if you want a variable to always be generated using a specific function, - and should not be over-ridden by 'set' functions (e.g. $request_uri, - $document_root), then you should use v->get_handler - -- if you want to allow a variable to be set using many possible methods, - including using the 'set' directive, then this module provides an easy way - for you to do so (if you use the v->get_handler method in this case, you may - run into problems because the get_handler may over-ride previous uses of the - set directive) - - -USAGE ------ - -- decide on the type of function you'll need to write - - type use when there are these requirements - ---- ------------------------------------- - NDK_SET_VAR_BASIC 0 variable values, no extra data - NDK_SET_VAR_DATA 0 variable values, extra data - NDK_SET_VAR_VALUE 1 variable value, no extra data - NDK_SET_VAR_VALUE_DATA 1 variable value, extra data - NDK_SET_VAR_MULTI_VALUE 2+ variable values, no extra data - NDK_SET_VAR_MULTI_VALUE_DATA 2+ variable values, extra data - NDK_SET_VAR_HASH the space needed for the result string - value is known in advance (usually - used in a hash function) - - NOTE : if none of these generic calling types suit your needs, it is - easy to extend the list of types in the .c file (and you if you let me know - I'll add them to the list - - -- define the filter function with the respective prototype - - type prototype - ---- --------- - NDK_SET_VAR_BASIC ndk_set_var_pt - NDK_SET_VAR_DATA ndk_set_var_data_pt - NDK_SET_VAR_VALUE ndk_set_var_value_pt - NDK_SET_VAR_DATA_VALUE ndk_set_var_value_data_pt - NDK_SET_VAR_MULTI_VALUE ndk_set_var_value_pt - NDK_SET_VAR_MULTI_VALUE_DATA ndk_set_var_value_data_pt - NDK_SET_VAR_HASH ndk_set_var_hash_pt - - (See ngx_tools_module.h for the prototype definitions.) - - Note : For the multi_value functions, the variable value pointer is to the - first value (with the others being in an array following it) - - -to use one of the default setup functions ------------------------------------------ - -- define one or multiple ngx_http_var_filter_t's at the global scope, setting : - - type = (one of types above) - func = function to call - size = (for multi value) the number of variable values - (for hash) length of buffer to allocate - data = (for data functions) additional data (see note below) - -- define a configuration directive (see in the .c file for examples), where the - function is 'ngx_http_set_var' and the 'post' is a pointer your filter definition - - -to setup in a customized way ----------------------------- - -- define a configuration directive which has your own specific configuration function - -- inside your config function, define one or several ngx_http_var_filter_t's like - above, and call one of the ngx_http_set_var_..._core functions, passing the - variable name and value pointers as appropriate - see examples section - -Note : if you're passing extra data to the function, then you will probably want -to use this second method and store the data either in the loc conf, or just -allocate the space for it using one of the ngx_palloc functions. - -If the values that will be used for processing are in the same order as in the -config file and there aren't any additional values that are input, then you can -just use the (ngx_str_t *) (cf->args->elts) + 1 as your base for the values or -possibly not use the _core versions of the functions. - - -That's it! - - -FEEDBACK --------- - -If you have any comments (good/bad), or have found any bugs, please let me know at: -ngx.eugaia AT gmail DOT com - - -TODO ----- -- add more documentation/examples - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/patches/more_logging_info b/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/patches/more_logging_info deleted file mode 100644 index 3685916..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/patches/more_logging_info +++ /dev/null @@ -1,48 +0,0 @@ -When tracking down some potential issues in the nginx constellation, -we've found it useful to understand where particular error messages -are coming from, since many of the same messages are repeated in -various places. This patch will write the source file from which the -message originated, the function name, and the line number if you're -using GCC to compile nginx. Here's an example: - -Old Output: -2010/01/12 14:43:10 [notice] 67772#0: nginx/0.7.64 -2010/01/12 14:43:10 [notice] 67772#0: built by gcc 4.0.1 (Apple Inc. build 5490) -2010/01/12 14:43:10 [notice] 67772#0: OS: Darwin 9.8.0 -2010/01/12 14:43:10 [notice] 67772#0: hw.ncpu: 2 -2010/01/12 14:43:10 [notice] 67772#0: net.inet.tcp.sendspace: 65536 -2010/01/12 14:43:10 [notice] 67772#0: kern.ipc.somaxconn: 128 -2010/01/12 14:43:10 [notice] 67772#0: getrlimit(RLIMIT_NOFILE): -256:9223372036854775807 -2010/01/12 14:43:10 [notice] 67772#0: start worker processes -2010/01/12 14:43:10 [notice] 67772#0: start worker process 67785 -2010/01/12 14:43:16 [notice] 67772#0: signal 20 (SIGCHLD) received - -New Output: -2010/01/14 16:35:09 [notice] 27241#0: src/os/unix/ngx_posix_init.c -ngx_os_status( 80) nginx/0.7.64 -2010/01/14 16:35:09 [notice] 27241#0: src/os/unix/ngx_posix_init.c -ngx_os_status( 83) built by gcc 4.0.1 (Apple Inc. build 5490) -2010/01/14 16:35:09 [notice] 27241#0: src/os/unix/ngx_darwin_init.c -ngx_os_specific_status( 153) OS: Darwin 9.8.0 -2010/01/14 16:35:09 [notice] 27241#0: src/os/unix/ngx_darwin_init.c -ngx_os_specific_status( 166) hw.ncpu: 2 -2010/01/14 16:35:09 [notice] 27241#0: src/os/unix/ngx_darwin_init.c -ngx_os_specific_status( 166) net.inet.tcp.sendspace: 65536 -2010/01/14 16:35:09 [notice] 27241#0: src/os/unix/ngx_darwin_init.c -ngx_os_specific_status( 166) kern.ipc.somaxconn: 128 -2010/01/14 16:35:09 [notice] 27241#0: src/os/unix/ngx_posix_init.c -ngx_os_status( 92) getrlimit(RLIMIT_NOFILE): -2560:9223372036854775807 -2010/01/14 16:35:09 [notice] 27241#0: src/os/unix/ngx_process_cycle.c -ngx_start_worker_processes( 337) start worker processes -2010/01/14 16:35:09 [notice] 27241#0: src/os/unix/ngx_process.c -ngx_spawn_process( 201) start worker process 27254 -2010/01/14 16:35:14 [notice] 27241#0: src/os/unix/ngx_process.c -ngx_signal_handler( 420) signal 20 (SIGCHLD) received - -Formatting the filename and function name fields into fixed-width -fields would be nicer, however that would require further changes in -src/core/ngx_string.c - -(C) Brian Moran - bmoran@onehub.com (posted to nginx-devel mailing list on 15/01/10) diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/upstream/list b/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/upstream/list deleted file mode 100644 index 3ad485d..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/docs/upstream/list +++ /dev/null @@ -1,45 +0,0 @@ - -NDK_UPSTREAM_LIST ------------------ - -This submodule provides a directive that creates a list of upstreams, with -optional weighting. This list can then be used by other modules to hash over -the upstreams however they choose. - - -USAGE IN CONF FILE ------------------- - -e.g. upstream_list name backend1 4:backend2 3:backend3; - - - -USAGE WITH OTHER MODULES ------------------------- - -Add a line like - -CFLAGS="$CFLAGS -DNDK_UPSTREAM_LIST" - -to the config file of your module. - - - -INTEGRATING WITH YOUR MODULE ----------------------------- - -The upstream lists are stored in the array given in the lists.h file, which is -an array of ndk_upstream_list_t elts. The elts are currently all pointers to -strings which have been distributed according to the weight - so if there are -two backends, with weight 3 and 4 respectively, there will be 7 pointers in -total with the first 3 pointing to the first backend and the last 4 to the -second. - - - -TODO ----- -- replace strings with pointers to upstreams if they are available (and if - this is possible) -- add additional 'http://' to strings if necessary -- improve this documentation diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/examples/README b/modules_deb/libnginx-mod-http-ndk-0.3.4/examples/README deleted file mode 100644 index 22e2417..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/examples/README +++ /dev/null @@ -1,12 +0,0 @@ - -2010 (C) Marcus Clyne - - -Examples --------- - -In this section there are a number of examples of the various features of the tools -module. These have been given in the form of dummy modules, to make it easier to -use as templates for your own module should you choose to do so. - - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/examples/http/set_var/config b/modules_deb/libnginx-mod-http-ndk-0.3.4/examples/http/set_var/config deleted file mode 100644 index aa58f77..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/examples/http/set_var/config +++ /dev/null @@ -1,4 +0,0 @@ -ngx_addon_name=ngx_http_set_var_examples_module -HTTP_MODULES="$HTTP_MODULES ngx_http_set_var_examples_module" -NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_set_var_examples_module.c" -have=NDK_SET_VAR . auto/have \ No newline at end of file diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/examples/http/set_var/ngx_http_set_var_examples_module.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/examples/http/set_var/ngx_http_set_var_examples_module.c deleted file mode 100644 index 7a4daae..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/examples/http/set_var/ngx_http_set_var_examples_module.c +++ /dev/null @@ -1,136 +0,0 @@ - -/* - * 2010 (C) Marcus Clyne - */ - - -#include - - -static ngx_int_t ngx_http_set_var_concat2 (ngx_http_request_t *r, ngx_str_t *val, ngx_http_variable_value_t *v); -static char * ngx_http_set_prepend_hello (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); - - -static ndk_set_var_t ngx_http_var_set_concat2 = { - NDK_SET_VAR_MULTI_VALUE, - ngx_http_set_var_concat2, - 2, - NULL -}; - - -static ngx_command_t ngx_http_set_var_examples_commands[] = { - { - ngx_string ("set_concat2"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE3, - ndk_set_var_multi_value, - 0, - 0, - &ngx_http_var_set_concat2 - }, - { - ngx_string ("set_prepend_hello"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE1, - ngx_http_set_prepend_hello, - 0, - 0, - NULL - }, - ngx_null_command -}; - - -ngx_http_module_t ngx_http_set_var_examples_module_ctx = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}; -ngx_module_t ngx_http_set_var_examples_module = { - - NGX_MODULE_V1, - &ngx_http_set_var_examples_module_ctx, // module context - ngx_http_set_var_examples_commands, // module directives - NGX_HTTP_MODULE, // module type - NULL, // init master - NULL, // init module - NULL, // init process - NULL, // init thread - NULL, // exit thread - NULL, // exit process - NULL, // exit master - NGX_MODULE_V1_PADDING -}; - - -/* - This function is called by both examples, takes two variable values and concatenates them - to give a third string. -*/ - -static ngx_int_t -ngx_http_set_var_concat2 (ngx_http_request_t *r, ngx_str_t *val, ngx_http_variable_value_t *v) -{ - size_t len; - ngx_http_variable_value_t *v2; - u_char *p; - - v2 = v + 1; - - len = v->len + v2->len; - - /* - * NDK provided abbreviation for the following code: - * - * p = ngx_palloc (r->pool, len); - * if (p == NULL) - * return NGX_ERROR; - * - * */ - ndk_palloc_re(p, r->pool, len); - - val->data = p; - val->len = len; - - ngx_memzero (p, len); - - p = ngx_cpymem (p, v->data, v->len); - ngx_memcpy (p, v2->data, v2->len); - - return NGX_OK; -} - - - -/* - This function demonstrates using the 'core' function in a function that appends the word - 'hello_' to the beginning of a variable. - - set $var world; - set_prepend_hello $var $var; - - If the arguments used in the variable value filter do not all come directly from the conf - file, or are not given in the order - - direcive $var_name val1 "val2 string $var" ... - - then the _core functions should be used inside the function that is called when the directive - is read. -*/ - -static char * -ngx_http_set_prepend_hello (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_str_t s[2], *var_name; - ndk_set_var_t filter; - - var_name = cf->args->elts; - var_name++; - - s[0].data = (u_char*) "hello_"; - s[0].len = 6; - - s[1] = *(var_name + 1); - - filter.type = NDK_SET_VAR_MULTI_VALUE; - filter.func = ngx_http_set_var_concat2; - filter.size = 2; - - return ndk_set_var_multi_value_core (cf, var_name, (ngx_str_t *) s, &filter); -} - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/ngx_auto_lib_core b/modules_deb/libnginx-mod-http-ndk-0.3.4/ngx_auto_lib_core deleted file mode 100644 index d5441fb..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/ngx_auto_lib_core +++ /dev/null @@ -1,797 +0,0 @@ - -## Directories to search for usable builds: -## -## - [$PFX]_INC and [$PFX]_LIB -## - the dir specified by --with-[$pfx]=* -## - each dir named [$pfx]-* under [$PFX]_BASE (descending order) -## - each dir named [$pfx]-* under $ngx_src_dir/.. (descending order) -## - system_paths (see below) -## -## Note : specifying [$PFX]_INC or [$PFX]_LIB prevents other dirs being tried -## specifying --with-[$pfx]= prevents autodiscovery of dirs -## -## Note : if this file is not in the same directory as the config file, the value -## for ngx_auto_lib_file should be changed to a relative path from that file -## e.g. : $ngx_addon_dir/libs/ngx_auto_lib -## -## TODO : explain hooks - -############# -## VERSION ## -############# - -ngx_auto_lib_version=1001 - -if [ ! $ngx_auto_lib_file_version ] || [ $ngx_auto_lib_file_version -lt $ngx_auto_lib_version ]; then - - if [ ! $ngx_addon_dir ]; then - ngx_addon_dir=`cd $(dirname $0); pwd` - fi - - ngx_auto_lib_file="$ngx_addon_dir/ngx_auto_lib_core" - ngx_auto_lib_file_version="$ngx_auto_lib_version" -fi - -############### -## VARIABLES ## -############### - -v= -v="$v inc_path" -v="$v incs" -v="$v libs" -v="$v name" -v="$v path" -v="$v run" -v="$v test" -ev= -ev="$ev add_libs" -ev="$ev add_path" -ev="$ev build_dirs" -ev="$ev build_inc_dirs" -ev="$ev build_lib_dirs" -ev="$ev check_macros_defined" -ev="$ev check_macros_non_zero" -ev="$ev defines" -ev="$ev deps" -ev="$ev exit_if_not_found" -ev="$ev haves" -ev="$ev inc_names" -ev="$ev lib_files" -ev="$ev lib_names" -ev="$ev libs_to_add" -ev="$ev modules" -ev="$ev srcs" -ev="$ev shared" -ev="$ev test_libs" -ev="$ev variables" - -ngx_feature_vars="$v" -ngx_feature_extra_vars="$ev" -ngx_feature_all_vars="$v $ev" - -NGX_AUTO_LIB_DEFAULT_SYSTEM_DIRS='/usr/local /usr /opt/local /opt /usr/pkg' - -#################### -## UTIL FUNCTIONS ## -#################### - -to_upper() { - echo "$@" | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' -} - -to_lower() { - echo "$@" | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' -} - -#################### -## INIT FUNCTIONS ## -#################### - -ngx_auto_lib_init() { - - . $ngx_auto_lib_file - - ngx_auto_lib_init_latest $@ -} - -ngx_auto_lib_init_latest() { - - # set name and prefixes - - if [ ! $1 ]; then - echo "ngx_auto_lib_init() requires that a name be passed" - exit 1 - fi - - ngx_auto_lib_name=$1 - ngx_auto_lib_module_name=$2 - - if [ $2 ]; then - NGX_AUTO_LIB_PFX=`to_upper $2` - else - NGX_AUTO_LIB_PFX=`to_upper $1` - fi - - ngx_auto_lib_pfx=`to_lower $NGX_AUTO_LIB_PFX` - - ngx_auto_lib_clean_feature_vars -} - -ngx_auto_lib_clean_feature_vars() { - for var in $ngx_feature_all_vars; do - eval ngx_feature_$var= - done -} - -ngx_auto_lib_get_variables() { - - local pfx=$ngx_auto_lib_pfx - local PFX=$NGX_AUTO_LIB_PFX - - eval NGX_AUTO_LIB_INC=\"\$${PFX}_INC\" - eval NGX_AUTO_LIB_LIB=\"\$${PFX}_LIB\" - eval NGX_AUTO_LIB_DIR=\"\$${PFX}\" - eval NGX_AUTO_LIB_BASE=\"\$${PFX}_BASE\" - eval NGX_AUTO_LIB_SEARCH_LIB_INC=\"\$${PFX}_SEARCH_LIB_INC\" - eval NGX_AUTO_LIB_SEARCH_DIR=\"\$${PFX}_SEARCH_DIR\" - eval NGX_AUTO_LIB_SEARCH_BASE=\"\$${PFX}_SEARCH_BASE\" - eval NGX_AUTO_LIB_SEARCH_BASE_PREFIX=\"\$${PFX}_SEARCH_BASE_PREFIX\" - eval NGX_AUTO_LIB_SEARCH_PARENT=\"\$${PFX}_SEARCH_PARENT\" - eval NGX_AUTO_LIB_SEARCH_SYSTEM=\"\$${PFX}_SEARCH_SYSTEM\" - eval NGX_AUTO_LIB_SHARED=\"\$${PFX}_SHARED\" - eval NGX_AUTO_LIB_SYSTEM_DIRS=\"\$${PFX}_SYSTEM_DIR\" - eval USE_NGX_AUTO_LIB=\"\$USE_${LIB}\" - - if [ ! "$NGX_AUTO_LIB_DIR" ]; then - NGX_AUTO_LIB_DIR=NONE - fi - - if [ ! "$USE_NGX_AUTO_LIB" ]; then - if [ $ngx_feature_check_macros_defined -o $ngx_feature_check_macros_non_zero ]; then - USE_NGX_AUTO_LIB=MAYBE - elif [ "$ngx_feature_required" = no ]; then - USE_NGX_AUTO_LIB=MAYBE - else - USE_NGX_AUTO_LIB=YES - fi - fi - - if [ ! "$NGX_AUTO_LIB_SYSTEM_DIRS" ]; then - NGX_AUTO_LIB_SYSTEM_DIRS=$NGX_AUTO_LIB_DEFAULT_SYSTEM_DIRS - fi - - # TODO : add _STATIC, and do searches for both static and shared libs - - if [ ! "$NGX_AUTO_LIB_SHARED" ]; then - if [ "$ngx_feature_shared" = no ]; then - NGX_AUTO_LIB_SHARED=NO - else - NGX_AUTO_LIB_SHARED=YES - fi - fi - - NGX_AUTO_LIB_SEARCH_DEP=NO - - # set default search methods - # Note : these can be over-ridden by setting NGX_AUTO_LIB_SEARCH_[type]=YES|NO - - local auto=y - - if [ "$NGX_AUTO_LIB_INC" ] || [ "$NGX_AUTO_LIB_LIB" ]; then - ngx_auto_lib_search LIB_INC YES - auto=n - fi - - if [ "$NGX_AUTO_LIB_DIR" != NONE ]; then - ngx_auto_lib_search DIR YES - auto=n - fi - - if [ "$NGX_AUTO_LIB_BASE" ]; then - ngx_auto_lib_search BASE YES - auto=n - fi - - if [ $auto = y ]; then - ngx_auto_lib_search PARENT YES - ngx_auto_lib_search SYSTEM YES - fi - - ngx_auto_lib_search LIB_INC NO - ngx_auto_lib_search DIR NO - ngx_auto_lib_search BASE NO - ngx_auto_lib_search PARENT NO - ngx_auto_lib_search SYSTEM NO - - if [ ! "$ngx_feature_lib_names" ]; then - ngx_feature_lib_names=$pfx - fi - - if [ ! "$ngx_feature_inc_names" ]; then - ngx_feature_inc_names=$ngx_feature_lib_names - fi - - if [ ! "$ngx_feature_exit_if_not_found" ]; then - ngx_feature_exit_if_not_found=yes - fi -} - -####################### -## DEFAULT FUNCTIONS ## -####################### - -ngx_auto_lib_set_default() { - - local suffix= - if [ $1 ]; then - suffix="_$1" - fi - - local def=$2 - local var="NGX_AUTO_LIB$suffix" - - val= - if [ ! `eval echo '$'$var` ]; then - eval $var=\"$def\" - fi - - #eval echo "$var = \$$var" -} - -ngx_auto_lib_search() { - ngx_auto_lib_set_default "SEARCH_$1" $2 -} - -#################### -## SAVE FUNCTIONS ## -#################### - -ngx_auto_lib_save_vars() { - OLD_CORE_DEPS=$CORE_DEPS - OLD_CORE_INCS=$CORE_INCS - OLD_CORE_LIBS=$CORE_LIBS - OLD_CORE_SRCS=$CORE_SRCS - OLD_LINK_DEPS=$LINK_DEPS - - CORE_DEPS= - CORE_INCS= - CORE_LIBS= - CORE_SRCS= - LINK_DEPS= -} - -ngx_auto_lib_reset_vars() { - CORE_DEPS=$OLD_CORE_DEPS - CORE_INCS=$OLD_CORE_INCS - CORE_LIBS=$OLD_CORE_LIBS - CORE_SRCS=$OLD_CORE_SRCS - LINK_DEPS=$OLD_LINK_DEPS -} - -ngx_auto_lib_save_feature_vars() { - for var in $ngx_feature_all_vars; do - eval main_ngx_feature_$var=\"\$ngx_feature_$var\" - done -} - -ngx_auto_lib_reset_feature_vars() { - for var in $ngx_feature_all_vars; do - eval ngx_feature_$var=\"\$main_ngx_feature_$var\" - done -} - -######################## -## CHECKING FUNCTIONS ## -######################## - -ngx_auto_lib_check_auto_config() { - - ngx_auto_lib_save_feature_vars - ngx_auto_lib_clean_feature_vars - - ngx_feature=$1 - ngx_feature_inc_path="`echo $CFLAGS | tr ' ' '\n' | grep -- -D | tr '\n' ' '`" - ngx_feature_incs="#include <$NGX_AUTO_CONFIG_H>" - ngx_feature_libs= - ngx_feature_path=`pwd` - ngx_feature_run=no - ngx_feature_test=$2 - - #ngx_auto_lib_print_feature_vars - - . auto/feature - - if [ $ngx_found = yes ]; then - rv=0 - else - rv=1 - fi - - ngx_auto_lib_reset_feature_vars - - return $rv -} - -ngx_auto_lib_check_macro_defined() { - - for m in $@; do - ngx_auto_lib_check_auto_config "$m" " - #ifndef $m - rubbish - #endif" && return 0 - done - - return 1 -} - -ngx_auto_lib_check_macro_non_zero() { - - for m in $@; do - ngx_auto_lib_check_auto_config "$m" " - #if !($m) - rubbish - #endif" && return 0 - done - - return 1 -} - -ngx_auto_lib_check_require() { - - if [ $USE_NGX_AUTO_LIB = YES ]; then - return 0 - elif [ $USE_NGX_AUTO_LIB = NO ]; then - return 1 - fi - - - # check if the libraries are required elsewhere - - for l in $ngx_feature_lib_names; do - [ ! "`echo $CORE_LIBS $ADDON_LIBS | grep -w -- -l$l`" ] && return 0 - done - - - - # check that any required macros are set - - local d=$ngx_feature_check_macros_defined - local nz=$ngx_feature_check_macros_non_zero - - if [ "$d" ] || [ "$nz" ]; then - - ngx_auto_lib_check_macro_defined $d && return 0 - ngx_auto_lib_check_macro_non_zero $nz && return 0 - fi - - - ngx_auto_lib_check -} - -ngx_auto_lib_check() { - return 1 -} - -################################## -## TEST PHASE HANDLER FUNCTIONS ## -################################## - -ngx_auto_lib_test() { - ngx_auto_lib_test_pre_setup "$@" - ngx_auto_lib_test_setup "$@" - ngx_auto_lib_test_post_setup "$@" - ngx_auto_lib_test_feature -} - -ngx_auto_lib_test_pre_setup() { - return 0 -} - -ngx_auto_lib_test_setup() { - - local INC=$1 - local LIB=$2 - - ngx_auto_lib_inc_dir=$INC - ngx_auto_lib_lib_dir=$LIB - - ngx_auto_lib_reset_feature_vars - - if [ ! "$ngx_feature_path" ]; then - ngx_feature_path="$INC" - fi - - ngx_feature_path="$ngx_feature_path $ngx_feature_add_path" - - for sfx in $ngx_feature_path_suffixes; do - ngx_feature_path="$ngx_feature_path $INC/$sfx" - done - - - local inc= - local lib= - local incs="$ngx_feature_inc_names" - local libs="$ngx_feature_lib_names" - local lib_files="$ngx_feature_lib_files" - - for inc in $incs; do - ngx_feature_incs="$ngx_feature_incs -#include <$inc.h>" - done - - - if [ ! "$ngx_feature_libs" ]; then - - if [ $NGX_AUTO_LIB_SHARED = YES ]; then - if [ $NGX_RPATH = YES ]; then - ngx_feature_libs="-R$LIB" - fi - ngx_feature_libs="$ngx_feature_libs -L$LIB" - - for lib in $libs; do - ngx_feature_libs="$ngx_feature_libs -l$lib" - done - - # TODO : only add --rpath when the path is not a standard system path - warn if /usr - - ngx_feature_libs="$ngx_feature_libs -Wl,--rpath -Wl,$LIB" - - else - - for lib in $lib_files; do - ngx_feature_libs="$ngx_feature_libs $LIB/$lib" - done - - for lib in $libs; do - ngx_feature_libs="$ngx_feature_libs $LIB/lib$lib.a" - done - fi - fi - - if [ ! $ngx_feature_run ]; then - ngx_feature_run=no - fi - - if [ $NGX_AUTO_LIB_SHARED = YES ]; then - - # Add a test to be called in auto/feature after compilation that will check - # whether any libraries that are linked are in fact using the path provided to - # link libraries rather than a standard path. Note : this test will work on - # all linked shared objects, even if supplied directly by setting - # $ngx_feature_libs instead of usign $ngx_feature_lib_names - - # TODO : allow for some libraries to not be checked here if desired - if part of system paths - - libs="`echo $ngx_feature_libs | tr ' ' '\n' | grep -- -l | sed 's|-l||g'`" - - local test=" - for l in $libs; do - o="'\`ldd '$NGX_AUTOTEST' | grep '$LIB'/lib\$l\\.so\`; - if [ ! \"\$o\" ]; then - chmod -x $NGX_AUTOTEST; - echo Linker does not link to correct version - else - chmod +x $NGX_AUTOTEST; - fi - done' - test="`echo "$test" | tr '\n' ' '`" - - ngx_feature_test_libs="$ngx_feature_test_libs; $test" - fi - - ngx_feature_libs="$ngx_feature_libs $ngx_feature_add_libs" - ngx_feature_libs_to_add="$ngx_feature_libs" - ngx_feature_libs="$ngx_feature_libs $ngx_feature_test_libs" - ngx_feature="$ngx_auto_lib_name library $ngx_feature" -} - -ngx_auto_lib_test_post_setup() { - return 0 -} - -ngx_auto_lib_test_feature() { - #ngx_auto_lib_print_feature_vars - . auto/feature - [ $ngx_found = yes ] && return 0 - return 1 -} - -######################## -## TEST DIR FUNCTIONS ## -######################## - -ngx_auto_lib_test_dir_pair() { - ngx_auto_lib_test_inc_dir=$1 - ngx_auto_lib_test_lib_dir=$2 - - if [ $1 = $2 ]; then - ngx_feature="in $1$3" - else - ngx_feature="in $1 and $2$3" - fi - ngx_auto_lib_test "$1" "$2" "$3" -} - -ngx_auto_lib_test_dir_pairs() { - ngx_auto_lib_test_dir_pair "$1/include" "$2/lib" "$3" && return 0 - ngx_auto_lib_test_dir_pair "$1" "$2" "$3" && return 0 - return 1 -} - -ngx_auto_lib_test_dirs() { - - local msg="$1" - local bdir idir ldir - - local bdirs=$ngx_feature_build_dirs - local idirs=$ngx_feature_build_inc_dirs - local ldirs=$ngx_feature_build_lib_dirs - - shift - - for dir in "$@"; do - ngx_auto_lib_test_dir=$dir - - for ldir in $ldirs; do - for idir in $idirs; do - ngx_auto_lib_test_dir_pair "$dir/$idir" "$dir/$ldir" "$msg" && return 0 - done - done - - for ldir in $ldirs; do - ngx_auto_lib_test_dir_pair "$dir" "$dir/$ldir" "$msg" && return 0 - done - - for idir in $idirs; do - ngx_auto_lib_test_dir_pair "$dir/$idir" "$dir" "$msg" && return 0 - done - - for bdir in $bdirs; do - ngx_auto_lib_test_dir_pairs "$dir/$bdir" "$dir/$bdir" "$msg" && return 0 - done - - ngx_auto_lib_test_dir_pairs "$dir" "$dir" "$msg" && return 0 - ngx_auto_lib_test_dir= - done - - return 1 -} - -ngx_auto_lib_test_install_dirs() { - - local msg="$1" - local dir= - - shift - - for dir in "$@"; do - ngx_auto_lib_test_dir=$dir - ngx_auto_lib_test_dir_pair "$dir/include" "$dir/lib" "$msg" && return 0 - ngx_auto_lib_test_dir= - done - - return 1 -} - -ngx_auto_lib_run_tests() { - - local name="$ngx_auto_lib_name" - local pfx="$ngx_auto_lib_pfx" - local PFX="$NGX_AUTO_LIB_PFX" - local INC="$NGX_AUTO_LIB_INC" - local LIB="$NGX_AUTO_LIB_LIB" - local DIR="$NGX_AUTO_LIB_DIR" - local BASE="$NGX_AUTO_LIB_BASE" - local MSG="$NGX_AUTO_LIB_MSG" - - - ngx_found=no - - - # dependency - - if [ $NGX_AUTO_LIB_SEARCH_DEP = YES ]; then - ngx_auto_lib_test_dir_pair "$INC" "$LIB" "$MSG" - return $? - fi - - - # lib and include dirs set explicitly (e.g. $OPENSSL_INC, $OPENSSL_LIB) - - if [ $NGX_AUTO_LIB_SEARCH_LIB_INC = YES ]; then - ngx_auto_lib_test_dir_pair "$INC" "$LIB" " (specified by \$${PFX}_INC and \$${PFX}_LIB)" && return 0 - fi - - - # path specified by ${PFX} (e.g. $OPENSSL, $PCRE) - # Note : these will be set automatically by configure for OpenSSL, PCRE, Zlib etc - # TODO : change to searching more than one path - - if [ $NGX_AUTO_LIB_SEARCH_DIR = YES ] && [ $DIR != NONE ]; then - ngx_auto_lib_test_dirs " (specified by \$${PFX})" $DIR && return 0 - fi - - - # directories beginning with '$pfx-' that are in $NGX_AUTO_LIB_BASE (e.g. $OPENSSL_BASE) - - if [ $NGX_AUTO_LIB_SEARCH_BASE = YES ] && [ $BASE ]; then - - p=$NGX_AUTO_LIB_SEARCH_BASE_PREFIX - - if [ "$p" = YES ]; then - p="!ame $pfx-*" - elif [ "$p" ]; then - p="!ame $p*" - fi - - ngx_auto_lib_test_dirs " (found under \$${PFX}_BASE)" \ - `find $BASE/* -maxdepth 0 -type d $p 2> /dev/null | sort -r` && return 0 - fi - - - # directories beginning with '$pfx-' that are in the same directory as the Nginx source - - if [ $NGX_AUTO_LIB_SEARCH_PARENT = YES ]; then - local src_dir=`cd ..; pwd` - ngx_auto_lib_test_dirs " (found under Nginx source parent dir)" \ - `find $src_dir/* -maxdepth 0 -type d !ame $pfx-* 2> /dev/null | sort -r` && return 0 - fi - - - # system folders - - if [ $NGX_AUTO_LIB_SEARCH_SYSTEM = YES ]; then - ngx_auto_lib_test_install_dirs "" $NGX_AUTO_LIB_SYSTEM_DIRS && return 0 - fi - - return 1 -} - -####################### -## HANDLER FUNCTIONS ## -####################### - -ngx_auto_lib_run() { - ngx_auto_lib_get_variables - eval AUTO_$NGX_AUTO_LIB_PFX=NO - - ngx_auto_lib_check_require || return - ngx_auto_lib_setup || return - ngx_auto_lib_save_feature_vars - ngx_auto_lib_run_tests - ngx_auto_lib_post_tests || return - ngx_auto_lib_finalize -} - -ngx_auto_lib_print_feature_vars() { - echo ---------------------------- - for var in $ngx_feature_vars; do - eval "echo ngx_feature_$var = \$ngx_feature_$var" - done - echo ---------------------------- -} - -ngx_auto_lib_setup() { - return 0 -} - -ngx_auto_lib_post_tests() { - return 0 -} - -############################# -## SET VARIABLES FUNCTIONS ## -############################# - -# TODO : add HTTP/ADDON settings too - -ngx_auto_lib_set_core_variables() { - # TODO : don't add includes / libs more than once - - eval CORE_DEPS=\"$CORE_DEPS $ngx_feature_deps\" - eval CORE_INCS=\"$CORE_INCS $ngx_feature_path\" - eval CORE_LIBS=\"$CORE_LIBS $ngx_feature_libs_to_add\" - eval CORE_SRCS=\"$CORE_SRCS $ngx_feature_srcs\" -} - -ngx_auto_lib_set_generic_variables() { - local INC=$ngx_auto_lib_test_inc_dir - local LIB=$ngx_auto_lib_test_lib_dir - - modules="$modules $ngx_feature_modules" - - for have in $ngx_feature_haves; do - . auto/have - done - - set - $ngx_feature_defines - - while [ $1 ]; do - have=$1 - value=$2 - . auto/define - done - - local PFX=$NGX_AUTO_LIB_PFX - - eval USE_$PFX=NO - - if [ $ngx_auto_lib_test_dir ]; then - eval $PFX=$ngx_auto_lib_test_dir - else - eval $PFX=$ngx_auto_lib_lib_dir - fi - - if [ $NGX_AUTO_LIB_SHARED != YES ]; then - for l in $ngx_feature_lib_names; do - CORE_LIBS=`echo $CORE_LIBS | sed 's|-\||g'` - ADDON_LIBS=`echo $ADDON_LIBS | sed 's|-\||g'` - done - fi - - eval ${PFX}_INC=$INC - eval ${PFX}_LIB=$LIB - eval ${PFX}_SHARED=$NGX_AUTO_LIB_SHARED - eval AUTO_$PFX=YES -} - -ngx_auto_lib_set_custom_variables() { - return 0 -} - -######################## -## FINALIZE FUNCTIONS ## -######################## - -ngx_auto_lib_finalize() { - ngx_auto_lib_finalize_core -} - -ngx_auto_lib_finalize_core() { - - if [ $ngx_found = yes ]; then - - ngx_auto_lib_set_core_variables - ngx_auto_lib_set_generic_variables - - if [ "$ngx_feature_variables" ]; then - eval $ngx_feature_variables - fi - - ngx_auto_lib_set_custom_variables - - elif [ $ngx_feature_exit_if_not_found = yes ]; then - - if [ $ngx_auto_lib_module_name ]; then - module_txt=" by the $ngx_auto_lib_module_name module" - else - module_text= - fi - - lib=$ngx_auto_lib_name - pfx=$ngx_auto_lib_pfx - PFX=$NGX_AUTO_LIB_PFX - -cat << END - -$0: error: the $lib library is required$module_txt, but cannot -be found using the current configuration. In order for the compilation to succeed, -you will need to install the library using your system's package installer or point -the configure script to the library using one of the following variables : - -to define a dir to find $pfx library (source or install dir) $PFX -to define $pfx lib and include dirs separately ${PFX}_LIB & ${PFX}_INC -to define a base dir to search for dirs beginning with $pfx- ${PFX}_BASE - -e.g. - -$ export ${PFX}_LIB=/path/to/library/lib -$ export ${PFX}_LIB=/path/to/library/include -$ $0 ... - -END - exit 1 - fi -} - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/notes/CHANGES b/modules_deb/libnginx-mod-http-ndk-0.3.4/notes/CHANGES deleted file mode 100644 index eaaef0b..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/notes/CHANGES +++ /dev/null @@ -1,17 +0,0 @@ -Changelog ---------- - -0.1 feature : set_var functions -0.1.1 feature : upstream_list directive and functions -0.2 feature : conf merge functions - feature : conf command macros - feature : 'action' macros -0.2.1 bugfix : ndk_map_uri_to_path_add_suffix -0.2.2 feature : regex conf functions -0.2.3 feature : version number -0.2.4 change : the auto/build script is now executed automatically on compilation -0.2.9 feature : ngx_auto_lib included with source -0.2.11 bugfix : hash functions did not display properly -0.2.12 feature : patches for rewrite functions and rewrite phase handler -0.2.13 change : revert to old behaviour rewrite functions - change : pre-generated config and macro files now provided \ No newline at end of file diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/notes/LICENSE b/modules_deb/libnginx-mod-http-ndk-0.3.4/notes/LICENSE deleted file mode 100644 index 7074f57..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/notes/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2010, Marcus Clyne, Simpl (simpl.it) -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the organization (Simpl) nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 MARCUS CLYNE OR SIMPL 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) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_array.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_array.h deleted file mode 100644 index 4e0d518..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_array.h +++ /dev/null @@ -1,113 +0,0 @@ - -/* - * 2010 (C) Marcus Clyne - * - * DO NOT EDIT THIS FILE MANUALLY - * ------------------------------ - * This file has been generated automatically from scripts in the $base/auto dir and - * data in the $base/auto/data dir. If you wish to edit the output of this file, then - * you should edit these files instead. - * -*/ - - -/* Non-generated macros */ - -#define ndk_array_count(a) ((a)->nelts) -#define ndk_array_get_first(a) ((a)->elts) -#define ndk_array_get_index(a,n) ((void*) ((char*) (a)->elts + (a)->size * n)) -#define ndk_array_get_last(a) ((void*) ((char*) (a)->elts + (a)->size * ((a)->nelts - 1))) -#define ndk_array_get_reverse_index(a,n) ((void*) ((char*) (a)->elts + (a)->size * ((a)->nelts - 1 - n))) -#define ndk_array_push_clean(p,a) {p = ngx_array_push (a); ndk_zerop (p);} - - -/* base action macro macros */ - -#define ndk_array_create_ac(a,pl,n,sz,ac) {a = ngx_array_create (pl,n,sz); if (a == NULL) ac;} -#define ndk_array_init_ac(a,pl,n,sz,ac) {if (ngx_array_init (a,pl,n,sz) == NGX_ERROR) ac;} -#define ndk_array_push_ac(p,a,ac) {p = ngx_array_push (a); if (p == NULL) ac;} -#define ndk_array_push_clean_ac(p,a,ac) {p = ngx_array_push (a); if (p == NULL) ac; ndk_zerop (p);} -#define ndk_array_push_n_ac(p,a,n,ac) {p = ngx_array_push_n (a,n); if (p == NULL) ac;} -#define ndk_array_push_n_clean_ac(p,a,n,ac) {p = ngx_array_push_n (a,n); if (p == NULL) ac; ndk_zeropn (p,n);} - - -/* generated action macros */ - -#define ndk_array_create_r0(a,pl,n,sz) ndk_array_create_ac (a,pl,n,sz,return 0) -#define ndk_array_create_r1(a,pl,n,sz) ndk_array_create_ac (a,pl,n,sz,return 1) -#define ndk_array_create_r_1(a,pl,n,sz) ndk_array_create_ac (a,pl,n,sz,return -1) -#define ndk_array_create_rok(a,pl,n,sz) ndk_array_create_ac (a,pl,n,sz,return NGX_OK) -#define ndk_array_create_rce(a,pl,n,sz) ndk_array_create_ac (a,pl,n,sz,return NGX_CONF_ERROR) -#define ndk_array_create_rcok(a,pl,n,sz) ndk_array_create_ac (a,pl,n,sz,return NGX_CONF_OK) -#define ndk_array_create_re(a,pl,n,sz) ndk_array_create_ac (a,pl,n,sz,return NGX_ERROR) -#define ndk_array_create_rn(a,pl,n,sz) ndk_array_create_ac (a,pl,n,sz,return NULL) -#define ndk_array_create_rse(a,pl,n,sz) ndk_array_create_ac (a,pl,n,sz,{ngx_script_error (e); return;}) -#define ndk_array_create_sce(a,pl,n,sz) ndk_array_create_ac (a,pl,n,sz,{ngx_script_configure_error (c); return;}) -#define ndk_array_create_g(a,pl,n,sz,_lb) ndk_array_create_ac (a,pl,n,sz,goto _lb) -#define ndk_array_create_ge(a,pl,n,sz) ndk_array_create_ac (a,pl,n,sz,goto error) - -#define ndk_array_init_r0(a,pl,n,sz) ndk_array_init_ac (a,pl,n,sz,return 0) -#define ndk_array_init_r1(a,pl,n,sz) ndk_array_init_ac (a,pl,n,sz,return 1) -#define ndk_array_init_r_1(a,pl,n,sz) ndk_array_init_ac (a,pl,n,sz,return -1) -#define ndk_array_init_rok(a,pl,n,sz) ndk_array_init_ac (a,pl,n,sz,return NGX_OK) -#define ndk_array_init_rce(a,pl,n,sz) ndk_array_init_ac (a,pl,n,sz,return NGX_CONF_ERROR) -#define ndk_array_init_rcok(a,pl,n,sz) ndk_array_init_ac (a,pl,n,sz,return NGX_CONF_OK) -#define ndk_array_init_re(a,pl,n,sz) ndk_array_init_ac (a,pl,n,sz,return NGX_ERROR) -#define ndk_array_init_rn(a,pl,n,sz) ndk_array_init_ac (a,pl,n,sz,return NULL) -#define ndk_array_init_rse(a,pl,n,sz) ndk_array_init_ac (a,pl,n,sz,{ngx_script_error (e); return;}) -#define ndk_array_init_sce(a,pl,n,sz) ndk_array_init_ac (a,pl,n,sz,{ngx_script_configure_error (c); return;}) -#define ndk_array_init_g(a,pl,n,sz,_lb) ndk_array_init_ac (a,pl,n,sz,goto _lb) -#define ndk_array_init_ge(a,pl,n,sz) ndk_array_init_ac (a,pl,n,sz,goto error) - -#define ndk_array_push_r0(p,a) ndk_array_push_ac (p,a,return 0) -#define ndk_array_push_r1(p,a) ndk_array_push_ac (p,a,return 1) -#define ndk_array_push_r_1(p,a) ndk_array_push_ac (p,a,return -1) -#define ndk_array_push_rok(p,a) ndk_array_push_ac (p,a,return NGX_OK) -#define ndk_array_push_rce(p,a) ndk_array_push_ac (p,a,return NGX_CONF_ERROR) -#define ndk_array_push_rcok(p,a) ndk_array_push_ac (p,a,return NGX_CONF_OK) -#define ndk_array_push_re(p,a) ndk_array_push_ac (p,a,return NGX_ERROR) -#define ndk_array_push_rn(p,a) ndk_array_push_ac (p,a,return NULL) -#define ndk_array_push_rse(p,a) ndk_array_push_ac (p,a,{ngx_script_error (e); return;}) -#define ndk_array_push_sce(p,a) ndk_array_push_ac (p,a,{ngx_script_configure_error (c); return;}) -#define ndk_array_push_g(p,a,_lb) ndk_array_push_ac (p,a,goto _lb) -#define ndk_array_push_ge(p,a) ndk_array_push_ac (p,a,goto error) - -#define ndk_array_push_clean_r0(p,a) ndk_array_push_clean_ac (p,a,return 0) -#define ndk_array_push_clean_r1(p,a) ndk_array_push_clean_ac (p,a,return 1) -#define ndk_array_push_clean_r_1(p,a) ndk_array_push_clean_ac (p,a,return -1) -#define ndk_array_push_clean_rok(p,a) ndk_array_push_clean_ac (p,a,return NGX_OK) -#define ndk_array_push_clean_rce(p,a) ndk_array_push_clean_ac (p,a,return NGX_CONF_ERROR) -#define ndk_array_push_clean_rcok(p,a) ndk_array_push_clean_ac (p,a,return NGX_CONF_OK) -#define ndk_array_push_clean_re(p,a) ndk_array_push_clean_ac (p,a,return NGX_ERROR) -#define ndk_array_push_clean_rn(p,a) ndk_array_push_clean_ac (p,a,return NULL) -#define ndk_array_push_clean_rse(p,a) ndk_array_push_clean_ac (p,a,{ngx_script_error (e); return;}) -#define ndk_array_push_clean_sce(p,a) ndk_array_push_clean_ac (p,a,{ngx_script_configure_error (c); return;}) -#define ndk_array_push_clean_g(p,a,_lb) ndk_array_push_clean_ac (p,a,goto _lb) -#define ndk_array_push_clean_ge(p,a) ndk_array_push_clean_ac (p,a,goto error) - -#define ndk_array_push_n_r0(p,a,n) ndk_array_push_n_ac (p,a,n,return 0) -#define ndk_array_push_n_r1(p,a,n) ndk_array_push_n_ac (p,a,n,return 1) -#define ndk_array_push_n_r_1(p,a,n) ndk_array_push_n_ac (p,a,n,return -1) -#define ndk_array_push_n_rok(p,a,n) ndk_array_push_n_ac (p,a,n,return NGX_OK) -#define ndk_array_push_n_rce(p,a,n) ndk_array_push_n_ac (p,a,n,return NGX_CONF_ERROR) -#define ndk_array_push_n_rcok(p,a,n) ndk_array_push_n_ac (p,a,n,return NGX_CONF_OK) -#define ndk_array_push_n_re(p,a,n) ndk_array_push_n_ac (p,a,n,return NGX_ERROR) -#define ndk_array_push_n_rn(p,a,n) ndk_array_push_n_ac (p,a,n,return NULL) -#define ndk_array_push_n_rse(p,a,n) ndk_array_push_n_ac (p,a,n,{ngx_script_error (e); return;}) -#define ndk_array_push_n_sce(p,a,n) ndk_array_push_n_ac (p,a,n,{ngx_script_configure_error (c); return;}) -#define ndk_array_push_n_g(p,a,n,_lb) ndk_array_push_n_ac (p,a,n,goto _lb) -#define ndk_array_push_n_ge(p,a,n) ndk_array_push_n_ac (p,a,n,goto error) - -#define ndk_array_push_n_clean_r0(p,a,n) ndk_array_push_n_clean_ac (p,a,n,return 0) -#define ndk_array_push_n_clean_r1(p,a,n) ndk_array_push_n_clean_ac (p,a,n,return 1) -#define ndk_array_push_n_clean_r_1(p,a,n) ndk_array_push_n_clean_ac (p,a,n,return -1) -#define ndk_array_push_n_clean_rok(p,a,n) ndk_array_push_n_clean_ac (p,a,n,return NGX_OK) -#define ndk_array_push_n_clean_rce(p,a,n) ndk_array_push_n_clean_ac (p,a,n,return NGX_CONF_ERROR) -#define ndk_array_push_n_clean_rcok(p,a,n) ndk_array_push_n_clean_ac (p,a,n,return NGX_CONF_OK) -#define ndk_array_push_n_clean_re(p,a,n) ndk_array_push_n_clean_ac (p,a,n,return NGX_ERROR) -#define ndk_array_push_n_clean_rn(p,a,n) ndk_array_push_n_clean_ac (p,a,n,return NULL) -#define ndk_array_push_n_clean_rse(p,a,n) ndk_array_push_n_clean_ac (p,a,n,{ngx_script_error (e); return;}) -#define ndk_array_push_n_clean_sce(p,a,n) ndk_array_push_n_clean_ac (p,a,n,{ngx_script_configure_error (c); return;}) -#define ndk_array_push_n_clean_g(p,a,n,_lb) ndk_array_push_n_clean_ac (p,a,n,goto _lb) -#define ndk_array_push_n_clean_ge(p,a,n) ndk_array_push_n_clean_ac (p,a,n,goto error) - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_conf_cmd_basic.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_conf_cmd_basic.h deleted file mode 100644 index c2db894..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_conf_cmd_basic.h +++ /dev/null @@ -1,2203 +0,0 @@ - -/* - * 2010 (C) Marcus Clyne - * - * DO NOT EDIT THIS FILE MANUALLY - * ------------------------------ - * This file has been generated automatically from scripts in the $base/auto dir and - * data in the $base/auto/data dir. If you wish to edit the output of this file, then - * you should edit these files instead. - * -*/ - - -/* conf cmd core values/bitmasks */ - -#define NDK_1MORE NGX_1MORE -#define NDK_2MORE NGX_2MORE -#define NDK_ANY NGX_ANY -#define NDK_ARGS_NUMBER NGX_ARGS_NUMBER -#define NDK_BLOCK NGX_BLOCK -#define NDK_FLAG NGX_FLAG -#define NDK_MULTI NGX_MULTI -#define NDK_TAKE1 NGX_TAKE1 -#define NDK_TAKE12 NGX_TAKE12 -#define NDK_TAKE123 NGX_TAKE123 -#define NDK_TAKE1234 NGX_TAKE1234 -#define NDK_TAKE13 NGX_TAKE13 -#define NDK_TAKE2 NGX_TAKE2 -#define NDK_TAKE23 NGX_TAKE23 -#define NDK_TAKE3 NGX_TAKE3 -#define NDK_TAKE4 NGX_TAKE4 -#define NDK_TAKE5 NGX_TAKE5 -#define NDK_TAKE6 NGX_TAKE6 -#define NDK_TAKE7 NGX_TAKE7 -#define NDK_TAKE8 NGX_TAKE8 - - -/* conf cmd bitmasks */ - -/* TODO : finish this */ - -#define NDK_HTTP_MAIN_CONF NGX_HTTP_MAIN_CONF -#define NDK_HTTP_SRV_CONF NGX_HTTP_SRV_CONF -#define NDK_HTTP_SIF_CONF NGX_HTTP_SIF_CONF -#define NDK_HTTP_LOC_CONF NGX_HTTP_LOC_CONF -#define NDK_HTTP_LIF_CONF NGX_HTTP_LIF_CONF -#define NDK_HTTP_UPS_CONF NGX_HTTP_UPS_CONF -#define NDK_MAIN_CONF NGX_MAIN_CONF -#define NDK_ANY_CONF NGX_ANY_CONF - - -/* compound locations */ - -#define NDK_HTTP_MAIN_SRV_CONF NDK_HTTP_MAIN_CONF|NDK_HTTP_SRV_CONF -#define NDK_HTTP_MAIN_SIF_CONF NDK_HTTP_MAIN_CONF|NDK_HTTP_SRV_SIF_CONF -#define NDK_HTTP_MAIN_LOC_CONF NDK_HTTP_MAIN_CONF|NDK_HTTP_LOC_CONF -#define NDK_HTTP_MAIN_LIF_CONF NDK_HTTP_MAIN_CONF|NDK_HTTP_LOC_LIF_CONF - -#define NDK_HTTP_SRV_SIF_CONF NDK_HTTP_SRV_CONF|NDK_HTTP_SIF_CONF -#define NDK_HTTP_SRV_LOC_CONF NDK_HTTP_SRV_CONF|NDK_HTTP_LOC_CONF -#define NDK_HTTP_SRV_LOC_LIF_CONF NDK_HTTP_SRV_CONF|NDK_HTTP_LOC_LIF_CONF -#define NDK_HTTP_SRV_SIF_LOC_CONF NDK_HTTP_SRV_SIF_CONF|NDK_HTTP_LOC_CONF -#define NDK_HTTP_SRV_SIF_LOC_LIF_CONF NDK_HTTP_SRV_SIF_CONF|NDK_HTTP_LOC_LIF_CONF - -#define NDK_HTTP_LOC_LIF_CONF NDK_HTTP_LOC_CONF|NDK_HTTP_LIF_CONF - -#define NDK_HTTP_MAIN_SRV_LOC_CONF NDK_HTTP_MAIN_CONF|NDK_HTTP_SRV_LOC_CONF -#define NDK_HTTP_MAIN_SRV_LIF_CONF NDK_HTTP_MAIN_CONF|NDK_HTTP_SRV_LIF_CONF -#define NDK_HTTP_MAIN_SIF_LOC_CONF NDK_HTTP_MAIN_CONF|NDK_HTTP_SIF_LOC_CONF -#define NDK_HTTP_MAIN_SRV_SIF_LOC_LIF_CONF NDK_HTTP_SRV_SIF_LOC_LIF_CONF|NDK_MAIN_CONF -#define NDK_HTTP_CONF NDK_HTTP_MAIN_SRV_SIF_LOC_LIF_CONF -#define NDK_HTTP_ANY_CONF NDK_HTTP_CONF|NDK_HTTP_UPS_CONF - - -/* property offsets NOTE : ngx_module_main_conf_t etc should be defined in the module's .c file before the commands */ - -#define NDK_HTTP_MAIN_CONF_PROP(p) NGX_HTTP_MAIN_CONF_OFFSET, offsetof (ndk_module_main_conf_t, p) -#define NDK_HTTP_SRV_CONF_PROP(p) NGX_HTTP_SRV_CONF_OFFSET, offsetof (ndk_module_srv_conf_t, p) -#define NDK_HTTP_LOC_CONF_PROP(p) NGX_HTTP_LOC_CONF_OFFSET, offsetof (ndk_module_loc_conf_t, p) - - -/* conf cmd basic macros */ - -#define NDK_HTTP_MAIN_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_1MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_1MORE|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_2MORE(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_2MORE|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_ANY(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ANY|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_ARGS_NUMBER(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_ARGS_NUMBER|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_BLOCK(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_BLOCK|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_FLAG(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_FLAG|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_MULTI(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_MULTI|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_TAKE1(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_TAKE12(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE12|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_TAKE123(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE123|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_TAKE1234(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE1234|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_TAKE13(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE13|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_TAKE2(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE2|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_TAKE23(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE23|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_TAKE3(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE3|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_TAKE4(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE4|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_TAKE5(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE5|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_TAKE6(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE6|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_TAKE7(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE7|NDK_ANY_CONF,\ - func, off1, off2, post}, - - -#define NDK_HTTP_MAIN_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_MAIN_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LOC_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_LIF_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_MAIN_SRV_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_MAIN_SIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LOC_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_MAIN_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_LIF_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_MAIN_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LOC_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SRV_LIF_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LOC_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_SIF_LIF_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_SIF_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_MAIN_SRV_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_MAIN_SRV_LIF_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_MAIN_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_MAIN_SRV_SIF_LOC_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_UPS_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_UPS_CONF,\ - func, off1, off2, post}, - -#define NDK_HTTP_ANY_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_HTTP_ANY_CONF,\ - func, off1, off2, post}, - -#define NDK_ANY_CONF_TAKE8(name,func,off1,off2,post)\ - {ngx_string (name),\ - NGX_CONF_TAKE8|NDK_ANY_CONF,\ - func, off1, off2, post}, - - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_conf_cmd_extra.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_conf_cmd_extra.h deleted file mode 100644 index 68e276f..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_conf_cmd_extra.h +++ /dev/null @@ -1,5423 +0,0 @@ - -/* - * 2010 (C) Marcus Clyne - * - * DO NOT EDIT THIS FILE MANUALLY - * ------------------------------ - * This file has been generated automatically from scripts in the $base/auto dir and - * data in the $base/auto/data dir. If you wish to edit the output of this file, then - * you should edit these files instead. - * -*/ - - -/* conf command macros */ - -#define NDK_HTTP_MAIN_CONF_BITMASK(name,p,post)\ - NDK_HTTP_MAIN_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_BITMASK(name,p,post)\ - NDK_HTTP_SRV_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_BITMASK(name,p,post)\ - NDK_HTTP_SIF_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_BITMASK(name,p,post)\ - NDK_HTTP_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_BITMASK(name,p,post)\ - NDK_HTTP_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_BITMASK(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_BITMASK(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_BITMASK(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_BITMASK(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_BITMASK(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_BITMASK(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_BITMASK(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_BITMASK(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_BITMASK(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_BITMASK(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_BITMASK(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_BITMASK(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_BITMASK(name,p,post)\ - NDK_HTTP_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_BITMASK(name,p,post)\ - NDK_HTTP_UPS_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_BITMASK(name,p,post)\ - NDK_HTTP_ANY_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_BITMASK(name,p,post)\ - NDK_ANY_CONF_1MORE\ - (name,\ - ndk_conf_set_bitmask_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_BUFS(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_BUFS(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_BUFS(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_BUFS(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_BUFS(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_BUFS(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_BUFS(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_BUFS(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_BUFS(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_BUFS(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_BUFS(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_BUFS(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_BUFS(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_BUFS(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_BUFS(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_BUFS(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_BUFS(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_BUFS(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_BUFS(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_BUFS(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_BUFS(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_bufs_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_COMPLEX_KEYVAL(name,p,post)\ - NDK_ANY_CONF_TAKE2\ - (name,\ - ndk_conf_set_http_complex_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_COMPLEX_PATH(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_COMPLEX_PATH(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_SRV_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_SIF_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_UPS_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_HTTP_ANY_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_COMPLEX_VALUE_ARRAY(name,p,post)\ - NDK_ANY_CONF_1MORE\ - (name,\ - ndk_conf_set_http_complex_value_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_COMPLEX_VALUE(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_http_complex_value_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_ENCODING(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_ENCODING(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_ENCODING(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_ENCODING(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_ENCODING(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_ENCODING(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_ENCODING(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_ENCODING(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_ENCODING(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_ENCODING(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_ENCODING(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_ENCODING(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_ENCODING(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_ENCODING(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_ENCODING(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_ENCODING(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_ENCODING(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_ENCODING(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_ENCODING(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_ENCODING(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_ENCODING(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_encoding_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_ENUM(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_ENUM(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_ENUM(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_ENUM(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_ENUM(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_ENUM(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_ENUM(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_ENUM(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_ENUM(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_ENUM(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_ENUM(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_ENUM(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_ENUM(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_ENUM(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_ENUM(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_ENUM(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_ENUM(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_ENUM(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_ENUM(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_ENUM(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_ENUM(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_enum_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_FALSE(name,p,post)\ - NDK_HTTP_MAIN_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_FALSE(name,p,post)\ - NDK_HTTP_SRV_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_FALSE(name,p,post)\ - NDK_HTTP_SIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_FALSE(name,p,post)\ - NDK_HTTP_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_FALSE(name,p,post)\ - NDK_HTTP_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_FALSE(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_FALSE(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_FALSE(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_FALSE(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_FALSE(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_FALSE(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_FALSE(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_FALSE(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_FALSE(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_FALSE(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_FALSE(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_FALSE(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_FALSE(name,p,post)\ - NDK_HTTP_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_FALSE(name,p,post)\ - NDK_HTTP_UPS_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_FALSE(name,p,post)\ - NDK_HTTP_ANY_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_FALSE(name,p,post)\ - NDK_ANY_CONF_NOARGS\ - (name,\ - ndk_conf_set_false_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_FULL_PATH(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_FULL_PATH(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_full_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_KEYVAL1(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_KEYVAL1(name,p,post)\ - NDK_ANY_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval1_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_KEYVAL(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_KEYVAL(name,p,post)\ - NDK_ANY_CONF_TAKE2\ - (name,\ - ndk_conf_set_keyval_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_MSEC(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_MSEC(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_MSEC(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_MSEC(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_MSEC(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_MSEC(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_MSEC(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_MSEC(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_MSEC(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_MSEC(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_MSEC(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_MSEC(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_MSEC(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_MSEC(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_MSEC(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_MSEC(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_MSEC(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_MSEC(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_MSEC(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_MSEC(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_MSEC(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_msec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_NULL(name,p,post)\ - NDK_HTTP_MAIN_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_NULL(name,p,post)\ - NDK_HTTP_SRV_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_NULL(name,p,post)\ - NDK_HTTP_SIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_NULL(name,p,post)\ - NDK_HTTP_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_NULL(name,p,post)\ - NDK_HTTP_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_NULL(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_NULL(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_NULL(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_NULL(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_NULL(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_NULL(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_NULL(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_NULL(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_NULL(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_NULL(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_NULL(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_NULL(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_NULL(name,p,post)\ - NDK_HTTP_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_NULL(name,p,post)\ - NDK_HTTP_UPS_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_NULL(name,p,post)\ - NDK_HTTP_ANY_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_NULL(name,p,post)\ - NDK_ANY_CONF_NOARGS\ - (name,\ - ndk_conf_set_null_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_NUM64(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_NUM64(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_NUM64(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_NUM64(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_NUM64(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_NUM64(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_NUM64(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_NUM64(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_NUM64(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_NUM64(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_NUM64(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_NUM64(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_NUM64(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_NUM64(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_NUM64(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_NUM64(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_NUM64(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_NUM64(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_NUM64(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_NUM64(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_NUM64(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_num64_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_NUM_FLAG(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_NUM_FLAG(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_NUM(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_NUM(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_NUM(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_NUM(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_NUM(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_NUM(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_NUM(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_NUM(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_NUM(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_NUM(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_NUM(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_NUM(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_NUM(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_NUM(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_NUM(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_NUM(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_NUM(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_NUM(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_NUM(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_NUM(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_NUM(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_num_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_OFF(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_OFF(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_OFF(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_OFF(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_OFF(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_OFF(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_OFF(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_OFF(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_OFF(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_OFF(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_OFF(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_OFF(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_OFF(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_OFF(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_OFF(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_OFF(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_OFF(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_OFF(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_OFF(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_OFF(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_OFF(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_off_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_ONOFF(name,p,post)\ - NDK_HTTP_MAIN_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_ONOFF(name,p,post)\ - NDK_HTTP_SRV_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_ONOFF(name,p,post)\ - NDK_HTTP_SIF_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_ONOFF(name,p,post)\ - NDK_HTTP_LOC_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_ONOFF(name,p,post)\ - NDK_HTTP_LIF_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_ONOFF(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_ONOFF(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_ONOFF(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_ONOFF(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_ONOFF(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_ONOFF(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_ONOFF(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_ONOFF(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_ONOFF(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_ONOFF(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_ONOFF(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_ONOFF(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_ONOFF(name,p,post)\ - NDK_HTTP_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_ONOFF(name,p,post)\ - NDK_HTTP_UPS_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_ONOFF(name,p,post)\ - NDK_HTTP_ANY_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_ONOFF(name,p,post)\ - NDK_ANY_CONF_FLAG\ - (name,\ - ndk_conf_set_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_PATH(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_PATH(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_PATH(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_PATH(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_PATH(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_PATH(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_PATH(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_PATH(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_PATH(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_PATH(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_PATH(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_PATH(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_PATH(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_PATH(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_PATH(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_PATH(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_PATH(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_PATH(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_PATH(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_PATH(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_PATH(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_split_path_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_PTR(name,p,post)\ - NDK_HTTP_MAIN_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_PTR(name,p,post)\ - NDK_HTTP_SRV_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_PTR(name,p,post)\ - NDK_HTTP_SIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_PTR(name,p,post)\ - NDK_HTTP_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_PTR(name,p,post)\ - NDK_HTTP_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_PTR(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_PTR(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_PTR(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_PTR(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_PTR(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_PTR(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_PTR(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_PTR(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_PTR(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_PTR(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_PTR(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_PTR(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_PTR(name,p,post)\ - NDK_HTTP_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_PTR(name,p,post)\ - NDK_HTTP_UPS_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_PTR(name,p,post)\ - NDK_HTTP_ANY_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_PTR(name,p,post)\ - NDK_ANY_CONF_NOARGS\ - (name,\ - ndk_conf_set_ptr_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_SRV_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_SIF_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_UPS_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_REGEX_ARRAY(name,p,post)\ - NDK_HTTP_ANY_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_REGEX_ARRAY(name,p,post)\ - NDK_ANY_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_MAIN_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_SRV_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_SIF_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_UPS_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_HTTP_ANY_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_REGEX_ARRAY_CL(name,p,post)\ - NDK_ANY_CONF_1MORE\ - (name,\ - ndk_conf_set_regex_array_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_REGEX_CL(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_REGEX_CL(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_caseless_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_REXEX(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_REXEX(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_REXEX(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_REXEX(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_REXEX(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_REXEX(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_REXEX(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_REXEX(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_REXEX(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_REXEX(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_REXEX(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_REXEX(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_REXEX(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_REXEX(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_REXEX(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_REXEX(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_REXEX(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_REXEX(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_REXEX(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_REXEX(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_REXEX(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_regex_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_SEC_FLAG(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_SEC_FLAG(name,p,post)\ - NDK_ANY_CONF_TAKE2\ - (name,\ - ndk_conf_set_sec_flag_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_SEC(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_SEC(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_SEC(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_SEC(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_SEC(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_SEC(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_SEC(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_SEC(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_SEC(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_SEC(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_SEC(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_SEC(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_SEC(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_SEC(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_SEC(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_SEC(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_SEC(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_SEC(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_SEC(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_SEC(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_SEC(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_sec_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_SIZE(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_SIZE(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_SIZE(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_SIZE(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_SIZE(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_SIZE(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_SIZE(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_SIZE(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_SIZE(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_SIZE(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_SIZE(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_SIZE(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_SIZE(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_SIZE(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_SIZE(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_SIZE(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_SIZE(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_SIZE(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_SIZE(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_SIZE(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_SIZE(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_size_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_SRV_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_SIF_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_UPS_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_STR_ARRAY(name,p,post)\ - NDK_HTTP_ANY_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_STR_ARRAY(name,p,post)\ - NDK_ANY_CONF_1MORE\ - (name,\ - ndk_conf_set_str_array_multi_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_STR_ARRAY1(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_STR_ARRAY1(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_array_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_STR(name,p,post)\ - NDK_HTTP_MAIN_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_STR(name,p,post)\ - NDK_HTTP_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_STR(name,p,post)\ - NDK_HTTP_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_STR(name,p,post)\ - NDK_HTTP_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_STR(name,p,post)\ - NDK_HTTP_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_STR(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_STR(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_STR(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_STR(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_STR(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_STR(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_STR(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_STR(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_STR(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_STR(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_STR(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_STR(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_STR(name,p,post)\ - NDK_HTTP_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_STR(name,p,post)\ - NDK_HTTP_UPS_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_STR(name,p,post)\ - NDK_HTTP_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_STR(name,p,post)\ - NDK_ANY_CONF_TAKE1\ - (name,\ - ndk_conf_set_str_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - -#define NDK_HTTP_MAIN_CONF_TRUE(name,p,post)\ - NDK_HTTP_MAIN_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_MAIN_CONF_OFFSET,\ - offsetof (ndk_module_main_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_CONF_TRUE(name,p,post)\ - NDK_HTTP_SRV_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_CONF_TRUE(name,p,post)\ - NDK_HTTP_SIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_LOC_CONF_TRUE(name,p,post)\ - NDK_HTTP_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_LIF_CONF_TRUE(name,p,post)\ - NDK_HTTP_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_CONF_TRUE(name,p,post)\ - NDK_HTTP_MAIN_SRV_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_CONF_TRUE(name,p,post)\ - NDK_HTTP_MAIN_SIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_SRV_CONF_OFFSET,\ - offsetof (ndk_module_srv_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LOC_CONF_TRUE(name,p,post)\ - NDK_HTTP_MAIN_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_LIF_CONF_TRUE(name,p,post)\ - NDK_HTTP_MAIN_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LOC_CONF_TRUE(name,p,post)\ - NDK_HTTP_SRV_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SRV_LIF_CONF_TRUE(name,p,post)\ - NDK_HTTP_SRV_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LOC_CONF_TRUE(name,p,post)\ - NDK_HTTP_SIF_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_SIF_LIF_CONF_TRUE(name,p,post)\ - NDK_HTTP_SIF_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LOC_CONF_TRUE(name,p,post)\ - NDK_HTTP_MAIN_SRV_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_LIF_CONF_TRUE(name,p,post)\ - NDK_HTTP_MAIN_SRV_LIF_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SIF_LOC_CONF_TRUE(name,p,post)\ - NDK_HTTP_MAIN_SIF_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_TRUE(name,p,post)\ - NDK_HTTP_MAIN_SRV_SIF_LOC_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_CONF_TRUE(name,p,post)\ - NDK_HTTP_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_UPS_CONF_TRUE(name,p,post)\ - NDK_HTTP_UPS_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_HTTP_ANY_CONF_TRUE(name,p,post)\ - NDK_HTTP_ANY_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - -#define NDK_ANY_CONF_TRUE(name,p,post)\ - NDK_ANY_CONF_NOARGS\ - (name,\ - ndk_conf_set_true_slot,\ - NGX_HTTP_LOC_CONF_OFFSET,\ - offsetof (ndk_module_loc_conf_t, p),\ - post) - - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_conf_merge.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_conf_merge.h deleted file mode 100644 index 4f7855f..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_conf_merge.h +++ /dev/null @@ -1,227 +0,0 @@ - -/* - * 2010 (C) Marcus Clyne - * - * DO NOT EDIT THIS FILE MANUALLY - * ------------------------------ - * This file has been generated automatically from scripts in the $base/auto dir and - * data in the $base/auto/data dir. If you wish to edit the output of this file, then - * you should edit these files instead. - * -*/ - - -/* conf-merge-value macros */ - -/* TODO : check that all the main types have a corresponding merge function */ - -#define ndk_conf_merge_value ngx_conf_merge_value -#define ndk_conf_merge_off_value ngx_conf_merge_off_value -#define ndk_conf_merge_ptr_value ngx_conf_merge_ptr_value -#define ndk_conf_merge_str_value ngx_conf_merge_str_value -#define ndk_conf_merge_size_value ngx_conf_merge_size_value - - -#define ndk_conf_merge_keyval_value(conf,prev,default) \ - \ - conf = prev ? prev : default; - -#define ndk_conf_merge_str_array_value(conf,prev,val1,...) \ - \ - if (conf == NGX_CONF_UNSET_PTR) { \ - if (prev == NGX_CONF_UNSET_PTR) { \ - if (val1 == NULL) { \ - conf = NULL; \ - } else { \ - char * elts[] = {val1,##__VA_ARGS__}; \ - int n = sizeof(elts)/sizeof(char*); \ - \ - conf = ndk_str_array_create (cf->pool, elts, n); \ - \ - if (conf == NULL) \ - return NGX_CONF_ERROR; \ - } \ - } else { \ - conf = prev; \ - } \ - } - -#define ndk_conf_merge_http_complex_value_value(conf,prev,default) \ - \ - if (!conf.str.len) { \ - if (prev.str.len) { \ - conf = prev; \ - } else { \ - conf.str.data = (u_char *) default; \ - conf.str.len = sizeof (default) - 1; \ - \ - if (ndk_http_complex_value_compile (cf, &conf)) \ - return NGX_CONF_ERROR; \ - } \ - } - -#define ndk_conf_merge_http_complex_value_array_value(conf,prev,val1,...) \ - \ - if (conf == NGX_CONF_UNSET_PTR) { \ - if (prev == NGX_CONF_UNSET_PTR) { \ - if (val1 == NULL) \ - conf = NULL; \ - else { \ - char * elts[] = {val1,##__VA_ARGS__}; \ - int n = sizeof(elts)/sizeof(char*); \ - \ - conf = ndk_http_complex_value_array_create (cf, elts, n); \ - \ - if (conf == NULL) \ - return NGX_CONF_ERROR; \ - } \ - } else { \ - conf = prev; \ - } \ - } - -#define ndk_conf_merge_http_complex_path_value(conf,prev,...) \ - ndk_conf_merge_http_complex_value_array_value (conf.a, prev.a, __VA_ARGS__) - -#define ndk_conf_merge_split_path_value(conf,prev,path) \ - \ - if (conf == NGX_CONF_UNSET_PTR) { \ - conf = (prev == NGX_CONF_UNSET_PTR ? \ - ndk_split_path_create_raw (cf, path) : prev); \ - } - - -/* conf-merge-prop macros */ - -#define ndk_conf_merge_prop(prop,default)\ - ndk_conf_merge_value\ - (conf->prop, prev->prop, default) - -#define ndk_conf_merge_bitmask_prop(prop,default,...)\ - ndk_conf_merge_bitmask_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_bufs_prop(prop,default,...)\ - ndk_conf_merge_bufs_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_encoding_prop(prop,default,...)\ - ndk_conf_merge_encoding_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_enum_prop(prop,default,...)\ - ndk_conf_merge_enum_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_false_prop(prop,default,...)\ - ndk_conf_merge_false_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_flag_prop(prop,default,...)\ - ndk_conf_merge_flag_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_full_path_prop(prop,default,...)\ - ndk_conf_merge_full_path_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_http_complex_keyval_prop(prop,default,...)\ - ndk_conf_merge_http_complex_keyval_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_http_complex_path_prop(prop,default,...)\ - ndk_conf_merge_http_complex_path_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_http_complex_value_prop(prop,default,...)\ - ndk_conf_merge_http_complex_value_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_http_complex_value_array_prop(prop,default,...)\ - ndk_conf_merge_http_complex_value_array_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_keyval_prop(prop,default,...)\ - ndk_conf_merge_keyval_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_keyval1_prop(prop,default,...)\ - ndk_conf_merge_keyval1_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_msec_prop(prop,default,...)\ - ndk_conf_merge_msec_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_null_prop(prop,default,...)\ - ndk_conf_merge_null_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_num_prop(prop,default,...)\ - ndk_conf_merge_num_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_num64_prop(prop,default,...)\ - ndk_conf_merge_num64_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_num_flag_prop(prop,default,...)\ - ndk_conf_merge_num_flag_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_off_prop(prop,default,...)\ - ndk_conf_merge_off_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_ptr_prop(prop,default,...)\ - ndk_conf_merge_ptr_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_regex_prop(prop,default,...)\ - ndk_conf_merge_regex_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_regex_array_prop(prop,default,...)\ - ndk_conf_merge_regex_array_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_regex_array_caseless_prop(prop,default,...)\ - ndk_conf_merge_regex_array_caseless_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_regex_caseless_prop(prop,default,...)\ - ndk_conf_merge_regex_caseless_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_sec_prop(prop,default,...)\ - ndk_conf_merge_sec_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_sec_flag_prop(prop,default,...)\ - ndk_conf_merge_sec_flag_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_size_prop(prop,default,...)\ - ndk_conf_merge_size_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_split_path_prop(prop,default,...)\ - ndk_conf_merge_split_path_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_str_prop(prop,default,...)\ - ndk_conf_merge_str_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_str_array_prop(prop,default,...)\ - ndk_conf_merge_str_array_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_str_array_multi_prop(prop,default,...)\ - ndk_conf_merge_str_array_multi_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - -#define ndk_conf_merge_true_prop(prop,default,...)\ - ndk_conf_merge_true_value\ - (conf->prop, prev->prop, default,##__VA_ARGS__) - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_config.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_config.c deleted file mode 100644 index d2e572f..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_config.c +++ /dev/null @@ -1,72 +0,0 @@ - -/* - * 2010 (C) Marcus Clyne - * - * DO NOT EDIT THIS FILE MANUALLY - * ------------------------------ - * This file has been generated automatically from scripts in the $base/auto dir and - * data in the $base/auto/data dir. If you wish to edit the output of this file, then - * you should edit these files instead. - * -*/ - - -/* optional includes */ - -#if (NDK_BUF) -#include -#endif -#if (NDK_COMPLEX_PATH) -#include -#endif -#if (NDK_COMPLEX_VALUE) -#include -#endif -#if (NDK_CONF_FILE) -#include -#endif -#if (NDK_ENCODING) -#include -#endif -#if (NDK_HASH) -#include -#endif -#if (NDK_HTTP) -#include -#endif -#if (NDK_PATH) -#include -#endif -#if (NDK_PROCESS) -#include -#endif -#if (NDK_REGEX) -#include -#endif -#if (NDK_REWRITE) -#include -#endif -#if (NDK_SET_VAR) -#include -#endif -#if (NDK_STRING) -#include -#endif -#if (NDK_UPSTREAM_LIST) -#include -#endif -#if (NDK_URI) -#include -#endif - - -/* module commands */ - -static ngx_command_t ndk_http_commands[] = { -#if (NDK_UPSTREAM_LIST) -#define NDK_UPSTREAM_LIST_CMDS 1 -#include -#undef NDK_UPSTREAM_LIST_CMDS -#endif - ngx_null_command -}; diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_config.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_config.h deleted file mode 100644 index 7223950..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_config.h +++ /dev/null @@ -1,98 +0,0 @@ - -/* - * 2010 (C) Marcus Clyne - * - * DO NOT EDIT THIS FILE MANUALLY - * ------------------------------ - * This file has been generated automatically from scripts in the $base/auto dir and - * data in the $base/auto/data dir. If you wish to edit the output of this file, then - * you should edit these files instead. - * -*/ - - -/* include all optional modules */ - -#ifdef NDK_ALL - -#ifndef NDK_BUF -#define NDK_BUF 1 -#endif -#ifndef NDK_COMPLEX_PATH -#define NDK_COMPLEX_PATH 1 -#endif -#ifndef NDK_COMPLEX_VALUE -#define NDK_COMPLEX_VALUE 1 -#endif -#ifndef NDK_CONF_FILE -#define NDK_CONF_FILE 1 -#endif -#ifndef NDK_ENCODING -#define NDK_ENCODING 1 -#endif -#ifndef NDK_HASH -#define NDK_HASH 1 -#endif -#ifndef NDK_HTTP -#define NDK_HTTP 1 -#endif -#ifndef NDK_PATH -#define NDK_PATH 1 -#endif -#ifndef NDK_PROCESS -#define NDK_PROCESS 1 -#endif -#ifndef NDK_REGEX -#define NDK_REGEX 1 -#endif -#ifndef NDK_REWRITE -#define NDK_REWRITE 1 -#endif -#ifndef NDK_SET_VAR -#define NDK_SET_VAR 1 -#endif -#ifndef NDK_STRING -#define NDK_STRING 1 -#endif -#ifndef NDK_UPSTREAM_LIST -#define NDK_UPSTREAM_LIST 1 -#endif -#ifndef NDK_URI -#define NDK_URI 1 -#endif - -#endif - - -/* module dependencies */ - -#ifdef NDK_COMPLEX_PATH -#ifndef NDK_COMPLEX_VALUE -#define NDK_COMPLEX_VALUE 1 -#endif -#ifndef NDK_PATH -#define NDK_PATH 1 -#endif -#endif -#ifdef NDK_CONF_FILE -#ifndef NDK_STRING -#define NDK_STRING 1 -#endif -#endif -#ifdef NDK_HASH -#ifndef NDK_STRING -#define NDK_STRING 1 -#endif -#endif -#ifdef NDK_SET_VAR -#ifndef NDK_REWRITE -#define NDK_REWRITE 1 -#endif -#endif -#ifdef NDK_UPSTREAM_LIST -#ifndef NDK_HTTP_CREATE_MAIN_CONF -#define NDK_HTTP_CREATE_MAIN_CONF 1 -#endif -#endif - - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_includes.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_includes.h deleted file mode 100644 index cbbf60a..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_includes.h +++ /dev/null @@ -1,66 +0,0 @@ -/* optional includes */ - -#if (NDK_BUF) -#include -#endif -#if (NDK_COMPLEX_PATH) -#include -#endif -#if (NDK_COMPLEX_VALUE) -#include -#endif -#if (NDK_CONF_FILE) -#include -#endif -#if (NDK_ENCODING) -#include -#endif -#if (NDK_HASH) -#include -#endif -#if (NDK_HTTP) -#include -#endif -#if (NDK_PATH) -#include -#endif -#if (NDK_PROCESS) -#include -#endif -#if (NDK_REGEX) -#include -#endif -#if (NDK_REWRITE) -#include -#endif -#if (NDK_SET_VAR) -#include -#endif -#if (NDK_STRING) -#include -#endif -#if (NDK_UPSTREAM_LIST) -#include -#endif -#if (NDK_URI) -#include -#endif - - -/* non-optional includes */ - -#include -#include -#include -#include - - -/* auto-generated headers */ - -#include -#include -#include -#include -#include - - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_palloc.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_palloc.h deleted file mode 100644 index db8aaf1..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/objs/ndk_palloc.h +++ /dev/null @@ -1,112 +0,0 @@ - -/* - * 2010 (C) Marcus Clyne - * - * DO NOT EDIT THIS FILE MANUALLY - * ------------------------------ - * This file has been generated automatically from scripts in the $base/auto dir and - * data in the $base/auto/data dir. If you wish to edit the output of this file, then - * you should edit these files instead. - * -*/ - - -/* Non-generated macros */ - -#define ndk_pallocp(p,pl) p = ngx_palloc (pl,sizeof(*p)) -#define ndk_pallocpn(p,pl,n) p = ngx_palloc (pl,sizeof(*p)*(n)) - -#define ndk_pcallocp(p,pl) p = ngx_pcalloc (pl,sizeof(*p)) -#define ndk_pcallocpn(p,pl,n) p = ngx_pcalloc (pl,sizeof(*p)*(n)) - - -/* base action macro macros */ - -#define ndk_palloc_ac(p,pl,sz,ac) {p = ngx_palloc (pl,sz); if (p == NULL) ac;} -#define ndk_pallocp_ac(p,pl,ac) {ndk_pallocp (p,pl); if (p == NULL) ac;} -#define ndk_pallocpn_ac(p,pl,n,ac) {ndk_pallocpn (p,pl,n); if (p == NULL) ac;} -#define ndk_pcalloc_ac(p,pl,sz,ac) {p = ngx_pcalloc (pl,sz); if (p == NULL) ac;} -#define ndk_pcallocp_ac(p,pl,ac) {ndk_pcallocp (p,pl); if (p == NULL) ac;} -#define ndk_pcallocpn_ac(p,pl,n,ac) {ndk_pcallocpn (p,pl,n); if (p == NULL) ac;} - - -/* generated action macros */ - -#define ndk_palloc_r0(p,pl,sz) ndk_palloc_ac (p,pl,sz,return 0) -#define ndk_palloc_r1(p,pl,sz) ndk_palloc_ac (p,pl,sz,return 1) -#define ndk_palloc_r_1(p,pl,sz) ndk_palloc_ac (p,pl,sz,return -1) -#define ndk_palloc_rok(p,pl,sz) ndk_palloc_ac (p,pl,sz,return NGX_OK) -#define ndk_palloc_rce(p,pl,sz) ndk_palloc_ac (p,pl,sz,return NGX_CONF_ERROR) -#define ndk_palloc_rcok(p,pl,sz) ndk_palloc_ac (p,pl,sz,return NGX_CONF_OK) -#define ndk_palloc_re(p,pl,sz) ndk_palloc_ac (p,pl,sz,return NGX_ERROR) -#define ndk_palloc_rn(p,pl,sz) ndk_palloc_ac (p,pl,sz,return NULL) -#define ndk_palloc_rse(p,pl,sz) ndk_palloc_ac (p,pl,sz,{ngx_script_error (e); return;}) -#define ndk_palloc_sce(p,pl,sz) ndk_palloc_ac (p,pl,sz,{ngx_script_configure_error (c); return;}) -#define ndk_palloc_g(p,pl,sz,_lb) ndk_palloc_ac (p,pl,sz,goto _lb) -#define ndk_palloc_ge(p,pl,sz) ndk_palloc_ac (p,pl,sz,goto error) - -#define ndk_pallocp_r0(p,pl) ndk_pallocp_ac (p,pl,return 0) -#define ndk_pallocp_r1(p,pl) ndk_pallocp_ac (p,pl,return 1) -#define ndk_pallocp_r_1(p,pl) ndk_pallocp_ac (p,pl,return -1) -#define ndk_pallocp_rok(p,pl) ndk_pallocp_ac (p,pl,return NGX_OK) -#define ndk_pallocp_rce(p,pl) ndk_pallocp_ac (p,pl,return NGX_CONF_ERROR) -#define ndk_pallocp_rcok(p,pl) ndk_pallocp_ac (p,pl,return NGX_CONF_OK) -#define ndk_pallocp_re(p,pl) ndk_pallocp_ac (p,pl,return NGX_ERROR) -#define ndk_pallocp_rn(p,pl) ndk_pallocp_ac (p,pl,return NULL) -#define ndk_pallocp_rse(p,pl) ndk_pallocp_ac (p,pl,{ngx_script_error (e); return;}) -#define ndk_pallocp_sce(p,pl) ndk_pallocp_ac (p,pl,{ngx_script_configure_error (c); return;}) -#define ndk_pallocp_g(p,pl,_lb) ndk_pallocp_ac (p,pl,goto _lb) -#define ndk_pallocp_ge(p,pl) ndk_pallocp_ac (p,pl,goto error) - -#define ndk_pallocpn_r0(p,pl,n) ndk_pallocpn_ac (p,pl,n,return 0) -#define ndk_pallocpn_r1(p,pl,n) ndk_pallocpn_ac (p,pl,n,return 1) -#define ndk_pallocpn_r_1(p,pl,n) ndk_pallocpn_ac (p,pl,n,return -1) -#define ndk_pallocpn_rok(p,pl,n) ndk_pallocpn_ac (p,pl,n,return NGX_OK) -#define ndk_pallocpn_rce(p,pl,n) ndk_pallocpn_ac (p,pl,n,return NGX_CONF_ERROR) -#define ndk_pallocpn_rcok(p,pl,n) ndk_pallocpn_ac (p,pl,n,return NGX_CONF_OK) -#define ndk_pallocpn_re(p,pl,n) ndk_pallocpn_ac (p,pl,n,return NGX_ERROR) -#define ndk_pallocpn_rn(p,pl,n) ndk_pallocpn_ac (p,pl,n,return NULL) -#define ndk_pallocpn_rse(p,pl,n) ndk_pallocpn_ac (p,pl,n,{ngx_script_error (e); return;}) -#define ndk_pallocpn_sce(p,pl,n) ndk_pallocpn_ac (p,pl,n,{ngx_script_configure_error (c); return;}) -#define ndk_pallocpn_g(p,pl,n,_lb) ndk_pallocpn_ac (p,pl,n,goto _lb) -#define ndk_pallocpn_ge(p,pl,n) ndk_pallocpn_ac (p,pl,n,goto error) - -#define ndk_pcalloc_r0(p,pl,sz) ndk_pcalloc_ac (p,pl,sz,return 0) -#define ndk_pcalloc_r1(p,pl,sz) ndk_pcalloc_ac (p,pl,sz,return 1) -#define ndk_pcalloc_r_1(p,pl,sz) ndk_pcalloc_ac (p,pl,sz,return -1) -#define ndk_pcalloc_rok(p,pl,sz) ndk_pcalloc_ac (p,pl,sz,return NGX_OK) -#define ndk_pcalloc_rce(p,pl,sz) ndk_pcalloc_ac (p,pl,sz,return NGX_CONF_ERROR) -#define ndk_pcalloc_rcok(p,pl,sz) ndk_pcalloc_ac (p,pl,sz,return NGX_CONF_OK) -#define ndk_pcalloc_re(p,pl,sz) ndk_pcalloc_ac (p,pl,sz,return NGX_ERROR) -#define ndk_pcalloc_rn(p,pl,sz) ndk_pcalloc_ac (p,pl,sz,return NULL) -#define ndk_pcalloc_rse(p,pl,sz) ndk_pcalloc_ac (p,pl,sz,{ngx_script_error (e); return;}) -#define ndk_pcalloc_sce(p,pl,sz) ndk_pcalloc_ac (p,pl,sz,{ngx_script_configure_error (c); return;}) -#define ndk_pcalloc_g(p,pl,sz,_lb) ndk_pcalloc_ac (p,pl,sz,goto _lb) -#define ndk_pcalloc_ge(p,pl,sz) ndk_pcalloc_ac (p,pl,sz,goto error) - -#define ndk_pcallocp_r0(p,pl) ndk_pcallocp_ac (p,pl,return 0) -#define ndk_pcallocp_r1(p,pl) ndk_pcallocp_ac (p,pl,return 1) -#define ndk_pcallocp_r_1(p,pl) ndk_pcallocp_ac (p,pl,return -1) -#define ndk_pcallocp_rok(p,pl) ndk_pcallocp_ac (p,pl,return NGX_OK) -#define ndk_pcallocp_rce(p,pl) ndk_pcallocp_ac (p,pl,return NGX_CONF_ERROR) -#define ndk_pcallocp_rcok(p,pl) ndk_pcallocp_ac (p,pl,return NGX_CONF_OK) -#define ndk_pcallocp_re(p,pl) ndk_pcallocp_ac (p,pl,return NGX_ERROR) -#define ndk_pcallocp_rn(p,pl) ndk_pcallocp_ac (p,pl,return NULL) -#define ndk_pcallocp_rse(p,pl) ndk_pcallocp_ac (p,pl,{ngx_script_error (e); return;}) -#define ndk_pcallocp_sce(p,pl) ndk_pcallocp_ac (p,pl,{ngx_script_configure_error (c); return;}) -#define ndk_pcallocp_g(p,pl,_lb) ndk_pcallocp_ac (p,pl,goto _lb) -#define ndk_pcallocp_ge(p,pl) ndk_pcallocp_ac (p,pl,goto error) - -#define ndk_pcallocpn_r0(p,pl,n) ndk_pcallocpn_ac (p,pl,n,return 0) -#define ndk_pcallocpn_r1(p,pl,n) ndk_pcallocpn_ac (p,pl,n,return 1) -#define ndk_pcallocpn_r_1(p,pl,n) ndk_pcallocpn_ac (p,pl,n,return -1) -#define ndk_pcallocpn_rok(p,pl,n) ndk_pcallocpn_ac (p,pl,n,return NGX_OK) -#define ndk_pcallocpn_rce(p,pl,n) ndk_pcallocpn_ac (p,pl,n,return NGX_CONF_ERROR) -#define ndk_pcallocpn_rcok(p,pl,n) ndk_pcallocpn_ac (p,pl,n,return NGX_CONF_OK) -#define ndk_pcallocpn_re(p,pl,n) ndk_pcallocpn_ac (p,pl,n,return NGX_ERROR) -#define ndk_pcallocpn_rn(p,pl,n) ndk_pcallocpn_ac (p,pl,n,return NULL) -#define ndk_pcallocpn_rse(p,pl,n) ndk_pcallocpn_ac (p,pl,n,{ngx_script_error (e); return;}) -#define ndk_pcallocpn_sce(p,pl,n) ndk_pcallocpn_ac (p,pl,n,{ngx_script_configure_error (c); return;}) -#define ndk_pcallocpn_g(p,pl,n,_lb) ndk_pcallocpn_ac (p,pl,n,goto _lb) -#define ndk_pcallocpn_ge(p,pl,n) ndk_pcallocpn_ac (p,pl,n,goto error) - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/patches/auto_config b/modules_deb/libnginx-mod-http-ndk-0.3.4/patches/auto_config deleted file mode 100644 index ba4fdd4..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/patches/auto_config +++ /dev/null @@ -1,16 +0,0 @@ -diff -pNr a/src/core/ngx_config.h b/src/core/ngx_config.h -*** a/src/core/ngx_config.h 2008-09-19 13:47:13.000000000 +0100 ---- b/src/core/ngx_config.h 2010-10-09 17:14:13.000000000 +0100 -*************** typedef intptr_t ngx_flag_t; -*** 127,131 **** - #define NGX_MAX_UINT32_VALUE (uint32_t) 0xffffffff - #endif - -! - #endif /* _NGX_CONFIG_H_INCLUDED_ */ ---- 127,131 ---- - #define NGX_MAX_UINT32_VALUE (uint32_t) 0xffffffff - #endif - -! #include - #endif /* _NGX_CONFIG_H_INCLUDED_ */ diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/patches/expose_rewrite_functions b/modules_deb/libnginx-mod-http-ndk-0.3.4/patches/expose_rewrite_functions deleted file mode 100644 index ec1d6d8..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/patches/expose_rewrite_functions +++ /dev/null @@ -1,291 +0,0 @@ -diff -rNp a/src/http/modules/ngx_http_rewrite_module.c b/src/http/modules/ngx_http_rewrite_module.c -*** a/src/http/modules/ngx_http_rewrite_module.c 2010-06-18 16:15:20.000000000 +0100 ---- b/src/http/modules/ngx_http_rewrite_module.c 2010-10-09 14:47:10.000000000 +0100 -*************** -*** 8,14 **** - #include - #include - -! - typedef struct { - ngx_array_t *codes; /* uintptr_t */ - ---- 8,14 ---- - #include - #include - -! #if !(NDK_EXPOSE_REWRITE_FUNCTIONS) - typedef struct { - ngx_array_t *codes; /* uintptr_t */ - -*************** typedef struct { -*** 17,23 **** - ngx_flag_t log; - ngx_flag_t uninitialized_variable_warn; - } ngx_http_rewrite_loc_conf_t; -! - - static void *ngx_http_rewrite_create_loc_conf(ngx_conf_t *cf); - static char *ngx_http_rewrite_merge_loc_conf(ngx_conf_t *cf, ---- 17,23 ---- - ngx_flag_t log; - ngx_flag_t uninitialized_variable_warn; - } ngx_http_rewrite_loc_conf_t; -! #endif - - static void *ngx_http_rewrite_create_loc_conf(ngx_conf_t *cf); - static char *ngx_http_rewrite_merge_loc_conf(ngx_conf_t *cf, -*************** static char *ngx_http_rewrite_return(ngx -*** 28,44 **** - void *conf); - static char *ngx_http_rewrite_break(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); - static char *ngx_http_rewrite_if(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); - static char * ngx_http_rewrite_if_condition(ngx_conf_t *cf, - ngx_http_rewrite_loc_conf_t *lcf); - static char *ngx_http_rewrite_variable(ngx_conf_t *cf, - ngx_http_rewrite_loc_conf_t *lcf, ngx_str_t *value); - static char *ngx_http_rewrite_set(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); - static char * ngx_http_rewrite_value(ngx_conf_t *cf, - ngx_http_rewrite_loc_conf_t *lcf, ngx_str_t *value); -! - - static ngx_command_t ngx_http_rewrite_commands[] = { - ---- 28,47 ---- - void *conf); - static char *ngx_http_rewrite_break(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); -+ #if !(NDK_EXPOSE_REWRITE_FUNCTIONS) - static char *ngx_http_rewrite_if(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); - static char * ngx_http_rewrite_if_condition(ngx_conf_t *cf, - ngx_http_rewrite_loc_conf_t *lcf); - static char *ngx_http_rewrite_variable(ngx_conf_t *cf, - ngx_http_rewrite_loc_conf_t *lcf, ngx_str_t *value); -+ #endif - static char *ngx_http_rewrite_set(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); -+ #if !(NDK_EXPOSE_REWRITE_FUNCTIONS) - static char * ngx_http_rewrite_value(ngx_conf_t *cf, - ngx_http_rewrite_loc_conf_t *lcf, ngx_str_t *value); -! #endif - - static ngx_command_t ngx_http_rewrite_commands[] = { - -*************** ngx_http_rewrite_handler(ngx_http_reques -*** 178,185 **** - return r->err_status; - } - -! -! static ngx_int_t - ngx_http_rewrite_var(ngx_http_request_t *r, ngx_http_variable_value_t *v, - uintptr_t data) - { ---- 181,190 ---- - return r->err_status; - } - -! #if !(NDK_EXPOSE_REWRITE_FUNCTIONS) -! static -! #endif -! ngx_int_t - ngx_http_rewrite_var(ngx_http_request_t *r, ngx_http_variable_value_t *v, - uintptr_t data) - { -*************** ngx_http_rewrite_break(ngx_conf_t *cf, n -*** 511,517 **** - } - - -! static char * - ngx_http_rewrite_if(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) - { - ngx_http_rewrite_loc_conf_t *lcf = conf; ---- 516,525 ---- - } - - -! #if !(NDK_EXPOSE_REWRITE_FUNCTIONS) -! static -! #endif -! char * - ngx_http_rewrite_if(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) - { - ngx_http_rewrite_loc_conf_t *lcf = conf; -*************** ngx_http_rewrite_if(ngx_conf_t *cf, ngx_ -*** 627,633 **** - } - - -! static char * - ngx_http_rewrite_if_condition(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf) - { - u_char *p; ---- 635,644 ---- - } - - -! #if !(NDK_EXPOSE_REWRITE_FUNCTIONS) -! static -! #endif -! char * - ngx_http_rewrite_if_condition(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf) - { - u_char *p; -*************** ngx_http_rewrite_if_condition(ngx_conf_t -*** 847,853 **** - } - - -! static char * - ngx_http_rewrite_variable(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf, - ngx_str_t *value) - { ---- 858,867 ---- - } - - -! #if !(NDK_EXPOSE_REWRITE_FUNCTIONS) -! static -! #endif -! char * - ngx_http_rewrite_variable(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf, - ngx_str_t *value) - { -*************** ngx_http_rewrite_set(ngx_conf_t *cf, ngx -*** 948,954 **** - } - - -! static char * - ngx_http_rewrite_value(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf, - ngx_str_t *value) - { ---- 962,971 ---- - } - - -! #if !(NDK_EXPOSE_REWRITE_FUNCTIONS) -! static -! #endif -! char * - ngx_http_rewrite_value(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf, - ngx_str_t *value) - { -diff -rNp a/src/http/modules/ngx_http_rewrite_module.h b/src/http/modules/ngx_http_rewrite_module.h -*** a/src/http/modules/ngx_http_rewrite_module.h 1970-01-01 01:00:00.000000000 +0100 ---- b/src/http/modules/ngx_http_rewrite_module.h 2010-10-09 14:38:04.000000000 +0100 -*************** -*** 0 **** ---- 1,47 ---- -+ -+ /* -+ * Copyright (C) Marcus Clyne -+ * -+ * Note : this file has been created by the Nginx Development Kit using -+ * some code from ngx_http_rewrite_module.c -+ */ -+ -+ #if (NDK_EXPOSE_REWRITE_FUNCTIONS) -+ -+ #ifndef _NGX_HTTP_REWRITE_H_INCLUDED_ -+ #define _NGX_HTTP_REWRITE_H_INCLUDED_ -+ -+ #include -+ #include -+ #include -+ -+ -+ extern ngx_module_t ngx_http_rewrite_module; -+ -+ -+ typedef struct { -+ ngx_array_t *codes; /* uintptr_t */ -+ -+ ngx_uint_t stack_size; -+ -+ ngx_flag_t log; -+ ngx_flag_t uninitialized_variable_warn; -+ } ngx_http_rewrite_loc_conf_t; -+ -+ -+ char * -+ ngx_http_rewrite_if(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -+ char * -+ ngx_http_rewrite_if_condition(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf); -+ char * -+ ngx_http_rewrite_variable(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf, -+ ngx_str_t *value); -+ char * -+ ngx_http_rewrite_value(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf, -+ ngx_str_t *value); -+ ngx_int_t -+ ngx_http_rewrite_var(ngx_http_request_t *r, ngx_http_variable_value_t *v, -+ uintptr_t data); -+ -+ #endif -+ #endif -diff -rNp a/src/http/ngx_http.h b/src/http/ngx_http.h -*** a/src/http/ngx_http.h 2010-06-15 16:13:34.000000000 +0100 ---- b/src/http/ngx_http.h 2010-10-09 14:25:56.000000000 +0100 -*************** typedef u_char *(*ngx_http_log_handler_p -*** 43,48 **** ---- 43,52 ---- - #include - #endif - -+ #if (NDK_EXPOSE_REWRITE_FUNCTIONS) -+ #include -+ #endif -+ - - struct ngx_http_log_ctx_s { - ngx_connection_t *connection; -diff -rNp a/src/http/ngx_http_script.c b/src/http/ngx_http_script.c -*** a/src/http/ngx_http_script.c 2010-09-13 13:44:43.000000000 +0100 ---- b/src/http/ngx_http_script.c 2010-10-09 14:36:10.000000000 +0100 -*************** static size_t ngx_http_script_full_name_ -*** 26,35 **** ---- 26,43 ---- - static void ngx_http_script_full_name_code(ngx_http_script_engine_t *e); - - -+ #if (NDK_EXPOSE_REWRITE_FUNCTIONS) -+ -+ uintptr_t ngx_http_script_exit_code = (uintptr_t) NULL; -+ -+ #else -+ - #define ngx_http_script_exit (u_char *) &ngx_http_script_exit_code - - static uintptr_t ngx_http_script_exit_code = (uintptr_t) NULL; - -+ #endif -+ - - void - ngx_http_script_flush_complex_value(ngx_http_request_t *r, -diff -rNp a/src/http/ngx_http_script.h b/src/http/ngx_http_script.h -*** a/src/http/ngx_http_script.h 2010-09-13 13:44:43.000000000 +0100 ---- b/src/http/ngx_http_script.h 2010-10-09 14:33:40.000000000 +0100 -*************** -*** 12,17 **** ---- 12,25 ---- - #include - #include - -+ #if (NDK_EXPOSE_REWRITE_FUNCTIONS) -+ -+ #define ngx_http_script_exit (u_char *) &ngx_http_script_exit_code -+ -+ extern uintptr_t ngx_http_script_exit_code; -+ -+ #endif -+ - - typedef struct { - u_char *ip; diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/patches/rewrite_phase_handler b/modules_deb/libnginx-mod-http-ndk-0.3.4/patches/rewrite_phase_handler deleted file mode 100644 index bd5161f..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/patches/rewrite_phase_handler +++ /dev/null @@ -1,19 +0,0 @@ -diff -p -r a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c -*** a/src/http/ngx_http_core_module.c 2010-09-27 12:48:12.000000000 +0100 ---- b/src/http/ngx_http_core_module.c 2010-10-09 13:44:09.000000000 +0100 -*************** ngx_http_core_rewrite_phase(ngx_http_req -*** 910,915 **** ---- 910,922 ---- - return NGX_AGAIN; - } - -+ #if defined(nginx_version) && nginx_version >= 8042 && (NDK_REWRITE_PHASE) -+ -+ if (rc == NGX_AGAIN || rc == NGX_DONE) { -+ return NGX_OK; -+ } -+ -+ #endif - /* rc == NGX_OK || rc == NGX_ERROR || rc == NGX_HTTP_... */ - - ngx_http_finalize_request(r, rc); diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/hash/md5.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/hash/md5.h deleted file mode 100644 index 4cbf843..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/hash/md5.h +++ /dev/null @@ -1,117 +0,0 @@ -/* crypto/md5/md5.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 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) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_MD5_H -#define HEADER_MD5_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef OPENSSL_NO_MD5 -#error MD5 is disabled. -#endif - -/* - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * ! MD5_LONG has to be at least 32 bits wide. If it's wider, then ! - * ! MD5_LONG_LOG2 has to be defined along. ! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - -#if defined(__LP32__) -#define MD5_LONG unsigned long -#elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) -#define MD5_LONG unsigned long -#define MD5_LONG_LOG2 3 -/* - * _CRAY note. I could declare short, but I have no idea what impact - * does it have on performance on none-T3E machines. I could declare - * int, but at least on C90 sizeof(int) can be chosen at compile time. - * So I've chosen long... - * - */ -#else -#define MD5_LONG unsigned int -#endif - -#define MD5_CBLOCK 64 -#define MD5_LBLOCK (MD5_CBLOCK/4) -#define MD5_DIGEST_LENGTH 16 - -typedef struct MD5state_st - { - MD5_LONG A,B,C,D; - MD5_LONG Nl,Nh; - MD5_LONG data[MD5_LBLOCK]; - unsigned int num; - } MD5_CTX; - -int MD5_Init(MD5_CTX *c); -int MD5_Update(MD5_CTX *c, const void *data, size_t len); -int MD5_Final(unsigned char *md, MD5_CTX *c); -unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md); -void MD5_Transform(MD5_CTX *c, const unsigned char *b); -#ifdef __cplusplus -} -#endif - -#endif diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/hash/murmurhash2.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/hash/murmurhash2.c deleted file mode 100644 index ac899b4..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/hash/murmurhash2.c +++ /dev/null @@ -1,77 +0,0 @@ - - -#ifndef MURMURHASH2_C -#define MURMURHASH2_C - -#define MURMURHASH2_DIGEST_LENGTH 4 - -/* - * ----------------------------------------------------------------------------- - * MurmurHash2, by Austin Appleby - - * Note - This code makes a few assumptions about how your machine behaves - - - * 1. We can read a 4-byte value from any address without crashing - * 2. sizeof(int) == 4 - - * And it has a few limitations - - - * 1. It will not work incrementally. - * 2. It will not produce the same results on little-endian and big-endian - * machines. - */ - -unsigned int MurmurHash2 ( const void * key, int len, unsigned int seed ) -{ - /* - * 'm' and 'r' are mixing constants generated offline. - * They're not really 'magic', they just happen to work well. - */ - - const unsigned int m = 0x5bd1e995; - const int r = 24; - - /* Initialize the hash to a 'random' value */ - - unsigned int h = seed ^ len; - - /* Mix 4 bytes at a time into the hash */ - - const unsigned char * data = (const unsigned char *)key; - - while(len >= 4) - { - unsigned int k = *(unsigned int *)data; - - k *= m; - k ^= k >> r; - k *= m; - - h *= m; - h ^= k; - - data += 4; - len -= 4; - } - - /* Handle the last few bytes of the input array */ - - switch(len) - { - case 3: h ^= data[2] << 16; - case 2: h ^= data[1] << 8; - case 1: h ^= data[0]; - h *= m; - }; - - /* Do a few final mixes of the hash to ensure the last few - * bytes are well-incorporated. */ - - h ^= h >> 13; - h *= m; - h ^= h >> 15; - - return h; -} - -#endif diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/hash/sha.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/hash/sha.h deleted file mode 100644 index 16cacf9..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/hash/sha.h +++ /dev/null @@ -1,200 +0,0 @@ -/* crypto/sha/sha.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 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) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_SHA_H -#define HEADER_SHA_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(OPENSSL_NO_SHA) || (defined(OPENSSL_NO_SHA0) && defined(OPENSSL_NO_SHA1)) -#error SHA is disabled. -#endif - -#if defined(OPENSSL_FIPS) -#define FIPS_SHA_SIZE_T size_t -#endif - -/* - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * ! SHA_LONG has to be at least 32 bits wide. If it's wider, then ! - * ! SHA_LONG_LOG2 has to be defined along. ! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - -#if defined(__LP32__) -#define SHA_LONG unsigned long -#elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) -#define SHA_LONG unsigned long -#define SHA_LONG_LOG2 3 -#else -#define SHA_LONG unsigned int -#endif - -#define SHA_LBLOCK 16 -#define SHA_CBLOCK (SHA_LBLOCK*4) /* SHA treats input data as a - * contiguous array of 32 bit - * wide big-endian values. */ -#define SHA_LAST_BLOCK (SHA_CBLOCK-8) -#define SHA_DIGEST_LENGTH 20 - -typedef struct SHAstate_st - { - SHA_LONG h0,h1,h2,h3,h4; - SHA_LONG Nl,Nh; - SHA_LONG data[SHA_LBLOCK]; - unsigned int num; - } SHA_CTX; - -#ifndef OPENSSL_NO_SHA0 -int SHA_Init(SHA_CTX *c); -int SHA_Update(SHA_CTX *c, const void *data, size_t len); -int SHA_Final(unsigned char *md, SHA_CTX *c); -unsigned char *SHA(const unsigned char *d, size_t n, unsigned char *md); -void SHA_Transform(SHA_CTX *c, const unsigned char *data); -#endif -#ifndef OPENSSL_NO_SHA1 -int SHA1_Init(SHA_CTX *c); -int SHA1_Update(SHA_CTX *c, const void *data, size_t len); -int SHA1_Final(unsigned char *md, SHA_CTX *c); -unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md); -void SHA1_Transform(SHA_CTX *c, const unsigned char *data); -#endif - -#define SHA256_CBLOCK (SHA_LBLOCK*4) /* SHA-256 treats input data as a - * contiguous array of 32 bit - * wide big-endian values. */ -#define SHA224_DIGEST_LENGTH 28 -#define SHA256_DIGEST_LENGTH 32 - -typedef struct SHA256state_st - { - SHA_LONG h[8]; - SHA_LONG Nl,Nh; - SHA_LONG data[SHA_LBLOCK]; - unsigned int num,md_len; - } SHA256_CTX; - -#ifndef OPENSSL_NO_SHA256 -int SHA224_Init(SHA256_CTX *c); -int SHA224_Update(SHA256_CTX *c, const void *data, size_t len); -int SHA224_Final(unsigned char *md, SHA256_CTX *c); -unsigned char *SHA224(const unsigned char *d, size_t n,unsigned char *md); -int SHA256_Init(SHA256_CTX *c); -int SHA256_Update(SHA256_CTX *c, const void *data, size_t len); -int SHA256_Final(unsigned char *md, SHA256_CTX *c); -unsigned char *SHA256(const unsigned char *d, size_t n,unsigned char *md); -void SHA256_Transform(SHA256_CTX *c, const unsigned char *data); -#endif - -#define SHA384_DIGEST_LENGTH 48 -#define SHA512_DIGEST_LENGTH 64 - -#ifndef OPENSSL_NO_SHA512 -/* - * Unlike 32-bit digest algorithms, SHA-512 *relies* on SHA_LONG64 - * being exactly 64-bit wide. See Implementation Notes in sha512.c - * for further details. - */ -#define SHA512_CBLOCK (SHA_LBLOCK*8) /* SHA-512 treats input data as a - * contiguous array of 64 bit - * wide big-endian values. */ -#if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__) -#define SHA_LONG64 unsigned __int64 -#define U64(C) C##UI64 -#elif defined(__arch64__) -#define SHA_LONG64 unsigned long -#define U64(C) C##UL -#else -#define SHA_LONG64 unsigned long long -#define U64(C) C##ULL -#endif - -typedef struct SHA512state_st - { - SHA_LONG64 h[8]; - SHA_LONG64 Nl,Nh; - union { - SHA_LONG64 d[SHA_LBLOCK]; - unsigned char p[SHA512_CBLOCK]; - } u; - unsigned int num,md_len; - } SHA512_CTX; -#endif - -#ifndef OPENSSL_NO_SHA512 -int SHA384_Init(SHA512_CTX *c); -int SHA384_Update(SHA512_CTX *c, const void *data, size_t len); -int SHA384_Final(unsigned char *md, SHA512_CTX *c); -unsigned char *SHA384(const unsigned char *d, size_t n,unsigned char *md); -int SHA512_Init(SHA512_CTX *c); -int SHA512_Update(SHA512_CTX *c, const void *data, size_t len); -int SHA512_Final(unsigned char *md, SHA512_CTX *c); -unsigned char *SHA512(const unsigned char *d, size_t n,unsigned char *md); -void SHA512_Transform(SHA512_CTX *c, const unsigned char *data); -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk.c deleted file mode 100644 index d57040a..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk.c +++ /dev/null @@ -1,155 +0,0 @@ - -/* - * 2010 (C) Marcus Clyne - */ - -#include - -#include - - -#if (NDK_HTTP_PRE_CONFIG) -static ngx_int_t ndk_http_preconfiguration (ngx_conf_t *cf); -#endif -#if (NDK_HTTP_POST_CONFIG) -static ngx_int_t ndk_http_postconfiguration (ngx_conf_t *cf); -#endif -#if (NDK_HTTP_CREATE_MAIN_CONF) -static void * ndk_http_create_main_conf (ngx_conf_t *cf); -#endif -#if (NDK_HTTP_INIT_MAIN_CONF) -static char * ndk_http_init_main_conf (ngx_conf_t *cf, void *conf); -#endif -#if (NDK_HTTP_CREATE_SRV_CONF) -static void * ndk_http_create_srv_conf (ngx_conf_t *cf); -#endif -#if (NDK_HTTP_MERGE_SRV_CONF) -static char * ndk_http_merge_srv_conf (ngx_conf_t *cf, void *parent, void *child); -#endif -#if (NDK_HTTP_CREATE_LOC_CONF) -static void * ndk_http_create_loc_conf (ngx_conf_t *cf); -#endif -#if (NDK_HTTP_MERGE_LOC_CONF) -static char * ndk_http_merge_loc_conf (ngx_conf_t *cf, void *parent, void *child); -#endif - - -#if (NDK_HTTP_INIT_MASTER) -static ngx_int_t ndk_http_init_master (ngx_log_t *log); -#endif -#if (NDK_HTTP_INIT_MODULE) -static ngx_int_t ndk_http_init_module (ngx_cycle_t *cycle); -#endif -#if (NDK_HTTP_INIT_PROCESS) -static ngx_int_t ndk_http_init_process (ngx_cycle_t *cycle); -#endif -#if (NDK_HTTP_EXIT_PROCESS) -static void ndk_http_exit_process (ngx_cycle_t *cycle); -#endif -#if (NDK_HTTP_EXIT_MASTER) -static void ndk_http_exit_master (ngx_cycle_t *cycle); -#endif - - -ngx_http_module_t ndk_http_module_ctx = { - -#if (NDK_HTTP_PRE_CONFIG) - ndk_http_preconfiguration, -#else - NULL, -#endif -#if (NDK_HTTP_POST_CONFIG) - ndk_http_postconfiguration, -#else - NULL, -#endif - -#if (NDK_HTTP_CREATE_MAIN_CONF) - ndk_http_create_main_conf, -#else - NULL, -#endif -#if (NDK_HTTP_INIT_MAIN_CONF) - ndk_http_merge_main_conf, -#else - NULL, -#endif - -#if (NDK_HTTP_CREATE_SVR_CONF) - ndk_http_create_srv_conf, -#else - NULL, -#endif -#if (NDK_HTTP_MERGE_SVR_CONF) - ndk_http_merge_srv_conf, -#else - NULL, -#endif - -#if (NDK_HTTP_CREATE_LOC_CONF) - ndk_http_create_loc_conf, -#else - NULL, -#endif -#if (NDK_HTTP_MERGE_LOC_CONF) - ndk_http_merge_loc_conf, -#else - NULL, -#endif - -}; - -ngx_module_t ndk_http_module = { - - NGX_MODULE_V1, - &ndk_http_module_ctx, /* module context */ - ndk_http_commands, /* module directives */ - NGX_HTTP_MODULE, /* module type */ - -#if (NDK_HTTP_INIT_MASTER) - ndk_http_init_master, -#else - NULL, -#endif - -#if (NDK_HTTP_INIT_MODULE) - ndk_http_init_module, -#else - NULL, -#endif -#if (NDK_HTTP_INIT_PROCESS) - ndk_http_init_process, -#else - NULL, -#endif - - NULL, /* init thread */ - NULL, /* exit thread */ - -#if (NDK_HTTP_EXIT_PROCESS) - ndk_http_exit_process, -#else - NULL, -#endif -#if (NDK_HTTP_EXIT_MASTER) - ndk_http_exit_master, -#else - NULL, -#endif - NGX_MODULE_V1_PADDING -}; - - - -#if (NDK_HTTP_CREATE_MAIN_CONF) -static void * -ndk_http_create_main_conf (ngx_conf_t *cf) -{ - ndk_http_main_conf_t *mcf; - - ndk_pcallocp_rce (mcf, cf->pool); - - return mcf; -} -#endif - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk.h deleted file mode 100644 index e08dfac..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk.h +++ /dev/null @@ -1,53 +0,0 @@ - -/* - * 2010 (C) Marcus Clyne -*/ - - -#ifndef NDK_H -#define NDK_H - - -#include -#include -#include - - -#define ndk_version 3004 -#define NDK_VERSION "0.3.4" - - -#if (NGX_DEBUG) -#ifndef NDK_DEBUG -#define NDK_DEBUG 1 -#endif -#else -#ifndef NDK_DEBUG -#define NDK_DEBUG 0 -#endif -#endif - - -#include - - -#if (NDK_HTTP_CREATE_MAIN_CONF) - -#define ndk_http_conf_get_main_conf(cf) ngx_http_conf_get_module_main_conf (cf, ndk_http_module) -#define ndk_http_get_main_conf(r) ngx_http_get_module_main_conf (r, ndk_http_module) - -typedef struct { -#if (NDK_UPSTREAM_LIST) - ngx_array_t *upstreams; -#endif -} ndk_http_main_conf_t; - -#endif /* NDK_HTTP_CREATE_MAIN_CONF */ - -#include - - -extern ngx_module_t ndk_http_module; - - -#endif diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_buf.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_buf.c deleted file mode 100644 index c491f72..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_buf.c +++ /dev/null @@ -1,43 +0,0 @@ - -ngx_int_t -ndk_copy_chain_to_str (ngx_pool_t *pool, ngx_chain_t *in, ngx_str_t *str) -{ - ngx_chain_t *cl; - size_t len; - u_char *p; - ngx_buf_t *b; - - len = 0; - for (cl = in; cl; cl = cl->next) - len += ngx_buf_size (cl->buf); - - ndk_palloc_re (p, pool, len + 1); - - str->data = p; - str->len = len; - - for (cl = in; cl; cl = cl->next) { - - b = cl->buf; - - if (ngx_buf_in_memory (b)) { - p = ngx_cpymem (p, b->pos, b->last - b->pos); - } - } - - *p = '\0'; - - return NGX_OK; -} - - -char * -ndk_copy_chain_to_charp (ngx_pool_t *pool, ngx_chain_t *in) -{ - ngx_str_t str; - - if (ndk_copy_chain_to_str (pool, in, &str) != NGX_OK) - return NULL; - - return (char *) str.data; -} \ No newline at end of file diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_buf.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_buf.h deleted file mode 100644 index e6334ad..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_buf.h +++ /dev/null @@ -1,5 +0,0 @@ - - -ngx_int_t ndk_copy_chain_to_str (ngx_pool_t *pool, ngx_chain_t *in, ngx_str_t *str); -char * ndk_copy_chain_to_charp (ngx_pool_t *pool, ngx_chain_t *in); - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_complex_path.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_complex_path.c deleted file mode 100644 index 8b32713..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_complex_path.c +++ /dev/null @@ -1,129 +0,0 @@ - - -ndk_http_complex_path_value_t ndk_empty_http_complex_path_value = {{0,NULL},0}; - - -ngx_int_t -ndk_http_complex_path_value_compile (ngx_conf_t *cf, ngx_http_complex_value_t *cv, ngx_str_t *value, ngx_uint_t prefix) -{ - ngx_http_compile_complex_value_t ccv; - - ngx_memzero (&ccv, sizeof(ngx_http_compile_complex_value_t)); - - ccv.cf = cf; - ccv.value = value; - ccv.complex_value = cv; - - switch (prefix) { - - case 1 : - ccv.root_prefix = 1; - break; - - case 2 : - ccv.conf_prefix = 1; - break; - } - - ndk_path_to_dir_safe (value, 1, 0); - - if (!value->len) - return NGX_OK; - - return ngx_http_compile_complex_value (&ccv); -} - - - -ngx_array_t * -ndk_http_complex_path_create_compile (ngx_conf_t *cf, ngx_str_t *path, ngx_uint_t prefix) -{ - ndk_http_complex_path_elt_t *cpe; - ngx_array_t *a; - ngx_int_t n; - u_char *m, *s, *e; - ngx_str_t value; - - n = ndk_strcntc (path, ':') + 1; - - a = ngx_array_create (cf->pool, n, sizeof (ndk_http_complex_path_elt_t)); - if (a == NULL) { - return NULL; - } - - s = path->data; - e = s + path->len; - - - while (s < e) { - - m = s; - - while (m < e && *m != ':') m++; - - if (m == s) { - s = m+1; - continue; - } - - cpe = ngx_array_push (a); - if (cpe == NULL) { - return NULL; - } - - if (*s == '#') { - s++; - cpe->dynamic = 1; - } else { - cpe->dynamic = 0; - } - - value.data = s; - value.len = m - s; - - if (ndk_http_complex_path_value_compile (cf, &cpe->val, &value, prefix) == NGX_ERROR) - return NULL; - - s = m+1; - } - - return a; -} - - - - -char * -ndk_conf_set_http_complex_path_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ngx_str_t *path; - ngx_conf_post_t *post; - ndk_http_complex_path_t *cp; - - cp = (ndk_http_complex_path_t *) (p + cmd->offset); - - if (cp->a != NGX_CONF_UNSET_PTR) { - return "is duplicate"; - } - - path = cf->args->elts; - path++; - - cp->a = ndk_http_complex_path_create_compile (cf, path, cp->prefix); - if (cp->a == NULL) { - /* TODO : log */ - return NGX_CONF_ERROR; - } - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, cp->a); - } - - return NGX_CONF_OK; -} - - - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_complex_path.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_complex_path.h deleted file mode 100644 index eb93d1f..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_complex_path.h +++ /dev/null @@ -1,30 +0,0 @@ - - -typedef struct { - ngx_array_t *a; - ngx_uint_t prefix; -} ndk_http_complex_path_t; - -typedef struct { - ngx_http_complex_value_t val; - ngx_flag_t dynamic; -} ndk_http_complex_path_elt_t; - -typedef struct { - ngx_str_t val; - ngx_flag_t dynamic; -} ndk_http_complex_path_value_t; - -typedef struct { - ndk_http_complex_path_value_t *elts; - ngx_uint_t nelts; -} ndk_http_complex_path_values_t; - - -extern ndk_http_complex_path_value_t ndk_empty_http_complex_path_value; - - -ngx_array_t * ndk_http_complex_path_create_compile (ngx_conf_t *cf, ngx_str_t *path, ngx_uint_t prefix); -ngx_int_t ndk_http_complex_path_value_compile (ngx_conf_t *cf, ngx_http_complex_value_t *cv, - ngx_str_t *value, ngx_uint_t prefix); -char * ndk_conf_set_http_complex_path_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_complex_value.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_complex_value.c deleted file mode 100644 index 97681ff..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_complex_value.c +++ /dev/null @@ -1,192 +0,0 @@ - - - -ngx_int_t -ndk_http_complex_value_compile (ngx_conf_t *cf, ngx_http_complex_value_t *cv, ngx_str_t *value) -{ - ngx_http_compile_complex_value_t ccv; - - ngx_memzero (&ccv, sizeof(ngx_http_compile_complex_value_t)); - - ccv.cf = cf; - ccv.value = value; - ccv.complex_value = cv; - - return ngx_http_compile_complex_value (&ccv); -} - - - - -ngx_array_t * -ndk_http_complex_value_array_create (ngx_conf_t *cf, char **s, ngx_int_t n) -{ - ngx_int_t i; - ngx_http_complex_value_t *cv; - ngx_array_t *a; - ngx_str_t value; - - a = ngx_array_create (cf->pool, n, sizeof (ngx_http_complex_value_t)); - if (a == NULL) - return NULL; - - - for (i=0; ielts; - - for (i=0; inelts; i++, cv++) { - - if (ndk_http_complex_value_compile (cf, cv, &cv->value)) - return NGX_ERROR; - } - - return NGX_OK; -} - - - -char * -ndk_conf_set_http_complex_value_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ngx_http_complex_value_t *cv; - ngx_str_t *value; - ngx_conf_post_t *post; - - cv = (ngx_http_complex_value_t *) (p + cmd->offset); - - if (cv->value.data) { - return "is duplicate"; - } - - value = cf->args->elts; - - if (ndk_http_complex_value_compile (cf, cv, value + 1)) - return NGX_CONF_ERROR; - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, cv); - } - - return NGX_CONF_OK; -} - - - -char * -ndk_conf_set_http_complex_value_array_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ngx_str_t *value; - ngx_http_complex_value_t *cv; - ngx_array_t **a; - ngx_conf_post_t *post; - ngx_uint_t i, alloc; - - a = (ngx_array_t **) (p + cmd->offset); - - if (*a == NULL || *a == NGX_CONF_UNSET_PTR) { - - alloc = cf->args->nelts > 4 ? cf->args->nelts : 4; - - *a = ngx_array_create (cf->pool, alloc, sizeof (ngx_http_complex_value_t)); - if (*a == NULL) { - return NGX_CONF_ERROR; - } - } - - value = cf->args->elts; - - for (i=1; iargs->nelts; i++) { - - cv = ngx_array_push (*a); - if (cv == NULL) { - return NGX_CONF_ERROR; - } - - if (ndk_http_complex_value_compile (cf, cv, &value[i]) == NGX_ERROR) - return NGX_CONF_ERROR; - } - - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, a); - } - - return NGX_CONF_OK; -} - - -char * -ndk_conf_set_http_complex_keyval_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ngx_str_t *value; - ndk_http_complex_keyval_t *ckv; - ngx_array_t **a; - ngx_conf_post_t *post; - ngx_int_t alloc; - - a = (ngx_array_t **) (p + cmd->offset); - - if (*a == NULL || *a == NGX_CONF_UNSET_PTR) { - - alloc = cf->args->nelts > 4 ? cf->args->nelts : 4; - - *a = ngx_array_create (cf->pool, alloc, sizeof (ndk_http_complex_keyval_t)); - if (*a == NULL) { - return NGX_CONF_ERROR; - } - } - - ckv = ngx_array_push (*a); - if (ckv == NULL) { - return NGX_CONF_ERROR; - } - - value = cf->args->elts; - - ckv->key = value[1]; - - if (ndk_http_complex_value_compile (cf, &ckv->value, &value[2]) == NGX_ERROR) - return NGX_CONF_ERROR; - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, a); - } - - return NGX_CONF_OK; -} - -/* TODO : complex keyval1 */ diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_complex_value.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_complex_value.h deleted file mode 100644 index 4178d62..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_complex_value.h +++ /dev/null @@ -1,21 +0,0 @@ - - -typedef struct { - ngx_str_t key; - ngx_http_complex_value_t value; -} ndk_http_complex_keyval_t; - - - -/* create/compile functions */ - -ngx_int_t ndk_http_complex_value_compile (ngx_conf_t *cf, ngx_http_complex_value_t *cv, ngx_str_t *value); -ngx_array_t * ndk_http_complex_value_array_create (ngx_conf_t *cf, char **s, ngx_int_t n); -ngx_int_t ndk_http_complex_value_array_compile (ngx_conf_t *cf, ngx_array_t *a); - - -/* conf set slot functions */ - -char * ndk_conf_set_http_complex_keyval_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_http_complex_value_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_http_complex_value_array_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_conf_file.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_conf_file.c deleted file mode 100644 index 980641c..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_conf_file.c +++ /dev/null @@ -1,396 +0,0 @@ - - -/* NOTE : you will find other conf_set functions in the following files : - * - * complex_value.c - * encoding.c - * path.c - * - */ - - -char * -ndk_conf_set_true_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ngx_flag_t *fp; - ngx_conf_post_t *post; - - fp = (ngx_flag_t*) (p + cmd->offset); - - if (*fp != NGX_CONF_UNSET) { - return "is duplicate"; - } - - *fp = 1; - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, fp); - } - - return NGX_CONF_OK; -} - - - -char * -ndk_conf_set_false_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ngx_flag_t *fp; - ngx_conf_post_t *post; - - fp = (ngx_flag_t*) (p + cmd->offset); - - if (*fp != NGX_CONF_UNSET) { - return "is duplicate"; - } - - *fp = 0; - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, fp); - } - - return NGX_CONF_OK; -} - - - - -char * -ndk_conf_set_ptr_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - void **ptr; - - ptr = (void**) (p + cmd->offset); - - if (*ptr != NGX_CONF_UNSET_PTR) { - return "is duplicate"; - } - - *ptr = cmd->post; - - return NGX_CONF_OK; -} - - - -char * -ndk_conf_set_null_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - void **pp; - ngx_conf_post_t *post; - - pp = (void **) (p + cmd->offset); - - if (*pp != NGX_CONF_UNSET_PTR) { - return "is duplicate"; - } - - *pp = NULL; - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, pp); - } - - return NGX_CONF_OK; -} - - -char * -ndk_conf_set_num64_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - int64_t *np; - ngx_str_t *value; - ngx_conf_post_t *post; - - - np = (int64_t *) (p + cmd->offset); - - if (*np != NGX_CONF_UNSET) { - return "is duplicate"; - } - - value = cf->args->elts; - *np = ndk_atoi64 (value[1].data, value[1].len); - if (*np == NGX_ERROR) { - return "invalid number"; - } - - if (cmd->post) { - post = cmd->post; - return post->post_handler(cf, post, np); - } - - return NGX_CONF_OK; -} - - -char * -ndk_conf_set_str_array_multi_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ngx_str_t *value, *s; - ngx_array_t **a; - ngx_conf_post_t *post; - ngx_uint_t i; - - a = (ngx_array_t **) (p + cmd->offset); - - if (*a == NGX_CONF_UNSET_PTR) { - *a = ngx_array_create(cf->pool, 4, sizeof(ngx_str_t)); - if (*a == NULL) { - return NGX_CONF_ERROR; - } - } - - s = NULL; - - for (i=cf->args->nelts-1; i; i--) { - - s = ngx_array_push(*a); - if (s == NULL) { - return NGX_CONF_ERROR; - } - - value = cf->args->elts; - - *s = value[i]; - } - - if (cmd->post) { - post = cmd->post; - return post->post_handler(cf, post, s); - } - - return NGX_CONF_OK; -} - - - -char * -ndk_conf_set_keyval1_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ngx_str_t *value; - ngx_keyval_t *kv; - ngx_conf_post_t *post; - - kv = (ngx_keyval_t *) (p + cmd->offset); - - if (kv->key.data) - return "is duplicate"; - - value = cf->args->elts; - - kv->key = value[1]; - kv->value = value[2]; - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, kv); - } - - return NGX_CONF_OK; -} - - - -char * -ndk_conf_set_num_flag_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ngx_int_t *np; - ngx_str_t *value; - ngx_conf_post_t *post; - - np = (ngx_int_t *) (p + cmd->offset); - - if (*np != NGX_CONF_UNSET) { - return "is duplicate"; - } - - value = cf->args->elts; - - if (ngx_strcasecmp (value[1].data, (u_char *) "on") == 0) { - *np = NDK_CONF_SET_TRUE; - - } else if (ngx_strcasecmp (value[1].data, (u_char *) "off") == 0) { - *np = NDK_CONF_SET_FALSE; - - } else { - *np = ngx_atoi (value[1].data, value[1].len); - if (*np == NGX_ERROR) { - return "invalid number and not 'on'/'off'"; - } - } - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, np); - } - - return NGX_CONF_OK; -} - - - -char * -ndk_conf_set_sec_flag_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - time_t *tp; - ngx_str_t *value; - ngx_conf_post_t *post; - - tp = (time_t *) (p + cmd->offset); - - if (*tp != NGX_CONF_UNSET) { - return "is duplicate"; - } - - value = cf->args->elts; - - if (ngx_strcasecmp (value[1].data, (u_char *) "on") == 0) { - *tp = NDK_CONF_SET_TRUE; - - } else if (ngx_strcasecmp (value[1].data, (u_char *) "off") == 0) { - *tp = NDK_CONF_SET_FALSE; - - } else { - *tp = ngx_parse_time (&value[1], 1); - if (*tp == NGX_ERROR) { - return "has an invalid time and not 'on'/'off'"; - } - } - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, tp); - } - - return NGX_CONF_OK; -} - - - -ngx_http_conf_ctx_t * -ndk_conf_create_http_location (ngx_conf_t *cf) -{ - ngx_http_conf_ctx_t *ctx, *pctx; - void *mconf; - ngx_http_core_loc_conf_t *clcf, *pclcf; - ngx_uint_t i; - ngx_http_module_t *module; - - ndk_pcallocp_rce (ctx, cf->pool); - - pctx = cf->ctx; - ctx->main_conf = pctx->main_conf; - ctx->srv_conf = pctx->srv_conf; - - ndk_pcalloc_rce (ctx->loc_conf, cf->pool, sizeof(void *) * ngx_http_max_module); - - - for (i = 0; ngx_modules[i]; i++) { - if (ngx_modules[i]->type != NGX_HTTP_MODULE) { - continue; - } - - module = ngx_modules[i]->ctx; - - if (module->create_loc_conf) { - - mconf = module->create_loc_conf(cf); - if (mconf == NULL) { - return NGX_CONF_ERROR; - } - - ctx->loc_conf[ngx_modules[i]->ctx_index] = mconf; - } - } - - pclcf = pctx->loc_conf[ngx_http_core_module.ctx_index]; - - clcf = ctx->loc_conf[ngx_http_core_module.ctx_index]; - clcf->loc_conf = ctx->loc_conf; - clcf->name = pclcf->name; - clcf->noname = 1; - - if (ngx_http_add_location(cf, &pclcf->locations, clcf) != NGX_OK) { - return NGX_CONF_ERROR; - } - - return ctx; -} - - -ngx_http_conf_ctx_t * -ngx_conf_create_http_named_location (ngx_conf_t *cf, ngx_str_t *name) -{ - ngx_http_conf_ctx_t *ctx; - ngx_http_core_loc_conf_t *clcf; - - ctx = ndk_conf_create_http_location (cf); - if (ctx == NGX_CONF_ERROR) - return NGX_CONF_ERROR; - - clcf = ctx->loc_conf[ngx_http_core_module.ctx_index]; - - /* in case the developer forgets to add '@' at the beginning of the named location */ - - if (name->data[0] != '@' && ndk_catstrf (cf->pool, name, "sS", "@", name) == NULL) - return NGX_CONF_ERROR; - - clcf->name = *name; /* TODO : copy? */ - clcf->noname = 0; - clcf->named = 1; - - return ctx; -} - - -ngx_int_t -ndk_replace_command (ngx_command_t *new_cmd, ngx_uint_t module_type) -{ - ngx_uint_t i; - ngx_command_t *cmd; - - for (i = 0; ngx_modules[i]; i++) { - - if (ngx_modules[i]->type != module_type) - continue; - - cmd = ngx_modules[i]->commands; - if (cmd == NULL) { - continue; - } - - for ( /* void */ ; cmd->name.len; cmd++) { - - if (ndk_cmpstr (&new_cmd->name, &cmd->name) == 0) { - - ndk_memcpyp (cmd, new_cmd); - return NGX_OK; - } - } - } - - return NGX_DECLINED; -} diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_conf_file.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_conf_file.h deleted file mode 100644 index 6956b17..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_conf_file.h +++ /dev/null @@ -1,44 +0,0 @@ - - -/* conf set functions */ - -char * ndk_conf_set_true_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_false_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_full_path_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_ptr_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_null_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_str_array_multi_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_keyval1_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_num_flag (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_num64_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_sec_flag_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); - -ngx_http_conf_ctx_t * ndk_conf_create_http_location (ngx_conf_t *cf); -ngx_http_conf_ctx_t * ngx_conf_create_http_named_location (ngx_conf_t *cf, ngx_str_t *name); - -ngx_int_t ndk_replace_command (ngx_command_t *new_cmd, ngx_uint_t module_type); - - -/* values for conf_set_xxx_flag */ - -#define NDK_CONF_SET_TRUE -2 -#define NDK_CONF_SET_FALSE -3 - - -/* wrappers for utility macros */ - -#define ndk_conf_set_bitmask_slot ngx_conf_set_bitmask_slot -#define ndk_conf_set_bufs_slot ngx_conf_set_bufs_slot -#define ndk_conf_set_enum_slot ngx_conf_set_enum_slot -#define ndk_conf_set_flag_slot ngx_conf_set_flag_slot -#define ndk_conf_set_keyval_slot ngx_conf_set_keyval_slot -#define ndk_conf_set_msec_slot ngx_conf_set_msec_slot -#define ndk_conf_set_num_slot ngx_conf_set_num_slot -#define ndk_conf_set_off_slot ngx_conf_set_off_slot -#define ndk_conf_set_sec_slot ngx_conf_set_sec_slot -#define ndk_conf_set_size_slot ngx_conf_set_size_slot -#define ndk_conf_set_str_slot ngx_conf_set_str_slot - - - - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_debug.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_debug.c deleted file mode 100644 index e0251cc..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_debug.c +++ /dev/null @@ -1,72 +0,0 @@ - -#if (NGX_DEBUG) - -void -ndk_debug_helper (const char *func, const char *fmt, ...) -{ - size_t len, flen, tlen; - char *s, *p, *e; - - /* check to see if the format is empty */ - - flen = strlen (fmt); - - /* build func name */ - - len = strlen (func); - - if (flen == 0) - tlen = len + 1; - else - - char func_name [len + flen + 1]; - - s = func_name; - e = s + len; - - memcpy (s, func, len); - - /* remove initial ngx_ */ - - if (strncmp (s, "ngx_", 4) == 0) - s += 4; - - /* replace '_' with ' ' */ - - for (p=s; pmethod_name.len, r->method_name.data, - (int) r->uri.len, r->uri.data, - (int) r->args.len, r->args.data, - 0/*(int) r->main->count*/, r->main, - r, r->connection->data, r->parent); - - if (r->posted_requests) { - fprintf(stderr, " posted:"); - - for (pr = r->posted_requests; pr; pr = pr->next) { - fprintf (stderr, "%p,", pr); - } - } - - fprintf (stderr, "\n"); -} - - -#endif diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_debug.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_debug.h deleted file mode 100644 index 883a6eb..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_debug.h +++ /dev/null @@ -1,171 +0,0 @@ -#ifndef NDK_DEBUG_H -#define NDK_DEBUG_H - - -/* TODO : use the Nginx printf function */ - - -#include -#include - -/* TODO -- andk_debug variety of debugging formats -- global include file for all debugging - can pass declaration to cflags for the option -*/ - - -#if (NDK_DEBUG) - - #if (NGX_HAVE_VARIADIC_MACROS) - - #define ndk_debug(...) ndk_debug_helper (__func__,__VA_ARGS__) - - #define ndk_debug_helper(func,...) \ - fprintf(stderr, "%-60s", func); \ - fprintf(stderr, (const char *)__VA_ARGS__); \ - fprintf(stderr,"\n"); - /*fprintf(stderr, " at %s line %d.\n", __FILE__, __LINE__)*/ - - #else - - /* NOTE : these includes might not be necessary since they're probably included with the core */ - - #include - #include - #include - - static void ndk_debug (const char * fmt, ...) { - } - - #endif - - #if NDK_DEBUG > 1 - - #define ndk_debug_request() ndk_debug_request_helper(r, __func__) - - static ngx_inline void - ndk_debug_request_helper (ngx_http_request_t *r, const char *func) - { - ngx_http_posted_request_t *pr; - - /* TODO : improve the format */ - - fprintf (stderr, "%s %.*s %.*s?%.*s c:%d m:%p r:%p ar:%p pr:%p", - func, - (int) r->method_name.len, r->method_name.data, - (int) r->uri.len, r->uri.data, - (int) r->args.len, r->args.data, - 0/*(int) r->main->count*/, r->main, - r, r->connection->data, r->parent); - - if (r->posted_requests) { - fprintf(stderr, " posted:"); - - for (pr = r->posted_requests; pr; pr = pr->next) { - fprintf (stderr, "%p,", pr); - } - } - - fprintf (stderr, "\n"); - } - - - #else - - #define ndk_debug_request() - - #endif - - - static ngx_inline void - ndk_debug_print_posted_requests (ngx_http_request_t *r) - { - ngx_http_posted_request_t *pr; - - ndk_request_log_debug_http (r, "ndk debug - http posted requests"); - - for (pr = r->main->posted_requests; pr; pr = pr->next) { - - if (!pr->request) - continue; - - ndk_request_log_debug_http (r, "ndk debug - http posted request:%V", &pr->request->uri); - } - } - - - #define ndk_debug_http_conf_location(cf) ndk_debug_http_conf_location_helper (cf, __func__) - - static ngx_inline void - ndk_debug_http_conf_location_helper (ngx_conf_t *cf, const char *func) - { - ngx_http_core_loc_conf_t *lcf; - - lcf = ngx_http_conf_get_module_loc_conf (cf, ngx_http_core_module); - - ndk_debug_helper (func, "[%s]", lcf->name.data); - } - - /* - static void - ndk_debug_log_chain (ngx_log_t *log, ngx_chain_t *cl) - { - - - } - */ - -#else - - #if (NGX_HAVE_VARIADIC_MACROS) - - #define ndk_debug(...) - #define ndk_debug_request() - - #else - - #include - - static void ndk_debug (const char * fmt, ...) { - } - - static void ndk_debug_request() { - } - - #endif - - #define ndk_debug_http_conf_location(cf) - -#endif - -#if (NDK_DEBUG) - - #define ndk_debug_check_read_event_handler(r) \ - \ - ndk_debug("r->read_event_handler = %s", \ - r->read_event_handler == ngx_http_block_reading ? \ - "ngx_http_block_reading" : \ - r->read_event_handler == ngx_http_test_reading ? \ - "ngx_http_test_reading" : \ - r->read_event_handler == ngx_http_request_empty_handler ? \ - "ngx_http_request_empty_handler" : "UNKNOWN") - - #define ndk_debug_check_write_event_handler(r) \ - \ - ndk_debug ("r->write_event_handler = %s", \ - r->write_event_handler == ngx_http_handler ? \ - "ngx_http_handler" : \ - r->write_event_handler == ngx_http_core_run_phases ? \ - "ngx_http_core_run_phases" : \ - r->write_event_handler == ngx_http_request_empty_handler ? \ - "ngx_http_request_empty_handler" : "UNKNOWN") - -#else - - #define ndk_debug_check_read_event_handler(r) - #define ndk_debug_check_write_event_handler(r) - -#endif - -#endif /* NDK_DEBUG_H */ - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_encoding.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_encoding.c deleted file mode 100644 index 4a07872..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_encoding.c +++ /dev/null @@ -1,57 +0,0 @@ - - - -char * -ndk_conf_set_encoding_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ndk_encoding_t *ep; - ngx_str_t *value; - size_t len; - iconv_t ic; - - ep = (ndk_encoding_t *) (p + cmd->offset); - if (ep->from && ep->to) - return "is duplicate"; - - value = cf->args->elts; - - - if (ep->from) { - - ep->to = (char *) value[1].data; - len = strlen (ep->from); - - } else if (ep->to) { - - ep->from = (char *) value[1].data; - len = strlen (ep->to); - - } else { - return "has no base encoding"; - } - - - if (len == value[1].len && !strncasecmp (ep->to, ep->from, len)) { - - ngx_log_error (NGX_LOG_WARN, cf->log, 0, - "\"%V\" '%V' encoding is ignored (no conversion)", &value[0], &value[1]); - - return NGX_CONF_OK; - } - - - ic = iconv_open (ep->to, ep->from); - if (ic == (iconv_t)-1) - return "has an invalid encoding"; - - - if (iconv_close (ic)) { - ngx_log_error (NGX_LOG_EMERG, cf->log, errno, "iconv_close()"); - return NGX_CONF_ERROR; - } - - return NGX_CONF_OK; -} - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_encoding.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_encoding.h deleted file mode 100644 index b295b18..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_encoding.h +++ /dev/null @@ -1,12 +0,0 @@ - - -#include - -typedef struct { - char *from; - char *to; -} ndk_encoding_t; - - -char * ndk_conf_set_encoding_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_hash.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_hash.c deleted file mode 100644 index dec3d41..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_hash.c +++ /dev/null @@ -1,82 +0,0 @@ - -#include - - - -/* openssl hashes */ - -#define NDK_OPENSSL_HASH(type,ctxt_type,upper) \ - u_char md [ctxt_type ## _DIGEST_LENGTH]; \ - ctxt_type ##_CTX c; \ - \ - type ## _Init (&c); \ - type ## _Update (&c, data, len); \ - type ## _Final (md, &c); \ - \ - ndk_hex_dump (p, (u_char *) md, ctxt_type ## _DIGEST_LENGTH); \ - if (upper) { \ - ndk_strtoupper (p, (ctxt_type ## _DIGEST_LENGTH) *2); \ - } - - -#ifdef NDK_MD5 - -void -ndk_md5_hash (u_char *p, char *data, size_t len) -{ - NDK_OPENSSL_HASH (MD5, MD5, 0); -} - -void -ndk_md5_hash_upper (u_char *p, char *data, size_t len) -{ - NDK_OPENSSL_HASH (MD5, MD5, 1); -} - -#endif -#ifdef NDK_SHA1 - -void -ndk_sha1_hash (u_char *p, char *data, size_t len) -{ - NDK_OPENSSL_HASH (SHA1, SHA, 0); -} - -void -ndk_sha1_hash_upper (u_char *p, char *data, size_t len) -{ - NDK_OPENSSL_HASH (SHA1, SHA, 1); -} - -#endif - - - -/* non-openssl hashes */ - -#ifdef NDK_MURMUR2 - -#include "hash/murmurhash2.c" - -void -ndk_murmur2_hash (u_char *p, char *data, size_t len) -{ - uint32_t hash; - - hash = MurmurHash2 (data, len, 47); - - ndk_hex_dump (p, (u_char*) &hash, 4); -} - -void -ndk_murmur2_hash_upper (u_char *p, char *data, size_t len) -{ - uint32_t hash; - - hash = MurmurHash2 (data, len, 47); - - ndk_hex_dump (p, (u_char*) &hash, 4); - ndk_strtoupper (p, 8); -} - -#endif diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_hash.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_hash.h deleted file mode 100644 index a15e923..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_hash.h +++ /dev/null @@ -1,45 +0,0 @@ - -#ifndef NDK_HASH_H -#define NDK_HASH_H - -#ifdef NDK_HASH_ALL - -#ifndef NDK_MD5 -#define NDK_MD5 -#endif - -#ifndef NDK_MURMUR2 -#define NDK_MURMUR2 -#endif - -#ifndef NDK_SHA1 -#define NDK_SHA1 -#endif - -#endif - -#include -#include -typedef void (*ndk_hash_pt) (u_char *p, char *data, size_t len); - - -#ifdef NDK_MD5 -#include -void ndk_md5_hash (u_char *p, char *data, size_t len); -void ndk_md5_hash_upper (u_char *p, char *data, size_t len); -#endif - -#ifdef NDK_MURMUR2 -#define MURMURHASH2_DIGEST_LENGTH 4 -void ndk_murmur2_hash (u_char *p, char *data, size_t len); -void ndk_murmur2_hash_upper (u_char *p, char *data, size_t len); -#endif - -#ifdef NDK_SHA1 -#include -void ndk_sha1_hash (u_char *p, char *data, size_t len); -void ndk_sha1_hash_upper (u_char *p, char *data, size_t len); -#endif - -#endif /* NDK_HASH_H */ - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_http.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_http.c deleted file mode 100644 index 60728bb..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_http.c +++ /dev/null @@ -1,138 +0,0 @@ - -ngx_uint_t -ndk_http_count_phase_handlers (ngx_http_core_main_conf_t *cmcf) -{ - ngx_http_phase_handler_t *ph; - ngx_uint_t i; - - ph = cmcf->phase_engine.handlers; - - for (i=0; ph[i].checker; i++) /* void */; - - return i; -} - - -ngx_uint_t -ndk_http_parse_request_method (ngx_str_t *m) -{ - switch (m->len) { - - case 3: - -#if (NGX_HAVE_LITTLE_ENDIAN && NGX_HAVE_NONALIGNED) - { - u_char t[4]; - - ngx_memcpy (t, m->data, 3); - t[3] = ' '; - - if (ndk_str3_cmp (t, 'G', 'E', 'T', ' ')) { - return NGX_HTTP_GET; - } - - if (ndk_str3_cmp (t, 'P', 'U', 'T', ' ')) { - return NGX_HTTP_PUT; - } - } - -#else - - if (ndk_str3_cmp (m->data, 'G', 'E', 'T', ' ')) { - return NGX_HTTP_GET; - } - - if (ndk_str3_cmp (m->data, 'P', 'U', 'T', ' ')) { - return NGX_HTTP_PUT; - } - -#endif - break; - - case 4: - - if (m->data[1] == 'O') { - - if (ndk_str3Ocmp (m->data, 'P', 'O', 'S', 'T')) { - return NGX_HTTP_POST; - } - - if (ndk_str3Ocmp (m->data, 'C', 'O', 'P', 'Y')) { - return NGX_HTTP_COPY; - } - - if (ndk_str3Ocmp (m->data, 'M', 'O', 'V', 'E')) { - return NGX_HTTP_MOVE; - } - - if (ndk_str3Ocmp (m->data, 'L', 'O', 'C', 'K')) { - return NGX_HTTP_LOCK; - } - - } else { - - if (ndk_str4cmp (m->data, 'H', 'E', 'A', 'D')) { - return NGX_HTTP_HEAD; - } - } - - break; - - case 5: - - if (ndk_str5cmp (m->data, 'M', 'K', 'C', 'O', 'L')) { - return NGX_HTTP_MKCOL; - } - - if (ndk_str5cmp (m->data, 'P', 'A', 'T', 'C', 'H')) { - return NGX_HTTP_PATCH; - } - - if (ndk_str5cmp (m->data, 'T', 'R', 'A', 'C', 'E')) { - return NGX_HTTP_TRACE; - } - - break; - - case 6: - - if (ndk_str6cmp (m->data, 'D', 'E', 'L', 'E', 'T', 'E')) { - return NGX_HTTP_DELETE; - } - - if (ndk_str6cmp (m->data, 'U', 'N', 'L', 'O', 'C', 'K')) { - return NGX_HTTP_UNLOCK; - } - - break; - - case 7: - - if (ndk_str7_cmp (m->data, 'O', 'P', 'T', 'I', 'O', 'N', 'S', ' ')) - { - return NGX_HTTP_OPTIONS; - } - - break; - - case 8: - - if (ndk_str8cmp (m->data, 'P', 'R', 'O', 'P', 'F', 'I', 'N', 'D')) - { - return NGX_HTTP_PROPFIND; - } - - break; - - case 9: - - if (ndk_str9cmp (m->data, 'P', 'R', 'O', 'P', 'P', 'A', 'T', 'C', 'H')) - { - return NGX_HTTP_PROPPATCH; - } - - break; - } - - return 0; -} \ No newline at end of file diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_http.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_http.h deleted file mode 100644 index 6a9d1c5..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_http.h +++ /dev/null @@ -1,3 +0,0 @@ - -ngx_uint_t ndk_http_count_phase_handlers (ngx_http_core_main_conf_t *cmcf); -ngx_uint_t ndk_http_parse_request_method (ngx_str_t *m); diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_http_headers.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_http_headers.h deleted file mode 100644 index e71c70e..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_http_headers.h +++ /dev/null @@ -1,35 +0,0 @@ - - -/* TODO : organize and add */ -/* TODO : check - should it be r->main? */ - -#define ndk_http_uri(r) (r)->uri -#define ndk_http_request_uri(r) (r)->unparsed_uri - -#define ndk_http_header_in(r,name) ((r)->headers_in.name ? &(r)->headers_in.name->value : NULL) -#define ndk_http_header_out(r,name) ((r)->headers_out.name ? &(r)->headers_out.name->value : NULL) - -#define ndk_http_host_header(r) ndk_http_header_in (r, host) -#define ndk_http_connection_header(r) ndk_http_header_in (r, connection) -#define ndk_http_if_modified_since_header(r) ndk_http_header_in (r, if_modified_since) -#define ndk_http_user_agent_header(r) ndk_http_header_in (r, user_agent) -#define ndk_http_referer_header(r) ndk_http_header_in (r, referer) -#define ndk_http_content_length_header(r) ndk_http_header_in (r, content_length) -#define ndk_http_content_type_header(r) ndk_http_header_in (r, content_type) -#define ndk_http_range_header(r) ndk_http_header_in (r, range) -#define ndk_http_if_range_header(r) ndk_http_header_in (r, if_range) -#define ndk_http_transfer_encoding_header(r) ndk_http_header_in (r, transfer_encoding) -#define ndk_http_expect_header(r) ndk_http_header_in (r, expect) -#define ndk_http_accept_encoding_header(r) ndk_http_header_in (r, accept_encoding) -#define ndk_http_via_header(r) ndk_http_header_in (r, via) -#define ndk_http_authorization_header(r) ndk_http_header_in (r, authorization) -#define ndk_http_keep_alive_header(r) ndk_http_header_in (r, keep_alive) -#define ndk_http_x_forwarded_for_header(r) ndk_http_header_in (r, x_forwarded_for) -#define ndk_http_x_real_ip_header(r) ndk_http_header_in (r, x_real_ip) -#define ndk_http_accept_header(r) ndk_http_header_in (r, accept) -#define ndk_http_accept_language_header(r) ndk_http_header_in (r, accept_language) -#define ndk_http_depth_header(r) ndk_http_header_in (r, depth) -#define ndk_http_destination_header(r) ndk_http_header_in (r, destination) -#define ndk_http_overwrite_header(r) ndk_http_header_in (r, overwrite) -#define ndk_http_date_header(r) ndk_http_header_in (r, date) - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_log.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_log.c deleted file mode 100644 index 36dca15..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_log.c +++ /dev/null @@ -1,3 +0,0 @@ - - -/* TODO : the required functions if the compiler does not have variadic macros */ diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_log.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_log.h deleted file mode 100644 index 1dd9c22..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_log.h +++ /dev/null @@ -1,165 +0,0 @@ - -/* TODO : fix the conf_log macros */ - -#define NGX_LOG_DEBUG_SCRIPT NGX_LOG_DEBUG_HTTP /* TODO : add new section to log/conf directives */ - -#define ndk_conf_to_log(cf) ((cf)->log) - -#ifndef ndk_request_to_log -#define ndk_request_to_log(r) ((r)->connection->log) -#endif - - -/*********************************/ - -#if (NGX_HAVE_C99_VARIADIC_MACROS) - -#define ndk_log_stderr(log,...) ngx_log_error (NGX_LOG_STDERR, log, 0, __VA_ARGS__) -#define ndk_log_emerg(log,...) ngx_log_error (NGX_LOG_EMERG, log, 0, __VA_ARGS__) -#define ndk_log_alert(log,...) ngx_log_error (NGX_LOG_ALERT, log, 0, __VA_ARGS__) -#define ndk_log_crit(log,...) ngx_log_error (NGX_LOG_CRIT, log, 0, __VA_ARGS__) -#define ndk_log_err(log,...) ngx_log_error (NGX_LOG_ERR, log, 0, __VA_ARGS__) -#define ndk_log_warning(log,...) ngx_log_error (NGX_LOG_WARN, log, 0, __VA_ARGS__) -#define ndk_log_notice(log,...) ngx_log_error (NGX_LOG_NOTICE, log, 0, __VA_ARGS__) -#define ndk_log_info(log,...) ngx_log_error (NGX_LOG_INFO, log, 0, __VA_ARGS__) - -#define ndk_conf_log_stderr(cf,...) ngx_conf_log_error (NGX_LOG_STDERR, cf, 0, __VA_ARGS__) -#define ndk_conf_log_emerg(cf,...) ngx_conf_log_error (NGX_LOG_EMERG, cf, 0, __VA_ARGS__) -#define ndk_conf_log_alert(cf,...) ngx_conf_log_error (NGX_LOG_ALERT, cf, 0, __VA_ARGS__) -#define ndk_conf_log_crit(cf,...) ngx_conf_log_error (NGX_LOG_CRIT, cf, 0, __VA_ARGS__) -#define ndk_conf_log_err(cf,...) ngx_conf_log_error (NGX_LOG_ERR, cf, 0, __VA_ARGS__) -#define ndk_conf_log_warning(cf,...) ngx_conf_log_error (NGX_LOG_WARN, cf, 0, __VA_ARGS__) -#define ndk_conf_log_notice(cf,...) ngx_conf_log_error (NGX_LOG_NOTICE, cf, 0, __VA_ARGS__) -#define ndk_conf_log_info(cf,...) ngx_conf_log_error (NGX_LOG_INFO, cf, 0, __VA_ARGS__) - -#define ndk_request_log_stderr(r,...) ndk_log_stderr (ndk_request_to_log(r), __VA_ARGS__) -#define ndk_request_log_emerg(r,...) ndk_log_emerg (ndk_request_to_log(r), __VA_ARGS__) -#define ndk_request_log_alert(r,...) ndk_log_alert (ndk_request_to_log(r), __VA_ARGS__) -#define ndk_request_log_crit(r,...) ndk_log_crit (ndk_request_to_log(r), __VA_ARGS__) -#define ndk_request_log_err(r,...) ndk_log_err (ndk_request_to_log(r), __VA_ARGS__) -#define ndk_request_log_warning(r,...) ndk_log_warning (ndk_request_to_log(r), __VA_ARGS__) -#define ndk_request_log_notice(r,...) ndk_log_notice (ndk_request_to_log(r), __VA_ARGS__) -#define ndk_request_log_info(r,...) ndk_log_info (ndk_request_to_log(r), __VA_ARGS__) - - -#if (NGX_DEBUG) - -#define ndk_log_debug_core(log,...) ngx_log_debug (NGX_LOG_DEBUG_CORE, log, 0, __VA_ARGS__) -#define ndk_log_debug_alloc(log,...) ngx_log_debug (NGX_LOG_DEBUG_ALLOC, log, 0, __VA_ARGS__) -#define ndk_log_debug_mutex(log,...) ngx_log_debug (NGX_LOG_DEBUG_MUTEX, log, 0, __VA_ARGS__) -#define ndk_log_debug_event(log,...) ngx_log_debug (NGX_LOG_DEBUG_EVENT, log, 0, __VA_ARGS__) -#define ndk_log_debug_http(log,...) ngx_log_debug (NGX_LOG_DEBUG_HTTP, log, 0, __VA_ARGS__) -#define ndk_log_debug_mail(log,...) ngx_log_debug (NGX_LOG_DEBUG_MAIL, log, 0, __VA_ARGS__) -#define ndk_log_debug_mysql(log,...) ngx_log_debug (NGX_LOG_DEBUG_MYSQL, log, 0, __VA_ARGS__) - -#define ndk_conf_log_debug_core(r,...) ndk_log_debug_core (ndk_conf_to_log(r), __VA_ARGS__) -#define ndk_conf_log_debug_alloc(r,...) ndk_log_debug_alloc (ndk_conf_to_log(r), __VA_ARGS__) -#define ndk_conf_log_debug_mutex(r,...) ndk_log_debug_mutex (ndk_conf_to_log(r), __VA_ARGS__) -#define ndk_conf_log_debug_event(r,...) ndk_log_debug_event (ndk_conf_to_log(r), __VA_ARGS__) -#define ndk_conf_log_debug_http(r,...) ndk_log_debug_http (ndk_conf_to_log(r), __VA_ARGS__) -#define ndk_conf_log_debug_mail(r,...) ndk_log_debug_mail (ndk_conf_to_log(r), __VA_ARGS__) -#define ndk_conf_log_debug_mysql(r,...) ndk_log_debug_mysql (ndk_conf_to_log(r), __VA_ARGS__) - -#define ndk_request_log_debug_core(r,...) ndk_log_debug_core (ndk_request_to_log(r), __VA_ARGS__) -#define ndk_request_log_debug_alloc(r,...) ndk_log_debug_alloc (ndk_request_to_log(r), __VA_ARGS__) -#define ndk_request_log_debug_mutex(r,...) ndk_log_debug_mutex (ndk_request_to_log(r), __VA_ARGS__) -#define ndk_request_log_debug_event(r,...) ndk_log_debug_event (ndk_request_to_log(r), __VA_ARGS__) -#define ndk_request_log_debug_http(r,...) ndk_log_debug_http (ndk_request_to_log(r), __VA_ARGS__) -#define ndk_request_log_debug_mail(r,...) ndk_log_debug_mail (ndk_request_to_log(r), __VA_ARGS__) -#define ndk_request_log_debug_mysql(r,...) ndk_log_debug_mysql (ndk_request_to_log(r), __VA_ARGS__) - -#else - -#define ndk_log_debug_core(log,...) -#define ndk_log_debug_alloc(log,...) -#define ndk_log_debug_mutex(log,...) -#define ndk_log_debug_event(log,...) -#define ndk_log_debug_http(log,...) -#define ndk_log_debug_mail(log,...) -#define ndk_log_debug_mysql(log,...) - -#define ndk_conf_log_debug_core(r,...) -#define ndk_conf_log_debug_alloc(r,...) -#define ndk_conf_log_debug_mutex(r,...) -#define ndk_conf_log_debug_event(r,...) -#define ndk_conf_log_debug_http(r,...) -#define ndk_conf_log_debug_mail(r,...) -#define ndk_conf_log_debug_mysql(r,...) - -#define ndk_request_log_debug_core(r,...) -#define ndk_request_log_debug_alloc(r,...) -#define ndk_request_log_debug_mutex(r,...) -#define ndk_request_log_debug_event(r,...) -#define ndk_request_log_debug_http(r,...) -#define ndk_request_log_debug_mail(r,...) -#define ndk_request_log_debug_mysql(r,...) - -#endif - - -/*********************************/ - -#elif (NGX_HAVE_GCC_VARIADIC_MACROS) - -#define ndk_log_stderr(log,args...) ngx_log_error (NGX_LOG_STDERR, log, 0, args) -#define ndk_log_emerg(log,args...) ngx_log_error (NGX_LOG_EMERG, log, 0, args) -#define ndk_log_alert(log,args...) ngx_log_error (NGX_LOG_ALERT, log, 0, args) -#define ndk_log_crit(log,args...) ngx_log_error (NGX_LOG_CRIT, log, 0, args) -#define ndk_log_err(log,args...) ngx_log_error (NGX_LOG_ERR, log, 0, args) -#define ndk_log_warning(log,args...) ngx_log_error (NGX_LOG_WARN, log, 0, args) -#define ndk_log_notice(log,args...) ngx_log_error (NGX_LOG_NOTICE, log, 0, args) -#define ndk_log_info(log,args...) ngx_log_error (NGX_LOG_INFO, log, 0, args) - -#define ndk_log_debug_core(log,args...) ngx_log_debug (NGX_LOG_DEBUG_CORE, log, 0, args) -#define ndk_log_debug_alloc(log,args...) ngx_log_debug (NGX_LOG_DEBUG_ALLOC, log, 0, args) -#define ndk_log_debug_mutex(log,args...) ngx_log_debug (NGX_LOG_DEBUG_MUTEX, log, 0, args) -#define ndk_log_debug_event(log,args...) ngx_log_debug (NGX_LOG_DEBUG_EVENT, log, 0, args) -#define ndk_log_debug_http(log,args...) ngx_log_debug (NGX_LOG_DEBUG_HTTP, log, 0, args) -#define ndk_log_debug_mail(log,args...) ngx_log_debug (NGX_LOG_DEBUG_MAIL, log, 0, args) -#define ndk_log_debug_mysql(log,args...) ngx_log_debug (NGX_LOG_DEBUG_MYSQL, log, 0, args) -#define ndk_log_debug_script(log,args...) ngx_log_debug (NGX_LOG_DEBUG_SCRIPT, log, 0, args) - -#define ndk_conf_log_stderr(cf,args...) ngx_conf_log_error (NGX_LOG_STDERR, cf, 0, args) -#define ndk_conf_log_emerg(cf,args...) ngx_conf_log_error (NGX_LOG_EMERG, cf, 0, args) -#define ndk_conf_log_alert(cf,args...) ngx_conf_log_error (NGX_LOG_ALERT, cf, 0, args) -#define ndk_conf_log_crit(cf,args...) ngx_conf_log_error (NGX_LOG_CRIT, cf, 0, args) -#define ndk_conf_log_err(cf,args...) ngx_conf_log_error (NGX_LOG_ERR, cf, 0, args) -#define ndk_conf_log_warning(cf,args...) ngx_conf_log_error (NGX_LOG_WARN, cf, 0, args) -#define ndk_conf_log_notice(cf,args...) ngx_conf_log_error (NGX_LOG_NOTICE, cf, 0, args) -#define ndk_conf_log_info(cf,args...) ngx_conf_log_error (NGX_LOG_INFO, cf, 0, args) - -#define ndk_conf_log_debug_core(r,args...) ndk_log_debug_core (ndk_conf_to_log(r), args) -#define ndk_conf_log_debug_alloc(r,args...) ndk_log_debug_alloc (ndk_conf_to_log(r), args) -#define ndk_conf_log_debug_mutex(r,args...) ndk_log_debug_mutex (ndk_conf_to_log(r), args) -#define ndk_conf_log_debug_event(r,args...) ndk_log_debug_event (ndk_conf_to_log(r), args) -#define ndk_conf_log_debug_http(r,args...) ndk_log_debug_http (ndk_conf_to_log(r), args) -#define ndk_conf_log_debug_mail(r,args...) ndk_log_debug_mail (ndk_conf_to_log(r), args) -#define ndk_conf_log_debug_mysql(r,args...) ndk_log_debug_mysql (ndk_conf_to_log(r), args) -#define ndk_conf_log_debug_script(r,args...) ndk_log_debug_script (ndk_conf_to_log(r), args) - -#define ndk_request_log_stderr(r,args...) ndk_log_stderr (ndk_request_to_log(r), args) -#define ndk_request_log_emerg(r,args...) ndk_log_emerg (ndk_request_to_log(r), args) -#define ndk_request_log_alert(r,args...) ndk_log_alert (ndk_request_to_log(r), args) -#define ndk_request_log_crit(r,args...) ndk_log_crit (ndk_request_to_log(r), args) -#define ndk_request_log_err(r,args...) ndk_log_err (ndk_request_to_log(r), args) -#define ndk_request_log_warning(r,args...) ndk_log_warning (ndk_request_to_log(r), args) -#define ndk_request_log_notice(r,args...) ndk_log_notice (ndk_request_to_log(r), args) -#define ndk_request_log_info(r,args...) ndk_log_info (ndk_request_to_log(r), args) - -#define ndk_request_log_debug_core(r,args...) ndk_log_debug_core (ndk_request_to_log(r), args) -#define ndk_request_log_debug_alloc(r,args...) ndk_log_debug_alloc (ndk_request_to_log(r), args) -#define ndk_request_log_debug_mutex(r,args...) ndk_log_debug_mutex (ndk_request_to_log(r), args) -#define ndk_request_log_debug_event(r,args...) ndk_log_debug_event (ndk_request_to_log(r), args) -#define ndk_request_log_debug_http(r,args...) ndk_log_debug_http (ndk_request_to_log(r), args) -#define ndk_request_log_debug_mail(r,args...) ndk_log_debug_mail (ndk_request_to_log(r), args) -#define ndk_request_log_debug_mysql(r,args...) ndk_log_debug_mysql (ndk_request_to_log(r), args) -#define ndk_request_log_debug_script(r,args...) ndk_log_debug_script (ndk_request_to_log(r), args) - -/*********************************/ - -#else /* NO VARIADIC MACROS */ - -/* #warning does not work on Windows */ -#pragma message("Nginx Devel Kit logging without variadic macros not yet implemented") - -#endif /* VARIADIC MACROS */ diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_parse.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_parse.h deleted file mode 100644 index 7c43e14..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_parse.h +++ /dev/null @@ -1,67 +0,0 @@ - - - -#if (NGX_HAVE_LITTLE_ENDIAN && NGX_HAVE_NONALIGNED) - -#define ndk_str3_cmp(m, c0, c1, c2, c3) \ - *(uint32_t *) m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0) - -#define ndk_str3Ocmp(m, c0, c1, c2, c3) \ - *(uint32_t *) m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0) - -#define ndk_str4cmp(m, c0, c1, c2, c3) \ - *(uint32_t *) m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0) - -#define ndk_str5cmp(m, c0, c1, c2, c3, c4) \ - *(uint32_t *) m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0) \ - && m[4] == c4 - -#define ndk_str6cmp(m, c0, c1, c2, c3, c4, c5) \ - *(uint32_t *) m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0) \ - && (((uint32_t *) m)[1] & 0xffff) == ((c5 << 8) | c4) - -#define ndk_str7_cmp(m, c0, c1, c2, c3, c4, c5, c6, c7) \ - *(uint32_t *) m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0) \ - && ((uint32_t *) m)[1] == ((c7 << 24) | (c6 << 16) | (c5 << 8) | c4) - -#define ndk_str8cmp(m, c0, c1, c2, c3, c4, c5, c6, c7) \ - *(uint32_t *) m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0) \ - && ((uint32_t *) m)[1] == ((c7 << 24) | (c6 << 16) | (c5 << 8) | c4) - -#define ndk_str9cmp(m, c0, c1, c2, c3, c4, c5, c6, c7, c8) \ - *(uint32_t *) m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0) \ - && ((uint32_t *) m)[1] == ((c7 << 24) | (c6 << 16) | (c5 << 8) | c4) \ - && m[8] == c8 - -#else /* !(NGX_HAVE_LITTLE_ENDIAN && NGX_HAVE_NONALIGNED) */ - -#define ndk_str3_cmp(m, c0, c1, c2, c3) \ - m[0] == c0 && m[1] == c1 && m[2] == c2 - -#define ndk_str3Ocmp(m, c0, c1, c2, c3) \ - m[0] == c0 && m[2] == c2 && m[3] == c3 - -#define ndk_str4cmp(m, c0, c1, c2, c3) \ - m[0] == c0 && m[1] == c1 && m[2] == c2 && m[3] == c3 - -#define ndk_str5cmp(m, c0, c1, c2, c3, c4) \ - m[0] == c0 && m[1] == c1 && m[2] == c2 && m[3] == c3 && m[4] == c4 - -#define ndk_str6cmp(m, c0, c1, c2, c3, c4, c5) \ - m[0] == c0 && m[1] == c1 && m[2] == c2 && m[3] == c3 \ - && m[4] == c4 && m[5] == c5 - -#define ndk_str7_cmp(m, c0, c1, c2, c3, c4, c5, c6, c7) \ - m[0] == c0 && m[1] == c1 && m[2] == c2 && m[3] == c3 \ - && m[4] == c4 && m[5] == c5 && m[6] == c6 - -#define ndk_str8cmp(m, c0, c1, c2, c3, c4, c5, c6, c7) \ - m[0] == c0 && m[1] == c1 && m[2] == c2 && m[3] == c3 \ - && m[4] == c4 && m[5] == c5 && m[6] == c6 && m[7] == c7 - -#define ndk_str9cmp(m, c0, c1, c2, c3, c4, c5, c6, c7, c8) \ - m[0] == c0 && m[1] == c1 && m[2] == c2 && m[3] == c3 \ - && m[4] == c4 && m[5] == c5 && m[6] == c6 && m[7] == c7 && m[8] == c8 - -#endif - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_path.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_path.c deleted file mode 100644 index 0b7c266..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_path.c +++ /dev/null @@ -1,583 +0,0 @@ - - - -/* This function cleans a path to its most basic form, performing the following transformations : - * - * - ./ -> [empty] - * - // -> / - * - /base/parent/../ -> /base/ - * - * If possible, it leaves the original string in place and does not copy characters, otherwise - * characters are copied. -*/ - -void -ndk_clean_path (ngx_str_t *path, ngx_uint_t complex, size_t off) -{ - u_char *s, *p, *m, *e, c, *l; - ngx_uint_t root; - - if (path->len == 1) { - - if (path->data[0] == '.') { - path->len = 0; - } - - return; - } - - /* strip initial './' */ - - s = path->data; - e = s + path->len; - - if (off) { - p = s + off; - goto check_basic; - } - - if (*s == '/') - root = 1; - else - root = 0; - - while (s < e) { - - switch (*s) { - - case '/' : - - /* '//' => '/' */ - - s++; - continue; - - case '.' : - - if (s == e-1) { - - if (root) { - path->data[0] = '/'; - path->len = 1; - } else { - path->len = 0; - } - - return; - } - - /* './' => '' */ - - if (s[1] == '/') { - - s += 2; - - if (s == e) { - - path->len = 0; - return; - } - - continue; - } - } - - break; - } - - if (root && *s != '/') { - s--; - } - - p = s; - -check_basic : - - for ( ; p '/' */ - - m = p + 2; - goto copy; - - case '.' : - - if (e - p == 2) - break; - - switch (p[2]) { - - case '/' : - - /* './' => '' */ - - m = p + 2; - goto copy; - - case '.' : - - if (e - p == 3 || p[3] == '/') { - - if (p == s) { - - s += 3; - continue; - } - - if (p - s >= 2) { - - if (p[-1] == '.' && p[-2] == '.') { - - if (p - s == 2 || p[-3] == '/') { /* = '../../' */ - - p += 2; /* 3? */ - continue; - } - } - } - - m = p + 4; - - if (complex) { - - for (p--; p >= s; p--) { - - switch (*p) { - - case '/' : - goto copy; - - case '$' : - - p = m - 1; - - if (m == e) - goto end_basic; - - goto new_dir_first; - } - } - - } else { - - for (p--; p > s; p--) { - - /* '/path/folder/../' => '/path/' */ - - if (*p == '/') - break; - } - } - - goto copy; - } - } - } - } - } - -end_basic : - - path->data = s; - path->len = p - s; - - return; - -copy : - - p++; - - if (m < e) - goto new_dir; - - while (m < e) { - - c = *m; - *p = c; - p++; - - if (c == '/') { - - m++; - - new_dir : - - for ( ; m '' */ - - m += 2; - if (m == e) - break; - - goto new_dir; - - case '.' : - - if (e - m == 2 || m[2] == '/') { - - if (m - s >= 3) { /* NOTE : this is one higher than above because m has moved on 1 */ - - if (p[-2] == '.' && p[-3] == '.') { - - if (m - s == 3 || p[-4] == '/') { /* = '../../' */ - - p[0] = '.'; - p[1] = '.'; - p[2] = '/'; - p += 3; - m += 3; - goto new_dir; - } - } - } - - if (complex) { - - l = p; - - for (p -= 2; p >= s; p--) { - - switch (*p) { - - case '/' : - break; - - case '$' : - - l[0] = '.'; - l[1] = '.'; - l[2] = '/'; - p = l + 4; - break; - - default : - continue; - } - - break; - } - - m += 3; - if (m == e) - goto end; - - goto new_dir; - - } else { - - for (p -= 2; p > s; p--) { - - /* '/path/folder/../' => '/path/' */ - - if (*p == '/') - break; - } - - m += 3; - if (m == e) - goto end; - - goto new_dir; - } - } - } - } - - } else { - m++; - } - } - -end : - - path->data = s; - path->len = p - s; -} - - -/* This function converts a path to its directory version, and assumes that there is always space - * to allocatate an extra character on the end (which is only true if the provided strings always - * have NULL's at the end (hence the 'safe'). -*/ - -void -ndk_path_to_dir_safe (ngx_str_t *path, ngx_uint_t complex, size_t off) -{ - size_t len; - u_char *p, *m; - - ndk_clean_path (path, complex, off); - - len = path->len; - if (!len) - return; - - p = path->data; - m = p + len - 1; - - if (*m != '/') { - - p [len] = '/'; - path->len++; - } -} - - -/* Divides a path given by path/to/path1:path/to/path2 into separate strings and returns an - * array of these strings. -*/ - -ngx_array_t * -ndk_split_path_create (ngx_conf_t *cf, ngx_str_t *path) -{ - ngx_str_t *str; - int n; - u_char *m, *s, *e; - ngx_array_t *a; - - if (path == NULL) - return NULL; - - n = ndk_strcntc (path, ':'); - - a = ngx_array_create (cf->pool, n + 1, sizeof (ngx_str_t)); - if (a == NULL) { - return NULL; - } - - s = path->data; - e = s + path->len; - - while (s < e) { - - m = s; - - while (m < e && *m != ':') m++; - - if (m == s) { - s = m+1; - continue; - } - - str = ngx_array_push (a); - if (str == NULL) { - return NULL; - } - - str->data = s; - str->len = m - s; - - if (ngx_conf_full_name (cf->cycle, str, 0) == NGX_ERROR) - return NULL; - - s = m+1; - } - - return a; -} - - - -ngx_array_t * -ndk_split_path_create_raw (ngx_conf_t *cf, char *path) -{ - ngx_str_t *str; - int n; - char *m, *s; - ngx_array_t *a; - - if (path == NULL) - return NULL; - - n = ndk_strccnt (path, ':'); - - a = ngx_array_create (cf->pool, n + 1, sizeof (ngx_str_t)); - if (a == NULL) { - return NULL; - } - - s = path; - - - while (*s != '\0') { - - m = s; - - while (*m != '\0' && *m != ':') m++; - - if (m == s) { - s = m+1; - continue; - } - - str = ngx_array_push (a); - if (str == NULL) { - return NULL; - } - - str->data = (u_char *) s; - str->len = m - s; - - if (ngx_conf_full_name (cf->cycle, str, 0) == NGX_ERROR) - return NULL; - - if (*m == '\0') - break; - - s = m+1; - } - - return a; -} - - - -char * -ndk_conf_set_full_path_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ngx_str_t *path, *value; - ngx_conf_post_t *post; - - path = (ngx_str_t *) (p + cmd->offset); - - if (path->data) { - return "is duplicate"; - } - - value = cf->args->elts; - - *path = value[1]; - - if (ngx_conf_full_name (cf->cycle, path, 0) == NGX_ERROR) - return NGX_CONF_ERROR; - - if (cmd->post) { - post = cmd->post; - return post->post_handler(cf, post, path); - } - - return NGX_CONF_OK; -} - - - -char * -ndk_conf_set_split_path_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - /* TODO : change to use the path func above */ - - char *p = conf; - - ngx_str_t *value, *str; - ngx_array_t **a; - ngx_conf_post_t *post; - int n; - u_char *m, *s, *e; - - a = (ngx_array_t **) (p + cmd->offset); - - if (*a != NGX_CONF_UNSET_PTR) { - return "is duplicate"; - } - - value = cf->args->elts; - value++; - - n = ndk_strcntc (value, ':') + 1; - - *a = ngx_array_create (cf->pool, n, sizeof (ngx_str_t)); - if (*a == NULL) { - return NGX_CONF_ERROR; - } - - s = value->data; - e = s + value->len; - - while (s < e) { - - m = s; - - while (m < e && *m != ':') m++; - - if (m == s) { - s = m+1; - continue; - } - - str = ngx_array_push (*a); - if (str == NULL) { - return NGX_CONF_ERROR; - } - - str->data = s; - str->len = m - s; - - if (ngx_conf_full_name (cf->cycle, str, 0) == NGX_ERROR) - return NGX_CONF_ERROR; - - s = m+1; - } - - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, a); - } - - return NGX_CONF_OK; -} - - - -char * -ndk_conf_set_full_path (ngx_conf_t *cf, void *data, ngx_str_t *path) -{ - if (ngx_conf_full_name (cf->cycle, path, 0) == NGX_ERROR) - return NGX_CONF_ERROR; - - return NGX_CONF_OK; -} - - - -char * -ndk_conf_set_full_conf_path (ngx_conf_t *cf, void *data, ngx_str_t *path) -{ - if (ngx_conf_full_name (cf->cycle, path, 1) == NGX_ERROR) - return NGX_CONF_ERROR; - - return NGX_CONF_OK; -} - - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_path.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_path.h deleted file mode 100644 index 22ba945..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_path.h +++ /dev/null @@ -1,22 +0,0 @@ - - -/* path conversion functions */ - -void ndk_clean_path (ngx_str_t *path, ngx_uint_t complex, size_t off); -void ndk_path_to_dir_safe (ngx_str_t *path, ngx_uint_t complex, size_t off); - -/* path create functions */ - -ngx_array_t * ndk_split_path_create (ngx_conf_t *cf, ngx_str_t *path); -ngx_array_t * ndk_split_path_create_raw (ngx_conf_t *cf, char *path); - -/* conf set functions */ - -char * ndk_conf_set_full_path_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_split_path_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); - -/* conf set post functions */ - -char * ndk_conf_set_full_path (ngx_conf_t *cf, void *data, ngx_str_t *path); -char * ndk_conf_set_full_conf_path (ngx_conf_t *cf, void *data, ngx_str_t *path); - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_process.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_process.c deleted file mode 100644 index fbc789c..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_process.c +++ /dev/null @@ -1,20 +0,0 @@ - -ngx_int_t -ndk_init_signals (ngx_signal_t *sig, ngx_log_t *log) -{ - struct sigaction sa; - - for ( ; sig->signo != 0; sig++) { - ndk_zerov (sa); - sa.sa_handler = sig->handler; - sigemptyset (&sa.sa_mask); - - if (sigaction (sig->signo, &sa, NULL) == -1) { - ngx_log_error (NGX_LOG_EMERG, log, ngx_errno, - "sigaction(%s) failed", sig->signame); - return NGX_ERROR; - } - } - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_process.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_process.h deleted file mode 100644 index 7ac1d99..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_process.h +++ /dev/null @@ -1,12 +0,0 @@ - - -typedef struct { - int signo; - char *signame; - char *name; - void (*handler)(int signo); -} ngx_signal_t; - - -ngx_int_t ndk_init_signals (ngx_signal_t *sig, ngx_log_t *log); - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_regex.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_regex.c deleted file mode 100644 index c1efd86..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_regex.c +++ /dev/null @@ -1,215 +0,0 @@ - - -char * -ndk_conf_set_regex_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ngx_str_t *value; - ngx_conf_post_t *post; - ngx_regex_elt_t *re; - ngx_regex_compile_t rc; - u_char errstr[NGX_MAX_CONF_ERRSTR]; - - re = (ngx_regex_elt_t *) (p + cmd->offset); - - if (re->name) { - return "is duplicate"; - } - - value = cf->args->elts; - value++; - - ndk_zerov (rc); - - rc.pool = cf->pool; - rc.err.len = NGX_MAX_CONF_ERRSTR; - rc.err.data = errstr; - rc.pattern = *value; - - if (ngx_regex_compile(&rc) != NGX_OK) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "%V", &rc.err); - return NGX_CONF_ERROR; - } - - re->regex = rc.regex; - re->name = value->data; - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, re); - } - - return NGX_CONF_OK; -} - - -char * -ndk_conf_set_regex_caseless_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ngx_str_t *value; - ngx_conf_post_t *post; - ngx_regex_elt_t *re; - ngx_regex_compile_t rc; - u_char errstr[NGX_MAX_CONF_ERRSTR]; - - re = (ngx_regex_elt_t *) (p + cmd->offset); - - if (re->name) { - return "is duplicate"; - } - - value = cf->args->elts; - value++; - - ndk_zerov (rc); - - rc.pool = cf->pool; - rc.err.len = NGX_MAX_CONF_ERRSTR; - rc.err.data = errstr; - rc.pattern = *value; - rc.options = NGX_REGEX_CASELESS; - - if (ngx_regex_compile(&rc) != NGX_OK) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "%V", &rc.err); - return NGX_CONF_ERROR; - } - - re->regex = rc.regex; - re->name = value->data; - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, re); - } - - return NGX_CONF_OK; -} - - - -char * -ndk_conf_set_regex_array_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ngx_str_t *value; - ngx_conf_post_t *post; - ngx_array_t **a; - ngx_regex_elt_t *re; - ngx_regex_compile_t rc; - ngx_uint_t i, n = 0; - u_char errstr[NGX_MAX_CONF_ERRSTR]; - - a = (ngx_array_t **) (p + cmd->offset); - - if (*a != NGX_CONF_UNSET_PTR) { - - n = cf->args->nelts > 4 ? cf->args->nelts : 4; - - *a = ngx_array_create (cf->pool, n, sizeof (ngx_regex_elt_t)); - if (*a == NULL) { - return NGX_CONF_ERROR; - } - } - - ndk_zerov (rc); - - rc.pool = cf->pool; - rc.err.len = NGX_MAX_CONF_ERRSTR; - rc.err.data = errstr; - - value = cf->args->elts; - value++; - - for (i=0; iregex = rc.regex; - re->name = value->data; - } - - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, a); - } - - return NGX_CONF_OK; -} - - - -char * -ndk_conf_set_regex_array_caseless_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - char *p = conf; - - ngx_str_t *value; - ngx_conf_post_t *post; - ngx_array_t **a; - ngx_regex_elt_t *re; - ngx_regex_compile_t rc; - ngx_uint_t i, n = 0; - u_char errstr[NGX_MAX_CONF_ERRSTR]; - - a = (ngx_array_t **) (p + cmd->offset); - - if (*a != NGX_CONF_UNSET_PTR) { - - n = cf->args->nelts > 4 ? cf->args->nelts : 4; - - *a = ngx_array_create (cf->pool, n, sizeof (ngx_regex_elt_t)); - if (*a == NULL) { - return NGX_CONF_ERROR; - } - } - - ndk_zerov (rc); - - rc.pool = cf->pool; - rc.err.len = NGX_MAX_CONF_ERRSTR; - rc.err.data = errstr; - - value = cf->args->elts; - value++; - - for (i=0; iregex = rc.regex; - re->name = value->data; - } - - - if (cmd->post) { - post = cmd->post; - return post->post_handler (cf, post, a); - } - - return NGX_CONF_OK; -} - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_regex.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_regex.h deleted file mode 100644 index 4319b04..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_regex.h +++ /dev/null @@ -1,7 +0,0 @@ - - -char * ndk_conf_set_regex_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_regex_caseless_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_regex_array_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_conf_set_regex_array_caseless_slot (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_rewrite.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_rewrite.c deleted file mode 100644 index 77ce9f8..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_rewrite.c +++ /dev/null @@ -1,103 +0,0 @@ - - -/* these have been taken from the rewrite module and http_script file - * because those functions are defined as being static - a patch will - * be provided later to un-define them as being static - */ - - -uintptr_t ndk_http_script_exit_code = (uintptr_t) NULL; - - -char * -ndk_http_rewrite_value (ngx_conf_t *cf, ndk_http_rewrite_loc_conf_t *lcf, - ngx_str_t *value) -{ - ngx_int_t n; - ngx_http_script_compile_t sc; - ngx_http_script_value_code_t *val; - ngx_http_script_complex_value_code_t *complex; - - n = ngx_http_script_variables_count(value); - - if (n == 0) { - val = ngx_http_script_start_code(cf->pool, &lcf->codes, - sizeof(ngx_http_script_value_code_t)); - if (val == NULL) { - return NGX_CONF_ERROR; - } - - n = ngx_atoi(value->data, value->len); - - if (n == NGX_ERROR) { - n = 0; - } - - val->code = ngx_http_script_value_code; - val->value = (uintptr_t) n; - val->text_len = (uintptr_t) value->len; - val->text_data = (uintptr_t) value->data; - - return NGX_CONF_OK; - } - - complex = ngx_http_script_start_code(cf->pool, &lcf->codes, - sizeof(ngx_http_script_complex_value_code_t)); - if (complex == NULL) { - return NGX_CONF_ERROR; - } - - complex->code = ngx_http_script_complex_value_code; - complex->lengths = NULL; - - ngx_memzero(&sc, sizeof(ngx_http_script_compile_t)); - - sc.cf = cf; - sc.source = value; - sc.lengths = &complex->lengths; - sc.values = &lcf->codes; - sc.variables = n; - sc.complete_lengths = 1; - - if (ngx_http_script_compile(&sc) != NGX_OK) { - return NGX_CONF_ERROR; - } - - return NGX_CONF_OK; -} - - -ngx_int_t -ndk_http_rewrite_var (ngx_http_request_t *r, ngx_http_variable_value_t *v, - uintptr_t data) -{ - ngx_http_variable_t *var; - ngx_http_core_main_conf_t *cmcf; - ndk_http_rewrite_loc_conf_t *rlcf; - - rlcf = ngx_http_get_module_loc_conf(r, ngx_http_rewrite_module); - - if (rlcf->uninitialized_variable_warn == 0) { - *v = ngx_http_variable_null_value; - return NGX_OK; - } - - cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module); - - var = cmcf->variables.elts; - - /* - * the ngx_http_rewrite_module sets variables directly in r->variables, - * and they should be handled by ngx_http_get_indexed_variable(), - * so the handler is called only if the variable is not initialized - */ - - ngx_log_error(NGX_LOG_WARN, r->connection->log, 0, - "using uninitialized \"%V\" variable", &var[data].name); - - *v = ngx_http_variable_null_value; - - return NGX_OK; -} - - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_rewrite.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_rewrite.h deleted file mode 100644 index 2479aa2..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_rewrite.h +++ /dev/null @@ -1,26 +0,0 @@ - - -/* TODO : should remove this when not needed */ - - - -/* used for plugging into the rewrite module (taken from the rewrite module) */ - -typedef struct { - ngx_array_t *codes; /* uintptr_t */ - ngx_uint_t stack_size; - ngx_flag_t log; - ngx_flag_t uninitialized_variable_warn; -} ndk_http_rewrite_loc_conf_t; - - -extern ngx_module_t ngx_http_rewrite_module; -extern uintptr_t ndk_http_script_exit_code; - -char * ndk_http_rewrite_value (ngx_conf_t *cf, ndk_http_rewrite_loc_conf_t *lcf, - ngx_str_t *value); -ngx_int_t ndk_http_rewrite_var (ngx_http_request_t *r, - ngx_http_variable_value_t *v, uintptr_t data); - -#define ndk_http_script_exit (u_char *) &ndk_http_script_exit_code - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_set_var.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_set_var.c deleted file mode 100644 index 388f873..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_set_var.c +++ /dev/null @@ -1,602 +0,0 @@ -#include - - -typedef struct { - ngx_http_script_code_pt code; - void *func; -} ndk_set_var_code_t; - - -typedef struct { - ngx_http_script_code_pt code; - void *func; - size_t size; -} ndk_set_var_size_code_t; - - -typedef struct { - ngx_http_script_code_pt code; - void *func; - void *data; -} ndk_set_var_data_code_t; - - -typedef struct { - ngx_http_script_code_pt code; - void *func; - size_t size; - void *data; -} ndk_set_var_size_data_code_t; - - -typedef struct { - ngx_int_t index; - ngx_str_t *value; - ngx_http_variable_t *v; - ngx_conf_t *cf; - ndk_http_rewrite_loc_conf_t *rlcf; -} ndk_set_var_info_t; - - -static void ndk_set_var_code (ngx_http_script_engine_t *e); -static void ndk_set_var_hash_code (ngx_http_script_engine_t *e); -static void ndk_set_var_value_code (ngx_http_script_engine_t *e); - - -static ngx_inline void -ndk_set_var_code_finalize(ngx_http_script_engine_t *e, ngx_int_t rc, - ngx_http_variable_value_t *v, ngx_str_t *str) -{ - switch (rc) { - - case NGX_OK: - - v->data = str->data; - v->len = str->len; - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0, - "http script value (post filter): \"%v\"", v); - break; - - case NGX_DECLINED: - - v->valid = 0; - v->not_found = 1; - v->no_cacheable = 1; - break; - - case NGX_ERROR: - - e->ip = ndk_http_script_exit; - e->status = NGX_HTTP_INTERNAL_SERVER_ERROR; - break; - } -} - - - -static void -ndk_set_var_code(ngx_http_script_engine_t *e) -{ - ngx_int_t rc; - ngx_str_t str; - ngx_http_variable_value_t *v; - ndk_set_var_code_t *sv; - ndk_set_var_pt func; - - sv = (ndk_set_var_code_t *) e->ip; - - e->ip += sizeof(ndk_set_var_code_t); - - v = e->sp++; - - func = (ndk_set_var_pt) sv->func; - - rc = func(e->request, &str); - - ndk_set_var_code_finalize(e, rc, v, &str); -} - - -static void -ndk_set_var_data_code(ngx_http_script_engine_t *e) -{ - ngx_int_t rc; - ngx_str_t str; - ngx_http_variable_value_t *v; - ndk_set_var_data_code_t *svd; - ndk_set_var_data_pt func; - - svd = (ndk_set_var_data_code_t *) e->ip; - - e->ip += sizeof(ndk_set_var_data_code_t); - - v = e->sp++; - - func = (ndk_set_var_data_pt) svd->func; - - rc = func(e->request, &str, svd->data); - - ndk_set_var_code_finalize(e, rc, v, &str); -} - - -static void -ndk_set_var_value_code(ngx_http_script_engine_t *e) -{ - ngx_int_t rc; - ngx_str_t str; - ngx_http_variable_value_t *v; - ndk_set_var_code_t *sv; - ndk_set_var_value_pt func; - - sv = (ndk_set_var_code_t *) e->ip; - - e->ip += sizeof(ndk_set_var_code_t); - - v = e->sp - 1; - - func = (ndk_set_var_value_pt) sv->func; - - rc = func(e->request, &str, v); - - ndk_set_var_code_finalize(e, rc, v, &str); -} - - -static void -ndk_set_var_value_data_code(ngx_http_script_engine_t *e) -{ - ngx_int_t rc; - ngx_str_t str; - ngx_http_variable_value_t *v; - ndk_set_var_data_code_t *svd; - ndk_set_var_value_data_pt func; - - svd = (ndk_set_var_data_code_t *) e->ip; - - e->ip += sizeof(ndk_set_var_data_code_t); - - v = e->sp - 1; - - func = (ndk_set_var_value_data_pt) svd->func; - - rc = func(e->request, &str, v, svd->data); - - ndk_set_var_code_finalize(e, rc, v, &str); -} - - -static void -ndk_set_var_multi_value_code(ngx_http_script_engine_t *e) -{ - ngx_int_t rc; - ngx_str_t str; - ngx_http_variable_value_t *v; - ndk_set_var_size_code_t *svs; - ndk_set_var_value_pt func; - - svs = (ndk_set_var_size_code_t *) e->ip; - - e->ip += sizeof(ndk_set_var_size_code_t); - - v = e->sp - svs->size; - e->sp = v + 1; - - func = (ndk_set_var_value_pt) svs->func; - - rc = func(e->request, &str, v); - - ndk_set_var_code_finalize(e, rc, v, &str); -} - - -static void -ndk_set_var_multi_value_data_code(ngx_http_script_engine_t *e) -{ - ngx_int_t rc; - ngx_str_t str; - ngx_http_variable_value_t *v; - ndk_set_var_size_data_code_t *svsd; - ndk_set_var_value_data_pt func; - - svsd = (ndk_set_var_size_data_code_t *) e->ip; - - e->ip += sizeof(ndk_set_var_size_data_code_t); - - v = e->sp - svsd->size; - e->sp = v + 1; - - func = (ndk_set_var_value_data_pt) svsd->func; - - rc = func(e->request, &str, v, svsd->data); - - ndk_set_var_code_finalize(e, rc, v, &str); -} - - -static void -ndk_set_var_hash_code(ngx_http_script_engine_t *e) -{ - u_char *p; - ngx_http_variable_value_t *v; - ndk_set_var_size_code_t *svs; - ndk_set_var_hash_pt func; - - svs = (ndk_set_var_size_code_t *) e->ip; - - e->ip += sizeof(ndk_set_var_size_code_t); - - p = ngx_palloc(e->request->pool, svs->size); - if (p == NULL) { - e->ip = ndk_http_script_exit; - e->status = NGX_HTTP_INTERNAL_SERVER_ERROR; - return; - } - - v = e->sp - 1; - - func = (ndk_set_var_hash_pt) svs->func; - - func(p, (char *) v->data, v->len); - - v->data = (u_char *) p; - v->len = svs->size; - - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0, - "http script hashed value: \"%v\"", v); -} - - - -static char * -ndk_set_var_name(ndk_set_var_info_t *info, ngx_str_t *varname) -{ - ngx_int_t index; - ngx_http_variable_t *v; - ngx_conf_t *cf; - ndk_http_rewrite_loc_conf_t *rlcf; - ngx_str_t name; - - name = *varname; - - cf = info->cf; - rlcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_rewrite_module); - - if (name.data[0] != '$') { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid variable name \"%V\"", &name); - return NGX_CONF_ERROR; - } - - name.len--; - name.data++; - - v = ngx_http_add_variable(cf, &name, NGX_HTTP_VAR_CHANGEABLE); - if (v == NULL) { - return NGX_CONF_ERROR; - } - - index = ngx_http_get_variable_index(cf, &name); - if (index == NGX_ERROR) { - return NGX_CONF_ERROR; - } - - if (v->get_handler == NULL - && ngx_strncasecmp(name.data, (u_char *) "arg_", 4) != 0 - && ngx_strncasecmp(name.data, (u_char *) "cookie_", 7) != 0 - && ngx_strncasecmp(name.data, (u_char *) "http_", 5) != 0 - && ngx_strncasecmp(name.data, (u_char *) "sent_http_", 10) != 0 - && ngx_strncasecmp(name.data, (u_char *) "upstream_http_", 14) != 0) - { - v->get_handler = ndk_http_rewrite_var; - v->data = index; - } - - info->v = v; - info->index = index; - info->rlcf = rlcf; - - return NGX_CONF_OK; -} - - - -static void -ndk_set_variable_value_space(ndk_http_rewrite_loc_conf_t *rlcf, ngx_uint_t count) -{ - /* if the number of variable values that will be used is greater than 10, - * make sure there is enough space allocated on the rewrite value stack - */ - - if (count <= 10) - return; - - if (rlcf->stack_size == NGX_CONF_UNSET_UINT) { - rlcf->stack_size = count; - return; - } - - if (rlcf->stack_size < count) - rlcf->stack_size = count; -} - - - -static char * -ndk_set_var_filter(ngx_conf_t *cf, ndk_http_rewrite_loc_conf_t *rlcf, - ndk_set_var_t *filter) -{ - ndk_set_var_code_t *sv; - ndk_set_var_size_code_t *svs; - ndk_set_var_data_code_t *svd; - ndk_set_var_size_data_code_t *svsd; - - if (filter == NULL) { - return "no filter set"; - } - - switch (filter->type) { - case NDK_SET_VAR_BASIC: - - sv = ngx_http_script_start_code(cf->pool, &rlcf->codes, - sizeof(ndk_set_var_code_t)); - if (sv == NULL) { - return NGX_CONF_ERROR; - } - - sv->code = ndk_set_var_code; - sv->func = filter->func; - break; - - case NDK_SET_VAR_DATA: - - svd = ngx_http_script_start_code(cf->pool, &rlcf->codes, - sizeof(ndk_set_var_data_code_t)); - if (svd == NULL) { - return NGX_CONF_ERROR; - } - - svd->code = ndk_set_var_data_code; - svd->func = filter->func; - svd->data = filter->data; - break; - - case NDK_SET_VAR_VALUE: - - sv = ngx_http_script_start_code(cf->pool, &rlcf->codes, - sizeof(ndk_set_var_code_t)); - if (sv == NULL) { - return NGX_CONF_ERROR; - } - - sv->code = ndk_set_var_value_code; - sv->func = filter->func; - break; - - case NDK_SET_VAR_VALUE_DATA: - - svd = ngx_http_script_start_code(cf->pool, &rlcf->codes, - sizeof(ndk_set_var_data_code_t)); - if (svd == NULL) { - return NGX_CONF_ERROR; - } - - svd->code = ndk_set_var_value_data_code; - svd->func = filter->func; - svd->data = filter->data; - break; - - case NDK_SET_VAR_MULTI_VALUE: - - svs = ngx_http_script_start_code(cf->pool, &rlcf->codes, - sizeof(ndk_set_var_size_code_t)); - if (svs == NULL) { - return NGX_CONF_ERROR; - } - - svs->code = ndk_set_var_multi_value_code; - svs->func = filter->func; - svs->size = filter->size; - - ndk_set_variable_value_space(rlcf, svs->size); - break; - - case NDK_SET_VAR_MULTI_VALUE_DATA: - - svsd = ngx_http_script_start_code(cf->pool, &rlcf->codes, - sizeof(ndk_set_var_size_data_code_t)); - if (svsd == NULL) { - return NGX_CONF_ERROR; - } - - svsd->code = ndk_set_var_multi_value_data_code; - svsd->func = filter->func; - svsd->size = filter->size; - svsd->data = filter->data; - - ndk_set_variable_value_space(rlcf, svsd->size); - break; - - - case NDK_SET_VAR_HASH: - - svs = ngx_http_script_start_code(cf->pool, &rlcf->codes, - sizeof(ndk_set_var_size_code_t)); - if (svs == NULL) { - return NGX_CONF_ERROR; - } - - svs->code = ndk_set_var_hash_code; - svs->func = filter->func; - svs->size = filter->size; - break; - - default: - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "invalid filter type \"%ul\"", filter->type); - return NGX_CONF_ERROR; - } - - return NGX_CONF_OK; -} - - -static char * -ndk_set_var_filter_value(ndk_set_var_info_t *info, ndk_set_var_t *filter) -{ - ngx_conf_t *cf; - ngx_http_variable_t *v; - ndk_http_rewrite_loc_conf_t *rlcf; - ngx_http_script_var_code_t *vcode; - ngx_http_script_var_handler_code_t *vhcode; - - v = info->v; - cf = info->cf; - rlcf = info->rlcf; - - if (ndk_set_var_filter(cf, rlcf, filter) != NGX_CONF_OK) { - return NGX_CONF_ERROR; - } - - if (v->set_handler) { - vhcode = ngx_http_script_start_code(cf->pool, &rlcf->codes, - sizeof(ngx_http_script_var_handler_code_t)); - if (vhcode == NULL) { - return NGX_CONF_ERROR; - } - - vhcode->code = ngx_http_script_var_set_handler_code; - vhcode->handler = v->set_handler; - vhcode->data = v->data; - - return NGX_CONF_OK; - } - - vcode = ngx_http_script_start_code(cf->pool, &rlcf->codes, - sizeof(ngx_http_script_var_code_t)); - if (vcode == NULL) { - return NGX_CONF_ERROR; - } - - vcode->code = ngx_http_script_set_var_code; - vcode->index = (uintptr_t) info->index; - - return NGX_CONF_OK; -} - - -char * -ndk_set_var_core(ngx_conf_t *cf, ngx_str_t *name, ndk_set_var_t *filter) -{ - char *p; - ndk_set_var_info_t info; - - info.cf = cf; - - p = ndk_set_var_name(&info, name); - if (p != NGX_CONF_OK) { - return p; - } - - return ndk_set_var_filter_value(&info, filter); -} - - -char * -ndk_set_var_value_core(ngx_conf_t *cf, ngx_str_t *name, ngx_str_t *value, ndk_set_var_t *filter) -{ - char *p; - ndk_set_var_info_t info; - - info.cf = cf; - - p = ndk_set_var_name(&info, name); - if (p != NGX_CONF_OK) { - return p; - } - - p = ndk_http_rewrite_value(cf, info.rlcf, value); - if (p != NGX_CONF_OK) { - return p; - } - - return ndk_set_var_filter_value(&info, filter); -} - - -char * -ndk_set_var_multi_value_core(ngx_conf_t *cf, ngx_str_t *name, - ngx_str_t *value, ndk_set_var_t *filter) -{ - char *p; - ndk_set_var_info_t info; - ngx_int_t i; - - info.cf = cf; - - p = ndk_set_var_name(&info, name); - if (p != NGX_CONF_OK) { - return p; - } - - for (i = filter->size; i; i--, value++) { - - p = ndk_http_rewrite_value(cf, info.rlcf, value); - if (p != NGX_CONF_OK) { - return p; - } - } - - return ndk_set_var_filter_value(&info, filter); -} - - -char * -ndk_set_var(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_str_t *value; - ndk_set_var_t *filter; - - value = cf->args->elts; - value++; - - filter = (ndk_set_var_t *) cmd->post; - - return ndk_set_var_core(cf, value, filter); -} - - -char * -ndk_set_var_value(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_str_t *value; - ndk_set_var_t *filter; - - value = cf->args->elts; - value++; - - filter = (ndk_set_var_t *) cmd->post; - - return ndk_set_var_value_core(cf, value, - cf->args->nelts == 1 + 1 ? value : value + 1, filter); -} - - -char * -ndk_set_var_multi_value(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_str_t *value; - ndk_set_var_t *filter; - - value = cf->args->elts; - value++; - - filter = (ndk_set_var_t *) cmd->post; - - return ndk_set_var_multi_value_core(cf, value, value + 1, filter); -} - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_set_var.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_set_var.h deleted file mode 100644 index 5dcba97..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_set_var.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 2010 (C) Marcus Clyne - */ - -#ifndef _NDK_SET_VAR_H_INCLUDED_ -#define _NDK_SET_VAR_H_INCLUDED_ - - -typedef ngx_int_t (*ndk_set_var_pt) (ngx_http_request_t *r, ngx_str_t *val); -typedef ngx_int_t (*ndk_set_var_data_pt) (ngx_http_request_t *r, ngx_str_t *val, void *data); -typedef ngx_int_t (*ndk_set_var_value_pt) (ngx_http_request_t *r, ngx_str_t *val, ngx_http_variable_value_t *v); -typedef ngx_int_t (*ndk_set_var_value_data_pt) (ngx_http_request_t *r, ngx_str_t *val, ngx_http_variable_value_t *v, void *data); -typedef void (*ndk_set_var_hash_pt) (u_char *p, char *data, size_t len); - - -typedef struct { - ngx_uint_t type; - void *func; - size_t size; - void *data; -} ndk_set_var_t; - - -enum { - NDK_SET_VAR_BASIC = 0, - NDK_SET_VAR_DATA, - NDK_SET_VAR_VALUE, - NDK_SET_VAR_VALUE_DATA, - NDK_SET_VAR_MULTI_VALUE, - NDK_SET_VAR_MULTI_VALUE_DATA, - NDK_SET_VAR_HASH -}; - - -char * ndk_set_var (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_set_var_value (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -char * ndk_set_var_multi_value (ngx_conf_t *cf, ngx_command_t *cmd, void *conf); - - -char * ndk_set_var_core (ngx_conf_t *cf, ngx_str_t *name, ndk_set_var_t *filter); -char * ndk_set_var_value_core (ngx_conf_t *cf, ngx_str_t *name, ngx_str_t *value, ndk_set_var_t *filter); -char * ndk_set_var_multi_value_core (ngx_conf_t *cf, ngx_str_t *name, ngx_str_t *value, ndk_set_var_t *filter); - -#endif /* _NDK_SET_VAR_H_INCLUDED_ */ diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_string.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_string.c deleted file mode 100644 index 7c2a965..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_string.c +++ /dev/null @@ -1,434 +0,0 @@ - - -int64_t -ndk_atoi64 (u_char *line, size_t n) -{ - int64_t value; - - if (n == 0ll) { - return NGX_ERROR; - } - - for (value = 0ll; n--; line++) { - if (*line < '0' || *line > '9') { - return NGX_ERROR; - } - - value = value * 10ll + (*line - '0'); - } - - if (value < 0ll) { - return NGX_ERROR; - } - - return value; -} - - -ngx_int_t -ndk_strcntc (ngx_str_t *s, char c) -{ - ngx_int_t n; - size_t i; - u_char *p; - - i = s->len; - p = s->data; - - for (n=0; i; i--, p++) { - - if (*p == (u_char) c) - n++; - } - - return n; -} - - -ngx_int_t -ndk_strccnt (char *s, char c) -{ - ngx_int_t n; - - n = 0; - - while (*s != '\0') { - - if (*s == 'c') - n++; - - s++; - } - - return n; -} - - - -ngx_array_t * -ndk_str_array_create (ngx_pool_t *pool, char **s, ngx_int_t n) -{ - ngx_int_t i; - ngx_str_t *str; - ngx_array_t *a; - - a = ngx_array_create (pool, n, sizeof (ngx_str_t)); - if (a == NULL) - return NULL; - - - for (i=0; idata = (u_char *) *s; - str->len = strlen (*s); - } - - return a; -} - - - -u_char * -ndk_vcatstrf (ngx_pool_t *pool, ngx_str_t *dest, const char *fmt, va_list args) -{ - size_t len, l, el; - int argc; - u_char *p, *m, *e, c, c1, *cp; - - argc = strlen (fmt); - - ngx_str_t *s; - ndk_estr_t *sp, *sp2, ss [argc]; - u_char cs [argc]; - - sp = sp2 = ss; - cp = cs; - - len = 0; - - /* TODO : maybe have 'e' at the beginning? */ - - /* parse format to get strings */ - - while (*fmt) { - - switch (*fmt) { - - case 'S' : - - s = va_arg (args, ngx_str_t *); - - sp->data = s->data; - sp->len = s->len; - sp->escaped = 0; - - len += sp->len; - break; - - case 's' : - - sp->data = va_arg (args, u_char *); - sp->len = (size_t) ngx_strlen (sp->data); - sp->escaped = 0; - - len += sp->len; - break; - - case 'l' : - - sp->data = va_arg (args, u_char *); - sp->len = (size_t) va_arg (args, int); - sp->escaped = 0; - - len += sp->len; - break; - - case 'L' : - - sp->data = va_arg (args, u_char *); - sp->len = va_arg (args, size_t); - sp->escaped = 0; - - len += sp->len; - break; - - case 'e' : - - p = va_arg (args, u_char *); - - sp->data = p; - - l = 0; - el = 0; - c = *p; - - while (c != '\0') { - - if (c == '\\') { - l += 2; - p += 2; - } else { - l++; - p++; - } - - el++; - c = *p; - } - - sp->len = l; - sp->escaped = 1; - - len += el; - break; - - case 'E' : - - s = va_arg (args, ngx_str_t *); - - sp->data = s->data; - sp->len = s->len; - - p = sp->data; - - el = 0; - e = p + sp->len; - - while (p < e) { - - c = *p; - - if (c == '\\') { - p += 2; - } else { - p++; - } - - el++; - } - - sp->escaped = 1; - - len += el; - break; - - case 'n' : - - sp->data = va_arg (args, u_char *); - sp->len = (size_t) va_arg (args, int); - - p = sp->data; - - el = 0; - e = p + sp->len; - - while (p < e) { - - c = *p; - - if (c == '\\') { - p += 2; - } else { - p++; - } - - el++; - } - - sp->escaped = 1; - - len += el; - break; - - case 'c' : - - *cp = (u_char) va_arg (args, int); - - sp->data = cp; - sp->len = (size_t) 1; - - len++; - cp++; - - break; - - default : - - ndk_log_alert (pool->log, 0, "catstrf () : format [%s] incorrect", fmt); - - return NULL; - - } - - sp++; - fmt++; - } - - - - /* create space for string (assumes no NULL's in strings) */ - - ndk_palloc_rn (p, pool, len + 1); - - dest->data = p; - dest->len = len; - - /* copy other strings */ - - if (len) { - - while (sp2 < sp) { - - if (sp2->escaped) { - - m = sp2->data; - e = m + sp2->len; - - while (m < e) { - - c = *m; - - if (c == '\\') { - - if (m == e - 1) { - *p = '\\'; - p++; - break; - } - - c1 = m[1]; - - switch (c1) { - - case 'n' : - *p = '\n'; - break; - - case 't' : - *p = '\t'; - break; - - case '0' : - *p = '\0'; - break; - - case '\\' : - *p = '\\'; - break; - - case 's' : - *p = ' '; - break; - - case 'b' : - *p = '\b'; - break; - - case 'r' : - *p = '\r'; - break; - - default : - - *p = c1; - break; - } - - m += 2; - - } else { - - *p = c; - m++; - } - - p++; - } - - } else { - - p = ngx_cpymem (p, sp2->data, sp2->len); - } - - sp2++; - } - } - - *p = '\0'; - - return dest->data; -} - - -u_char * -ndk_catstrf (ngx_pool_t *pool, ngx_str_t *dest, const char *fmt, ...) -{ - u_char *p; - va_list args; - - va_start (args, fmt); - p = ndk_vcatstrf (pool, dest, fmt, args); - va_end (args); - - return p; -} - - -ngx_int_t -ndk_cmpstr (ngx_str_t *s1, ngx_str_t *s2) -{ - ngx_int_t rv; - size_t len1, len2; - - len1 = s1->len; - len2 = s2->len; - - if (len1 == len2) { - return ngx_strncmp (s1->data, s2->data, len1); - } - - if (len1 > len2) { - - rv = ngx_strncmp (s1->data, s2->data, len2); - if (rv == 0) - return 1; - - return rv; - } - - rv = ngx_strncmp (s1->data, s2->data, len1); - if (rv == 0) - return -1; - - return rv; -} - - -u_char * -ndk_dupstr (ngx_pool_t *pool, ngx_str_t *dest, ngx_str_t *src) -{ - u_char *d; - size_t n; - - n = src->len; - - ndk_palloc_rn (d, pool, n + 1); - ndk_strncpy (d, src->data, n); - - dest->data = d; - dest->len = n; - - return d; -} - -/* -ngx_keyval_t * -ndk_url_args_to_keyval_list (ngx_pool_t *pool, ngx_str_t *str) -{ - ngx_keyval_t *kv; - ngx_st - -} -*/ diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_string.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_string.h deleted file mode 100644 index ecd21c4..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_string.h +++ /dev/null @@ -1,37 +0,0 @@ - - -#if 1 -/* TODO : set ndk_hex_dump for older versions of Nginx */ -#define ndk_hex_dump ngx_hex_dump -#endif - -typedef struct { - size_t len; - u_char *data; - ngx_flag_t escaped; -} ndk_estr_t; - -int64_t ndk_atoi64 (u_char *line, size_t n); - -ngx_int_t ndk_strcntc (ngx_str_t *s, char c); -ngx_int_t ndk_strccnt (char *s, char c); -ngx_array_t * ndk_str_array_create (ngx_pool_t *pool, char **s, ngx_int_t n); -u_char * ndk_catstrf (ngx_pool_t *pool, ngx_str_t *dest, const char *fmt, ...); -ngx_int_t ndk_cmpstr (ngx_str_t *s1, ngx_str_t *s2); -u_char * ndk_dupstr (ngx_pool_t *pool, ngx_str_t *dest, ngx_str_t *src); - -static ngx_inline void -ndk_strtoupper (u_char *p, size_t len) -{ - u_char *e = p + len; - for ( ; pdata = (u_char*) s; (ns)->len = sizeof (s) - 1;} - -#define ndk_zero(p,sz) memset (p,'\0',sz) -#define ndk_zerop(p) ndk_zero (p,sizeof(*p)) -#define ndk_zeropn(p,n) ndk_zero (p,sizeof(*p)*(n)) -#define ndk_zerov(v) ndk_zero (&v,sizeof(v)) - -#define ngx_null_enum { ngx_null_string, 0 } - -#define ndk_memcpyp(d,s) ngx_memcpy(d,s,sizeof(*s)) - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_upstream_list.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_upstream_list.c deleted file mode 100644 index 3a83a25..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_upstream_list.c +++ /dev/null @@ -1,205 +0,0 @@ - - -/* TODO : generalize this into a generic list module, with weight */ - - -typedef struct { - ngx_uint_t weight; - ngx_str_t s; - ngx_conf_t *cf; -} ndk_upstream_list_parse_t; - - - -static ngx_int_t -ndk_upstream_list_parse_weight (ndk_upstream_list_parse_t *ulp) -{ - size_t i; - ngx_str_t *s; - - s = &ulp->s; - - for (i=0; ilen; i++) { - - if (s->data[i] < '0' || s->data[i] > '9') - break; - } - - if (!i) { - ulp->weight = 1; - return NGX_OK; - } - - if (i == s->len) { - ngx_conf_log_error (NGX_LOG_EMERG, ulp->cf, 0, - "upstream list just consists of number \"%V\"", s); - - return NGX_ERROR; - } - - if (s->data[i] != ':') { - ngx_conf_log_error (NGX_LOG_EMERG, ulp->cf, 0, - "upstream list not correct format \"%V\"", s); - - return NGX_ERROR; - } - - - ulp->weight = ngx_atoi (s->data, i); - - s->data += (i + 1); - s->len -= (i + 1); - - return NGX_OK; -} - - - -static char * -ndk_upstream_list (ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - /* TODO : change this for getting upstream pointer if available */ - - ngx_uint_t buckets, count, i, j; - ngx_str_t *value, **bucket, *us; - ngx_array_t *ula; - ndk_upstream_list_t *ul, *ule; - ndk_upstream_list_parse_t ulp; - - ndk_http_main_conf_t *mcf; - - mcf = ngx_http_conf_get_module_main_conf (cf, ndk_http_module); - - ula = mcf->upstreams; - - /* create array of upstream lists it doesn't already exist */ - - if (ula == NULL) { - - ula = ngx_array_create (cf->pool, 4, sizeof (ndk_upstream_list_t)); - if (ula == NULL) - return NGX_CONF_ERROR; - - mcf->upstreams = ula; - } - - - /* check to see if the list already exists */ - - value = cf->args->elts; - value++; - - ul = ula->elts; - ule = ul + ula->nelts; - - for ( ; ulname.len == value->len && - ngx_strncasecmp (ul->name.data, value->data, value->len) == 0) { - - ngx_conf_log_error (NGX_LOG_EMERG, cf, 0, - "duplicate upstream list name \"%V\"", value); - - return NGX_CONF_ERROR; - } - } - - - /* create a new list */ - - ul = ngx_array_push (ula); - if (ul == NULL) - return NGX_CONF_ERROR; - - ul->name = *value; - - - - /* copy all the upstream names */ - - count = cf->args->nelts - 2; - - us = ngx_palloc (cf->pool, count * sizeof (ngx_str_t)); - if (us == NULL) - return NGX_CONF_ERROR; - - ngx_memcpy (us, value + 1, count * sizeof (ngx_str_t)); - - - /* calculate the total number of buckets */ - - buckets = 0; - - ulp.cf = cf; - - for (i=0; ipool, buckets * sizeof (ngx_str_t *)); - if (bucket == NULL) - return NGX_CONF_ERROR; - - ul->elts = bucket; - ul->nelts = buckets; - - - /* set values for each bucket */ - - us -= count; - - for (i=0; idata = ulp.s.data; - us->len = ulp.s.len; - - /* TODO : check format of upstream */ - /* TODO : add automatic adding of http:// in upstreams? */ - - for (j=0; jupstreams; - - if (ua == NULL) { - return NULL; - } - - ul = ua->elts; - ule = ul + ua->nelts; - - for (; ul < ule; ul++) { - if (ul->name.len == len && ngx_strncasecmp(ul->name.data, data, len) == 0) - { - return ul; - } - } - - return NULL; -} - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_upstream_list.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_upstream_list.h deleted file mode 100644 index 3786456..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_upstream_list.h +++ /dev/null @@ -1,27 +0,0 @@ - -#if (NDK_UPSTREAM_LIST_CMDS) - -/* TODO : use the generated commands */ - -{ - ngx_string ("upstream_list"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_2MORE, - ndk_upstream_list, - 0, - 0, - NULL -}, - -#else - -typedef struct { - ngx_str_t **elts; - ngx_uint_t nelts; - ngx_str_t name; -} ndk_upstream_list_t; - - -ndk_upstream_list_t * -ndk_get_upstream_list (ndk_http_main_conf_t *mcf, u_char *data, size_t len); - -#endif diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_uri.c b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_uri.c deleted file mode 100644 index 19e90e8..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_uri.c +++ /dev/null @@ -1,45 +0,0 @@ - - -/* TODO : check that this is correct */ - -u_char * -ndk_map_uri_to_path_add_suffix (ngx_http_request_t *r, ngx_str_t *path, ngx_str_t *suffix, ngx_int_t dot) -{ - size_t root_size; - u_char *p; - - if (suffix->len) { - - if (dot) { - - p = ngx_http_map_uri_to_path (r, path, &root_size, suffix->len + 1); - - if (p == NULL) - return NULL; - - *p = '.'; - p++; - - } else { - - p = ngx_http_map_uri_to_path (r, path, &root_size, suffix->len); - - if (p == NULL) - return NULL; - } - - path->len--; - - p = ngx_cpymem (p, suffix->data, suffix->len); - *p = '\0'; - - return p; - } - - p = ngx_http_map_uri_to_path (r, path, &root_size, 0); - - path->len--; - - return p; -} - diff --git a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_uri.h b/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_uri.h deleted file mode 100644 index dac3880..0000000 --- a/modules_deb/libnginx-mod-http-ndk-0.3.4/src/ndk_uri.h +++ /dev/null @@ -1,6 +0,0 @@ - - - -u_char * ndk_map_uri_to_path_add_suffix (ngx_http_request_t *r, ngx_str_t *path, ngx_str_t *suffix, ngx_int_t dot); - - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/.gitattributes b/modules_deb/libnginx-mod-http-set-misc-0.33/.gitattributes deleted file mode 100644 index 6fe6f35..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.t linguist-language=Text diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/.gitignore b/modules_deb/libnginx-mod-http-set-misc-0.33/.gitignore deleted file mode 100644 index 7500112..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/.gitignore +++ /dev/null @@ -1,72 +0,0 @@ -reindex -.libs -*.swp -*.slo -*.la -*.swo -*.lo -*~ -*.o -print.txt -.rsync -*.tar.gz -dist -build[789] -build -tags -update-readme -*.tmp -test/Makefile -test/blib -test.sh -all -t/t.sh -test/t/servroot/ -releng -reset -*.t_ -genmobi.sh -*.mobi -misc/chunked -ctags -src/base32.h -src/uri.c -src/module.c -src/upstream.c -src/upstream.h -src/uri.c -src/sql.c -src/uri.h -src/sql.h -src/uri.h -src/value.c -src/base32.c -src/value.h -src/hash.h -src/hash.c -src/today.h -src/today.c -src/json.[ch] -all.sh -go -t/servroot/ -src/base64.c -src/base64.h -src/hex.c -src/hex.h -src/hmac.c -src/hmac.h -src/rotate.[ch] -analyze -buildroot/ -src/module.h -work/ -src/random.[ch] -build1[0-9] -nginx -analyze -src/rotate.[ch] -*.plist -Makefile -src/base64url.[ch] -src/expired.[ch] diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/.travis.yml b/modules_deb/libnginx-mod-http-set-misc-0.33/.travis.yml deleted file mode 100644 index a841a11..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/.travis.yml +++ /dev/null @@ -1,54 +0,0 @@ -sudo: required -dist: trusty - -branches: - only: - - "master" - -os: linux - -language: c -compiler: gcc - -env: - global: - - LUAJIT_PREFIX=/opt/luajit21 - - LUAJIT_LIB=$LUAJIT_PREFIX/lib - - LD_LIBRARY_PATH=$LUAJIT_LIB:$LD_LIBRARY_PATH - - LUAJIT_INC=$LUAJIT_PREFIX/include/luajit-2.1 - - LUA_INCLUDE_DIR=$LUAJIT_INC - - LUA_CMODULE_DIR=/lib - - JOBS=3 - - NGX_BUILD_JOBS=$JOBS - - TEST_NGINX_SLEEP=0.006 - matrix: - - NGINX_VERSION=1.19.9 - -before_install: - - sudo apt-get install -qq -y axel cpanminus libtest-base-perl libtext-diff-perl liburi-perl libwww-perl libtest-longstring-perl liblist-moreutils-perl > build.log 2>&1 || (cat build.log && exit 1) - -install: - - git clone https://github.com/openresty/nginx-devel-utils.git - - git clone https://github.com/openresty/openresty.git ../openresty - - git clone https://github.com/openresty/no-pool-nginx.git ../no-pool-nginx - - git clone https://github.com/simpl/ngx_devel_kit.git ../ndk-nginx-module - - git clone https://github.com/openresty/test-nginx.git - - git clone -b v2.1-agentzh https://github.com/openresty/luajit2.git - - git clone https://github.com/openresty/lua-nginx-module.git ../lua-nginx-module - - git clone https://github.com/openresty/lua-resty-core.git ../lua-resty-core - - git clone https://github.com/openresty/lua-resty-lrucache.git ../lua-resty-lrucache - - git clone https://github.com/openresty/echo-nginx-module.git ../echo-nginx-module - - git clone https://github.com/calio/iconv-nginx-module.git ../iconv-nginx-module - -script: - - export PATH=$PWD/work/nginx/sbin:$PWD/nginx-devel-utils:$PATH - - ngx-releng > check.txt || true - - lines=`wc -l check.txt | awk '{print $1}'`; if [ $lines -gt 3 ]; then cat check.txt; exit 1; fi - - cd luajit2 - - make -j$JOBS CCDEBUG=-g Q= PREFIX=$LUAJIT_PREFIX CC=$CC XCFLAGS='-DLUA_USE_APICHECK -DLUA_USE_ASSERT' > build.log 2>&1 || (cat build.log && exit 1) - - sudo make install PREFIX=$LUAJIT_PREFIX > build.log 2>&1 || (cat build.log && exit 1) - - cd ../test-nginx && sudo cpanm . && cd .. - - export NGX_BUILD_CC=$CC - - sh util/build.sh $NGINX_VERSION > build.log 2>&1 || (cat build.log && exit 1) - - nginx -V - - prove -r t diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/README.markdown b/modules_deb/libnginx-mod-http-set-misc-0.33/README.markdown deleted file mode 100644 index f7f4010..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/README.markdown +++ /dev/null @@ -1,1451 +0,0 @@ - - -Name -==== - -**ngx_set_misc** - Various set_xxx directives added to nginx's rewrite module (md5/sha1, sql/json quoting, and many more) - -*This module is not distributed with the Nginx source.* See [the installation instructions](#installation). - -Table of Contents -================= - -* [Name](#name) -* [Version](#version) -* [Synopsis](#synopsis) -* [Description](#description) -* [Directives](#directives) - * [set_if_empty](#set_if_empty) - * [set_quote_sql_str](#set_quote_sql_str) - * [set_quote_pgsql_str](#set_quote_pgsql_str) - * [set_quote_json_str](#set_quote_json_str) - * [set_unescape_uri](#set_unescape_uri) - * [set_escape_uri](#set_escape_uri) - * [set_hashed_upstream](#set_hashed_upstream) - * [set_encode_base32](#set_encode_base32) - * [set_base32_padding](#set_base32_padding) - * [set_misc_base32_padding](#set_misc_base32_padding) - * [set_base32_alphabet](#set_base32_alphabet) - * [set_decode_base32](#set_decode_base32) - * [set_encode_base64](#set_encode_base64) - * [set_decode_base64](#set_decode_base64) - * [set_encode_base64url](#set_encode_base64url) - * [set_decode_base64url](#set_decode_base64url) - * [set_encode_hex](#set_encode_hex) - * [set_decode_hex](#set_decode_hex) - * [set_sha1](#set_sha1) - * [set_md5](#set_md5) - * [set_hmac_sha1](#set_hmac_sha1) - * [set_hmac_sha256](#set_hmac_sha256) - * [set_random](#set_random) - * [set_secure_random_alphanum](#set_secure_random_alphanum) - * [set_secure_random_lcalpha](#set_secure_random_lcalpha) - * [set_rotate](#set_rotate) - * [set_local_today](#set_local_today) - * [set_formatted_gmt_time](#set_formatted_gmt_time) - * [set_formatted_local_time](#set_formatted_local_time) -* [Caveats](#caveats) -* [Installation](#installation) - * [Building as a dynamic module](#building-as-a-dynamic-module) -* [Compatibility](#compatibility) -* [Report Bugs](#report-bugs) -* [Source Repository](#source-repository) -* [Changes](#changes) -* [Test Suite](#test-suite) -* [Getting involved](#getting-involved) -* [Author](#author) -* [Copyright & License](#copyright--license) -* [See Also](#see-also) - -Version -======= - -This document describes ngx_set_misc [v0.32](https://github.com/openresty/set-misc-nginx-module/tags) released on 19 April 2018. - -Synopsis -======== - -```nginx - - location /foo { - set $a $arg_a; - set_if_empty $a 56; - - # GET /foo?a=32 will yield $a == 32 - # while GET /foo and GET /foo?a= will - # yeild $a == 56 here. - } - - location /bar { - set $foo "hello\n\n'\"\\"; - set_quote_sql_str $foo $foo; # for mysql - - # OR in-place editing: - # set_quote_sql_str $foo; - - # now $foo is: 'hello\n\n\'\"\\' - } - - location /bar { - set $foo "hello\n\n'\"\\"; - set_quote_pgsql_str $foo; # for PostgreSQL - - # now $foo is: E'hello\n\n\'\"\\' - } - - location /json { - set $foo "hello\n\n'\"\\"; - set_quote_json_str $foo $foo; - - # OR in-place editing: - # set_quote_json_str $foo; - - # now $foo is: "hello\n\n'\"\\" - } - - location /baz { - set $foo "hello%20world"; - set_unescape_uri $foo $foo; - - # OR in-place editing: - # set_unescape_uri $foo; - - # now $foo is: hello world - } - - upstream_list universe moon sun earth; - upstream moon { ... } - upstream sun { ... } - upstream earth { ... } - location /foo { - set_hashed_upstream $backend universe $arg_id; - drizzle_pass $backend; # used with ngx_drizzle - } - - location /base32 { - set $a 'abcde'; - set_encode_base32 $a; - set_decode_base32 $b $a; - - # now $a == 'c5h66p35' and - # $b == 'abcde' - } - - location /base64 { - set $a 'abcde'; - set_encode_base64 $a; - set_decode_base64 $b $a; - - # now $a == 'YWJjZGU=' and - # $b == 'abcde' - } - - location /hex { - set $a 'abcde'; - set_encode_hex $a; - set_decode_hex $b $a; - - # now $a == '6162636465' and - # $b == 'abcde' - } - - # GET /sha1 yields the output - # aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d - location /sha1 { - set_sha1 $a hello; - echo $a; - } - - # ditto - location /sha1 { - set $a hello; - set_sha1 $a; - echo $a; - } - - # GET /today yields the date of today in local time using format 'yyyy-mm-dd' - location /today { - set_local_today $today; - echo $today; - } - - # GET /signature yields the hmac-sha-1 signature - # given a secret and a string to sign - # this example yields the base64 encoded singature which is - # "HkADYytcoQQzqbjQX33k/ZBB/DQ=" - location /signature { - set $secret_key 'secret-key'; - set $string_to_sign "some-string-to-sign"; - set_hmac_sha1 $signature $secret_key $string_to_sign; - set_encode_base64 $signature $signature; - echo $signature; - } - - location = /rand { - set $from 3; - set $to 15; - set_random $rand $from $to; - - # or write directly - # set_random $rand 3 15; - - echo $rand; # will print a random integer in the range [3, 15] - } -``` - -Description -=========== - -This module extends the standard HttpRewriteModule's directive set to provide more functionalities like URI escaping and unescaping, JSON quoting, Hexadecimal/MD5/SHA1/Base32/Base64 digest encoding and decoding, random number generator, and more! - -Every directive provided by this module can be mixed freely with other [ngx_http_rewrite_module](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html)'s directives, like [if](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#if) and [set](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#set). (Thanks to the [Nginx Devel Kit](https://github.com/simpl/ngx_devel_kit)!) - -[Back to TOC](#table-of-contents) - -Directives -========== - -[Back to TOC](#table-of-contents) - -set_if_empty ------------- -**syntax:** *set_if_empty $dst <src>* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -Assign the value of the argument `` if and only if variable `$dst` is empty (i.e., not found or has an empty string value). - -In the following example, - -```nginx - - set $a 32; - set_if_empty $a 56; -``` - -the variable `$dst` will take the value 32 at last. But in the sample - -```nginx - - set $a ''; - set $value "hello, world" - set_if_empty $a $value; -``` - -`$a` will take the value `"hello, world"` at last. - -[Back to TOC](#table-of-contents) - -set_quote_sql_str ------------------ -**syntax:** *set_quote_sql_str $dst <src>* - -**syntax:** *set_quote_sql_str $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -When taking two arguments, this directive will quote the value of the second argument `` by MySQL's string value quoting rule and assign the result into the first argument, variable `$dst`. For example, - -```nginx - - location /test { - set $value "hello\n\r'\"\\"; - set_quote_sql_str $quoted $value; - - echo $quoted; - } -``` - -Then request `GET /test` will yield the following output - -```sql - - 'hello\n\r\'\"\\' -``` - -Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly. - -When taking a single argument, this directive will do in-place modification of the argument variable. For example, - -```nginx - - location /test { - set $value "hello\n\r'\"\\"; - set_quote_sql_str $value; - - echo $value; - } -``` - -then request `GET /test` will give exactly the same output as the previous example. - -This directive is usually used to prevent SQL injection. - -This directive can be invoked by [lua-nginx-module](http://github.com/openresty/lua-nginx-module)'s [ndk.set_var.DIRECTIVE](http://github.com/openresty/lua-nginx-module#ndkset_vardirective) interface and [array-var-nginx-module](http://github.com/openresty/array-var-nginx-module)'s [array_map_op](http://github.com/openresty/array-var-nginx-module#array_map_op) directive. - -[Back to TOC](#table-of-contents) - -set_quote_pgsql_str -------------------- -**syntax:** *set_quote_pgsql_str $dst <src>* - -**syntax:** *set_quote_pgsql_str $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -Very much like [set_quote_sql_str](#set_quote_sql_str), but with PostgreSQL quoting rules for SQL string literals. - -[Back to TOC](#table-of-contents) - -set_quote_json_str ------------------- -**syntax:** *set_quote_json_str $dst <src>* - -**syntax:** *set_quote_json_str $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -When taking two arguments, this directive will quote the value of the second argument `` by JSON string value quoting rule and assign the result into the first argument, variable `$dst`. For example, - -```nginx - - location /test { - set $value "hello\n\r'\"\\"; - set_quote_json_str $quoted $value; - - echo $quoted; - } -``` - -Then request `GET /test` will yield the following output - -```javascript - - "hello\n\r'\"\\" -``` - -Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly. - -When taking a single argument, this directive will do in-place modification of the argument variable. For example, - -```nginx - - location /test { - set $value "hello\n\r'\"\\"; - set_quote_json_str $value; - - echo $value; - } -``` - -then request `GET /test` will give exactly the same output as the previous example. - -This directive can be invoked by [lua-nginx-module](http://github.com/openresty/lua-nginx-module)'s [ndk.set_var.DIRECTIVE](http://github.com/openresty/lua-nginx-module#ndkset_vardirective) interface and [array-var-nginx-module](http://github.com/openresty/array-var-nginx-module)'s [array_map_op](http://github.com/openresty/array-var-nginx-module#array_map_op) directive. - -[Back to TOC](#table-of-contents) - -set_unescape_uri ----------------- -**syntax:** *set_unescape_uri $dst <src>* - -**syntax:** *set_unescape_uri $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -When taking two arguments, this directive will unescape the value of the second argument `` as a URI component and assign the result into the first argument, variable `$dst`. For example, - -```nginx - - location /test { - set_unescape_uri $key $arg_key; - echo $key; - } -``` - -Then request `GET /test?key=hello+world%21` will yield the following output - -``` -hello world! -``` - -The nginx standard [$arg_PARAMETER](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_arg_) variable holds the raw (escaped) value of the URI parameter. So we need the `set_unescape_uri` directive to unescape it first. - -Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly. - -When taking a single argument, this directive will do in-place modification of the argument variable. For example, - -```nginx - - location /test { - set $key $arg_key; - set_unescape_uri $key; - - echo $key; - } -``` - -then request `GET /test?key=hello+world%21` will give exactly the same output as the previous example. - -This directive can be invoked by [lua-nginx-module](http://github.com/openresty/lua-nginx-module)'s [ndk.set_var.DIRECTIVE](http://github.com/openresty/lua-nginx-module#ndkset_vardirective) interface and [array-var-nginx-module](http://github.com/openresty/array-var-nginx-module)'s [array_map_op](http://github.com/openresty/array-var-nginx-module#array_map_op) directive. - -[Back to TOC](#table-of-contents) - -set_escape_uri --------------- -**syntax:** *set_escape_uri $dst <src>* - -**syntax:** *set_escape_uri $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -Very much like the [set_unescape_uri](#set_unescape_uri) directive, but does the conversion the other way around, i.e., URL component escaping. - -[Back to TOC](#table-of-contents) - -set_hashed_upstream -------------------- -**syntax:** *set_hashed_upstream $dst <upstream_list_name> <src>* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -Hashes the string argument `` into one of the upstream name included in the upstream list named ``. The hash function being used is simple modulo. - -Here's an example, - -```nginx - - upstream moon { ... } - upstream sun { ... } - upstream earth { ... } - - upstream_list universe moon sun earth; - - location /test { - set_unescape_uri $key $arg_key; - set $list_name universe; - set_hashed_upstream $backend $list_name $key; - - echo $backend; - } -``` - -Then `GET /test?key=blah` will output either "moon", "sun", or "earth", depending on the actual value of the `key` query argument. - -This directive is usually used to compute an nginx variable to be passed to [memc-nginx-module](http://github.com/openresty/memc-nginx-module)'s [memc_pass](http://github.com/openresty/memc-nginx-module#memc_pass) directive, [redis2-nginx-module](http://github.com/openresty/redis2-nginx-module)'s [[HttpRedis2Module#redis2_pass]] directive, and [ngx_http_proxy_module](http://nginx.org/en/docs/http/ngx_http_proxy_module.html)'s [proxy_pass](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass) directive, among others. - -[Back to TOC](#table-of-contents) - -set_encode_base32 ------------------ -**syntax:** *set_encode_base32 $dst <src>* - -**syntax:** *set_encode_base32 $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -When taking two arguments, this directive will encode the value of the second argument `` to its base32(hex) digest and assign the result into the first argument, variable `$dst`. For example, - -```nginx - - location /test { - set $raw "abcde"; - set_encode_base32 $digest $raw; - - echo $digest; - } -``` - -Then request `GET /test` will yield the following output - -``` -c5h66p35 -``` - -Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly. - -RFC forces the `[A-Z2-7]` RFC-3548 compliant encoding, but we are using the "base32hex" encoding (`[0-9a-v]`) by default. The [set_base32_alphabet](#set_base32_alphabet) directive (first introduced in `v0.28`) allows you to change the alphabet used for encoding/decoding so RFC-3548 compliant encoding is still possible by custom configurations. - -By default, the `=` character is used to pad the left-over bytes due to alignment. But the padding behavior can be completely disabled by setting [set_base32_padding](#set_base32_padding) `off`. - -When taking a single argument, this directive will do in-place modification of the argument variable. For example, - -```nginx - - location /test { - set $value "abcde"; - set_encode_base32 $value; - - echo $value; - } -``` - -then request `GET /test` will give exactly the same output as the previous example. - -This directive can be invoked by [lua-nginx-module](http://github.com/openresty/lua-nginx-module)'s [ndk.set_var.DIRECTIVE](http://github.com/openresty/lua-nginx-module#ndkset_vardirective) interface and [array-var-nginx-module](http://github.com/openresty/array-var-nginx-module)'s [array_map_op](http://github.com/openresty/array-var-nginx-module#array_map_op) directive. - -[Back to TOC](#table-of-contents) - -set_base32_padding ------------------- -**syntax:** *set_base32_padding on|off* - -**default:** *on* - -**context:** *http, server, server if, location, location if* - -**phase:** *no* - -This directive can control whether to pad left-over bytes with the "=" character when encoding a base32 digest by the -[set_encode_base32](#set_encode_base32) directive. - -This directive was first introduced in `v0.28`. If you use earlier versions of this module, then you should use [set_misc_base32_padding](#set_misc_base32_padding) instead. - -[Back to TOC](#table-of-contents) - -set_misc_base32_padding ------------------------ -**syntax:** *set_misc_base32_padding on|off* - -**default:** *on* - -**context:** *http, server, server if, location, location if* - -**phase:** *no* - -This directive has been deprecated since `v0.28`. Use [set_base32_padding](#set_base32_padding) instead if you are using `v0.28+`. - -[Back to TOC](#table-of-contents) - -set_base32_alphabet -------------------- -**syntax:** *set_base32_alphabet <alphabet>* - -**default:** *"0123456789abcdefghijklmnopqrstuv"* - -**context:** *http, server, server if, location, location if* - -**phase:** *no* - -This directive controls the alphabet used for encoding/decoding a base32 digest. It accepts a string containing the desired alphabet like "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567" for standard alphabet. - -Extended (base32hex) alphabet is used by default. - -This directive was first introduced in `v0.28`. - -[Back to TOC](#table-of-contents) - -set_decode_base32 ------------------ -**syntax:** *set_decode_base32 $dst <src>* - -**syntax:** *set_decode_base32 $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -Similar to the [set_encode_base32](#set_encode_base32) directive, but does exactly the opposite operation, .i.e, decoding a base32(hex) digest into its original form. - -[Back to TOC](#table-of-contents) - -set_encode_base64 ------------------ -**syntax:** *set_encode_base64 $dst <src>* - -**syntax:** *set_encode_base64 $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -When taking two arguments, this directive will encode the value of the second argument `` to its base64 digest and assign the result into the first argument, variable `$dst`. For example, - -```nginx - - location /test { - set $raw "abcde"; - set_encode_base64 $digest $raw; - - echo $digest; - } -``` - -Then request `GET /test` will yield the following output - -``` -YWJjZGU= -``` - -Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly. - -When taking a single argument, this directive will do in-place modification of the argument variable. For example, - -```nginx - - location /test { - set $value "abcde"; - set_encode_base64 $value; - - echo $value; - } -``` - -then request `GET /test` will give exactly the same output as the previous example. - -This directive can be invoked by [lua-nginx-module](http://github.com/openresty/lua-nginx-module)'s [ndk.set_var.DIRECTIVE](http://github.com/openresty/lua-nginx-module#ndkset_vardirective) interface and [array-var-nginx-module](http://github.com/openresty/array-var-nginx-module)'s [array_map_op](http://github.com/openresty/array-var-nginx-module#array_map_op) directive. - -[Back to TOC](#table-of-contents) - -set_encode_base64url ------------------ -**syntax:** *set_encode_base64url $dst <src>* - -**syntax:** *set_encode_base64url $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -When taking two arguments, this directive will encode the value of the second argument `` to its base64 url safe digest and assign the result into the first argument, variable `$dst`. For example, - -```nginx - - location /test { - set $raw "abcde"; - set_encode_base64url $digest $raw; - - echo $digest; - } -``` - -Then request `GET /test` will yield the following output - -``` -YWJjZGU= -``` - -Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly. - -When taking a single argument, this directive will do in-place modification of the argument variable. For example, - -```nginx - - location /test { - set $value "abcde"; - set_encode_base64url $value; - - echo $value; - } -``` - -then request `GET /test` will give exactly the same output as the previous example. - -This directive can be invoked by [lua-nginx-module](http://github.com/openresty/lua-nginx-module)'s [ndk.set_var.DIRECTIVE](http://github.com/openresty/lua-nginx-module#ndkset_vardirective) interface and [array-var-nginx-module](http://github.com/openresty/array-var-nginx-module)'s [array_map_op](http://github.com/openresty/array-var-nginx-module#array_map_op) directive. - -[Back to TOC](#table-of-contents) - -set_decode_base64 ------------------ -**syntax:** *set_decode_base64 $dst <src>* - -**syntax:** *set_decode_base64 $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -Similar to the [set_encode_base64](#set_encode_base64) directive, but does exactly the opposite operation, .i.e, decoding a base64 digest into its original form. - -[Back to TOC](#table-of-contents) - -set_decode_base64url ------------------ -**syntax:** *set_decode_base64url $dst <src>* - -**syntax:** *set_decode_base64url $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -Similar to the [set_encode_base64url](#set_encode_base64url) directive, but does exactly the the opposite operation, .i.e, decoding a base64 url safe digest into its original form. - -[Back to TOC](#table-of-contents) - -set_encode_hex --------------- -**syntax:** *set_encode_hex $dst <src>* - -**syntax:** *set_encode_hex $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -When taking two arguments, this directive will encode the value of the second argument `` to its hexadecimal digest and assign the result into the first argument, variable `$dst`. For example, - -```nginx - - location /test { - set $raw "章亦春"; - set_encode_hex $digest $raw; - - echo $digest; - } -``` - -Then request `GET /test` will yield the following output - -``` -e7aba0e4baa6e698a5 -``` - -Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly. - -When taking a single argument, this directive will do in-place modification of the argument variable. For example, - -```nginx - - location /test { - set $value "章亦春"; - set_encode_hex $value; - - echo $value; - } -``` - -then request `GET /test` will give exactly the same output as the previous example. - -This directive can be invoked by [lua-nginx-module](http://github.com/openresty/lua-nginx-module)'s [ndk.set_var.DIRECTIVE](http://github.com/openresty/lua-nginx-module#ndkset_vardirective) interface and [array-var-nginx-module](http://github.com/openresty/array-var-nginx-module)'s [array_map_op](http://github.com/openresty/array-var-nginx-module#array_map_op) directive. - -[Back to TOC](#table-of-contents) - -set_decode_hex --------------- -**syntax:** *set_decode_hex $dst <src>* - -**syntax:** *set_decode_hex $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -Similar to the [set_encode_hex](#set_encode_hex) directive, but does exactly the opposite operation, .i.e, decoding a hexadecimal digest into its original form. - -[Back to TOC](#table-of-contents) - -set_sha1 --------- -**syntax:** *set_sha1 $dst <src>* - -**syntax:** *set_sha1 $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -When taking two arguments, this directive will encode the value of the second argument `` to its [SHA-1](http://en.wikipedia.org/wiki/SHA-1) digest and assign the result into the first argument, variable `$dst`. The hexadecimal form of the `SHA-1` digest will be generated automatically, use [set_decode_hex](#set_decode_hex) to decode the result if you want the binary form of the `SHA-1` digest. - -For example, - -```nginx - - location /test { - set $raw "hello"; - set_sha1 $digest $raw; - - echo $digest; - } -``` - -Then request `GET /test` will yield the following output - -``` -aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d -``` - -Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly. - -When taking a single argument, this directive will do in-place modification of the argument variable. For example, - -```nginx - - location /test { - set $value "hello"; - set_sha1 $value; - - echo $value; - } -``` - -then request `GET /test` will give exactly the same output as the previous example. - -This directive can be invoked by [lua-nginx-module](http://github.com/openresty/lua-nginx-module)'s [ndk.set_var.DIRECTIVE](http://github.com/openresty/lua-nginx-module#ndkset_vardirective) interface and [array-var-nginx-module](http://github.com/openresty/array-var-nginx-module)'s [array_map_op](http://github.com/openresty/array-var-nginx-module#array_map_op) directive. - -[Back to TOC](#table-of-contents) - -set_md5 -------- -**syntax:** *set_md5 $dst <src>* - -**syntax:** *set_md5 $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -**category:** *ndk_set_var_value* - -When taking two arguments, this directive will encode the value of the second argument `` to its [MD5](http://en.wikipedia.org/wiki/MD5) digest and assign the result into the first argument, variable `$dst`. The hexadecimal form of the `MD5` digest will be generated automatically, use [set_decode_hex](#set_decode_hex) to decode the result if you want the binary form of the `MD5` digest. - -For example, - -```nginx - - location /test { - set $raw "hello"; - set_md5 $digest $raw; - - echo $digest; - } -``` - -Then request `GET /test` will yield the following output - - - 5d41402abc4b2a76b9719d911017c592 - - -Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly. - -When taking a single argument, this directive will do in-place modification of the argument variable. For example, - -```nginx - - location /test { - set $value "hello"; - set_md5 $value; - - echo $value; - } -``` - -then request `GET /test` will give exactly the same output as the previous example. - -This directive can be invoked by [lua-nginx-module](http://github.com/openresty/lua-nginx-module)'s [ndk.set_var.DIRECTIVE](http://github.com/openresty/lua-nginx-module#ndkset_vardirective) interface and [array-var-nginx-module](http://github.com/openresty/array-var-nginx-module)'s [array_map_op](http://github.com/openresty/array-var-nginx-module#array_map_op) directive. - -[Back to TOC](#table-of-contents) - -set_hmac_sha1 -------------- -**syntax:** *set_hmac_sha1 $dst <secret_key> <src>* - -**syntax:** *set_hmac_sha1 $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -Computes the [HMAC-SHA1](http://en.wikipedia.org/wiki/HMAC) digest of the argument `` and assigns the result into the argument variable `$dst` with the secret key ``. - -The raw binary form of the `HMAC-SHA1` digest will be generated, use [set_encode_base64](#set_encode_base64), for example, to encode the result to a textual representation if desired. - -For example, - -```nginx - - location /test { - set $secret 'thisisverysecretstuff'; - set $string_to_sign 'some string we want to sign'; - set_hmac_sha1 $signature $secret $string_to_sign; - set_encode_base64 $signature $signature; - echo $signature; - } -``` - -Then request `GET /test` will yield the following output - -``` -R/pvxzHC4NLtj7S+kXFg/NePTmk= -``` - -Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly. - -This directive requires the OpenSSL library enabled in your Nginx build (usually by passing the `--with-http_ssl_module` option to the `./configure` script). - -[Back to TOC](#table-of-contents) - -set_hmac_sha256 ---------------- -**syntax:** *set_hmac_sha256 $dst <secret_key> <src>* - -**syntax:** *set_hmac_sha256 $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -Computes the [HMAC-SHA256](http://en.wikipedia.org/wiki/HMAC) digest of the argument `` and assigns the result into the argument variable `$dst` with the secret key ``. - -The raw binary form of the `HMAC-SHA256` digest will be generated, use [set_encode_base64](#set_encode_base64), for example, to encode the result to a textual representation if desired. - -For example, - -```nginx - - location /test { - set $secret 'thisisverysecretstuff'; - set $string_to_sign 'some string we want to sign'; - set_hmac_sha256 $signature $secret $string_to_sign; - set_encode_base64 $signature $signature; - echo $signature; - } -``` - -Then request `GET /test` will yield the following output - -``` -4pU3GRQrKKIoeLb9CqYsavHE2l6Hx+KMmRmesU+Cfrs= -``` - -Please note that we're using [echo-nginx-module](http://github.com/openresty/echo-nginx-module)'s [echo directive](http://github.com/openresty/echo-nginx-module#echo) here to output values of nginx variables directly. - -This directive requires the OpenSSL library enabled in your Nginx build (usually by passing the `--with-http_ssl_module` option to the `./configure` script). - -[Back to TOC](#table-of-contents) - -set_random ----------- -**syntax:** *set_random $res <from> <to>* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -Generates a (pseudo) random number (in textual form) within the range `[<$from>, <$to>]` (inclusive). - -Only non-negative numbers are allowed for the `` and `` arguments. - -When `` is greater than ``, their values will be exchanged accordingly. - -For instance, - -```nginx - - location /test { - set $from 5; - set $to 7; - set_random $res $from $to; - - echo $res; - } -``` - -then request `GET /test` will output a number between 5 and 7 (i.e., among 5, 6, 7). - -For now, there's no way to configure a custom random generator seed. - -Behind the scene, it makes use of the standard C function `rand()`. - -This directive was first introduced in the `v0.22rc1` release. - -See also [set_secure_random_alphanum](#set_secure_random_alphanum) and [set_secure_random_lcalpha](#set_secure_random_lcalpha). - -[Back to TOC](#table-of-contents) - -set_secure_random_alphanum --------------------------- -**syntax:** *set_secure_random_alphanum $res <length>* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -Generates a cryptographically-strong random string `` characters long with the alphabet `[a-zA-Z0-9]`. - -`` may be between 1 and 64, inclusive. - -For instance, - -```nginx - - location /test { - set_secure_random_alphanum $res 32; - - echo $res; - } -``` - -then request `GET /test` will output a string like `ivVVRP2DGaAqDmdf3Rv4ZDJ7k0gOfASz`. - -This functionality depends on the presence of the `/dev/urandom` device, available on most UNIX-like systems. - -See also [set_secure_random_lcalpha](#set_secure_random_lcalpha) and [set_random](#set_random). - -This directive was first introduced in the `v0.22rc8` release. - -[Back to TOC](#table-of-contents) - -set_secure_random_lcalpha -------------------------- -**syntax:** *set_secure_random_lcalpha $res <length>* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -Generates a cryptographically-strong random string `` characters long with the alphabet `[a-z]`. - -`` may be between 1 and 64, inclusive. - -For instance, - -```nginx - - location /test { - set_secure_random_lcalpha $res 32; - - echo $res; - } -``` - -then request `GET /test` will output a string like `kcuxcddktffsippuekhshdaclaquiusj`. - -This functionality depends on the presence of the `/dev/urandom` device, available on most UNIX-like systems. - -This directive was first introduced in the `v0.22rc8` release. - -See also [set_secure_random_alphanum](#set_secure_random_alphanum) and [set_random](#set_random). - -[Back to TOC](#table-of-contents) - -set_rotate ----------- -**syntax:** *set_rotate $value <from> <to>* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -Increments `$value` but keeps it in range from `` to ``. -If `$value` is greater than `` or less than `` is will be -set to `` value. - -The current value after running this directive will always be saved on a per-location basis. And the this saved value will be used for incrementation when the `$value` is not initialized or has a bad value. - -Only non-negative numbers are allowed for the `` and `` arguments. - -When `` is greater than ``, their values will be exchanged accordingly. - -For instance, - -```nginx - - location /rotate { - default_type text/plain; - set $counter $cookie_counter; - set_rotate $counter 1 5; - echo $counter; - add_header Set-Cookie counter=$counter; - } -``` - -then request `GET /rotate` will output next number between 1 and 5 (i.e., 1, 2, 3, 4, 5) on each -refresh of the page. This directive may be userful for banner rotation purposes. - -Another example is to use server-side value persistence to do simple round-robin: - -```nginx - - location /rotate { - default_type text/plain; - set_rotate $counter 0 3; - echo $counter; - } -``` - -And accessing `/rotate` will also output integer sequence 0, 1, 2, 3, 0, 1, 2, 3, and so on. - -This directive was first introduced in the `v0.22rc7` release. - -[Back to TOC](#table-of-contents) - -set_local_today ---------------- -**syntax:** *set_local_today $dst* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -Set today's date ("yyyy-mm-dd") in localtime to the argument variable `$dst`. - -Here's an example, - -```nginx - - location /today { - set_local_today $today; - echo $today; - } -``` - -then request `GET /today` will output something like - -``` -2011-08-16 -``` - -and year, the actual date you get here will vary every day ;) - -Behind the scene, this directive utilizes the `ngx_time` API in the Nginx core, so usually no syscall is involved due to the time caching mechanism in the Nginx core. - -[Back to TOC](#table-of-contents) - -set_formatted_gmt_time ----------------------- -**syntax:** *set_formatted_gmt_time $res <time-format>* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -Set a formatted GMT time to variable `$res` (as the first argument) using the format string in the second argument. - -All the conversion specification notations in the standard C function `strftime` are supported, like `%Y` (for 4-digit years) and `%M` (for minutes in decimal). See for a complete list of conversion specification symbols. - -Below is an example: - -```nginx - - location = /t { - set_formatted_gmt_time $timestr "%a %b %e %H:%M:%S %Y GMT"; - echo $timestr; - } -``` - -Accessing `/t` yields the output - -``` -Fri Dec 13 15:34:37 2013 GMT -``` - -This directive was first added in the `0.23` release. - -See also [set_formatted_local_time](#set_formatted_local_time). - -[Back to TOC](#table-of-contents) - -set_formatted_local_time ------------------------- -**syntax:** *set_formatted_local_time $res <time-format>* - -**default:** *no* - -**context:** *location, location if* - -**phase:** *rewrite* - -Set a formatted local time to variable `$res` (as the first argument) using the format string in the second argument. - -All the conversion specification notations in the standard C function `strftime` are supported, like `%Y` (for 4-digit years) and `%M` (for minutes in decimal). See for a complete list of conversion specification symbols. - -Below is an example: - -```nginx - - location = /t { - set_formatted_local_time $timestr "%a %b %e %H:%M:%S %Y %Z"; - echo $timestr; - } -``` - -Accessing `/t` yields the output - -``` -Fri Dec 13 15:42:15 2013 PST -``` - -This directive was first added in the `0.23` release. - -See also [set_formatted_gmt_time](#set_formatted_gmt_time). - -[Back to TOC](#table-of-contents) - -Caveats -======= - -Do not use [$arg_PARAMETER](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_arg_), [$cookie_COOKIE](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_cookie_), [$http_HEADER](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_http_) or other special variables defined in the Nginx core module as the target variable in this module's directives. For instance, - -```nginx - - set_if_empty $arg_user 'foo'; # DO NOT USE THIS! -``` - -may lead to segmentation faults. - -[Back to TOC](#table-of-contents) - -Installation -============ - -This module is included and enabled by default in the [OpenResty bundle](http://openresty.org). If you want to install this module manually with your own Nginx source tarball, then follow the steps below: - -Grab the nginx source code from [nginx.org](http://nginx.org/), for example, -the version 1.13.6 (see [nginx compatibility](#compatibility)), and then build the source with this module: - -```bash - - wget 'http://nginx.org/download/nginx-1.13.6.tar.gz' - tar -xzvf nginx-1.13.6.tar.gz - cd nginx-1.13.6/ - - # Here we assume you would install you nginx under /opt/nginx/. - ./configure --prefix=/opt/nginx \ - --with-http_ssl_module \ - --add-module=/path/to/ngx_devel_kit \ - --add-module=/path/to/set-misc-nginx-module - - make -j2 - make install -``` - -Download the latest version of the release tarball of this module from [set-misc-nginx-module file list](http://github.com/openresty/set-misc-nginx-module/tags), and the latest tarball for [ngx_devel_kit](https://github.com/simplresty/ngx_devel_kit) from its [file list](https://github.com/simplresty/ngx_devel_kit/tags). - -[Back to TOC](#table-of-contents) - -Building as a dynamic module ----------------------------- - -Starting from NGINX 1.9.11, you can also compile this module as a dynamic module, by using the `--add-dynamic-module=PATH` option instead of `--add-module=PATH` on the -`./configure` command line above. And then you can explicitly load the module in your `nginx.conf` via the [load_module](http://nginx.org/en/docs/ngx_core_module.html#load_module) -directive, for example, - -```nginx -load_module /path/to/modules/ndk_http_module.so; # assuming NDK is built as a dynamic module too -load_module /path/to/modules/ngx_http_set_misc_module.so; -``` - -Also, this module is included and enabled by default in the [OpenResty bundle](http://openresty.org/). - -[Back to TOC](#table-of-contents) - -Compatibility -============= - -The following versions of Nginx should work with this module: - -* **1.13.x** (last tested: 1.13.6) -* **1.12.x** -* **1.11.x** (last tested: 1.11.2) -* **1.10.x** -* **1.9.x** (last tested: 1.9.15) -* **1.8.x** -* **1.7.x** (last tested: 1.7.10) -* **1.6.x** -* **1.5.x** (last tested: 1.5.8) -* **1.4.x** (last tested: 1.4.4) -* **1.2.x** (last tested: 1.2.9) -* **1.1.x** (last tested: 1.1.5) -* **1.0.x** (last tested: 1.0.15) -* **0.9.x** (last tested: 0.9.4) -* **0.8.x** (last tested: 0.8.54) -* **0.7.x >= 0.7.46** (last tested: 0.7.68) - -If you find that any particular version of Nginx above 0.7.46 does not work with this module, please consider [reporting a bug](#report-bugs). - -[Back to TOC](#table-of-contents) - -Report Bugs -=========== - -Although a lot of effort has been put into testing and code tuning, there must be some serious bugs lurking somewhere in this module. So whenever you are bitten by any quirks, please don't hesitate to - -1. send a bug report or even patches to the [openresty-en mailing list](https://groups.google.com/group/openresty-en), -1. or create a ticket on the [issue tracking interface](http://github.com/openresty/set-misc-nginx-module/issues) provided by GitHub. - -[Back to TOC](#table-of-contents) - -Source Repository -================= - -Available on github at [openresty/set-misc-nginx-module](http://github.com/openresty/set-misc-nginx-module). - -[Back to TOC](#table-of-contents) - -Changes -======= - -The change logs for every release of this module can be obtained from the OpenResty bundle's change logs: - - - -[Back to TOC](#table-of-contents) - -Test Suite -========== - -This module comes with a Perl-driven test suite. The [test cases](http://github.com/openresty/set-misc-nginx-module/tree/master/t/) are -[declarative](http://github.com/openresty/set-misc-nginx-module/blob/master/t/escape-uri.t) too. Thanks to the [Test::Nginx](http://search.cpan.org/perldoc?Test::Nginx) module in the Perl world. - -To run it on your side: - -```bash - - $ PATH=/path/to/your/nginx-with-set-misc-module:$PATH prove -r t -``` - -You need to terminate any Nginx processes before running the test suite if you have changed the Nginx server binary. - -Because a single nginx server (by default, `localhost:1984`) is used across all the test scripts (`.t` files), it's meaningless to run the test suite in parallel by specifying `-jN` when invoking the `prove` utility. - -[Back to TOC](#table-of-contents) - -Getting involved -================ - -You'll be very welcomed to submit patches to the [author](#author) or just ask for a commit bit to the [source repository](#source-repository) on GitHub. - -[Back to TOC](#table-of-contents) - -Author -====== - -Yichun Zhang (agentzh) *<agentzh@gmail.com>*, OpenResty Inc. - -This wiki page is also maintained by the author himself, and everybody is encouraged to improve this page as well. - -[Back to TOC](#table-of-contents) - -Copyright & License -=================== - -Copyright (C) 2009-2018, Yichun Zhang (章亦春) , OpenResty Inc. - -This module is licensed under the terms of the BSD license. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright 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 THE COPYRIGHT HOLDERS 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 THE COPYRIGHT -HOLDER 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) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -[Back to TOC](#table-of-contents) - -See Also -======== -* [Nginx Devel Kit](https://github.com/simpl/ngx_devel_kit) -* [The OpenResty bundle](http://openresty.org) - -[Back to TOC](#table-of-contents) - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/config b/modules_deb/libnginx-mod-http-set-misc-0.33/config deleted file mode 100755 index 7bb00af..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/config +++ /dev/null @@ -1,79 +0,0 @@ -ngx_addon_name=ngx_http_set_misc_module - -if test -n "$ngx_module_link"; then - if test -n "$NDK_SRCS"; then - echo "found ngx_devel_kit for ngx_set_misc; looks good." - else - echo "error: ngx_devel_kit is required to build ngx_set_misc; please put it before ngx_set_misc." 1>&2 - exit 1 - fi -else - if echo $HTTP_MODULES | grep " ndk_http_module" > /dev/null; then - echo "found ngx_devel_kit for ngx_set_misc; looks good." - else - echo "error: ngx_devel_kit is required to build ngx_set_misc; please put it before ngx_set_misc." 1>&2 - exit 1 - fi -fi - -SET_MISC_SRCS=" \ - $ngx_addon_dir/src/ngx_http_set_base32.c \ - $ngx_addon_dir/src/ngx_http_set_default_value.c \ - $ngx_addon_dir/src/ngx_http_set_hashed_upstream.c \ - $ngx_addon_dir/src/ngx_http_set_quote_sql.c \ - $ngx_addon_dir/src/ngx_http_set_quote_json.c \ - $ngx_addon_dir/src/ngx_http_set_unescape_uri.c \ - $ngx_addon_dir/src/ngx_http_set_misc_module.c \ - $ngx_addon_dir/src/ngx_http_set_escape_uri.c \ - $ngx_addon_dir/src/ngx_http_set_hash.c \ - $ngx_addon_dir/src/ngx_http_set_local_today.c \ - $ngx_addon_dir/src/ngx_http_set_hex.c \ - $ngx_addon_dir/src/ngx_http_set_base64.c \ - $ngx_addon_dir/src/ngx_http_set_base64url.c \ - $ngx_addon_dir/src/ngx_http_set_random.c \ - $ngx_addon_dir/src/ngx_http_set_secure_random.c \ - $ngx_addon_dir/src/ngx_http_set_rotate.c - " - -SET_MISC_DEPS=" \ - $ngx_addon_dir/src/ddebug.h \ - $ngx_addon_dir/src/ngx_http_set_default_value.h \ - $ngx_addon_dir/src/ngx_http_set_hashed_upstream.h \ - $ngx_addon_dir/src/ngx_http_set_quote_sql.h \ - $ngx_addon_dir/src/ngx_http_set_quote_json.h \ - $ngx_addon_dir/src/ngx_http_set_unescape_uri.h \ - $ngx_addon_dir/src/ngx_http_set_escape_uri.h \ - $ngx_addon_dir/src/ngx_http_set_hash.h \ - $ngx_addon_dir/src/ngx_http_set_local_today.h \ - $ngx_addon_dir/src/ngx_http_set_hex.h \ - $ngx_addon_dir/src/ngx_http_set_base64url.h \ - $ngx_addon_dir/src/ngx_http_set_base64.h \ - $ngx_addon_dir/src/ngx_http_set_random.h \ - $ngx_addon_dir/src/ngx_http_set_rotate.h \ - $ngx_addon_dir/src/ngx_http_set_secure_random.h \ - $ngx_addon_dir/src/ngx_http_set_misc_module.h \ - " - -if [ $USE_OPENSSL = YES -o $MAIL_SSL = YES ]; then - SET_MISC_DEPS="$SET_MISC_DEPS $ngx_addon_dir/src/ngx_http_set_hmac.h" - SET_MISC_SRCS="$SET_MISC_SRCS $ngx_addon_dir/src/ngx_http_set_hmac.c" -fi - -CFLAGS="$CFLAGS -DNDK_SET_VAR -DNDK_UPSTREAM_LIST" -USE_SHA1=YES -USE_MD5=YES - -if test -n "$ngx_module_link"; then - ngx_module_type=HTTP - ngx_module_name=$ngx_addon_name - ngx_module_incs= - ngx_module_deps="$SET_MISC_DEPS" - ngx_module_srcs="$SET_MISC_SRCS" - ngx_module_libs= - - . auto/module -else - HTTP_MODULES="$HTTP_MODULES $ngx_addon_name" - NGX_ADDON_SRCS="$NGX_ADDON_SRCS $SET_MISC_SRCS" - NGX_ADDON_DEPS="$NGX_ADDON_DEPS $SET_MISC_DEPS" -fi diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/changelog b/modules_deb/libnginx-mod-http-set-misc-0.33/debian/changelog deleted file mode 100644 index bb494f4..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/changelog +++ /dev/null @@ -1,53 +0,0 @@ -libnginx-mod-http-set-misc (0.33-6) unstable; urgency=medium - - * Team upload. - * d/control: bump Standards-Version: 4.7.2, no changes - * d/watch: use more generic template - * d/copyright: bump debian/* copyright year - - -- Jan Mojžíš Sat, 12 Apr 2025 09:05:50 +0200 - -libnginx-mod-http-set-misc (0.33-5) unstable; urgency=medium - - * Team upload. - * Better usage of dh-sequence-nginx. - * d/control: remove Build-Depends nginx-abi-1.24.0-1 - * d/rules: remove override_dh_auto_test, override_dh_auto_test - * d/control: remove Depends libnginx-mod-http-ndk - * d/copyright-scan-patterns.yml add - - -- Jan Mojžíš Sun, 08 Oct 2023 17:10:26 +0200 - -libnginx-mod-http-set-misc (0.33-4) unstable; urgency=medium - - * Team upload. - * NEW ABI: rebuild with nginx-abi-1.24.0-1 - - -- Jan Mojžíš Wed, 28 Jun 2023 00:01:59 +0200 - -libnginx-mod-http-set-misc (0.33-3) unstable; urgency=medium - - * Team upload. - * d/t/set_if_empty renamed to d/t/setifempty, fixes lintian - warning illegal-runtime-test-name - * d/t/generic rework. The test now checks module after - installation/reload/restart. - * d/control: bump Standards-Version: 4.6.2, no changes - * d/copyright: reformat text to be compatible with 'cme update dpkg-copyright' - * d/fix.scanned.copyright: added, fixes upstream author name parsing - * NEW ABI: rebuild with nginx-abi-1.22.1-7 - - -- Jan Mojžíš Mon, 13 Feb 2023 12:56:37 +0100 - -libnginx-mod-http-set-misc (0.33-2) unstable; urgency=medium - - * Team upload. - * d/control: fixed dependency libnginx-mod-http-ndk-dev (>= 1:0.3.2-2) - - -- Jan Mojžíš Fri, 09 Dec 2022 14:08:01 +0100 - -libnginx-mod-http-set-misc (0.33-1) unstable; urgency=medium - - * Initial release. (Closes: #1025291) - - -- Jérémy Lal Fri, 02 Dec 2022 00:32:56 +0100 diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/control b/modules_deb/libnginx-mod-http-set-misc-0.33/debian/control deleted file mode 100644 index 9223829..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/control +++ /dev/null @@ -1,27 +0,0 @@ -Source: libnginx-mod-http-set-misc -Section: httpd -Priority: optional -Maintainer: Debian Nginx Maintainers -Uploaders: Jérémy Lal , -Build-Depends: debhelper-compat (= 13), - dh-sequence-nginx, - libnginx-mod-http-ndk-dev (>= 1:0.3.2-2), -Standards-Version: 4.7.2 -Homepage: https://github.com/openresty/set-misc-nginx-module -Vcs-Git: https://salsa.debian.org/nginx-team/libnginx-mod-http-set-misc.git -Vcs-Browser: https://salsa.debian.org/nginx-team/libnginx-mod-http-set-misc -Rules-Requires-Root: no - -Package: libnginx-mod-http-set-misc -Architecture: any -Multi-Arch: foreign -Depends: ${misc:Depends}, - ${shlibs:Depends}, -Recommends: nginx, -Description: Extended rewrite directives module for Nginx - This module provides more directives that can be used in - the Nginx rewrite phase, like the 'set' directive. - - URI escaping and unescaping - - JSON quoting - - digests encoding and decoding - - random number generator diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/copyright b/modules_deb/libnginx-mod-http-set-misc-0.33/debian/copyright deleted file mode 100644 index f77abc0..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/copyright +++ /dev/null @@ -1,49 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: memc-nginx-module -Upstream-Contact: Yichun "agentzh" Zhang (章亦春) -Source: https://github.com/openresty/set-misc-nginx-module - -Files: * -Copyright: 2009-2018, Yichun Zhang (章亦春) , OpenResty Inc. -License: BSD-2-clause - -Files: config -Copyright: 2009-2018, Yichun Zhang (章亦春) , OpenResty Inc. -License: BSD-2-clause - -Files: debian/* -Copyright: 2022, Jérémy Lal , - 2022-2025, Jan Mojzis -License: BSD-2-clause - -Files: src/* -Copyright: 2009-2018, Yichun Zhang (章亦春) , OpenResty Inc. -License: BSD-2-clause - -Files: t/* -Copyright: 2009-2018, Yichun Zhang (章亦春) , OpenResty Inc. -License: BSD-2-clause - -Files: util/* -Copyright: 2009-2018, Yichun Zhang (章亦春) , OpenResty Inc. -License: BSD-2-clause - -License: BSD-2-clause - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - . - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright 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 THE COPYRIGHT HOLDERS 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 THE COPYRIGHT - HOLDER 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) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/copyright-scan-patterns.yml b/modules_deb/libnginx-mod-http-set-misc-0.33/debian/copyright-scan-patterns.yml deleted file mode 100644 index e195ac6..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/copyright-scan-patterns.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -ignore: - pattern: - - debian/output diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/fix.scanned.copyright b/modules_deb/libnginx-mod-http-set-misc-0.33/debian/fix.scanned.copyright deleted file mode 100644 index b25e244..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/fix.scanned.copyright +++ /dev/null @@ -1,2 +0,0 @@ -# fixes upstream author name parsing -! copyright Files:~/.*/ Copyright=~"s/(Zhang)\s\(.*x\{6625\}\)/$1\ (章亦春)/" diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/gbp.conf b/modules_deb/libnginx-mod-http-set-misc-0.33/debian/gbp.conf deleted file mode 100644 index 38c12c1..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/gbp.conf +++ /dev/null @@ -1,9 +0,0 @@ -[DEFAULT] -debian-branch = main -upstream-branch = upstream -upstream-tag = upstream/%(version)s -pristine-tar = True -sign-tags = True - -[import-orig] -merge-mode = replace diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/rules b/modules_deb/libnginx-mod-http-set-misc-0.33/debian/rules deleted file mode 100755 index d8309f6..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/rules +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/make -f - -export DEB_BUILD_MAINT_OPTIONS = hardening=+all - -%: - dh $@ diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/source/format b/modules_deb/libnginx-mod-http-set-misc-0.33/debian/source/format deleted file mode 100644 index 163aaf8..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/tests/control b/modules_deb/libnginx-mod-http-set-misc-0.33/debian/tests/control deleted file mode 100644 index 9ecf806..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/tests/control +++ /dev/null @@ -1,13 +0,0 @@ -Tests: generic -Restrictions: allow-stderr isolation-container needs-root -Depends: curl, - nginx, - nginx-core, - @, - -Tests: setifempty -Restrictions: allow-stderr isolation-container needs-root -Depends: curl, - nginx, - nginx-core, - @, diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/tests/generic b/modules_deb/libnginx-mod-http-set-misc-0.33/debian/tests/generic deleted file mode 100644 index a14fc80..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/tests/generic +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -# version 20221215 - -# generic test that only verifies that nginx is running with the given -# libnginx-... module -# - after installation -# - after nginx reload -# - after nginx restart - -EX=0 -CURL_CMD="curl --max-time 60 --silent --fail -o /dev/null" - -#change directory to $AUTOPKGTEST_TMP -cd "${AUTOPKGTEST_TMP}" - -echo -n "curl after installation: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx reload ... " -if invoke-rc.d nginx reload; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - - -echo -n "curl after reload: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -echo -n "nginx restart ... " -if invoke-rc.d nginx restart; then - echo "OK" -else - EX=1 - echo "FAILED" -fi -sleep 5 - -echo -n "curl after restart: http status=" -if $CURL_CMD -w "response_code: %{http_code}, ... " http://127.0.0.1/; then - echo "OK" -else - EX=1 - echo "FAILED" -fi - -if [ ${EX} -ne 0 ]; then - echo "=== journalctl ===" - journalctl -n all -xu nginx.service || : - - echo "=== error.log ===" - if [ `wc -l /var/log/nginx/error.log | cut -d ' ' -f1` -gt 100 ]; then - head -n 50 /var/log/nginx/error.log - echo '...' - tail -n 50 /var/log/nginx/error.log - else - cat /var/log/nginx/error.log - fi -fi - -exit ${EX} diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/tests/setifempty b/modules_deb/libnginx-mod-http-set-misc-0.33/debian/tests/setifempty deleted file mode 100644 index 6aee6f3..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/tests/setifempty +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -set -e - -cat < "/etc/nginx/sites-enabled/default" -server { - listen 80 default_server; - - location /setifempty { - set_if_empty \$var aaa; - set_if_empty \$var bbb; - if (\$var = aaa ) { - return 200; - } - return 500; - } -} -EOF - -exp="response_code: 200" - -nginx -t -invoke-rc.d nginx restart || { journalctl -n all -xu nginx.service; exit 1; } - -out=`curl --fail -w "response_code: %{http_code}\n" http://127.0.0.1/setifempty` - -if [ x"${out}" != x"${exp}" ]; then - echo "output:" - echo "=====================" - echo "${out}" - echo "=====================" - echo "expected output:" - echo "=====================" - echo "${exp}" - echo "=====================" - exit 1 -fi diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/upstream/metadata b/modules_deb/libnginx-mod-http-set-misc-0.33/debian/upstream/metadata deleted file mode 100644 index fe767d2..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/upstream/metadata +++ /dev/null @@ -1,4 +0,0 @@ ---- -Bug-Database: https://github.com/openresty/set-misc-nginx-module/issues -Bug-Submit: https://github.com/openresty/set-misc-nginx-module/issues/new -Repository-Browse: https://github.com/openresty/set-misc-nginx-module diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/watch b/modules_deb/libnginx-mod-http-set-misc-0.33/debian/watch deleted file mode 100644 index b6d7cc0..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/debian/watch +++ /dev/null @@ -1,6 +0,0 @@ -version=4 -opts="\ -uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha|a|b)\d*)$/$1~$2/,\ -" \ -https://github.com/openresty/set-misc-nginx-module/tags \ -(?:.*?/)?v?@ANY_VERSION@@ARCHIVE_EXT@ diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ddebug.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ddebug.h deleted file mode 100644 index aaa6fef..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ddebug.h +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef DDEBUG_H -#define DDEBUG_H - -#include -#include - -#if defined(DDEBUG) && (DDEBUG) - -# if (NGX_HAVE_VARIADIC_MACROS) - -# define dd(...) fprintf(stderr, "set_misc *** "); \ - fprintf(stderr, __VA_ARGS__); \ - fprintf(stderr, " at %s line %d.\n", __FILE__, __LINE__) - -# else - -#include -#include - -#include - -static ngx_inline void -dd(const char *fmt, ...) { -} - -# endif - -#else - -# if (NGX_HAVE_VARIADIC_MACROS) - -# define dd(...) - -# else - -#include - -static ngx_inline void -dd(const char *fmt, ...) { -} - -# endif - -#endif - -#if defined(DDEBUG) && (DDEBUG) - -#define dd_check_read_event_handler(r) \ - dd("r->read_event_handler = %s", \ - r->read_event_handler == ngx_http_block_reading ? \ - "ngx_http_block_reading" : \ - r->read_event_handler == ngx_http_test_reading ? \ - "ngx_http_test_reading" : \ - r->read_event_handler == ngx_http_request_empty_handler ? \ - "ngx_http_request_empty_handler" : "UNKNOWN") - -#define dd_check_write_event_handler(r) \ - dd("r->write_event_handler = %s", \ - r->write_event_handler == ngx_http_handler ? \ - "ngx_http_handler" : \ - r->write_event_handler == ngx_http_core_run_phases ? \ - "ngx_http_core_run_phases" : \ - r->write_event_handler == ngx_http_request_empty_handler ? \ - "ngx_http_request_empty_handler" : "UNKNOWN") - -#else - -#define dd_check_read_event_handler(r) -#define dd_check_write_event_handler(r) - -#endif - -#endif /* DDEBUG_H */ - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base32.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base32.c deleted file mode 100644 index c56c7ba..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base32.c +++ /dev/null @@ -1,263 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include - -#include "ngx_http_set_base32.h" -#include "ngx_http_set_misc_module.h" - - -#define base32_encoded_length(len) ((((len)+4)/5)*8) -#define base32_decoded_length(len) ((((len)+7)/8)*5) - - -static void encode_base32(size_t slen, u_char *src, size_t *dlen, u_char *dst, - ngx_flag_t padding, ngx_str_t *alphabet); -static int decode_base32(size_t slen, u_char *src, size_t *dlen, u_char *dst, - u_char *basis32); - - -ngx_int_t -ngx_http_set_misc_encode_base32(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - size_t len; - u_char *p; - u_char *src, *dst; - - ngx_http_set_misc_loc_conf_t *conf; - - conf = ngx_http_get_module_loc_conf(r, ngx_http_set_misc_module); - - len = base32_encoded_length(v->len); - - dd("estimated dst len: %d", (int) len); - - p = ngx_palloc(r->pool, len); - if (p == NULL) { - return NGX_ERROR; - } - - src = v->data; dst = p; - - encode_base32(v->len, src, &len, dst, conf->base32_padding, - &conf->base32_alphabet); - - res->data = p; - res->len = len; - - dd("res (len %d): %.*s", (int) res->len, (int) res->len, res->data); - - return NGX_OK; -} - - -ngx_int_t -ngx_http_set_misc_decode_base32(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - size_t len; - u_char *p; - u_char *src, *dst; - int ret; - - ngx_http_set_misc_loc_conf_t *conf; - - conf = ngx_http_get_module_loc_conf(r, ngx_http_set_misc_module); - - len = base32_decoded_length(v->len); - - dd("estimated dst len: %d", (int) len); - - p = ngx_palloc(r->pool, len); - if (p == NULL) { - return NGX_ERROR; - } - - src = v->data; dst = p; - - ret = decode_base32(v->len, src, &len, dst, conf->basis32); - - if (ret == 0 /* OK */) { - res->data = p; - res->len = len; - - return NGX_OK; - } - - /* failed to decode */ - - res->data = NULL; - res->len = 0; - - return NGX_OK; -} - - -/* See the implementation in src/core/ngx_string.c's - * ngx_(encode|decode)_base64() for details. */ - -static void -encode_base32(size_t slen, u_char *src, size_t *dlen, u_char *dst, - ngx_flag_t padding, ngx_str_t *alphabet) -{ - unsigned char *basis32 = alphabet->data; - - size_t len; - u_char *s; - u_char *d; - - len = slen; - s = src; - d = dst; - - while (len > 4) { - *d++ = basis32[s[0] >> 3]; - *d++ = basis32[((s[0] & 0x07) << 2) | (s[1] >> 6)]; - *d++ = basis32[(s[1] >> 1) & 0x1f]; - *d++ = basis32[((s[1] & 1) << 4) | (s[2] >> 4)]; - *d++ = basis32[((s[2] & 0x0f) << 1) | (s[3] >> 7)]; - *d++ = basis32[(s[3] >> 2) & 0x1f]; - *d++ = basis32[((s[3] & 0x03) << 3) | (s[4] >> 5)]; - *d++ = basis32[s[4] & 0x1f]; - - s += 5; - len -= 5; - } - - if (len) { - *d++ = basis32[s[0] >> 3]; - - if (len == 1) { - /* 1 byte left */ - *d++ = basis32[(s[0] & 0x07) << 2]; - - /* pad six '='s to the end */ - if (padding) { - *d++ = '='; - *d++ = '='; - *d++ = '='; - *d++ = '='; - *d++ = '='; - } - - } else { - *d++ = basis32[((s[0] & 0x07) << 2) | (s[1] >> 6)]; - *d++ = basis32[(s[1] >> 1) & 0x1f]; - - if (len == 2) { - /* 2 bytes left */ - *d++ = basis32[(s[1] & 1) << 4]; - - /* pad four '='s to the end */ - if (padding) { - *d++ = '='; - *d++ = '='; - *d++ = '='; - } - - } else { - *d++ = basis32[((s[1] & 1) << 4) | (s[2] >> 4)]; - - if (len == 3) { - /* 3 bytes left */ - *d++ = basis32[(s[2] & 0x0f) << 1]; - - if (padding) { - /* pad three '='s to the end */ - *d++ = '='; - *d++ = '='; - } - - } else { - /* 4 bytes left */ - *d++ = basis32[((s[2] & 0x0f) << 1) | (s[3] >> 7)]; - *d++ = basis32[(s[3] >> 2) & 0x1f]; - *d++ = basis32[(s[3] & 0x03) << 3]; - - /* pad one '=' to the end */ - } - } - } - - if (padding) { - *d++ = '='; - } - } - - *dlen = (size_t) (d - dst); -} - - -static int -decode_base32(size_t slen, u_char *src, size_t *dlen, u_char *dst, - u_char *basis32) -{ - size_t len, mod; - u_char *s = src; - u_char *d = dst; - - for (len = 0; len < slen; len++) { - if (s[len] == '=') { - break; - } - - if (basis32[s[len]] == 77) { - return -1; - } - } - - mod = len % 8; - - if (mod == 1 || mod == 3 || mod == 6) { - /* bad Base32 digest length */ - return -1; - } - - while (len > 7) { - *d++ = (basis32[s[0]] << 3) | ((basis32[s[1]] >> 2) & 0x07); - - *d++ = ((basis32[s[1]] & 0x03) << 6) | (basis32[s[2]] << 1) | - ((basis32[s[3]] >> 4) & 1); - - *d++ = ((basis32[s[3]] & 0x0f) << 4) | ((basis32[s[4]] >> 1) & 0x0f); - - *d++ = ((basis32[s[4]] & 1) << 7) | ((basis32[s[5]] & 0x1f) << 2) | - ((basis32[s[6]] >> 3) & 0x03); - *d++ = ((basis32[s[6]] & 0x07) << 5) | (basis32[s[7]] & 0x1f); - - s += 8; - len -= 8; - } - - if (len) { - /* 2 bytes left */ - *d++ = (basis32[s[0]] << 3) | ((basis32[s[1]] >> 2) & 0x07); - - if (len > 2) { - /* 4 bytes left */ - *d++ = ((basis32[s[1]] & 0x03) << 6) | ((basis32[s[2]] & 0x1f) << 1) - | ((basis32[s[3]] >> 4) & 1); - - if (len > 4) { - /* 5 bytes left */ - *d++ = ((basis32[s[3]] & 0x0f) << 4) | - ((basis32[s[4]] >> 1) & 0x0f); - - if (len > 5) { - /* 7 bytes left */ - *d++ = ((basis32[s[4]] & 1) << 7) | - ((basis32[s[5]] & 0x1f) << 2) | - ((basis32[s[6]] >> 3) & 0x03); - } - } - } - } - - *dlen = (size_t) (d - dst); - - return 0; -} diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base32.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base32.h deleted file mode 100644 index 68ca277..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base32.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef NGX_HTTP_SET_BASE32 -#define NGX_HTTP_SET_BASE32 - - -#include -#include -#include - - -ngx_int_t ngx_http_set_misc_encode_base32(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - -ngx_int_t ngx_http_set_misc_decode_base32(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - - -#endif /* NGX_HTTP_SET_BASE32 */ - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base64.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base64.c deleted file mode 100644 index 8666ad8..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base64.c +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include -#include "ngx_http_set_base64.h" - - -ngx_int_t -ngx_http_set_misc_set_decode_base64(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - ngx_str_t src; - - src.len = v->len; - src.data = v->data; - - res->len = ngx_base64_decoded_length(v->len); - ndk_palloc_re(res->data, r->pool, res->len); - - if (ngx_decode_base64(res, &src) != NGX_OK) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_decode_base64: invalid value"); - return NGX_ERROR; - } - - return NGX_OK; -} - - -ngx_int_t -ngx_http_set_misc_set_encode_base64(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - ngx_str_t src; - - src.len = v->len; - src.data = v->data; - - res->len = ngx_base64_encoded_length(v->len); - ndk_palloc_re(res->data, r->pool, res->len); - - ngx_encode_base64(res, &src); - - return NGX_OK; -} - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base64.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base64.h deleted file mode 100644 index 6594c77..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base64.h +++ /dev/null @@ -1,10 +0,0 @@ -#include -#include -#include - -ngx_int_t ngx_http_set_misc_set_encode_base64(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - -ngx_int_t ngx_http_set_misc_set_decode_base64(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base64url.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base64url.c deleted file mode 100644 index f1426ad..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base64url.c +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include -#include "ngx_http_set_base64url.h" - - -ngx_int_t -ngx_http_set_misc_set_decode_base64url(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - - ngx_str_t src; - - src.len = v->len; - src.data = v->data; - - res->len = ngx_base64_decoded_length(v->len); - ndk_palloc_re(res->data, r->pool, res->len); - - if (ngx_decode_base64url(res, &src) != NGX_OK) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_decode_base64url: invalid value"); - return NGX_ERROR; - } - - return NGX_OK; -} - - -ngx_int_t -ngx_http_set_misc_set_encode_base64url(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - - ngx_str_t src; - - src.len = v->len; - src.data = v->data; - - res->len = ngx_base64_encoded_length(v->len); - ndk_palloc_re(res->data, r->pool, res->len); - - ngx_encode_base64url(res, &src); - - return NGX_OK; -} - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base64url.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base64url.h deleted file mode 100644 index 6ccf63b..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_base64url.h +++ /dev/null @@ -1,10 +0,0 @@ -#include -#include -#include - -ngx_int_t ngx_http_set_misc_set_encode_base64url(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - -ngx_int_t ngx_http_set_misc_set_decode_base64url(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_default_value.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_default_value.c deleted file mode 100644 index f4c80a1..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_default_value.c +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include -#include "ngx_http_set_default_value.h" - - -ngx_int_t -ngx_http_set_misc_set_if_empty(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - ngx_http_variable_value_t *cur_v, *default_v; - - cur_v = &v[0]; - default_v = &v[1]; - - if (cur_v->not_found || cur_v->len == 0) { - res->data = default_v->data; - res->len = default_v->len; - - return NGX_OK; - } - - res->data = cur_v->data; - res->len = cur_v->len; - - return NGX_OK; -} - - -char * -ngx_http_set_if_empty(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_str_t *value; - ndk_set_var_t filter; - - value = cf->args->elts; - - filter.type = NDK_SET_VAR_MULTI_VALUE; - filter.func = (void *) ngx_http_set_misc_set_if_empty; - filter.size = 2; - filter.data = NULL; - - return ndk_set_var_multi_value_core(cf, &value[1], &value[1], &filter); -} - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_default_value.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_default_value.h deleted file mode 100644 index 5bf5168..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_default_value.h +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include -#include - -#ifndef NGX_HTTP_SET_DEFAULT_VALUE -#define NGX_HTTP_SET_DEFAULT_VALUE - - -char *ngx_http_set_if_empty(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); -ngx_int_t ngx_http_set_misc_set_if_empty(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - - -#endif /* NGX_HTTP_SET_DEFAULT_VALUE */ diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_escape_uri.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_escape_uri.c deleted file mode 100644 index a09f8da..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_escape_uri.c +++ /dev/null @@ -1,210 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include -#include "ngx_http_set_escape_uri.h" -#include "ngx_string.h" - - -static uintptr_t ngx_escape_uri_patched(u_char *dst, u_char *src, size_t size, - ngx_uint_t type); - - -ngx_int_t -ngx_http_set_misc_escape_uri(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - size_t len; - uintptr_t escape; - u_char *src, *dst; - - if (v->len == 0) { - res->len = 0; - res->data = NULL; - return NGX_OK; - } - - src = v->data; - - dd("before escape:%.*s", v->len, v->data); - escape = 2 * ngx_escape_uri_patched(NULL, src, v->len, NGX_ESCAPE_URI); - /* len = v->len + 2 * ngx_escape_uri(NULL, src, v->len, NGX_ESCAPE_URI); */ - len = escape + v->len; - dd("escaped string len:%zu", len); - - dst = ngx_palloc(r->pool, len); - - if (dst == NULL) { - return NGX_ERROR; - } - - if (escape == 0) { - ngx_memcpy(dst, src, len); - dd("escape == 0"); - - } else { - ngx_escape_uri_patched(dst, src, v->len, NGX_ESCAPE_URI); - } - - res->data = dst; - res->len = len; - - dd("after eacape:%.*s", (int) res->len, res->data); - - return NGX_OK; -} - - -static uintptr_t -ngx_escape_uri_patched(u_char *dst, u_char *src, size_t size, ngx_uint_t type) -{ - ngx_uint_t n; - uint32_t *escape; - static u_char hex[] = "0123456789ABCDEF"; - - /* " ", "#", "%", "?", %00-%1F, %7F-%FF */ - - static uint32_t uri[] = { - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - - /* ?>=< ;:98 7654 3210 /.-, +*)( '&%$ #"! */ - 0xfc00886d, /* 1111 1100 0000 0000 1000 1000 0110 1101 */ - - /* _^]\ [ZYX WVUT SRQP ONML KJIH GFED CBA@ */ - 0x78000000, /* 0111 1000 0000 0000 0000 0000 0000 0000 */ - - /* ~}| {zyx wvut srqp onml kjih gfed cba` */ - 0xa8000000, /* 1010 1000 0000 0000 0000 0000 0000 0000 */ - - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - 0xffffffff /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - }; - - /* " ", "#", "%", "+", "?", %00-%1F, %7F-%FF */ - - static uint32_t args[] = { - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - - /* ?>=< ;:98 7654 3210 /.-, +*)( '&%$ #"! */ - 0x80000829, /* 1000 0000 0000 0000 0000 1000 0010 1001 */ - - /* _^]\ [ZYX WVUT SRQP ONML KJIH GFED CBA@ */ - 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ - - /* ~}| {zyx wvut srqp onml kjih gfed cba` */ - 0x80000000, /* 1000 0000 0000 0000 0000 0000 0000 0000 */ - - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - 0xffffffff /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - }; - - /* " ", "#", """, "%", "'", %00-%1F, %7F-%FF */ - - static uint32_t html[] = { - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - - /* ?>=< ;:98 7654 3210 /.-, +*)( '&%$ #"! */ - 0x000000ad, /* 0000 0000 0000 0000 0000 0000 1010 1101 */ - - /* _^]\ [ZYX WVUT SRQP ONML KJIH GFED CBA@ */ - 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ - - /* ~}| {zyx wvut srqp onml kjih gfed cba` */ - 0x80000000, /* 1000 0000 0000 0000 0000 0000 0000 0000 */ - - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - 0xffffffff /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - }; - - /* " ", """, "%", "'", %00-%1F, %7F-%FF */ - - static uint32_t refresh[] = { - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - - /* ?>=< ;:98 7654 3210 /.-, +*)( '&%$ #"! */ - 0x00000085, /* 0000 0000 0000 0000 0000 0000 1000 0101 */ - - /* _^]\ [ZYX WVUT SRQP ONML KJIH GFED CBA@ */ - 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ - - /* ~}| {zyx wvut srqp onml kjih gfed cba` */ - 0x80000000, /* 1000 0000 0000 0000 0000 0000 0000 0000 */ - - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - 0xffffffff /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - }; - - /* " ", "%", %00-%1F */ - - static uint32_t memcached[] = { - 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ - - /* ?>=< ;:98 7654 3210 /.-, +*)( '&%$ #"! */ - 0x00000021, /* 0000 0000 0000 0000 0000 0000 0010 0001 */ - - /* _^]\ [ZYX WVUT SRQP ONML KJIH GFED CBA@ */ - 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ - - /* ~}| {zyx wvut srqp onml kjih gfed cba` */ - 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ - - 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ - 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ - 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ - 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ - }; - - /* mail_auth is the same as memcached */ - - static uint32_t *map[] = - { uri, args, html, refresh, memcached, memcached }; - - - escape = map[type]; - - if (dst == NULL) { - - /* find the number of the characters to be escaped */ - - n = 0; - - while (size) { - if (escape[*src >> 5] & (1 << (*src & 0x1f))) { - n++; - } - - src++; - size--; - } - - return (uintptr_t) n; - } - - while (size) { - if (escape[*src >> 5] & (1 << (*src & 0x1f))) { - *dst++ = '%'; - *dst++ = hex[*src >> 4]; - *dst++ = hex[*src & 0xf]; - src++; - - } else { - *dst++ = *src++; - } - - size--; - } - - return (uintptr_t) dst; -} - - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_escape_uri.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_escape_uri.h deleted file mode 100644 index b8564bd..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_escape_uri.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef NGX_HTTP_SET_ESCAPE_URI -#define NGX_HTTP_SET_ESCAPE_URI - - -ngx_int_t -ngx_http_set_misc_escape_uri(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v); - - -#endif /* NGX_HTTP_SET_ESCAPE_URI */ diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hash.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hash.c deleted file mode 100644 index 59ad606..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hash.c +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include "ngx_http_set_hash.h" - -#if NGX_HAVE_SHA1 -#include "ngx_sha1.h" - -#ifndef SHA_DIGEST_LENGTH -#define SHA_DIGEST_LENGTH 20 -#endif - -#endif - -#include "ngx_md5.h" - - -#ifndef MD5_DIGEST_LENGTH -#define MD5_DIGEST_LENGTH 16 -#endif - -enum { -#if NGX_HAVE_SHA1 - SHA_HEX_LENGTH = SHA_DIGEST_LENGTH * 2, -#endif - MD5_HEX_LENGTH = MD5_DIGEST_LENGTH * 2 -}; - - -#if NGX_HAVE_SHA1 -ngx_int_t -ngx_http_set_misc_set_sha1(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - u_char *p; - ngx_sha1_t sha; - u_char sha_buf[SHA_DIGEST_LENGTH]; - - p = ngx_palloc(r->pool, SHA_HEX_LENGTH); - if (p == NULL) { - return NGX_ERROR; - } - - ngx_sha1_init(&sha); - ngx_sha1_update(&sha, v->data, v->len); - ngx_sha1_final(sha_buf, &sha); - - ngx_hex_dump(p, sha_buf, sizeof(sha_buf)); - - res->data = p; - res->len = SHA_HEX_LENGTH; - - return NGX_OK; -} -#endif - - -ngx_int_t -ngx_http_set_misc_set_md5(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - u_char *p; - ngx_md5_t md5; - u_char md5_buf[MD5_DIGEST_LENGTH]; - - p = ngx_palloc(r->pool, MD5_HEX_LENGTH); - if (p == NULL) { - return NGX_ERROR; - } - - ngx_md5_init(&md5); - ngx_md5_update(&md5, v->data, v->len); - ngx_md5_final(md5_buf, &md5); - - ngx_hex_dump(p, md5_buf, sizeof(md5_buf)); - - res->data = p; - res->len = MD5_HEX_LENGTH; - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hash.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hash.h deleted file mode 100644 index db3a558..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hash.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef NGX_HTTP_SET_HASH_H -#define NGX_HTTP_SET_HASH_H - - -#include "ngx_http_set_misc_module.h" - - -ngx_int_t ngx_http_set_misc_set_sha1(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - - -ngx_int_t ngx_http_set_misc_set_md5(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - -#endif /* NGX_HTTP_SET_HASH_H */ diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hashed_upstream.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hashed_upstream.c deleted file mode 100644 index 391dd35..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hashed_upstream.c +++ /dev/null @@ -1,141 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include "ngx_http_set_hashed_upstream.h" - - -ngx_uint_t -ngx_http_set_misc_apply_distribution(ngx_log_t *log, ngx_uint_t hash, - ndk_upstream_list_t *ul, ngx_http_set_misc_distribution_t type) -{ - switch (type) { - case ngx_http_set_misc_distribution_modula: - return (uint32_t) hash % (uint32_t) ul->nelts; - - default: - ngx_log_error(NGX_LOG_ERR, log, 0, "apply_distribution: " - "unknown distribution: %d", type); - - return 0; - } - - /* impossible to reach here */ -} - - -ngx_int_t -ngx_http_set_misc_set_hashed_upstream(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v, void *data) -{ - ngx_str_t **u; - ndk_upstream_list_t *ul = data; - ngx_str_t ulname; - ngx_uint_t hash, index; - ngx_http_variable_value_t *key; - - if (ul == NULL) { - ulname.data = v->data; - ulname.len = v->len; - - dd("ulname: %.*s", (int) ulname.len, ulname.data); - - ul = ndk_get_upstream_list(ndk_http_get_main_conf(r), - ulname.data, ulname.len); - - if (ul == NULL) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_hashed_upstream: upstream list \"%V\" " - "not defined yet", &ulname); - return NGX_ERROR; - } - - key = v + 1; - - } else { - key = v; - } - - if (ul->nelts == 0) { - res->data = NULL; - res->len = 0; - - return NGX_OK; - } - - u = ul->elts; - - dd("upstream list: %d upstreams found", (int) ul->nelts); - - if (ul->nelts == 1) { - dd("only one upstream found in the list"); - - res->data = u[0]->data; - res->len = u[0]->len; - - return NGX_OK; - } - - dd("key: \"%.*s\"", key->len, key->data); - - hash = ngx_hash_key_lc(key->data, key->len); - - index = ngx_http_set_misc_apply_distribution(r->connection->log, hash, ul, - ngx_http_set_misc_distribution_modula); - - res->data = u[index]->data; - res->len = u[index]->len; - - return NGX_OK; -} - - -char * -ngx_http_set_hashed_upstream(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_str_t *value; - ndk_set_var_t filter; - ngx_uint_t n; - ngx_str_t *var; - ngx_str_t *ulname; - ndk_upstream_list_t *ul; - ngx_str_t *v; - - value = cf->args->elts; - - var = &value[1]; - ulname = &value[2]; - - n = ngx_http_script_variables_count(ulname); - - filter.func = (void *) ngx_http_set_misc_set_hashed_upstream; - - if (n) { - /* upstream list name contains variables */ - v = &value[2]; - filter.size = 2; - filter.data = NULL; - filter.type = NDK_SET_VAR_MULTI_VALUE_DATA; - - return ndk_set_var_multi_value_core(cf, var, v, &filter); - } - - ul = ndk_get_upstream_list(ndk_http_conf_get_main_conf(cf), - ulname->data, ulname->len); - if (ul == NULL) { - ngx_log_error(NGX_LOG_ERR, cf->log, 0, - "set_hashed_upstream: upstream list \"%V\" " - "not defined yet", ulname); - return NGX_CONF_ERROR; - } - - v = &value[3]; - - filter.size = 1; - filter.data = ul; - filter.type = NDK_SET_VAR_VALUE_DATA; - - return ndk_set_var_value_core(cf, var, v, &filter); -} - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hashed_upstream.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hashed_upstream.h deleted file mode 100644 index 8b7caa7..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hashed_upstream.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef NGX_HTTP_SET_HASHED_UPSTREAM -#define NGX_HTTP_SET_HASHED_UPSTREAM - - -#include -#include -#include -#include - - -typedef enum { - ngx_http_set_misc_distribution_modula, - ngx_http_set_misc_distribution_random /* XXX not used */ -} ngx_http_set_misc_distribution_t; - - -ngx_uint_t ngx_http_set_misc_apply_distribution(ngx_log_t *log, ngx_uint_t hash, - ndk_upstream_list_t *ul, ngx_http_set_misc_distribution_t type); - -char *ngx_http_set_hashed_upstream(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); - -ngx_int_t ngx_http_set_misc_set_hashed_upstream(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v, void *data); - - -#endif /* NGX_HTTP_SET_HASHED_UPSTREAM */ diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hex.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hex.c deleted file mode 100644 index 6900650..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hex.c +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include -#include "ngx_http_set_hex.h" - - -ngx_int_t -ngx_http_set_misc_set_decode_hex(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - u_char *p; - ngx_int_t n; - ngx_uint_t i; - size_t len; - - if (v->len % 2 != 0) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_decode_hex: invalid value"); - return NGX_ERROR; - } - - p = v->data; - len = v->len >> 1; - - res->data = ngx_palloc(r->pool, len); - if (res->data == NULL) { - return NGX_ERROR; - } - - for (i = 0; i < len; i++) { - n = ngx_hextoi(p, 2); - if (n == NGX_ERROR || n > 255) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_decode_hex: invalid value"); - return NGX_ERROR; - } - - p += 2; - res->data[i] = (u_char) n; - } - - res->len = len; - return NGX_OK; -} - - -ngx_int_t -ngx_http_set_misc_set_encode_hex(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - res->len = v->len << 1; - res->data = ngx_palloc(r->pool, res->len); - if (res->data == NULL) { - return NGX_ERROR; - } - - ngx_hex_dump(res->data, v->data, v->len); - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hex.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hex.h deleted file mode 100644 index e8b77e0..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hex.h +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include -#include - -ngx_int_t ngx_http_set_misc_set_decode_hex(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - -ngx_int_t ngx_http_set_misc_set_encode_hex(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hmac.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hmac.c deleted file mode 100644 index 139c0c7..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hmac.c +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include - -#include "ngx_http_set_hmac.h" -#include -#include - - -/* this function's implementation is partly borrowed from - * https://github.com/anomalizer/ngx_aws_auth */ -static ngx_int_t -ngx_http_set_misc_set_hmac(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v, const EVP_MD *evp_md) -{ - ngx_http_variable_value_t *secret, *string_to_sign; - unsigned int md_len = 0; - unsigned char md[EVP_MAX_MD_SIZE]; - - secret = v; - string_to_sign = v + 1; - - dd("secret=%.*s, string_to_sign=%.*s", (int) secret->len, secret->data, - (int) string_to_sign->len, string_to_sign->data); - - HMAC(evp_md, secret->data, secret->len, string_to_sign->data, - string_to_sign->len, md, &md_len); - - /* defensive test if there is something wrong with openssl */ - if (md_len == 0 || md_len > EVP_MAX_MD_SIZE) { - res->len = 0; - return NGX_ERROR; - } - - res->len = md_len; - ndk_palloc_re(res->data, r->pool, md_len); - - ngx_memcpy(res->data, - &md, - md_len); - - return NGX_OK; -} - - -ngx_int_t -ngx_http_set_misc_set_hmac_sha1(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - return ngx_http_set_misc_set_hmac(r, res, v, EVP_sha1()); -} - - -ngx_int_t -ngx_http_set_misc_set_hmac_sha256(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - return ngx_http_set_misc_set_hmac(r, res, v, EVP_sha256()); -} diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hmac.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hmac.h deleted file mode 100644 index fe02ea4..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_hmac.h +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include -#include - -ngx_int_t ngx_http_set_misc_set_hmac_sha1(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - -ngx_int_t ngx_http_set_misc_set_hmac_sha256(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_local_today.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_local_today.c deleted file mode 100644 index fa1c703..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_local_today.c +++ /dev/null @@ -1,110 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include - - -#ifndef NGX_HTTP_SET_MISC_FMT_DATE_LEN -#define NGX_HTTP_SET_MISC_FMT_DATE_LEN 256 -#endif - - -ngx_int_t -ngx_http_set_local_today(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - time_t now; - ngx_tm_t tm; - u_char *p; - - /*t = ngx_timeofday();*/ - - now = ngx_time(); - - ngx_gmtime(now + ngx_cached_time->gmtoff * 60, &tm); - - dd("tm.ngx_tm_hour:%d", tm.ngx_tm_hour); - - p = ngx_palloc(r->pool, sizeof("yyyy-mm-dd") - 1); - if (p == NULL) { - return NGX_ERROR; - } - - ngx_sprintf(p, "%04d-%02d-%02d", tm.ngx_tm_year, tm.ngx_tm_mon, - tm.ngx_tm_mday); - - res->data = p; - res->len = sizeof("yyyy-mm-dd") - 1; - - return NGX_OK; -} - - -ngx_int_t -ngx_http_set_formatted_gmt_time(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - time_t now; - u_char *p; - struct tm tm; - - if (v->not_found || v->len == 0) { - res->data = NULL; - res->len = 0; - return NGX_OK; - } - - now = ngx_time(); - ngx_libc_gmtime(now, &tm); - - p = ngx_palloc(r->pool, NGX_HTTP_SET_MISC_FMT_DATE_LEN); - if (p == NULL) { - return NGX_ERROR; - } - - res->len = strftime((char *) p, NGX_HTTP_SET_MISC_FMT_DATE_LEN, - (char *) v->data, &tm); - if (res->len == 0) { - return NGX_ERROR; - } - - res->data = p; - - return NGX_OK; -} - - -ngx_int_t -ngx_http_set_formatted_local_time(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - time_t now; - u_char *p; - struct tm tm; - - if (v->not_found || v->len == 0) { - res->data = NULL; - res->len = 0; - return NGX_OK; - } - - now = ngx_time(); - ngx_libc_localtime(now, &tm); - - p = ngx_palloc(r->pool, NGX_HTTP_SET_MISC_FMT_DATE_LEN); - if (p == NULL) { - return NGX_ERROR; - } - - res->len = strftime((char *) p, NGX_HTTP_SET_MISC_FMT_DATE_LEN, - (char *) v->data, &tm); - if (res->len == 0) { - return NGX_ERROR; - } - - res->data = p; - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_local_today.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_local_today.h deleted file mode 100644 index 993431e..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_local_today.h +++ /dev/null @@ -1,13 +0,0 @@ -#include -#include -#include - - -ngx_int_t ngx_http_set_local_today(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v); - -ngx_int_t ngx_http_set_formatted_gmt_time(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v); - -ngx_int_t ngx_http_set_formatted_local_time(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_misc_module.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_misc_module.c deleted file mode 100644 index 3b12b0e..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_misc_module.c +++ /dev/null @@ -1,586 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include "ngx_http_set_misc_module.h" -#include -#include "ngx_http_set_base32.h" -#include "ngx_http_set_default_value.h" -#include "ngx_http_set_hashed_upstream.h" -#include "ngx_http_set_unescape_uri.h" -#include "ngx_http_set_quote_sql.h" -#include "ngx_http_set_quote_json.h" -#include "ngx_http_set_escape_uri.h" -#include "ngx_http_set_local_today.h" -#include "ngx_http_set_hash.h" -#include "ngx_http_set_hex.h" -#include "ngx_http_set_base64.h" -#include "ngx_http_set_base64url.h" -#if NGX_OPENSSL -#include "ngx_http_set_hmac.h" -#endif -#include "ngx_http_set_random.h" -#include "ngx_http_set_secure_random.h" -#include "ngx_http_set_rotate.h" - - -#define NGX_UNESCAPE_URI_COMPONENT 0 -#define BASE32_ALPHABET_LEN 32 - - -static void *ngx_http_set_misc_create_loc_conf(ngx_conf_t *cf); -static char *ngx_http_set_misc_merge_loc_conf(ngx_conf_t *cf, void *parent, - void *child); -static char *ngx_http_set_misc_base32_alphabet(ngx_conf_t *cf, - ngx_command_t *cmd, void *conf); - - -static ngx_conf_deprecated_t ngx_conf_deprecated_set_misc_base32_padding = { - ngx_conf_deprecated, "set_misc_base32_padding", "set_base32_padding" -}; - - -static ndk_set_var_t ngx_http_set_misc_set_encode_base64_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_set_encode_base64, - 1, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_set_decode_base64_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_set_decode_base64, - 1, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_set_encode_base64url_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_set_encode_base64url, - 1, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_set_decode_base64url_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_set_decode_base64url, - 1, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_set_decode_hex_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_set_decode_hex, - 1, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_set_encode_hex_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_set_encode_hex, - 1, - NULL -}; - - -#if NGX_OPENSSL -static ndk_set_var_t ngx_http_set_misc_set_hmac_sha1_filter = { - NDK_SET_VAR_MULTI_VALUE, - (void *) ngx_http_set_misc_set_hmac_sha1, - 2, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_set_hmac_sha256_filter = { - NDK_SET_VAR_MULTI_VALUE, - (void *) ngx_http_set_misc_set_hmac_sha256, - 2, - NULL -}; -#endif - - -#ifndef NGX_HTTP_SET_HASH -static ndk_set_var_t ngx_http_set_misc_set_md5_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_set_md5, - 1, - NULL -}; - - -#if NGX_HAVE_SHA1 -static ndk_set_var_t ngx_http_set_misc_set_sha1_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_set_sha1, - 1, - NULL -}; -#endif -#endif - - -static ndk_set_var_t ngx_http_set_misc_unescape_uri_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_unescape_uri, - 1, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_escape_uri_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_escape_uri, - 1, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_decode_base32_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_decode_base32, - 1, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_quote_sql_str_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_quote_sql_str, - 1, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_quote_pgsql_str_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_quote_pgsql_str, - 1, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_quote_json_str_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_quote_json_str, - 1, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_encode_base32_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_encode_base32, - 1, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_local_today_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_local_today, - 0, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_formatted_gmt_time_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_formatted_gmt_time, - 2, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_formatted_local_time_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_formatted_local_time, - 2, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_set_random_filter = { - NDK_SET_VAR_MULTI_VALUE, - (void *) ngx_http_set_misc_set_random, - 2, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_set_secure_random_alphanum_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_set_secure_random_alphanum, - 1, - NULL -}; - - -static ndk_set_var_t ngx_http_set_misc_set_secure_random_lcalpha_filter = { - NDK_SET_VAR_VALUE, - (void *) ngx_http_set_misc_set_secure_random_lcalpha, - 1, - NULL -}; - - -static ngx_command_t ngx_http_set_misc_commands[] = { - { ngx_string ("set_encode_base64"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_set_encode_base64_filter - }, - { ngx_string ("set_decode_base64"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_set_decode_base64_filter - }, - { ngx_string ("set_encode_base64url"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_set_encode_base64url_filter - }, - { ngx_string ("set_decode_base64url"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_set_decode_base64url_filter - }, - { ngx_string ("set_decode_hex"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_set_decode_hex_filter - }, - { ngx_string ("set_encode_hex"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_set_encode_hex_filter - }, -#if NGX_OPENSSL - { ngx_string ("set_hmac_sha1"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE3, - ndk_set_var_multi_value, - 0, - 0, - &ngx_http_set_misc_set_hmac_sha1_filter - }, - { ngx_string ("set_hmac_sha256"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE3, - ndk_set_var_multi_value, - 0, - 0, - &ngx_http_set_misc_set_hmac_sha256_filter - }, -#endif -#ifndef NGX_HTTP_SET_HASH - { ngx_string ("set_md5"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_set_md5_filter - }, -#if NGX_HAVE_SHA1 - { - ngx_string ("set_sha1"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_set_sha1_filter - }, -#endif -#endif - { - ngx_string ("set_unescape_uri"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_unescape_uri_filter - }, - { - ngx_string ("set_escape_uri"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_escape_uri_filter - }, - { - ngx_string ("set_quote_sql_str"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_quote_sql_str_filter - }, - { - ngx_string ("set_quote_pgsql_str"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_quote_pgsql_str_filter - }, - { - ngx_string ("set_quote_json_str"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_quote_json_str_filter - }, - { - ngx_string ("set_if_empty"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE2, - ngx_http_set_if_empty, - 0, - 0, - NULL - }, - { - ngx_string("set_hashed_upstream"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE3, - ngx_http_set_hashed_upstream, - 0, - 0, - NULL - }, - { - /* this is now deprecated; use set_base32_padding instead */ - ngx_string("set_misc_base32_padding"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_FLAG, - ngx_conf_set_flag_slot, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_set_misc_loc_conf_t, base32_padding), - &ngx_conf_deprecated_set_misc_base32_padding, - }, - { - ngx_string("set_base32_padding"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_FLAG, - ngx_conf_set_flag_slot, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_set_misc_loc_conf_t, base32_padding), - NULL - }, - { - ngx_string("set_base32_alphabet"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE1, - ngx_http_set_misc_base32_alphabet, - NGX_HTTP_LOC_CONF_OFFSET, - offsetof(ngx_http_set_misc_loc_conf_t, base32_alphabet), - NULL - }, - { - ngx_string("set_encode_base32"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_encode_base32_filter - }, - { - ngx_string("set_decode_base32"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_decode_base32_filter - }, - { - ngx_string("set_local_today"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE1, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_local_today_filter - }, - { - ngx_string("set_formatted_gmt_time"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE2, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_formatted_gmt_time_filter - }, - { - ngx_string("set_formatted_local_time"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE2, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_formatted_local_time_filter - }, - { ngx_string ("set_random"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE3, - ndk_set_var_multi_value, - 0, - 0, - &ngx_http_set_misc_set_random_filter - }, - { ngx_string ("set_secure_random_alphanum"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_set_secure_random_alphanum_filter - }, - { ngx_string ("set_secure_random_lcalpha"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE12, - ndk_set_var_value, - 0, - 0, - &ngx_http_set_misc_set_secure_random_lcalpha_filter - }, - { ngx_string ("set_rotate"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF - |NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE3, - ngx_http_set_rotate, - 0, - 0, - NULL - }, - - ngx_null_command -}; - - -static ngx_http_module_t ngx_http_set_misc_module_ctx = { - NULL, /* preconfiguration */ - NULL, /* postconfiguration */ - - NULL, /* create main configuration */ - NULL, /* init main configuration */ - - NULL, /* create server configuration */ - NULL, /* merge server configuration */ - - ngx_http_set_misc_create_loc_conf, /* create location configuration */ - ngx_http_set_misc_merge_loc_conf /* merge location configuration */ -}; - - -ngx_module_t ngx_http_set_misc_module = { - NGX_MODULE_V1, - &ngx_http_set_misc_module_ctx, /* module context */ - ngx_http_set_misc_commands, /* module directives */ - NGX_HTTP_MODULE, /* module type */ - NULL, /* init master */ - NULL, /* init module */ - NULL, /* init process */ - NULL, /* init thread */ - NULL, /* exit thread */ - NULL, /* exit process */ - NULL, /* exit master */ - NGX_MODULE_V1_PADDING -}; - - -void * -ngx_http_set_misc_create_loc_conf(ngx_conf_t *cf) -{ - ngx_http_set_misc_loc_conf_t *conf; - - conf = ngx_palloc(cf->pool, sizeof(ngx_http_set_misc_loc_conf_t)); - if (conf == NULL) { - return NULL; - } - - conf->base32_padding = NGX_CONF_UNSET; - conf->base32_alphabet.data = NULL; - conf->base32_alphabet.len = 0; - conf->current = NGX_CONF_UNSET; - - return conf; -} - - -char * -ngx_http_set_misc_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) -{ - ngx_uint_t i; - - ngx_http_set_misc_loc_conf_t *prev = parent; - ngx_http_set_misc_loc_conf_t *conf = child; - - ngx_conf_merge_value(conf->base32_padding, prev->base32_padding, 1); - - ngx_conf_merge_str_value(conf->base32_alphabet, prev->base32_alphabet, - "0123456789abcdefghijklmnopqrstuv"); - - ngx_conf_merge_value(conf->current, prev->current, NGX_CONF_UNSET); - - for (i = 0; i < BASE32_ALPHABET_LEN; i++) { - conf->basis32[conf->base32_alphabet.data[i]] = (u_char) i; - } - - return NGX_CONF_OK; -} - - -static char * -ngx_http_set_misc_base32_alphabet(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf) -{ - ngx_str_t *value; - - value = cf->args->elts; - - if (value[1].len != BASE32_ALPHABET_LEN) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "\"set_base32_alphabet\" directive takes an " - "alphabet of %uz bytes but %d expected", - value[1].len, BASE32_ALPHABET_LEN); - return NGX_CONF_ERROR; - } - - return ngx_conf_set_str_slot(cf, cmd, conf); -} diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_misc_module.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_misc_module.h deleted file mode 100644 index 49b3c9e..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_misc_module.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef NGX_HTTP_SET_MISC_MODULE_H -#define NGX_HTTP_SET_MISC_MODULE_H - - -#include -#include -#include -#include - - -#ifndef NGX_HAVE_SHA1 -# if (nginx_version >= 1011002) -# define NGX_HAVE_SHA1 1 -# endif -#endif - - -typedef struct { - ngx_flag_t base32_padding; - ngx_str_t base32_alphabet; - u_char basis32[256]; - ngx_int_t current; /* for set_rotate */ -} ngx_http_set_misc_loc_conf_t; - - -extern ngx_module_t ngx_http_set_misc_module; - - -#endif /* NGX_HTTP_SET_MISC_MODULE_H */ - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_quote_json.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_quote_json.c deleted file mode 100644 index 4bed13c..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_quote_json.c +++ /dev/null @@ -1,165 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include -#include "ngx_http_set_quote_json.h" - -ngx_int_t -ngx_http_set_misc_quote_json_str(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - size_t len; - u_char *p; - size_t escape; - - if (v->not_found || v->len == 0) { - res->data = (u_char *) "null"; - res->len = sizeof("null") - 1; - return NGX_OK; - } - - escape = ngx_http_set_misc_escape_json_str(NULL, v->data, v->len); - - len = sizeof("''") - 1 - + v->len - + escape; - - p = ngx_palloc(r->pool, len); - if (p == NULL) { - return NGX_ERROR; - } - - res->data = p; - res->len = len; - - *p++ = '\"'; - - if (escape == 0) { - p = ngx_copy(p, v->data, v->len); - - } else { - p = (u_char *) ngx_http_set_misc_escape_json_str(p, v->data, v->len); - } - - *p++ = '\"'; - - if (p != res->data + res->len) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_quote_sql_str: buffer error"); - return NGX_ERROR; - } - - return NGX_OK; -} - - -uintptr_t -ngx_http_set_misc_escape_json_str(u_char *dst, u_char *src, size_t size) -{ - ngx_uint_t n; - - static u_char hex[] = "0123456789abcdef"; - - if (dst == NULL) { - /* find the number of characters to be escaped */ - - n = 0; - - while (size) { - /* UTF-8 char has high bit of 1 */ - if ((*src & 0x80) == 0) { - switch (*src) { - case '\r': - case '\n': - case '\\': - case '"': - case '\f': - case '\b': - case '\t': - n++; - break; - default: - if (*src < 32) { - n += sizeof("\\u00xx") - 2; - } - - break; - } - } - - src++; - size--; - } - - return (uintptr_t) n; - } - - while (size) { - if ((*src & 0x80) == 0) { - switch (*src) { - case '\r': - *dst++ = '\\'; - *dst++ = 'r'; - break; - - case '\n': - *dst++ = '\\'; - *dst++ = 'n'; - break; - - case '\\': - *dst++ = '\\'; - *dst++ = '\\'; - break; - - case '"': - *dst++ = '\\'; - *dst++ = '"'; - break; - - case '\f': - *dst++ = '\\'; - *dst++ = 'f'; - break; - - case '\b': - *dst++ = '\\'; - *dst++ = 'b'; - break; - - case '\t': - *dst++ = '\\'; - *dst++ = 't'; - break; - - default: - if (*src < 32) { /* control chars */ - *dst++ = '\\'; - *dst++ = 'u'; - *dst++ = '0'; - *dst++ = '0'; - *dst++ = hex[*src >> 4]; - *dst++ = hex[*src & 0x0f]; - - } else { - *dst++ = *src; - } - - break; - } /* switch */ - - src++; - - } else { - *dst++ = *src++; - } - - size--; - } - - return (uintptr_t) dst; -} - - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_quote_json.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_quote_json.h deleted file mode 100644 index 1bf55e2..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_quote_json.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef NGX_HTTP_SET_QUOTE_JSON_H -#define NGX_HTTP_SET_QUOTE_JSON_H - - -#include -#include -#include - - -ngx_int_t ngx_http_set_misc_quote_json_str(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); -uintptr_t ngx_http_set_misc_escape_json_str(u_char *dst, u_char *src, - size_t size); - - -#endif /* NGX_HTTP_SET_QUOTE_JSON_H */ diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_quote_sql.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_quote_sql.c deleted file mode 100644 index 8d78348..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_quote_sql.c +++ /dev/null @@ -1,382 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include -#include "ngx_http_set_quote_sql.h" - - -static ngx_int_t ngx_http_pg_utf_escape(ngx_http_request_t *r, ngx_str_t *res); -static ngx_int_t ngx_http_pg_utf_islegal(const unsigned char *s, ngx_int_t len); -static ngx_int_t ngx_http_pg_utf_mblen(const unsigned char *s); - - -ngx_int_t -ngx_http_set_misc_quote_pgsql_str(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - u_char *pstr; - ngx_int_t length; - - if (v->not_found || v->len ==0) { - res->data = (u_char *) "''"; - res->len = sizeof("''") - 1; - return NGX_OK; - } - - ngx_http_set_misc_quote_sql_str(r, res, v); - length = res->len; - - pstr = ngx_palloc(r->pool, length + 1); - if (pstr == NULL) { - return NGX_ERROR; - } - - *pstr = 'E'; - memcpy(pstr + 1, res->data, length); - res->data = pstr; - res->len = length + 1; - - if (ngx_http_pg_utf_islegal(res->data, res->len)) { - return NGX_OK; - } - - if (ngx_http_pg_utf_escape(r, res) != NGX_OK) { - return NGX_ERROR; - } - - return NGX_OK; -} - - -static ngx_int_t -ngx_http_pg_utf_mblen(const unsigned char *s) -{ - int len; - - if ((*s & 0x80) == 0) - len = 1; - else if ((*s & 0xe0) == 0xc0) - len = 2; - else if ((*s & 0xf0) == 0xe0) - len = 3; - else if ((*s & 0xf8) == 0xf0) - len = 4; -#ifdef NOT_USED - else if ((*s & 0xfc) == 0xf8) - len = 5; - else if ((*s & 0xfe) == 0xfc) - len = 6; -#endif - else - len = 1; - return len; -} - - -static ngx_int_t -ngx_http_pg_utf_islegal(const unsigned char *s, ngx_int_t len) -{ - ngx_int_t mblen; - ngx_int_t slen; - u_char a; - - slen = len; - - while (slen > 0) { - mblen = ngx_http_pg_utf_mblen(s); - if (slen < mblen) { - return 0; - } - - switch (mblen) { - - case 4: - a = *(s + 3); - if (a < 0x80 || a > 0xBF) { - return 0; - } - - break; - - case 3: - a = *(s + 2); - if (a < 0x80 || a > 0xBF) { - return 0; - } - - break; - - case 2: - a = *(s + 1); - - switch (*s) { - - case 0xE0: - if (a < 0xA0 || a > 0xBF) { - return 0; - } - - break; - - case 0xED: - if (a < 0x80 || a > 0x9F) { - return 0; - } - - break; - - case 0xF0: - if (a < 0x90 || a > 0xBF) { - return 0; - } - - break; - - case 0xF4: - if (a < 0x80 || a > 0x8F) { - return 0; - } - - break; - - default: - if (a < 0x80 || a > 0xBF) { - return 0; - } - - break; - } - - break; - - case 1: - a = *s; - if (a >= 0x80 && a < 0xC2) { - return 0; - } - - if (a > 0xF4) { - return 0; - } - - break; - - default: - return 0; - } - - s += mblen; - slen -= mblen; - } - - return 1; -} - - -static ngx_int_t -ngx_http_pg_utf_escape(ngx_http_request_t *r, ngx_str_t *res) -{ - ngx_str_t *result; - ngx_int_t l, count; - u_char *d, *p, *p1; - - l = res->len; - d = res->data; - result = res; - count = 0; - - while (l-- > 0) { - if (*d & 0x80) { - count += 4; - } - - d++; - count++; - } - - d = res->data; - l = res->len; - - p = ngx_palloc(r->pool, count); - if (p == NULL) { - return NGX_ERROR; - } - - p1 = p; - while (l-- > 0) { - if ((*d & 0x80)) { - *p++ = '\\'; - *p++ = '\\'; - *p++ = (*d >> 6) + '0'; - *p++ = ((*d >> 3) & 07) + '0'; - *p++ = (*d & 07) + '0'; - - } else { - *p++ = *d; - } - - d++; - } - - result->len = count; - result->data = p1; - - return NGX_OK; -} - - -ngx_int_t -ngx_http_set_misc_quote_sql_str(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - size_t len; - u_char *p; - size_t escape; - - if (v->not_found || v->len == 0) { - res->data = (u_char *) "''"; - res->len = sizeof("''") - 1; - return NGX_OK; - } - - escape = ngx_http_set_misc_escape_sql_str(NULL, v->data, v->len); - - len = sizeof("''") - 1 + v->len + escape; - - p = ngx_palloc(r->pool, len); - if (p == NULL) { - return NGX_ERROR; - } - - res->data = p; - res->len = len; - - *p++ = '\''; - - if (escape == 0) { - p = ngx_copy(p, v->data, v->len); - - } else { - p = (u_char *) ngx_http_set_misc_escape_sql_str(p, v->data, v->len); - } - - *p++ = '\''; - - if (p != res->data + res->len) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_quote_sql_str: buffer error"); - return NGX_ERROR; - } - - return NGX_OK; -} - - -uintptr_t -ngx_http_set_misc_escape_sql_str(u_char *dst, u_char *src, size_t size) -{ - ngx_uint_t n; - - if (dst == NULL) { - /* find the number of chars to be escaped */ - n = 0; - while (size) { - /* the highest bit of all the UTF-8 chars - * is always 1 */ - if ((*src & 0x80) == 0) { - switch (*src) { - case '\0': - case '\b': - case '\n': - case '\r': - case '\t': - case '\\': - case '\'': - case '"': - case '$': - case 26: /* \Z */ - n++; - break; - default: - break; - } - } - - src++; - size--; - } - - return (uintptr_t) n; - } - - while (size) { - if ((*src & 0x80) == 0) { - switch (*src) { - case '\0': - *dst++ = '\\'; - *dst++ = '0'; - break; - - case '\b': - *dst++ = '\\'; - *dst++ = 'b'; - break; - - case '\n': - *dst++ = '\\'; - *dst++ = 'n'; - break; - - case '\r': - *dst++ = '\\'; - *dst++ = 'r'; - break; - - case '\t': - *dst++ = '\\'; - *dst++ = 't'; - break; - - case '\\': - *dst++ = '\\'; - *dst++ = '\\'; - break; - - case '\'': - *dst++ = '\\'; - *dst++ = '\''; - break; - - case '"': - *dst++ = '\\'; - *dst++ = '"'; - break; - - case '$': - *dst++ = '\\'; - *dst++ = '$'; - break; - - case 26: - *dst++ = '\\'; - *dst++ = 'Z'; - break; - - default: - *dst++ = *src; - break; - } - - } else { - *dst++ = *src; - } - - src++; - size--; - } /* while (size) */ - - return (uintptr_t) dst; -} - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_quote_sql.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_quote_sql.h deleted file mode 100644 index c631dd7..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_quote_sql.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef NGX_SET_QUOTE_SQL_H -#define NGX_SET_QUOTE_SQL_H - - -#include -#include -#include - - -uintptr_t ngx_http_set_misc_escape_sql_str(u_char *dst, u_char *src, - size_t size); - -ngx_int_t ngx_http_set_misc_quote_sql_str(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - -ngx_int_t ngx_http_set_misc_quote_pgsql_str(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - - -#endif /* NGX_SET_QUOTE_SQL_H */ - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_random.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_random.c deleted file mode 100644 index c223633..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_random.c +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include -#include "ngx_http_set_random.h" -#include - - -ngx_int_t -ngx_http_set_misc_set_random(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - ngx_http_variable_value_t *rand_from, *rand_to; - ngx_int_t int_from, int_to, tmp, random; - - rand_from = v; - rand_to = v + 1; - - int_from = ngx_atoi(rand_from->data, rand_from->len); - if (int_from == NGX_ERROR) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_random: bad \"from\" argument: %v", rand_from); - return NGX_ERROR; - } - - int_to = ngx_atoi(rand_to->data, rand_to->len); - if (int_to == NGX_ERROR) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_random: bad \"to\" argument: %v", rand_to); - return NGX_ERROR; - } - - if (int_from > int_to) { - tmp = int_from; - int_from = int_to; - int_to = tmp; - } - - random = rand() % (int_to - int_from + 1) + int_from; - - res->data = ngx_palloc(r->pool, NGX_INT_T_LEN); - if (res->data == NULL) { - return NGX_ERROR; - } - - res->len = ngx_sprintf(res->data, "%i", random) - res->data; - - /* Set all required params */ - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_random.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_random.h deleted file mode 100644 index 88cffdc..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_random.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef NGX_SET_RANDOM_H -#define NGX_SET_RANDOM_H - -#include -#include -#include - -ngx_int_t ngx_http_set_misc_set_random(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - -#endif /* NGX_SET_RANDOM_H */ - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_rotate.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_rotate.c deleted file mode 100644 index b83dee7..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_rotate.c +++ /dev/null @@ -1,113 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include -#include "ngx_http_set_rotate.h" -#include "ngx_http_set_misc_module.h" -#include - - -ngx_int_t -ngx_http_set_misc_set_rotate(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - ngx_http_variable_value_t *rotate_from, *rotate_to, *rotate_num; - ngx_int_t int_from, int_to, tmp, int_current; - - ngx_http_set_misc_loc_conf_t *conf; - - rotate_num = &v[0]; - rotate_from = &v[1]; - rotate_to = &v[2]; - - int_from = ngx_atoi(rotate_from->data, rotate_from->len); - if (int_from == NGX_ERROR) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_rotate: bad \"from\" argument value: \"%v\"", - rotate_from); - return NGX_ERROR; - } - - int_to = ngx_atoi(rotate_to->data, rotate_to->len); - if (int_to == NGX_ERROR) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_rotate: bad \"to\" argument value: \"%v\"", - rotate_to); - return NGX_ERROR; - } - - if (int_from > int_to) { - tmp = int_from; - int_from = int_to; - int_to = tmp; - } - - conf = ngx_http_get_module_loc_conf(r, ngx_http_set_misc_module); - - dd("current value not found: %d", (int) rotate_num->not_found); - - if (rotate_num->len == 0) { - if (conf->current != NGX_CONF_UNSET) { - int_current = conf->current; - - } else { - int_current = int_from - 1; - } - - } else { - - int_current = ngx_atoi(rotate_num->data, rotate_num->len); - if (int_current == NGX_ERROR) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_rotate: bad current value: \"%v\"", rotate_num); - - if (conf->current != NGX_CONF_UNSET) { - int_current = conf->current; - - } else { - int_current = int_from - 1; - } - } - } - - int_current++; - - if (int_current > int_to || int_current < int_from) { - int_current = int_from; - } - - conf->current = int_current; - - res->data = ngx_palloc(r->pool, NGX_INT_T_LEN); - if (res->data == NULL) { - return NGX_ERROR; - } - - res->len = ngx_sprintf(res->data, "%i", int_current) - res->data; - - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - - return NGX_OK; -} - - -char * -ngx_http_set_rotate(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - ngx_str_t *value; - ndk_set_var_t filter; - - value = cf->args->elts; - - filter.type = NDK_SET_VAR_MULTI_VALUE; - filter.func = (void *) ngx_http_set_misc_set_rotate; - filter.size = 3; - filter.data = NULL; - - return ndk_set_var_multi_value_core(cf, &value[1], &value[1], &filter); -} - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_rotate.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_rotate.h deleted file mode 100644 index 429204c..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_rotate.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef NGX_HTTP_SET_MISC_ROTATE_H -#define NGX_HTTP_SET_MISC_ROTATE_H - - -#include -#include -#include - - -char *ngx_http_set_rotate(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); - -ngx_int_t ngx_http_set_misc_set_rotate(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - - -#endif /* NGX_HTTP_SET_MISC_ROTATE_H */ - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_secure_random.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_secure_random.c deleted file mode 100644 index a07efe8..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_secure_random.c +++ /dev/null @@ -1,104 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - - -#include -#include "ngx_http_set_secure_random.h" -#include - - -enum { - MAX_RANDOM_STRING = 64, - ALPHANUM = 1, - LCALPHA = 2 -}; - - -static ngx_int_t -ngx_http_set_misc_set_secure_random_common(int alphabet_type, - ngx_http_request_t *r, ngx_str_t *res, ngx_http_variable_value_t *v); - - -ngx_int_t -ngx_http_set_misc_set_secure_random_alphanum(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v) -{ - return ngx_http_set_misc_set_secure_random_common(ALPHANUM, r, res, v); -} - - -ngx_int_t -ngx_http_set_misc_set_secure_random_lcalpha(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v) -{ - return ngx_http_set_misc_set_secure_random_common(LCALPHA, r, res, v); -} - - -static ngx_int_t -ngx_http_set_misc_set_secure_random_common(int alphabet_type, - ngx_http_request_t *r, ngx_str_t *res, ngx_http_variable_value_t *v) -{ - static u_char alphabet[] = "abcdefghijklmnopqrstuvwxyz" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; - - u_char entropy[MAX_RANDOM_STRING]; - u_char output[MAX_RANDOM_STRING]; - ngx_int_t length, i; - ngx_fd_t fd; - ssize_t n; - - length = ngx_atoi(v->data, v->len); - - if (length == NGX_ERROR || length < 1 || length > MAX_RANDOM_STRING) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_random: bad \"length\" argument: %v", v); - return NGX_ERROR; - } - - fd = ngx_open_file((u_char *) "/dev/urandom", NGX_FILE_RDONLY, - NGX_FILE_OPEN, 0); - if (fd == NGX_INVALID_FILE) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_secure_random: could not open /dev/urandom"); - return NGX_ERROR; - } - - n = ngx_read_fd(fd, entropy, length); - if (n != length) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_secure_random: could not read all %i byte(s) from " - "/dev/urandom", length); - ngx_close_file(fd); - return NGX_ERROR; - } - - ngx_close_file(fd); - - for (i = 0; i < length; i++) { - if (alphabet_type == LCALPHA) { - output[i] = entropy[i] % 26 + 'a'; - - } else { - output[i] = alphabet[ entropy[i] % (sizeof alphabet - 1) ]; - } - } - - res->data = ngx_palloc(r->pool, length); - if (res->data == NULL) { - return NGX_ERROR; - } - - ngx_memcpy(res->data, output, length); - - res->len = length; - - /* set all required params */ - v->valid = 1; - v->no_cacheable = 0; - v->not_found = 0; - - return NGX_OK; -} diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_secure_random.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_secure_random.h deleted file mode 100644 index d65129e..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_secure_random.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef NGX_SET_SECURE_RANDOM_H -#define NGX_SET_SECURE_RANDOM_H - -#include -#include -#include - -ngx_int_t ngx_http_set_misc_set_secure_random_alphanum(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - -ngx_int_t ngx_http_set_misc_set_secure_random_lcalpha(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - -#endif /* NGX_SET_SECURE_RANDOM_H */ - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_unescape_uri.c b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_unescape_uri.c deleted file mode 100644 index 3ae1d0a..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_unescape_uri.c +++ /dev/null @@ -1,184 +0,0 @@ -#ifndef DDEBUG -#define DDEBUG 0 -#endif -#include "ddebug.h" - -#include -#include "ngx_http_set_unescape_uri.h" - -#define NGX_UNESCAPE_URI_COMPONENT 0 - - -static void ngx_unescape_uri_patched(u_char **dst, u_char **src, size_t size, - ngx_uint_t type); - - -ngx_int_t -ngx_http_set_misc_unescape_uri(ngx_http_request_t *r, ngx_str_t *res, - ngx_http_variable_value_t *v) -{ - size_t len; - u_char *p; - u_char *src, *dst; - - /* the unescaped string can only be smaller */ - len = v->len; - - p = ngx_palloc(r->pool, len); - if (p == NULL) { - return NGX_ERROR; - } - - src = v->data; dst = p; - - ngx_unescape_uri_patched(&dst, &src, v->len, NGX_UNESCAPE_URI_COMPONENT); - - if (src != v->data + v->len) { - ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "set_unescape_uri: input data not consumed completely"); - return NGX_ERROR; - } - - res->data = p; - res->len = dst - p; - - return NGX_OK; -} - - -/* XXX we also decode '+' to ' ' */ -static void -ngx_unescape_uri_patched(u_char **dst, u_char **src, size_t size, - ngx_uint_t type) -{ - u_char *d, *s, ch, c, decoded; - enum { - sw_usual = 0, - sw_quoted, - sw_quoted_second - } state; - - d = *dst; - s = *src; - - state = 0; - decoded = 0; - - while (size--) { - - ch = *s++; - - switch (state) { - case sw_usual: - if (ch == '?' - && (type & (NGX_UNESCAPE_URI|NGX_UNESCAPE_REDIRECT))) - { - *d++ = ch; - goto done; - } - - if (ch == '%') { - state = sw_quoted; - break; - } - - if (ch == '+') { - *d++ = ' '; - break; - } - - *d++ = ch; - break; - - case sw_quoted: - - if (ch >= '0' && ch <= '9') { - decoded = (u_char) (ch - '0'); - state = sw_quoted_second; - break; - } - - c = (u_char) (ch | 0x20); - if (c >= 'a' && c <= 'f') { - decoded = (u_char) (c - 'a' + 10); - state = sw_quoted_second; - break; - } - - /* the invalid quoted character */ - - state = sw_usual; - - *d++ = ch; - - break; - - case sw_quoted_second: - - state = sw_usual; - - if (ch >= '0' && ch <= '9') { - ch = (u_char) ((decoded << 4) + ch - '0'); - - if (type & NGX_UNESCAPE_REDIRECT) { - if (ch > '%' && ch < 0x7f) { - *d++ = ch; - break; - } - - *d++ = '%'; *d++ = *(s - 2); *d++ = *(s - 1); - - break; - } - - *d++ = ch; - - break; - } - - c = (u_char) (ch | 0x20); - if (c >= 'a' && c <= 'f') { - ch = (u_char) ((decoded << 4) + c - 'a' + 10); - - if (type & NGX_UNESCAPE_URI) { - if (ch == '?') { - *d++ = ch; - goto done; - } - - *d++ = ch; - break; - } - - if (type & NGX_UNESCAPE_REDIRECT) { - if (ch == '?') { - *d++ = ch; - goto done; - } - - if (ch > '%' && ch < 0x7f) { - *d++ = ch; - break; - } - - *d++ = '%'; *d++ = *(s - 2); *d++ = *(s - 1); - break; - } - - *d++ = ch; - - break; - } - - /* the invalid quoted character */ - - break; - } - } - -done: - - *dst = d; - *src = s; -} - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_unescape_uri.h b/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_unescape_uri.h deleted file mode 100644 index 59e9a93..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/src/ngx_http_set_unescape_uri.h +++ /dev/null @@ -1,16 +0,0 @@ - -#ifndef NGX_HTTP_SET_UNESCAPE_URI -#define NGX_HTTP_SET_UNESCAPE_URI - - -#include -#include -#include - - -ngx_int_t ngx_http_set_misc_unescape_uri(ngx_http_request_t *r, - ngx_str_t *res, ngx_http_variable_value_t *v); - - -#endif /* NGX_HTTP_SET_UNESCAPE_URI */ - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/base32.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/base32.t deleted file mode 100644 index 2efa731..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/base32.t +++ /dev/null @@ -1,556 +0,0 @@ -# vi:filetype= - -use Test::Nginx::Socket; - -repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: base32 (5 bytes) ---- config - location /bar { - set $a 'abcde'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -c5h66p35 -abcde - - - -=== TEST 2: base32 (1 byte) ---- config - location /bar { - set $a '!'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -44====== -! - - - -=== TEST 3: base32 (1 byte) - not in-place editing ---- config - location /bar { - set $a '!'; - set_encode_base32 $a $a; - set_decode_base32 $b $a; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -44====== -! - - - -=== TEST 4: base32 (hello world) ---- config - location /bar { - set $a '"hello, world!\nhiya"'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -49k6ar3cdsm20trfe9m6888ad1knio92 -"hello, world! -hiya" - - - -=== TEST 5: base32 (0 bytes left) ---- config - set_base32_padding on; - location /bar { - set $a '"hello, world!"'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -49k6ar3cdsm20trfe9m68892 - - - -=== TEST 6: base32 (6 bytes padded) ---- config - set_base32_padding on; - location /bar { - set $a '"hello, world!"a'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -49k6ar3cdsm20trfe9m68892c4====== - - - -=== TEST 7: base32 (4 bytes left) ---- config - set_base32_padding on; - location /bar { - set $a '"hello, world!"ab'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -49k6ar3cdsm20trfe9m68892c5h0==== - - - -=== TEST 8: base32 (3 bytes left) ---- config - set_base32_padding on; - location /bar { - set $a '"hello, world!"abc'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -49k6ar3cdsm20trfe9m68892c5h66=== - - - -=== TEST 9: base32 (1 bytes left) ---- config - set_base32_padding on; - location /bar { - set $a '"hello, world!"abcd'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -49k6ar3cdsm20trfe9m68892c5h66p0= - - - -=== TEST 10: base32 standard alphabet (5 bytes) ---- config - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a 'abcde'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -MFRGGZDF -abcde - - - -=== TEST 11: base32 standard alphabet (1 byte) ---- config - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '!'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -EE====== -! - - - -=== TEST 12: base32 standard alphabet (1 byte) - not in-place editing ---- config - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '!'; - set_encode_base32 $a $a; - set_decode_base32 $b $a; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -EE====== -! - - - -=== TEST 13: base32 standard alphabet (hello world) ---- config - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '"hello, world!\nhiya"'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -EJUGK3DMN4WCA53POJWGIIIKNBUXSYJC -"hello, world! -hiya" - - - -=== TEST 14: base32 standard alphabet (0 bytes left) ---- config - set_base32_padding on; - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '"hello, world!"'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -EJUGK3DMN4WCA53POJWGIIJC - - - -=== TEST 15: base32 standard alphabet (6 bytes padded) ---- config - set_base32_padding on; - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '"hello, world!"a'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -EJUGK3DMN4WCA53POJWGIIJCME====== - - - -=== TEST 16: base32 standard alphabet (4 bytes left) ---- config - set_base32_padding on; - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '"hello, world!"ab'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -EJUGK3DMN4WCA53POJWGIIJCMFRA==== - - - -=== TEST 17: base32 standard alphabet (3 bytes left) ---- config - set_base32_padding on; - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '"hello, world!"abc'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -EJUGK3DMN4WCA53POJWGIIJCMFRGG=== - - - -=== TEST 18: base32 standard alphabet (1 bytes left) ---- config - set_base32_padding on; - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '"hello, world!"abcd'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -EJUGK3DMN4WCA53POJWGIIJCMFRGGZA= - - - -=== TEST 19: base32 custom alphabet (5 bytes) ---- config - set_base32_alphabet "efghijklmnopqrstuvwxyz0123456789"; - location /bar { - set $a 'abcde'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -qjvkk3hj -abcde - - - -=== TEST 20: base32 custom alphabet (1 byte) ---- config - set_base32_alphabet "efghijklmnopqrstuvwxyz0123456789"; - location /bar { - set $a '!'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -ii====== -! - - - -=== TEST 21: base32 custom alphabet (1 byte) - not in-place editing ---- config - set_base32_alphabet "efghijklmnopqrstuvwxyz0123456789"; - location /bar { - set $a '!'; - set_encode_base32 $a $a; - set_decode_base32 $b $a; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -ii====== -! - - - -=== TEST 22: base32 custom alphabet (hello world) ---- config - set_base32_alphabet "efghijklmnopqrstuvwxyz0123456789"; - location /bar { - set $a '"hello, world!\nhiya"'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -inyko5hqr60ge75tsn0kmmmorfy1w2ng -"hello, world! -hiya" - - - -=== TEST 23: base32 custom alphabet (0 bytes left) ---- config - set_base32_padding on; - set_base32_alphabet "efghijklmnopqrstuvwxyz0123456789"; - location /bar { - set $a '"hello, world!"'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -inyko5hqr60ge75tsn0kmmng - - - -=== TEST 24: base32 custom alphabet (6 bytes padded) ---- config - set_base32_padding on; - set_base32_alphabet "efghijklmnopqrstuvwxyz0123456789"; - location /bar { - set $a '"hello, world!"a'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -inyko5hqr60ge75tsn0kmmngqi====== - - - -=== TEST 25: base32 custom alphabet (4 bytes left) ---- config - set_base32_padding on; - set_base32_alphabet "efghijklmnopqrstuvwxyz0123456789"; - location /bar { - set $a '"hello, world!"ab'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -inyko5hqr60ge75tsn0kmmngqjve==== - - - -=== TEST 26: base32 custom alphabet (3 bytes left) ---- config - set_base32_padding on; - set_base32_alphabet "efghijklmnopqrstuvwxyz0123456789"; - location /bar { - set $a '"hello, world!"abc'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -inyko5hqr60ge75tsn0kmmngqjvkk=== - - - -=== TEST 27: base32 custom alphabet (1 bytes left) ---- config - set_base32_padding on; - set_base32_alphabet "efghijklmnopqrstuvwxyz0123456789"; - location /bar { - set $a '"hello, world!"abcd'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -inyko5hqr60ge75tsn0kmmngqjvkk3e= - - - -=== TEST 28: use set_base32_alphabet in location ---- config - set_base32_padding on; - location /bar { - set_base32_alphabet "efghijklmnopqrstuvwxyz0123456789"; - set $a '"hello, world!"abcd'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -inyko5hqr60ge75tsn0kmmngqjvkk3e= - - - -=== TEST 29: one byte less in set_base32_alphabet ---- config - set_base32_padding on; - location /bar { - set_base32_alphabet "efghijklmnopqrstuvwxyz012345678"; - set $a '"hello, world!"abcd?\/.;'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -inyko5hqr60ge75tsn0kmmngqjvkk3e= ---- must_die ---- error_log eval -qr/\[emerg\] .*? "set_base32_alphabet" directive takes an alphabet of 31 bytes but 32 expected/ - - - -=== TEST 30: one byte more in set_base32_alphabet ---- config - set_base32_padding on; - location /bar { - set_base32_alphabet "efghijklmnopqrstuvwxyz0123456789A"; - set $a '"hello, world!"abcd?\/.;'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -inyko5hqr60ge75tsn0kmmngqjvkk3e= ---- must_die ---- error_log eval -qr/\[emerg\] .*? "set_base32_alphabet" directive takes an alphabet of 33 bytes but 32 expected/ diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/base32_no_padding.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/base32_no_padding.t deleted file mode 100644 index 9330cbf..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/base32_no_padding.t +++ /dev/null @@ -1,531 +0,0 @@ -# vi:filetype= - -use Test::Nginx::Socket; - -repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: base32 (5 bytes) ---- config - set_base32_padding off; - location /bar { - set $a 'abcde'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -c5h66p35 -abcde - - - -=== TEST 2: base32 (1 byte) ---- config - set_base32_padding off; - location /bar { - set $a '!'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -44 -! - - - -=== TEST 3: base32 (1 byte) - not in-place editing ---- config - location /bar { - set_base32_padding off; - set $a '!'; - set_encode_base32 $a $a; - set_decode_base32 $b $a; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -44 -! - - - -=== TEST 4: base32 (hello world) ---- config - set_base32_padding off; - location /bar { - set $a '"hello, world!\nhiya"'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -49k6ar3cdsm20trfe9m6888ad1knio92 -"hello, world! -hiya" - - - -=== TEST 5: base32 (0 bytes left) ---- config - set_base32_padding off; - location /bar { - set $a '"hello, world!"'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -49k6ar3cdsm20trfe9m68892 - - - -=== TEST 6: base32 (6 bytes padded) ---- config - set_base32_padding off; - location /bar { - set $a '"hello, world!"a'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -49k6ar3cdsm20trfe9m68892c4 - - - -=== TEST 7: base32 (4 bytes left) ---- config - set_base32_padding off; - location /bar { - set $a '"hello, world!"ab'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -49k6ar3cdsm20trfe9m68892c5h0 - - - -=== TEST 8: base32 (3 bytes left) ---- config - set_base32_padding off; - location /bar { - set $a '"hello, world!"abc'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -49k6ar3cdsm20trfe9m68892c5h66 - - - -=== TEST 9: base32 (1 bytes left) ---- config - set_base32_padding off; - location /bar { - set $a '"hello, world!"abcd'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -49k6ar3cdsm20trfe9m68892c5h66p0 - - - -=== TEST 10: base32 standard alphabet (5 bytes) ---- config - set_base32_padding off; - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a 'abcde'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -MFRGGZDF -abcde - - - -=== TEST 11: base32 standard alphabet (1 byte) ---- config - set_base32_padding off; - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '!'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -EE -! - - - -=== TEST 12: base32 standard alphabet (1 byte) - not in-place editing ---- config - location /bar { - set_base32_padding off; - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - set $a '!'; - set_encode_base32 $a $a; - set_decode_base32 $b $a; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -EE -! - - - -=== TEST 13: base32 standard alphabet (hello world) ---- config - set_base32_padding off; - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '"hello, world!\nhiya"'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -EJUGK3DMN4WCA53POJWGIIIKNBUXSYJC -"hello, world! -hiya" - - - -=== TEST 14: base32 standard alphabet (0 bytes left) ---- config - set_base32_padding off; - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '"hello, world!"'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -EJUGK3DMN4WCA53POJWGIIJC - - - -=== TEST 15: base32 standard alphabet (6 bytes padded) ---- config - set_base32_padding off; - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '"hello, world!"a'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -EJUGK3DMN4WCA53POJWGIIJCME - - - -=== TEST 16: base32 standard alphabet (4 bytes left) ---- config - set_base32_padding off; - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '"hello, world!"ab'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -EJUGK3DMN4WCA53POJWGIIJCMFRA - - - -=== TEST 17: base32 standard alphabet (3 bytes left) ---- config - set_base32_padding off; - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '"hello, world!"abc'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -EJUGK3DMN4WCA53POJWGIIJCMFRGG - - - -=== TEST 18: base32 standard alphabet (1 bytes left) ---- config - set_base32_padding off; - set_base32_alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; - location /bar { - set $a '"hello, world!"abcd'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -EJUGK3DMN4WCA53POJWGIIJCMFRGGZA - - - -=== TEST 19: base32 custom alphabet (5 bytes) ---- config - set_base32_padding off; - set_base32_alphabet "cdefghijklmnopqrstuvwxyz12345678"; - location /bar { - set $a 'abcde'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -ohtii2fh -abcde - - - -=== TEST 20: base32 custom alphabet (1 byte) ---- config - set_base32_padding off; - set_base32_alphabet "cdefghijklmnopqrstuvwxyz12345678"; - location /bar { - set $a '!'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -gg -! - - - -=== TEST 21: base32 custom alphabet (1 byte) - not in-place editing ---- config - location /bar { - set_base32_padding off; - set_base32_alphabet "cdefghijklmnopqrstuvwxyz12345678"; - set $a '!'; - set_encode_base32 $a $a; - set_decode_base32 $b $a; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -gg -! - - - -=== TEST 22: base32 custom alphabet (hello world) ---- config - set_base32_padding off; - set_base32_alphabet "cdefghijklmnopqrstuvwxyz12345678"; - location /bar { - set $a '"hello, world!\nhiya"'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -glwim4fop5yec64rqlyikkkmpdwzu1le -"hello, world! -hiya" - - - -=== TEST 23: base32 custom alphabet (0 bytes left) ---- config - set_base32_padding off; - set_base32_alphabet "cdefghijklmnopqrstuvwxyz12345678"; - location /bar { - set $a '"hello, world!"'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -glwim4fop5yec64rqlyikkle - - - -=== TEST 24: base32 custom alphabet (6 bytes padded) ---- config - set_base32_padding off; - set_base32_alphabet "cdefghijklmnopqrstuvwxyz12345678"; - location /bar { - set $a '"hello, world!"a'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -glwim4fop5yec64rqlyikkleog - - - -=== TEST 25: base32 custom alphabet (4 bytes left) ---- config - set_base32_padding off; - set_base32_alphabet "cdefghijklmnopqrstuvwxyz12345678"; - location /bar { - set $a '"hello, world!"ab'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -glwim4fop5yec64rqlyikkleohtc - - - -=== TEST 26: base32 custom alphabet (3 bytes left) ---- config - set_base32_padding off; - set_base32_alphabet "cdefghijklmnopqrstuvwxyz12345678"; - location /bar { - set $a '"hello, world!"abc'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -glwim4fop5yec64rqlyikkleohtii - - - -=== TEST 27: base32 custom alphabet (1 bytes left) ---- config - set_base32_padding off; - set_base32_alphabet "cdefghijklmnopqrstuvwxyz12345678"; - location /bar { - set $a '"hello, world!"abcd'; - set_encode_base32 $a; - - echo $a; - } ---- request - GET /bar ---- response_body -glwim4fop5yec64rqlyikkleohtii2c - - - -=== TEST 28: deprecated set_misc_base32_padding ---- config - set_misc_base32_padding off; - location /bar { - set $a 'abcde'; - set_encode_base32 $a; - set $b $a; - set_decode_base32 $b; - - echo $a; - echo $b; - } ---- request - GET /bar ---- response_body -c5h66p35 -abcde diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/base64.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/base64.t deleted file mode 100644 index 5dd5af8..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/base64.t +++ /dev/null @@ -1,40 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -#repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: base64 encode ---- config - location /bar { - set_encode_base64 $out "abcde"; - echo $out; - } ---- request - GET /bar ---- response_body -YWJjZGU= - - - -=== TEST 2: base64 decode ---- config - location /bar { - set_decode_base64 $out "YWJjZGU="; - echo $out; - } ---- request - GET /bar ---- response_body -abcde diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/base64url.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/base64url.t deleted file mode 100644 index fc71d59..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/base64url.t +++ /dev/null @@ -1,40 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -#repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: base64url encode ---- config - location /bar { - set_encode_base64url $out "?b> repeat_each() * 2 * blocks(); - -no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: set if empty ---- config - location /foo { - set $a 32; - set_if_empty $a 56; - echo $a; - - set_if_empty $b 72; - echo $b; - } ---- request -GET /foo ---- response_body -32 -72 - - - -=== TEST 2: set if empty ---- config - location /foo { - set $bar $arg_bar; - set_if_empty $bar 15; - echo $bar; - - set $bah $arg_bah; - set_if_empty $bah 25; - echo $bah; - } ---- request -GET /foo?bar=71 ---- response_body -71 -25 - - - -=== TEST 3: set if empty ---- config - location /foo { - set $bar $arg_bar; - set_if_empty $bar 15; - echo $bar; - - set $bah $arg_bah; - set_if_empty $bah 25; - echo $bah; - } ---- request -GET /foo?bar= ---- response_body -15 -25 - - - -=== TEST 4: set if empty (using arg_xxx directly) -buggy? ---- config - location /foo { - set_if_empty $arg_bar 15; - echo $arg_bar; - - set_if_empty $arg_bah 25; - echo $arg_bah; - } ---- request -GET /foo?bar=71 ---- response_body -71 -25 diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/escape-uri.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/escape-uri.t deleted file mode 100644 index 7cbd067..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/escape-uri.t +++ /dev/null @@ -1,139 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -no_long_string(); -#no_diff(); - -run_tests(); - -__DATA__ - -=== TEST 1: set escape uri ---- config - location /foo { - set $foo "hello world"; - set_escape_uri $foo $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -hello%20world - - - -=== TEST 2: set escape uri(in-place) ---- config - location /foo { - set $foo "hello world"; - set_escape_uri $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -hello%20world - - - -=== TEST 3: blank string ---- config - location /foo { - set $foo ""; - set_escape_uri $foo; - echo $foo; - } ---- request -GET /foo ---- response_body eval -"\n" - - - -=== TEST 4: blank string(in place) ---- config - location /foo { - set $foo ""; - set_escape_uri $foo; - echo $foo; - } ---- request -GET /foo ---- response_body eval -"\n" - - - -=== TEST 5: eacape chinese character ---- config - location /foo { - set $foo "你好"; - set_escape_uri $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -%E4%BD%A0%E5%A5%BD - - - -=== TEST 6: escape long string ---- config - location /foo { - set $foo "法规及饿哦物权法家哦低价非结果哦我二期界 附件饿哦武器 积分饿哦为契机佛i 该软件哦气氛 份额叫我起 国无二君哦气氛为界非ieowq结果哦而完全附件 份额叫我iqfjeowiqgjeriowqfjpdjfosadijfoiasdjf 附件饿哦武器界 份额叫我起界份额叫我起哦ifjefejwioq附件饿哦武器界非风格及去哦根据份额叫我起哦界份额为契机哦乳房阿基完全哦igqtewqo个人就去哦ieorjwrewqoi日哦额外起今天诶哦我亲热为特务前日哦我而哥特完全哦iijrtewmkdf 服务鄂潜江哦irewq"; - set_escape_uri $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -%E6%B3%95%E8%A7%84%E5%8F%8A%E9%A5%BF%E5%93%A6%E7%89%A9%E6%9D%83%E6%B3%95%E5%AE%B6%E5%93%A6%E4%BD%8E%E4%BB%B7%E9%9D%9E%E7%BB%93%E6%9E%9C%E5%93%A6%E6%88%91%E4%BA%8C%E6%9C%9F%E7%95%8C%20%20%E9%99%84%E4%BB%B6%E9%A5%BF%E5%93%A6%E6%AD%A6%E5%99%A8%20%20%E7%A7%AF%E5%88%86%E9%A5%BF%E5%93%A6%E4%B8%BA%E5%A5%91%E6%9C%BA%E4%BD%9Bi%20%E8%AF%A5%E8%BD%AF%E4%BB%B6%E5%93%A6%E6%B0%94%E6%B0%9B%20%20%E4%BB%BD%E9%A2%9D%E5%8F%AB%E6%88%91%E8%B5%B7%20%E5%9B%BD%E6%97%A0%E4%BA%8C%E5%90%9B%E5%93%A6%E6%B0%94%E6%B0%9B%E4%B8%BA%E7%95%8C%E9%9D%9Eieowq%E7%BB%93%E6%9E%9C%E5%93%A6%E8%80%8C%E5%AE%8C%E5%85%A8%E9%99%84%E4%BB%B6%20%20%E4%BB%BD%E9%A2%9D%E5%8F%AB%E6%88%91iqfjeowiqgjeriowqfjpdjfosadijfoiasdjf%20%E9%99%84%E4%BB%B6%E9%A5%BF%E5%93%A6%E6%AD%A6%E5%99%A8%E7%95%8C%20%E4%BB%BD%E9%A2%9D%E5%8F%AB%E6%88%91%E8%B5%B7%E7%95%8C%E4%BB%BD%E9%A2%9D%E5%8F%AB%E6%88%91%E8%B5%B7%E5%93%A6ifjefejwioq%E9%99%84%E4%BB%B6%E9%A5%BF%E5%93%A6%E6%AD%A6%E5%99%A8%E7%95%8C%E9%9D%9E%E9%A3%8E%E6%A0%BC%E5%8F%8A%E5%8E%BB%E5%93%A6%E6%A0%B9%E6%8D%AE%E4%BB%BD%E9%A2%9D%E5%8F%AB%E6%88%91%E8%B5%B7%E5%93%A6%E7%95%8C%E4%BB%BD%E9%A2%9D%E4%B8%BA%E5%A5%91%E6%9C%BA%E5%93%A6%E4%B9%B3%E6%88%BF%E9%98%BF%E5%9F%BA%E5%AE%8C%E5%85%A8%E5%93%A6igqtewqo%E4%B8%AA%E4%BA%BA%E5%B0%B1%E5%8E%BB%E5%93%A6ieorjwrewqoi%E6%97%A5%E5%93%A6%E9%A2%9D%E5%A4%96%E8%B5%B7%E4%BB%8A%E5%A4%A9%E8%AF%B6%E5%93%A6%E6%88%91%E4%BA%B2%E7%83%AD%E4%B8%BA%E7%89%B9%E5%8A%A1%E5%89%8D%E6%97%A5%E5%93%A6%E6%88%91%E8%80%8C%E5%93%A5%E7%89%B9%E5%AE%8C%E5%85%A8%E5%93%A6iijrtewmkdf%20%E6%9C%8D%E5%8A%A1%E9%84%82%E6%BD%9C%E6%B1%9F%E5%93%A6irewq - - - -=== TEST 7: no need to escape ---- config - location /foo { - set $foo 'welcometotheworldofnginx'; - set_escape_uri $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -welcometotheworldofnginx - - - -=== TEST 8: fixed ngx_escape_uri issues: + and / should also be escaped ---- config - location /foo { - set $foo '+/='; - set_escape_uri $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -%2B%2F%3D - - - -=== TEST 9: fixed ngx_escape_uri issues: / {} : & [] and more ---- config - location /foo { - set $foo '"a/b={}:<>;&[]\\^'; - set_escape_uri $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -%22a%2Fb%3D%7B%7D%3A%3C%3E%3B%26%5B%5D%5C%5E diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/formatted-time.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/formatted-time.t deleted file mode 100644 index 9b0fc73..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/formatted-time.t +++ /dev/null @@ -1,84 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; -use POSIX qw(strftime); - -my $fmt="%a %b %e %H:%M:%S %Y"; - -our $str_local = (strftime $fmt, localtime time()).'|'.(strftime $fmt, localtime time()+1).'|'.(strftime $fmt, localtime time()+2); - -our $str_gmt = (strftime $fmt, gmtime time()).'|'.(strftime $fmt, gmtime time()+1).'|'.(strftime $fmt, gmtime time()+2); - -repeat_each(2); - -plan tests => repeat_each() * 2 * blocks(); - -log_level('warn'); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: local time format ---- config - location /foo { - set_formatted_local_time $today "%a %b %e %H:%M:%S %Y"; - echo $today; - } ---- request -GET /foo ---- response_body_like eval: $main::str_local - - - -=== TEST 2: GMT time format ---- config - location /bar { - set_formatted_gmt_time $today "%a %b %e %H:%M:%S %Y"; - echo $today; - } ---- request -GET /bar ---- response_body_like eval: $main::str_gmt - - - -=== TEST 3: set_formatted_gmt_time (empty formatter) ---- config - location /bar { - set_formatted_gmt_time $today ""; - echo "[$today]"; - } ---- request -GET /bar ---- response_body -[] - - - -=== TEST 4: set_formatted_local_time (empty formatter) ---- config - location /bar { - set_formatted_local_time $today ""; - echo "[$today]"; - } ---- request -GET /bar ---- response_body -[] - - - -=== TEST 5: set_formatted_local_time (constant formatter) ---- config - location /bar { - set_formatted_local_time $today "hello world"; - echo "[$today]"; - } ---- request -GET /bar ---- response_body -[hello world] diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/hash.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/hash.t deleted file mode 100644 index a9c884b..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/hash.t +++ /dev/null @@ -1,94 +0,0 @@ -# vi:filetype=perl - -use lib 'lib'; -use Test::Nginx::Socket; - -#repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: sha1 hello (copy) ---- config - location /sha1 { - set_sha1 $a hello; - echo $a; - } ---- request -GET /sha1 ---- response_body -aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d - - - -=== TEST 2: sha1 hello (in-place) ---- config - location /sha1 { - set $a hello; - set_sha1 $a; - echo $a; - } ---- request -GET /sha1 ---- response_body -aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d - - - -=== TEST 3: sha1 (empty) ---- config - location /sha1 { - set_sha1 $a ""; - echo $a; - } ---- request -GET /sha1 ---- response_body -da39a3ee5e6b4b0d3255bfef95601890afd80709 - - - -=== TEST 4: md5 hello (copy) ---- config - location /md5 { - set_md5 $a hello; - echo $a; - } ---- request -GET /md5 ---- response_body -5d41402abc4b2a76b9719d911017c592 - - - -=== TEST 5: md5 hello (in-place) ---- config - location /md5 { - set $a hello; - set_md5 $a; - echo $a; - } ---- request -GET /md5 ---- response_body -5d41402abc4b2a76b9719d911017c592 - - - -=== TEST 6: md5 (empty) ---- config - location /md5 { - set_md5 $a ""; - echo $a; - } ---- request -GET /md5 ---- response_body -d41d8cd98f00b204e9800998ecf8427e diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/hashed-upstream.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/hashed-upstream.t deleted file mode 100644 index fdebd15..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/hashed-upstream.t +++ /dev/null @@ -1,70 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -#repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -no_long_string(); - -#master_on(); -#log_level("warn"); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: set hashed upstream -buggy? ---- config - upstream_list universe moon sun earth; - location /foo { - set_hashed_upstream $backend universe $arg_id; - echo $backend; - } - location /main { - echo_location_async /foo; - echo_location_async /foo?id=hello; - echo_location_async /foo?id=world; - echo_location_async /foo?id=larry; - echo_location_async /foo?id=audreyt; - } ---- request -GET /main ---- response_body -moon -sun -moon -earth -earth - - - -=== TEST 2: set hashed upstream (use var for upstream_list name) -buggy? ---- config - upstream_list universe moon sun earth; - location /foo { - set $list_name universe; - set_hashed_upstream $backend $list_name $arg_id; - echo $backend; - } - location /main { - echo_location_async /foo; - echo_location_async /foo?id=hello; - echo_location_async /foo?id=world; - echo_location_async /foo?id=larry; - echo_location_async /foo?id=audreyt; - } ---- request -GET /main ---- response_body -moon -sun -moon -earth -earth diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/hex.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/hex.t deleted file mode 100644 index ae28105..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/hex.t +++ /dev/null @@ -1,57 +0,0 @@ -# vi:filetype=perl - -use lib 'lib'; -use Test::Nginx::Socket; - -#repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: hex encode ---- config - location /bar { - set_encode_hex $out "abcde"; - echo $out; - } ---- request - GET /bar ---- response_body -6162636465 - - - -=== TEST 2: hex decode ---- config - location /bar { - set_decode_hex $out "6162636465"; - echo $out; - } ---- request - GET /bar ---- response_body -abcde - - - -=== TEST 3: hex encode (chinese) ---- config - location /bar { - set $raw "章亦春"; - set_encode_hex $digest $raw; - set_decode_hex $hex $digest; - echo $digest; - echo $hex; - } ---- request - GET /bar ---- response_body -e7aba0e4baa6e698a5 -章亦春 diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/hmac.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/hmac.t deleted file mode 100644 index 5353eca..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/hmac.t +++ /dev/null @@ -1,78 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -#repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: hmac_sha1 ---- config - location /bar { - set $secret 'thisisverysecretstuff'; - set $string_to_sign 'some string we want to sign'; - set_hmac_sha1 $signature $secret $string_to_sign; - set_encode_base64 $signature $signature; - echo $signature; - } ---- request - GET /bar ---- response_body -R/pvxzHC4NLtj7S+kXFg/NePTmk= - - - -=== TEST 2: hmac_sha1 empty vars ---- config - location /bar { - set $secret ''; - set $string_to_sign ''; - set_hmac_sha1 $signature $secret $string_to_sign; - set_encode_base64 $signature $signature; - echo $signature; - } ---- request - GET /bar ---- response_body -+9sdGxiqbAgyS31ktx+3Y3BpDh0= - - - -=== TEST 3: hmac_sha256 ---- config - location /bar { - set $secret 'thisisverysecretstuff'; - set $string_to_sign 'some string we want to sign'; - set_hmac_sha256 $signature $secret $string_to_sign; - set_encode_base64 $signature $signature; - echo $signature; - } ---- request - GET /bar ---- response_body -4pU3GRQrKKIoeLb9CqYsavHE2l6Hx+KMmRmesU+Cfrs= - - - -=== TEST 4: hmac_sha256 empty vars ---- config - location /bar { - set $secret ''; - set $string_to_sign ''; - set_hmac_sha256 $signature $secret $string_to_sign; - set_encode_base64 $signature $signature; - echo $signature; - } ---- request - GET /bar ---- response_body -thNnmggU2ex3L5XXeMNfxf8Wl8STcVZTxscSFEKSxa0= diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/local-today.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/local-today.t deleted file mode 100644 index 7de0968..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/local-today.t +++ /dev/null @@ -1,29 +0,0 @@ -# vi:filetype=perl - -use lib 'lib'; -use Test::Nginx::Socket; - -my ($sec, $min, $hour, $mday, $mon, $year) = localtime; - -our $str = sprintf("%04d-%02d-%02d\n", $year + 1900, $mon + 1, $mday); -#repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -#no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /foo { - set_local_today $today; - echo $today; - } ---- request -GET /foo ---- response_body eval: $main::str diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/quote-json.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/quote-json.t deleted file mode 100644 index 8e15def..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/quote-json.t +++ /dev/null @@ -1,69 +0,0 @@ -# vi:filetype=perl - -use lib 'lib'; -use Test::Nginx::Socket; - -#repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: set quote json value ---- config - location /foo { - set $foo "hello\n\r'\"\\"; - set_quote_json_str $foo $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -"hello\n\r'\"\\" - - - -=== TEST 2: set quote json value (in place) ---- config - location /foo { - set $foo "hello\n\r'\"\\"; - set_quote_json_str $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -"hello\n\r'\"\\" - - - -=== TEST 3: set quote empty json value ---- config - location /foo { - set $foo ""; - set_quote_json_str $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -null - - - -=== TEST 4: set quote null json value ---- config - location /foo { - set_quote_json_str $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -null diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/quote-sql.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/quote-sql.t deleted file mode 100644 index bd81a87..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/quote-sql.t +++ /dev/null @@ -1,195 +0,0 @@ -# vi:filetype= - -use lib 'lib'; -use Test::Nginx::Socket; - -#repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: set quote sql value ---- config - location /foo { - set $foo "hello\n\r'\"\\"; - set_quote_sql_str $foo $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -'hello\n\r\'\"\\' - - - -=== TEST 2: set quote sql value (in place) ---- config - location /foo { - set $foo "hello\n\r'\"\\"; - set_quote_sql_str $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -'hello\n\r\'\"\\' - - - -=== TEST 3: set quote empty sql value ---- config - location /foo { - set $foo ""; - set_quote_sql_str $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -'' - - - -=== TEST 4: set quote null sql value ---- config - location /foo { - set_quote_sql_str $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -'' - - - -=== TEST 5: set quote null pgsql value ---- config - location /foo { - set_quote_pgsql_str $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -'' - - - -=== TEST 6: set quote pgsql value ---- config - location /foo { - set $foo "hello\n\r'\"\\"; - set_quote_pgsql_str $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -E'hello\n\r\'\"\\' - - - -=== TEST 7: set quote pgsql valid utf8 value ---- config - location /foo { - set $foo "你好"; - set_quote_pgsql_str $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -E'你好' - - - -=== TEST 8: set quote pgsql invalid utf8 value ---- config - location /foo { - set $foo "你好"; - set_iconv $foo $foo from=utf-8 to=gbk; - set_quote_pgsql_str $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -E'\\304\\343\\272\\303' - - - -=== TEST 9: \0 for mysql ---- config - location /foo { - set_unescape_uri $foo $arg_a; - set_quote_sql_str $foo $foo; - echo $foo; - } ---- request -GET /foo?a=a%00b%00 ---- response_body -'a\0b\0' - - - -=== TEST 10: \b for mysql ---- config - location /foo { - set_unescape_uri $foo $arg_a; - set_quote_sql_str $foo $foo; - echo $foo; - } ---- request -GET /foo?a=a%08b%08 ---- response_body -'a\bb\b' - - - -=== TEST 11: \t for mysql ---- config - location /foo { - set_unescape_uri $foo $arg_a; - set_quote_sql_str $foo $foo; - echo $foo; - } ---- request -GET /foo?a=a%09b%09 ---- response_body -'a\tb\t' - - - -=== TEST 12: \Z for mysql ---- config - location /foo { - set_unescape_uri $foo $arg_a; - set_quote_sql_str $foo $foo; - echo $foo; - } ---- request -GET /foo?a=a%1ab%1a ---- response_body -'a\Zb\Z' - - - -=== TEST 13: set quote sql value ---- config - location /foo { - set_unescape_uri $foo $arg_a; - set_quote_sql_str $foo $foo; - echo $foo; - } ---- request -GET /foo?a=$$ ---- response_body -'\$\$' diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/rand.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/rand.t deleted file mode 100644 index 7f042bb..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/rand.t +++ /dev/null @@ -1,168 +0,0 @@ -# vi:filetype=perl - -use Test::Nginx::Socket; - -repeat_each(100); - -plan tests => repeat_each() * 2 * blocks(); - -no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /rand { - set $from 5; - set $to 7; - set_random $res $from $to; - - echo $res; - } ---- request - GET /rand ---- response_body_like: [5-7] - - - -=== TEST 2: sanity (two digits) ---- config - location /rand { - set $from 35; - set $to 37; - set_random $res $from $to; - - echo $res; - } ---- request - GET /rand ---- response_body_like: 3[5-7] - - - -=== TEST 3: sanity (two digits, from > to) ---- config - location /rand { - set $from 37; - set $to 35; - set_random $res $from $to; - - echo $res; - } ---- request - GET /rand ---- response_body_like: 3[5-7] - - - -=== TEST 4: sanity (two digits, from == to) ---- config - location /rand { - set $from 117; - set $to 117; - set_random $res $from $to; - - echo $res; - } ---- request - GET /rand ---- response_body -117 - - - -=== TEST 5: negative number not allowed in from arg ---- config - location /rand { - set $from -2; - set $to 4; - set_random $res $from $to; - - echo $res; - } ---- request - GET /rand ---- response_body_like: 500 Internal Server Error ---- error_code: 500 - - - -=== TEST 6: negative number not allowed in to arg ---- config - location /rand { - set $from 2; - set $to -4; - set_random $res $from $to; - - echo $res; - } ---- request - GET /rand ---- response_body_like: 500 Internal Server Error ---- error_code: 500 - - - -=== TEST 7: empty string not allowed in from arg ---- config - location /rand { - set $from ''; - set $to 4; - set_random $res $from $to; - - echo $res; - } ---- request - GET /rand ---- response_body_like: 500 Internal Server Error ---- error_code: 500 - - - -=== TEST 8: empty string not allowed in to arg ---- config - location /rand { - set $from 2; - set $to ''; - set_random $res $from $to; - - echo $res; - } ---- request - GET /rand ---- response_body_like: 500 Internal Server Error ---- error_code: 500 - - - -=== TEST 9: wrong number of arguments ---- config - location /rand { - set $from 2; - set_random $res $from; - - echo $res; - } ---- request - GET /rand ---- response_body_like: 500 Internal Server Error ---- error_code: 500 ---- SKIP - - - -=== TEST 10: zero is fine ---- config - location /rand { - set_random $res 0 0; - - echo $res; - } ---- request - GET /rand ---- response_body -0 diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/rotate.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/rotate.t deleted file mode 100644 index 2982a71..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/rotate.t +++ /dev/null @@ -1,270 +0,0 @@ -# vi:filetype= - -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * (3 * blocks()); - -no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: sanity ---- config - location /bar { - set $a 1; - set_rotate $a 1 3; - - set $b 2; - set_rotate $b 1 3; - - set $c 3; - set_rotate $c 1 3; - - set $d 0; - set_rotate $d 1 3; - - set $e 1; - set_rotate $e 3 5; - - echo "a = $a"; - echo "b = $b"; - echo "c = $c"; - echo "d = $d"; - echo "e = $e"; - } ---- request - GET /bar ---- response_body -a = 2 -b = 3 -c = 1 -d = 1 -e = 3 ---- no_error_log -[error] - - - -=== TEST 2: bad current value ---- config - location /bar { - set $a abc; - set_rotate $a 1 3; - - echo "a = $a"; - } ---- request - GET /bar ---- response_body_like: ^a = [12]$ ---- error_log -set_rotate: bad current value: "abc" - - - -=== TEST 3: bad "from" value ---- config - location /bar { - set $a 2; - set_rotate $a abc 3; - - echo "a = $a"; - } ---- request - GET /bar ---- response_body_like: 500 Internal Server Error ---- error_code: 500 ---- error_log -set_rotate: bad "from" argument value: "abc" - - - -=== TEST 4: bad "to" argument value ---- config - location /bar { - set $a 2; - set_rotate $a 1 abc; - - echo "a = $a"; - } ---- request - GET /bar ---- response_body_like: 500 Internal Server Error ---- error_code: 500 ---- error_log -set_rotate: bad "to" argument value: "abc" - - - -=== TEST 5: when no current value is given ---- config - location /incr { - set_rotate $a 1 3; - - echo "a = $a"; - } - - location /t { - echo_location /incr; - echo_location /incr; - echo_location /incr; - echo_location /incr; - echo_location /incr; - echo_location /incr; - } ---- request - GET /t ---- response_body -a = 1 -a = 2 -a = 3 -a = 1 -a = 2 -a = 3 ---- no_error_log -[error] - - - -=== TEST 6: when no current value is given (starting from 0) ---- config - location /incr { - set_rotate $a 0 2; - - echo "a = $a"; - } - - location /t { - echo_location /incr; - echo_location /incr; - echo_location /incr; - echo_location /incr; - echo_location /incr; - echo_location /incr; - } ---- request - GET /t ---- response_body -a = 0 -a = 1 -a = 2 -a = 0 -a = 1 -a = 2 ---- no_error_log -[error] - - - -=== TEST 7: when a non-integer string value is given ---- config - location /incr { - set $a "hello"; - set_rotate $a 0 2; - - echo "a = $a"; - } - - location /t { - echo_location /incr; - echo_location /incr; - echo_location /incr; - echo_location /incr; - echo_location /incr; - echo_location /incr; - } ---- request - GET /t ---- response_body -a = 0 -a = 1 -a = 2 -a = 0 -a = 1 -a = 2 ---- error_log -set_rotate: bad current value: "hello" - - - -=== TEST 8: when an empty string value is given ---- config - location /incr { - set $a ""; - set_rotate $a 0 2; - - echo "a = $a"; - } - - location /t { - echo_location /incr; - echo_location /incr; - echo_location /incr; - echo_location /incr; - echo_location /incr; - echo_location /incr; - } ---- request - GET /t ---- response_body -a = 0 -a = 1 -a = 2 -a = 0 -a = 1 -a = 2 ---- no_error_log -[error] - - - -=== TEST 9: value persistence is per-location ---- config - location /incr { - set_rotate $a 0 2; - - echo "a = $a"; - } - - location /incr2 { - set_rotate $a 0 2; - - echo "a = $a"; - } - - location /t { - echo_location /incr; - echo_location /incr2; - echo_location /incr; - echo_location /incr2; - echo_location /incr; - echo_location /incr2; - echo_location /incr; - echo_location /incr2; - echo_location /incr; - echo_location /incr2; - echo_location /incr; - echo_location /incr2; - } ---- request - GET /t ---- response_body -a = 0 -a = 0 -a = 1 -a = 1 -a = 2 -a = 2 -a = 0 -a = 0 -a = 1 -a = 1 -a = 2 -a = 2 ---- no_error_log -[error] diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/secure-random.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/secure-random.t deleted file mode 100644 index 1f0b4a3..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/secure-random.t +++ /dev/null @@ -1,107 +0,0 @@ -# vi:filetype= - -use Test::Nginx::Socket; - -repeat_each(2); - -plan tests => repeat_each() * 2 * blocks(); - -no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: a 32-character alphanum ---- config - location /alphanum { - set_secure_random_alphanum $res 32; - - echo $res; - } ---- request - GET /alphanum ---- response_body_like: ^[a-zA-Z0-9]{32}$ - - - -=== TEST 2: a 16-character alphanum ---- config - location /alphanum { - set_secure_random_alphanum $res 16; - - echo $res; - } ---- request - GET /alphanum ---- response_body_like: ^[a-zA-Z0-9]{16}$ - - - -=== TEST 3: a 1-character alphanum ---- config - location /alphanum { - set_secure_random_alphanum $res 1; - - echo $res; - } ---- request - GET /alphanum ---- response_body_like: ^[a-zA-Z0-9]{1}$ - - - -=== TEST 4: length less than <= 0 should fail ---- config - location /alphanum { - set_secure_random_alphanum $res 0; - - echo $res; - } ---- request - GET /alphanum ---- response_body_like: 500 Internal Server Error ---- error_code: 500 - - - -=== TEST 5: length less than <= 0 should fail ---- config - location /alphanum { - set_secure_random_alphanum $res -4; - - echo $res; - } ---- request - GET /alphanum ---- response_body_like: 500 Internal Server Error ---- error_code: 500 - - - -=== TEST 6: non-numeric length should fail ---- config - location /alphanum { - set_secure_random_alphanum $res bob; - - echo $res; - } ---- request - GET /alphanum ---- response_body_like: 500 Internal Server Error ---- error_code: 500 - - - -=== TEST 7: a 16-character lcalpha ---- config - location /lcalpha { - set_secure_random_lcalpha $res 16; - - echo $res; - } ---- request - GET /lcalpha ---- response_body_like: ^[a-z]{16}$ diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/t/unescape-uri.t b/modules_deb/libnginx-mod-http-set-misc-0.33/t/unescape-uri.t deleted file mode 100644 index ad52b59..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/t/unescape-uri.t +++ /dev/null @@ -1,58 +0,0 @@ -# vi:filetype=perl - -use lib 'lib'; -use Test::Nginx::Socket; - -#repeat_each(3); - -plan tests => repeat_each() * 2 * blocks(); - -no_long_string(); - -run_tests(); - -#no_diff(); - -__DATA__ - -=== TEST 1: set unescape uri -buggy? ---- config - location /foo { - set $foo "hello%20world"; - set_unescape_uri $foo $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -hello world - - - -=== TEST 2: set unescape uri (in-place) -buggy? ---- config - location /foo { - set $foo "hello%20world"; - set_unescape_uri $foo; - echo $foo; - } ---- request -GET /foo ---- response_body -hello world - - - -=== TEST 3: unescape '+' to ' ' ---- config - location /bar { - set $a 'a+b'; - set_unescape_uri $a; - echo $a; - } ---- request - GET /bar ---- response_body -a b diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/util/build.sh b/modules_deb/libnginx-mod-http-set-misc-0.33/util/build.sh deleted file mode 100755 index dc2bcb6..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/util/build.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# this file is mostly meant to be used by the author himself. - -root=`pwd` -home=~ -version=$1 -force=$2 - - #--with-cc="gcc46" \ - #--with-ld-opt="-rdynamic" \ - #--with-mail \ - #--with-mail_ssl_module \ - -ngx-build $force $version \ - --with-cc-opt="-I$PCRE_INC -I$OPENSSL_INC" \ - --with-ld-opt="-L$PCRE_LIB -L$OPENSSL_LIB -Wl,-rpath,$PCRE_LIB:$OPENSSL_LIB" \ - --with-http_ssl_module \ - --without-mail_pop3_module \ - --without-mail_imap_module \ - --without-mail_smtp_module \ - --without-http_upstream_ip_hash_module \ - --without-http_empty_gif_module \ - --without-http_memcached_module \ - --without-http_referer_module \ - --without-http_autoindex_module \ - --without-http_auth_basic_module \ - --without-http_userid_module \ - --add-module=$root/../echo-nginx-module \ - --add-module=$root/../ndk-nginx-module \ - --add-module=$root/../iconv-nginx-module \ - --add-module=$root $opts \ - --with-debug \ - || exit 1 - diff --git a/modules_deb/libnginx-mod-http-set-misc-0.33/valgrind.suppress b/modules_deb/libnginx-mod-http-set-misc-0.33/valgrind.suppress deleted file mode 100644 index 470978e..0000000 --- a/modules_deb/libnginx-mod-http-set-misc-0.33/valgrind.suppress +++ /dev/null @@ -1,105 +0,0 @@ -{ - - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_create_pool - fun:ngx_http_init_request -} -{ - - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_create_pool - fun:ngx_event_accept -} -{ - - Memcheck:Addr4 - fun:ngx_init_cycle - fun:ngx_master_process_cycle - fun:main -} -{ - - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_calloc - fun:ngx_event_process_init -} -{ - - exp-sgcheck:SorG - fun:ngx_http_variables_init_vars - fun:ngx_http_block -} -{ - - exp-sgcheck:SorG - fun:ngx_conf_parse -} -{ - - exp-sgcheck:SorG - fun:ngx_vslprintf - fun:ngx_log_error_core -} -{ - - exp-sgcheck:SorG - fun:ngx_conf_parse - fun:ngx_http_core_location -} -{ - nginx-core-process-init - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_event_process_init -} -{ - nginx-core-crc32-init - Memcheck:Leak - fun:malloc - fun:ngx_alloc - fun:ngx_crc32_table_init - fun:main -} -{ - libc-2.12.so - Memcheck:Param - epoll_ctl(event) - fun:epoll_ctl -} -{ - - Memcheck:Cond - fun:index - fun:expand_dynamic_string_token - fun:_dl_map_object - fun:map_doit - fun:_dl_catch_error - fun:do_preload - fun:dl_main -} -{ - - Memcheck:Leak - match-leak-kinds: definite - fun:malloc - fun:ngx_alloc - fun:ngx_set_environment - fun:ngx_single_process_cycle -} -{ - - Memcheck:Leak - match-leak-kinds: definite - fun:malloc - fun:ngx_alloc - fun:ngx_set_environment - fun:ngx_worker_process_init - fun:ngx_worker_process_cycle -} diff --git a/modules_deb/libnginx-mod-http-srcache-filter-0.33/.gitattributes b/modules_deb/libnginx-mod-http-srcache-filter-0.33/.gitattributes deleted file mode 100644 index 6fe6f35..0000000 --- a/modules_deb/libnginx-mod-http-srcache-filter-0.33/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.t linguist-language=Text diff --git a/modules_deb/libnginx-mod-http-srcache-filter-0.33/.gitignore b/modules_deb/libnginx-mod-http-srcache-filter-0.33/.gitignore deleted file mode 100644 index 5e0cb97..0000000 --- a/modules_deb/libnginx-mod-http-srcache-filter-0.33/.gitignore +++ /dev/null @@ -1,79 +0,0 @@ -*.mobi -genmobi.sh -.libs -*.swp -*.slo -*.la -*.swo -*.lo -*~ -*.o -print.txt -.rsync -*.tar.gz -dist -build[78] -build -tags -update-readme -*.tmp -test/Makefile -test/blib -test.sh -t/t.sh -test/t/servroot/ -releng -reset -*.t_ -src/handler.h -src/util.c -src/module.h -src/module.c -src/drizzle.c -src/processor.h -src/handler.c -src/util.h -src/drizzle.h -src/processor.c -src/output.c -src/output.h -libdrizzle -ctags -src/stream.h -nginx -keepalive -reindex -src/keepalive.c -src/keepalive.h -src/checker.h -src/checker.c -src/quoting.h -src/quoting.c -src/module.h -src/module.c -src/util.h -src/util.c -src/processor.h -src/processor.c -src/rds.h -src/utils.h -src/handler.c -src/handler.h -src/var.[ch] -util/bench -*.html -trace.out* -try.sh -build9 -src/fetch.[ch] -src/store.[ch] -t/servroot/ -headers.[ch] -buildroot/ -build1[0-9] -go -all -analyze -addr2line -*.plist -Makefile diff --git a/modules_deb/libnginx-mod-http-srcache-filter-0.33/.travis.yml b/modules_deb/libnginx-mod-http-srcache-filter-0.33/.travis.yml deleted file mode 100644 index 600cf7d..0000000 --- a/modules_deb/libnginx-mod-http-srcache-filter-0.33/.travis.yml +++ /dev/null @@ -1,87 +0,0 @@ -sudo: required -dist: bionic - -os: linux - -language: c - -cache: - directories: - - download-cache - -compiler: - - gcc - -env: - global: - - LUAJIT_PREFIX=/opt/luajit21 - - LUAJIT_LIB=$LUAJIT_PREFIX/lib - - LD_LIBRARY_PATH=$LUAJIT_LIB:$LD_LIBRARY_PATH - - LUAJIT_INC=$LUAJIT_PREFIX/include/luajit-2.1 - - LUA_INCLUDE_DIR=$LUAJIT_INC - - LUA_CMODULE_DIR=/lib - - JOBS=3 - - NGX_BUILD_JOBS=$JOBS - matrix: - - NGINX_VERSION=1.17.8 - - NGINX_VERSION=1.19.9 - - NGINX_VERSION=1.23.0 - -services: - - memcache - - redis-server - - postgresql - - mysql - -before_install: - - sudo apt-get install -qq -y axel cpanminus libtest-base-perl libtext-diff-perl liburi-perl libwww-perl libtest-longstring-perl liblist-moreutils-perl > build.log 2>&1 || (cat build.log && exit 1) - -install: - - echo $HOME - - if [ ! -d download-cache ]; then mkdir download-cache; fi - - if [ ! -f download-cache/ngx_http_redis-0.3.7.tar.gz ]; then wget -O download-cache/ngx_http_redis-0.3.7.tar.gz http://people.freebsd.org/~osa/ngx_http_redis-0.3.7.tar.gz; fi - - if [ ! -f download-cache/drizzle7-2011.07.21.tar.gz ]; then wget -O download-cache/drizzle7-2011.07.21.tar.gz http://openresty.org/download/drizzle7-2011.07.21.tar.gz; fi - - mkdir -p ~/work/nginx && cp download-cache/ngx_http_redis-0.3.7.tar.gz ~/work/nginx/ - - git clone https://github.com/openresty/nginx-devel-utils.git - - git clone https://github.com/openresty/openresty.git ../openresty - - git clone https://github.com/openresty/no-pool-nginx.git ../no-pool-nginx - - git clone https://github.com/simpl/ngx_devel_kit.git ../ndk-nginx-module - - git clone https://github.com/openresty/test-nginx.git - - git clone -b v2.1-agentzh https://github.com/openresty/luajit2.git - - git clone https://github.com/openresty/lua-nginx-module.git ../lua-nginx-module - - git clone https://github.com/openresty/lua-resty-core.git ../lua-resty-core - - git clone https://github.com/openresty/lua-resty-lrucache.git ../lua-resty-lrucache - - git clone https://github.com/openresty/nginx-eval-module.git ../eval-nginx-module - - git clone https://github.com/openresty/echo-nginx-module.git ../echo-nginx-module - - git clone https://github.com/openresty/set-misc-nginx-module.git ../set-misc-nginx-module - - git clone https://github.com/openresty/xss-nginx-module.git ../xss-nginx-module - - git clone https://github.com/openresty/redis2-nginx-module.git ../redis2-nginx-module - - git clone https://github.com/openresty/headers-more-nginx-module.git ../headers-more-nginx-module - - git clone https://github.com/openresty/rds-json-nginx-module.git ../rds-json-nginx-module - - git clone https://github.com/openresty/drizzle-nginx-module.git ../drizzle-nginx-module - - git clone https://github.com/openresty/memc-nginx-module.git ../memc-nginx-module - - git clone https://github.com/openresty/ngx_postgres.git ../postgres-nginx-module - - git clone https://github.com/openresty/openresty.git ../ngx_openresty - -before_script: - - mysql -uroot -e 'create database ngx_test; grant all on ngx_test.* to "ngx_test"@"%" identified by "ngx_test"; flush privileges;' - - psql -c "create database ngx_test;" -U postgres - - psql -c "create user ngx_test with password 'ngx_test';" -U postgres - - psql -c "grant all privileges on database ngx_test to ngx_test;" -U postgres - -script: - - tar xzf download-cache/drizzle7-2011.07.21.tar.gz && cd drizzle7-2011.07.21 - - ./configure --prefix=/usr --without-server > build.log 2>&1 || (cat build.log && exit 1) - - sudo PATH=$PATH make libdrizzle-1.0 install-libdrizzle-1.0 > build.log 2>&1 || (cat build.log && exit 1) - - cd .. - - cd luajit2 - - make -j$JOBS CCDEBUG=-g Q= PREFIX=$LUAJIT_PREFIX CC=$CC XCFLAGS='-DLUA_USE_APICHECK -DLUA_USE_ASSERT' > build.log 2>&1 || (cat build.log && exit 1) - - sudo make install PREFIX=$LUAJIT_PREFIX > build.log 2>&1 || (cat build.log && exit 1) - - cd .. - - cd test-nginx && sudo cpanm . && cd .. - - export PATH=$PWD/work/nginx/sbin:$PWD/nginx-devel-utils:$PATH - - export NGX_BUILD_CC=$CC - - sh util/build.sh $NGINX_VERSION > build.log 2>&1 || (cat build.log && exit 1) - - nginx -V - - ldd `which nginx`|grep luajit - - prove -I. -r t diff --git a/modules_deb/libnginx-mod-http-srcache-filter-0.33/Changes b/modules_deb/libnginx-mod-http-srcache-filter-0.33/Changes deleted file mode 100644 index 5f257fe..0000000 --- a/modules_deb/libnginx-mod-http-srcache-filter-0.33/Changes +++ /dev/null @@ -1,16 +0,0 @@ -v0.12 - 11 July 2011 -* now we properly support fetch/store subrequests with internal redirection in them. main requests with internal redirection will still not be stored into the cache if there is a cache miss. thanks Liseen Wan for reporting it. -* fixed spots that trigger the unused-but-set-variable warning by gcc 4.6. -* added srcache_store_skip and srcache_fetch_skip directives to skip cache fetching or storing based on variables that are set and not empty nor 0. thanks Andre. Examples of using Lua to set $nocache to avoid storing URIs that contain /tmp: - set_by_lua $nocache ' - if string.match(ngx.var.request_uri, "/tmp") then - return "true" - else - return "" - end'; - - srcache_store_skip $nocache; -* added new directive srcache_store_max_size. thanks Andre. -* made our filter optimization work with nginx HUP by clearing the ngx_http_srcache_used flag at nginx pre-config callback. thanks Marcus Clyne. -* now we skip NULL chains in our output filters and also removed the SUBREQUEST_IN_MEMORY flag for our srcache_store subrequests because it will cause mysterious hanging issues when memcached returns CLIENT_ERROR for "get". - diff --git a/modules_deb/libnginx-mod-http-srcache-filter-0.33/README.markdown b/modules_deb/libnginx-mod-http-srcache-filter-0.33/README.markdown deleted file mode 100644 index e880b9c..0000000 --- a/modules_deb/libnginx-mod-http-srcache-filter-0.33/README.markdown +++ /dev/null @@ -1,1258 +0,0 @@ -Name -==== - -**ngx_srcache** - Transparent subrequest-based caching layout for arbitrary nginx locations - -*This module is not distributed with the Nginx source.* See [the installation instructions](#installation). - -Table of Contents -================= - -* [Name](#name) -* [Status](#status) -* [Version](#version) -* [Synopsis](#synopsis) -* [Description](#description) - * [Subrequest caching](#subrequest-caching) - * [Distributed Memcached Caching](#distributed-memcached-caching) - * [Caching with Redis](#caching-with-redis) - * [Cache Key Preprocessing](#cache-key-preprocessing) -* [Directives](#directives) - * [srcache_fetch](#srcache_fetch) - * [srcache_fetch_skip](#srcache_fetch_skip) - * [srcache_store](#srcache_store) - * [srcache_store_max_size](#srcache_store_max_size) - * [srcache_store_skip](#srcache_store_skip) - * [srcache_store_statuses](#srcache_store_statuses) - * [srcache_store_ranges](#srcache_store_ranges) - * [srcache_header_buffer_size](#srcache_header_buffer_size) - * [srcache_store_hide_header](#srcache_store_hide_header) - * [srcache_store_pass_header](#srcache_store_pass_header) - * [srcache_methods](#srcache_methods) - * [srcache_ignore_content_encoding](#srcache_ignore_content_encoding) - * [srcache_request_cache_control](#srcache_request_cache_control) - * [srcache_response_cache_control](#srcache_response_cache_control) - * [srcache_store_no_store](#srcache_store_no_store) - * [srcache_store_no_cache](#srcache_store_no_cache) - * [srcache_store_private](#srcache_store_private) - * [srcache_default_expire](#srcache_default_expire) - * [srcache_max_expire](#srcache_max_expire) -* [Variables](#variables) - * [$srcache_expire](#srcache_expire) - * [$srcache_fetch_status](#srcache_fetch_status) - * [$srcache_store_status](#srcache_store_status) -* [Known Issues](#known-issues) -* [Caveats](#caveats) -* [Trouble Shooting](#trouble-shooting) -* [Installation](#installation) -* [Compatibility](#compatibility) -* [Community](#community) - * [English Mailing List](#english-mailing-list) - * [Chinese Mailing List](#chinese-mailing-list) -* [Bugs and Patches](#bugs-and-patches) -* [Source Repository](#source-repository) -* [Test Suite](#test-suite) -* [TODO](#todo) -* [Getting involved](#getting-involved) -* [Author](#author) -* [Copyright & License](#copyright--license) -* [See Also](#see-also) - -Status -====== - -This module is production ready. - -Version -======= - -This document describes srcache-nginx-module [v0.32](https://github.com/openresty/srcache-nginx-module/tags) released on 2 July 2020. - -Synopsis -======== - -```nginx - - upstream my_memcached { - server 10.62.136.7:11211; - keepalive 10; - } - - location = /memc { - internal; - - memc_connect_timeout 100ms; - memc_send_timeout 100ms; - memc_read_timeout 100ms; - memc_ignore_client_abort on; - - set $memc_key $query_string; - set $memc_exptime 300; - - memc_pass my_memcached; - } - - location /foo { - set $key $uri$args; - srcache_fetch GET /memc $key; - srcache_store PUT /memc $key; - srcache_store_statuses 200 301 302 307 308; - - # proxy_pass/fastcgi_pass/drizzle_pass/echo/etc... - # or even static files on the disk - } -``` - -```nginx - - location = /memc2 { - internal; - - memc_connect_timeout 100ms; - memc_send_timeout 100ms; - memc_read_timeout 100ms; - memc_ignore_client_abort on; - - set_unescape_uri $memc_key $arg_key; - set $memc_exptime $arg_exptime; - - memc_pass unix:/tmp/memcached.sock; - } - - location /bar { - set_escape_uri $key $uri$args; - srcache_fetch GET /memc2 key=$key; - srcache_store PUT /memc2 key=$key&exptime=$srcache_expire; - - # proxy_pass/fastcgi_pass/drizzle_pass/echo/etc... - # or even static files on the disk - } -``` - -```nginx - - map $request_method $skip_fetch { - default 0; - POST 1; - PUT 1; - } - - server { - listen 8080; - - location /api/ { - set $key "$uri?$args"; - - srcache_fetch GET /memc $key; - srcache_store PUT /memc $key; - - srcache_methods GET PUT POST; - srcache_fetch_skip $skip_fetch; - - # proxy_pass/drizzle_pass/content_by_lua/echo/... - } - } -``` - -[Back to TOC](#table-of-contents) - -Description -=========== - -This module provides a transparent caching layer for arbitrary nginx locations (like those use an upstream or even serve static disk files). The caching behavior is mostly compatible with [RFC 2616](http://www.ietf.org/rfc/rfc2616.txt). - -Usually, [memc-nginx-module](https://github.com/openresty/memc-nginx-module) is used together with this module to provide a concrete caching storage backend. But technically, any modules that provide a REST interface can be used as the fetching and storage subrequests used by this module. - -For main requests, the [srcache_fetch](#srcache_fetch) directive works at the end of the access phase, so the [standard access module](http://nginx.org/en/docs/http/ngx_http_access_module.html)'s [allow](http://nginx.org/en/docs/http/ngx_http_access_module.html#allow) and [deny](http://nginx.org/en/docs/http/ngx_http_access_module.html#deny) direcives run *before* ours, which is usually the desired behavior for security reasons. - -The workflow of this module looks like below: - -![srcache flowchart](http://agentzh.org/misc/image/srcache-flowchart.png "srcache flowchart") - -[Back to TOC](#table-of-contents) - -Subrequest caching ------------------- - -For *subrequests*, we explicitly **disallow** the use of this module because it's too difficult to get right. There used to be an implementation but it was buggy and I finally gave up fixing it and abandoned it. - -However, if you're using [lua-nginx-module](https://github.com/openresty/lua-nginx-module), it's easy to do subrequest caching in Lua all by yourself. That is, first issue a subrequest to an [memc-nginx-module](https://github.com/openresty/memc-nginx-module) location to do an explicit cache lookup, if cache hit, just use the cached data returned; otherwise, fall back to the true backend, and finally do a cache insertion to feed the data into the cache. - -Using this module for main request caching and Lua for subrequest caching is the approach that we're taking in our business. This hybrid solution works great in production. - -[Back to TOC](#table-of-contents) - -Distributed Memcached Caching ------------------------------ - -Here is a simple example demonstrating a distributed memcached caching mechanism built atop this module. Suppose we do have three different memcached nodes and we use simple modulo to hash our keys. - -```nginx - - http { - upstream moon { - server 10.62.136.54:11211; - server unix:/tmp/memcached.sock backup; - } - - upstream earth { - server 10.62.136.55:11211; - } - - upstream sun { - server 10.62.136.56:11211; - } - - upstream_list universe moon earth sun; - - server { - memc_connect_timeout 100ms; - memc_send_timeout 100ms; - memc_read_timeout 100ms; - - location = /memc { - internal; - - set $memc_key $query_string; - set_hashed_upstream $backend universe $memc_key; - set $memc_exptime 3600; # in seconds - memc_pass $backend; - } - - location / { - set $key $uri; - srcache_fetch GET /memc $key; - srcache_store PUT /memc $key; - - # proxy_pass/fastcgi_pass/content_by_lua/drizzle_pass/... - } - } - } -``` -Here's what is going on in the sample above: -1. We first define three upstreams, `moon`, `earth`, and `sun`. These are our three memcached servers. -1. And then we group them together as an upstream list entity named `universe` with the `upstream_list` directive provided by [set-misc-nginx-module](https://github.com/openresty/set-misc-nginx-module). -1. After that, we define an internal location named `/memc` for talking to the memcached cluster. -1. In this `/memc` location, we first set the `$memc_key` variable with the query string (`$args`), and then use the [set_hashed_upstream](https://github.com/openresty/set-misc-nginx-module#set_hashed_upstream) directive to hash our [$memc_key](https://github.com/openresty/memc-nginx-module#memc_key) over the upsteam list `universe`, so as to obtain a concrete upstream name to be assigned to the variable `$backend`. -1. We pass this `$backend` variable into the [memc_pass](https://github.com/openresty/memc-nginx-module#memc_pass) directive. The `$backend` variable can hold a value among `moon`, `earth`, and `sun`. -1. Also, we define the memcached caching expiration time to be 3600 seconds (i.e., an hour) by overriding the [$memc_exptime](https://github.com/openresty/memc-nginx-module#memc_exptime) variable. -1. In our main public location `/`, we configure the `$uri` variable as our cache key, and then configure [srcache_fetch](#srcache_fetch) for cache lookups and [srcache_store](#srcache_store) for cache updates. We're using two subrequests to our `/memc` location defined earlier in these two directives. - -One can use [lua-nginx-module](https://github.com/openresty/lua-nginx-module)'s [set_by_lua](https://github.com/openresty/lua-nginx-module#set_by_lua) or [rewrite_by_lua](https://github.com/openresty/lua-nginx-module#rewrite_by_lua) directives to inject custom Lua code to compute the `$backend` and/or `$key` variables in the sample above. - -One thing that should be taken care of is that memcached does have restriction on key lengths, i.e., 250 bytes, so for keys that may be very long, one could use the [set_md5](https://github.com/openresty/set-misc-nginx-module#set_md5) directive or its friends to pre-hash the key to a fixed-length digest before assigning it to `$memc_key` in the `/memc` location or the like. - -Further, one can utilize the [srcache_fetch_skip](#srcache_fetch_skip) and [srcache_store_skip](#srcache_store_skip) directives to control what to cache and what not on a per-request basis, and Lua can also be used here in a similar way. So the possibility is really unlimited. - -To maximize speed, we often enable TCP (or Unix Domain Socket) connection pool for our memcached upstreams provided by [HttpUpstreamKeepaliveModule](http://wiki.nginx.org/HttpUpstreamKeepaliveModule), for example, - -```nginx - - upstream moon { - server 10.62.136.54:11211; - server unix:/tmp/memcached.sock backup; - keepalive 10; - } -``` - -where we define a connection pool which holds up to 10 keep-alive connections (per nginx worker process) for our `moon` upstream (cluster). - -[Back to TOC](#table-of-contents) - -Caching with Redis ------------------- - -Redis is an alternative key-value store with many additional features. - -Here is a working example using the lua-resty-redis module: - -``` - location ~ '\.php$|^/update.php' { - # cache setup - set $key $request_uri; - try_files $uri =404; - - srcache_fetch_skip $skip_cache; - srcache_store_skip $skip_cache; - - srcache_response_cache_control off; - srcache_store_statuses 200 201 301 302 307 308 404 503; - - set_escape_uri $escaped_key $key; - - srcache_fetch GET /redis-fetch $key; - srcache_store PUT /redis-store key=$escaped_key; - - more_set_headers 'X-Cache-Fetch-Status $srcache_fetch_status'; - more_set_headers 'X-Cache-Store-Status $srcache_store_status'; - - fastcgi_split_path_info ^(.+?\.php)(|/.*)$; - # Security note: If you're running a version of PHP older than the - # latest 5.3, you should have "cgi.fix_pathinfo = 0;" in php.ini. - # See http://serverfault.com/q/627903/94922 for details. - include fastcgi_params; - # Block httproxy attacks. See https://httpoxy.org/. - fastcgi_param HTTP_PROXY ""; - fastcgi_param SCRIPT_FILENAME /var/www/html/$fastcgi_script_name; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param QUERY_STRING $query_string; - fastcgi_intercept_errors on; - - fastcgi_pass upstream-name; - } - - location /redis-fetch { - internal; - - resolver 8.8.8.8 valid=300s; - resolver_timeout 10s; - - content_by_lua_block { - local key = assert(ngx.var.request_uri, "no key found") - local redis = require "resty.redis" - local red, err = redis:new() - if not red then - ngx.log(ngx.ERR, "Failed to create redis variable, error -> ", err) - ngx.exit(500) - end - assert(red:connect("redis-master.default.svc.cluster.local", 6379)) - if not red then - ngx.log(ngx.ERR, "Failed to connect to redis, error -> ", err) - ngx.exit(500) - end - local res, err = red:auth("redispassword") - if not res then - ngx.say("failed to authenticate, ", err) - ngx.exit(500) - end - local data = assert(red:get(key)) - assert(red:set_keepalive(10000, 100)) - if res == ngx.null then - return ngx.exit(404) - end - ngx.print(data) - } - } - - location /redis-store { - internal; - - resolver 8.8.8.8 valid=300s; - resolver_timeout 10s; - - content_by_lua_block { - local value = assert(ngx.req.get_body_data(), "no value found") - local key = assert(ngx.var.request_uri, "no key found") - local redis = require "resty.redis" - local red, err = redis:new() - if not red then - ngx.log(ngx.ERR, "Failed to create redis variable, error -> ", err) - ngx.exit(500) - end - assert(red:connect("redis-master.default.svc.cluster.local", 6379)) - if not red then - ngx.log(ngx.ERR, "Failed to connect to redis, error -> ", err) - ngx.exit(500) - end - local res, err = red:auth("redispassword") - if not res then - ngx.say("failed to authenticate, ", err) - ngx.exit(500) - end - local data = assert(red:set(key, value)) - assert(red:set_keepalive(10000, 100)) - if res == ngx.null then - return ngx.exit(404) - end - } - } -``` - - -Here is a working example by using the HTTPRedis (fetch) and Redis2 (store) modules: - -```nginx - - location /api { - default_type text/css; - - set $key $uri; - set_escape_uri $escaped_key $key; - - srcache_fetch GET /redis $key; - srcache_store PUT /redis2 key=$escaped_key&exptime=120; - - # fastcgi_pass/proxy_pass/drizzle_pass/postgres_pass/echo/etc - } - - location = /redis { - internal; - - set_md5 $redis_key $args; - redis_pass 127.0.0.1:6379; - } - - location = /redis2 { - internal; - - set_unescape_uri $exptime $arg_exptime; - set_unescape_uri $key $arg_key; - set_md5 $key; - - redis2_query set $key $echo_request_body; - redis2_query expire $key $exptime; - redis2_pass 127.0.0.1:6379; - } -``` - -This example makes use of the [$echo_request_body](https://github.com/openresty/echo-nginx-module#echo_request_body) variable provided by [echo-nginx-module](https://github.com/openresty/echo-nginx-module). Note that you need the latest version of [echo-nginx-module](https://github.com/openresty/echo-nginx-module), `v0.38rc2` because earlier versions may not work reliably. - -Also, you need both [HttpRedisModule](http://wiki.nginx.org/HttpRedisModule) and [redis2-nginx-module](https://github.com/openresty/redis2-nginx-module). The former is used in the [srcache_fetch](#srcache_fetch) subrequest and the latter is used in the [srcache_store](#srcache_store) subrequest. - -The Nginx core also has a bug that could prevent [redis2-nginx-module](https://github.com/openresty/redis2-nginx-module)'s pipelining support from working properly in certain extreme conditions. And the following patch fixes this: - - http://mailman.nginx.org/pipermail/nginx-devel/2012-March/002040.html - -Note that, however, if you are using the [OpenResty](http://openresty.org/) 1.0.15.3 bundle or later, then you already have everything that you need here in the bundle. - -[Back to TOC](#table-of-contents) - -Cache Key Preprocessing ------------------------ - -It is often desired to preprocess the cache key to exclude random noises that may hurt the cache hit rate. For example, random session IDs in the URI arguments are usually desired to get removed. - -Consider the following URI querystring - - SID=BC3781C3-2E02-4A11-89CF-34E5CFE8B0EF&UID=44332&L=EN&M=1&H=1&UNC=0&SRC=LK&RT=62 - -we want to remove the `SID` and `UID` arguments from it. It is easy to achieve if you use [lua-nginx-module](https://github.com/openresty/lua-nginx-module) at the same time: - -```nginx - - location = /t { - rewrite_by_lua ' - local args = ngx.req.get_uri_args() - args.SID = nil - args.UID = nil - ngx.req.set_uri_args(args) - '; - - echo $args; - } -``` - -Here we use the [echo](https://github.com/openresty/echo-nginx-module#echo) directive from [echo-nginx-module](https://github.com/openresty/echo-nginx-module) to dump out -the final value of [$args](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_args) in the end. You can replace it with your -[srcache-nginx-module](https://github.com/openresty/srcache-nginx-module) configurations and upstream configurations instead for -your case. Let's test this /t interface with curl: - - $ curl 'localhost:8081/t?RT=62&SID=BC3781C3-2E02-4A11-89CF-34E5CFE8B0EF&UID=44332&L=EN&M=1&H=1&UNC=0&SRC=LK' - M=1&UNC=0&RT=62&H=1&L=EN&SRC=LK - -It is worth mentioning that, if you want to retain the order of the URI -arguments, then you can do string substitutions on the value of [$args](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_args) -directly, for example, - - location = /t { - rewrite_by_lua ' - local args = ngx.var.args - newargs, n, err = ngx.re.gsub(args, [[\b[SU]ID=[^&]*&?]], "", "jo") - if n and n > 0 then - ngx.var.args = newargs - end - '; - - echo $args; - } - -Now test it with the original curl command again, we get exactly what -we would expect: - - RT=62&L=EN&M=1&H=1&UNC=0&SRC=LK - -But for caching purposes, it's good to normalize the URI argument -order so that you can increase the cache hit rate. And the hash table -entry order used by LuaJIT or Lua can be used to normalize the order -as a nice side effect. - -[Back to TOC](#table-of-contents) - -Directives -========== - -[Back to TOC](#table-of-contents) - -srcache_fetch -------------- -**syntax:** *srcache_fetch <method> <uri> <args>?* - -**default:** *no* - -**context:** *http, server, location, location if* - -**phase:** *post-access* - -This directive registers an access phase handler that will issue an Nginx subrequest to lookup the cache. - -When the subrequest returns status code other than `200`, than a cache miss is signaled and the control flow will continue to the later phases including the content phase configured by [ngx_http_proxy_module](http://nginx.org/en/docs/http/ngx_http_proxy_module.html), [ngx_http_fastcgi_module](http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html), and others. If the subrequest returns `200 OK`, then a cache hit is signaled and this module will send the subrequest's response as the current main request's response to the client directly. - -This directive will always run at the end of the access phase, such that [ngx_http_access_module](http://nginx.org/en/docs/http/ngx_http_access_module.html)'s [allow](http://nginx.org/en/docs/http/ngx_http_access_module.html#allow) and [deny](http://nginx.org/en/docs/http/ngx_http_access_module.html#deny) will always run *before* this. - -You can use the [srcache_fetch_skip](#srcache_fetch_skip) directive to disable cache look-up selectively. - -[Back to TOC](#table-of-contents) - -srcache_fetch_skip ------------------- -**syntax:** *srcache_fetch_skip <flag>* - -**default:** *srcache_fetch_skip 0* - -**context:** *http, server, location, location if* - -**phase:** *post-access* - -The `` argument supports nginx variables. When this argument's value is not empty *and* not equal to `0`, then the fetching process will be unconditionally skipped. - -For example, to skip caching requests which have a cookie named `foo` with the value `bar`, we can write - -```nginx - - location / { - set $key ...; - set_by_lua $skip ' - if ngx.var.cookie_foo == "bar" then - return 1 - end - return 0 - '; - - srcache_fetch_skip $skip; - srcache_store_skip $skip; - - srcache_fetch GET /memc $key; - srcache_store GET /memc $key; - - # proxy_pass/fastcgi_pass/content_by_lua/... - } -``` -where [lua-nginx-module](https://github.com/openresty/lua-nginx-module) is used to calculate the value of the `$skip` variable at the (earlier) rewrite phase. Similarly, the `$key` variable can be computed by Lua using the [set_by_lua](https://github.com/openresty/lua-nginx-module#set_by_lua) or [rewrite_by_lua](https://github.com/openresty/lua-nginx-module#rewrite_by_lua) directive too. - -The standard [map](http://nginx.org/en/docs/http/ngx_http_map_module.html#map) directive can also be used to compute the value of the `$skip` variable used in the sample above: - -```nginx - - map $cookie_foo $skip { - default 0; - bar 1; - } -``` - -but your [map](http://nginx.org/en/docs/http/ngx_http_map_module.html#map) statement should be put into the `http` config block in your `nginx.conf` file though. - -[Back to TOC](#table-of-contents) - -srcache_store -------------- -**syntax:** *srcache_store <method> <uri> <args>?* - -**default:** *no* - -**context:** *http, server, location, location if* - -**phase:** *output-filter* - -This directive registers an output filter handler that will issue an Nginx subrequest to save the response of the current main request into a cache backend. The status code of the subrequest will be ignored. - -You can use the [srcache_store_skip](#srcache_store_skip) and [srcache_store_max_size](#srcache_store_max_size) directives to disable caching for certain requests in case of a cache miss. - -Since the `v0.12rc7` release, both the response status line, response headers, and response bodies will be put into the cache. By default, the following special response headers will not be cached: - -* Connection -* Keep-Alive -* Proxy-Authenticate -* Proxy-Authorization -* TE -* Trailers -* Transfer-Encoding -* Upgrade -* Set-Cookie - -You can use the [srcache_store_pass_header](#srcache_store_pass_header) and/or [srcache_store_hide_header](#srcache_store_hide_header) directives to control what headers to cache and what not. - -The original response's data chunks get emitted as soon as -they arrive. `srcache_store` just copies and collects the data in an output filter without postponing them from being sent downstream. - -But please note that even though all the response data will be sent immediately, the current Nginx request lifetime will not finish until the srcache_store subrequest completes. That means a delay in closing the TCP connection on the server side (when HTTP keepalive is disabled, but proper HTTP clients should close the connection actively on the client side, which adds no extra delay or other issues at all) or serving the next request sent on the same TCP connection (when HTTP keepalive is in action). - -[Back to TOC](#table-of-contents) - -srcache_store_max_size ----------------------- -**syntax:** *srcache_store_max_size <size>* - -**default:** *srcache_store_max_size 0* - -**context:** *http, server, location, location if* - -**phase:** *output-header-filter* - -When the response body length is exceeding this size, this module will not try to store the response body into the cache using the subrequest template that is specified in [srcache_store](#srcache_store). - -This is particular useful when using a cache storage backend that does have a hard upper limit on the input data. For example, the Memcached server has a default limit of `1 MB` by item. - -When `0` is specified (the default value), there's no limit check at all. - -[Back to TOC](#table-of-contents) - -srcache_store_skip ------------------- -**syntax:** *srcache_store_skip <flag>* - -**default:** *srcache_store_skip 0* - -**context:** *http, server, location, location if* - -**phase:** *output-header-filter* - -The `` argument supports Nginx variables. When this argument's value is not empty *and* not equal to `0`, then the storing process will be unconditionally skipped. - -Starting from the `v0.25` release, the `` expression (possibly containing Nginx variables) can be evaluated up to twice: the first time is right after the response header is being sent and when the `` expression is not evaluated to true values it will be evaluated again right after the end of the response body data stream is seen. Before `v0.25`, only the first time evaluation is performed. - -Here's an example using Lua to set $nocache to avoid storing URIs that contain the string "/tmp": - -```nginx - - set_by_lua $nocache ' - if string.match(ngx.var.uri, "/tmp") then - return 1 - end - return 0'; - - srcache_store_skip $nocache; -``` - -[Back to TOC](#table-of-contents) - -srcache_store_statuses ----------------------- -**syntax:** *srcache_store_statuses <status1> <status2> ..* - -**default:** *srcache_store_statuses 200 301 302 307 308* - -**context:** *http, server, location, location if* - -**phase:** *output-header-filter* - -This directive controls what responses to store to the cache according to their status code. - -By default, only `200`, `301`, `302`, `307` and `308` responses will be stored to cache and any other responses will skip [srcache_store](#srcache_store). - -You can specify arbitrary positive numbers for the response status code that you'd like to cache, even including error code like `404` and `503`. For example: - -```nginx - - srcache_store_statuses 200 201 301 302 307 308 404 503; -``` - -At least one argument should be given to this directive. - -This directive was first introduced in the `v0.13rc2` release. - -[Back to TOC](#table-of-contents) - -srcache_store_ranges --------------------- -**syntax:** *srcache_store_ranges on|off* - -**default:** *srcache_store_ranges off* - -**context:** *http, server, location, location if* - -**phase:** *output-body-filter* - -When this directive is turned on (default to `off`), [srcache_store](#srcache_store) will also store 206 Partial Content responses generated by the standard `ngx_http_range_filter_module`. If you turn this directive on, you MUST add `$http_range` to your cache keys. For example, - -```nginx - - location / { - set $key "$uri$args$http_range"; - srcache_fetch GET /memc $key; - srcache_store PUT /memc $key; - } -``` - -This directive was first introduced in the `v0.27` release. - -[Back to TOC](#table-of-contents) - -srcache_header_buffer_size --------------------------- -**syntax:** *srcache_header_buffer_size <size>* - -**default:** *srcache_header_buffer_size 4k/8k* - -**context:** *http, server, location, location if* - -**phase:** *output-header-filter* - -This directive controles the header buffer when serializing response headers for [srcache_store](#srcache_store). The default size is the page size, usually `4k` or `8k` depending on specific platforms. - -Note that the buffer is not used to hold all the response headers, but just each individual header. So the buffer is merely needed to be big enough to hold the longest response header. - -This directive was first introduced in the `v0.12rc7` release. - -[Back to TOC](#table-of-contents) - -srcache_store_hide_header -------------------------- -**syntax:** *srcache_store_hide_header <header>* - -**default:** *no* - -**context:** *http, server, location, location if* - -**phase:** *output-header-filter* - -By default, this module caches all the response headers except the following ones: - -* Connection -* Keep-Alive -* Proxy-Authenticate -* Proxy-Authorization -* TE -* Trailers -* Transfer-Encoding -* Upgrade -* Set-Cookie - -You can hide even more response headers from [srcache_store](#srcache_store) by listing their names (case-insensitive) by means of this directive. For examples, - -```nginx - - srcache_store_hide_header X-Foo; - srcache_store_hide_header Last-Modified; -``` - -Multiple occurrences of this directive are allowed in a single location. - -This directive was first introduced in the `v0.12rc7` release. - -See also [srcache_store_pass_header](#srcache_store_pass_header). - -[Back to TOC](#table-of-contents) - -srcache_store_pass_header -------------------------- -**syntax:** *srcache_store_pass_header <header>* - -**default:** *no* - -**context:** *http, server, location, location if* - -**phase:** *output-header-filter* - -By default, this module caches all the response headers except the following ones: - -* Connection -* Keep-Alive -* Proxy-Authenticate -* Proxy-Authorization -* TE -* Trailers -* Transfer-Encoding -* Upgrade -* Set-Cookie - -You can force [srcache_store](#srcache_store) to store one or more of these response headers from [srcache_store](#srcache_store) by listing their names (case-insensitive) by means of this directive. For examples, - -```nginx - - srcache_store_pass_header Set-Cookie; - srcache_store_pass_header Proxy-Autenticate; -``` - -Multiple occurrences of this directive are allowed in a single location. - -This directive was first introduced in the `v0.12rc7` release. - -See also [srcache_store_hide_header](#srcache_store_hide_header). - -[Back to TOC](#table-of-contents) - -srcache_methods ---------------- -**syntax:** *srcache_methods <method>...* - -**default:** *srcache_methods GET HEAD* - -**context:** *http, server, location* - -**phase:** *post-access, output-header-filter* - -This directive specifies HTTP request methods that are considered by either [srcache_fetch](#srcache_fetch) or [srcache_store](#srcache_store). HTTP request methods not listed will be skipped completely from the cache. - -The following HTTP methods are allowed: `GET`, `HEAD`, `POST`, `PUT`, and `DELETE`. The `GET` and `HEAD` methods are always implicitly included in the list regardless of their presence in this directive. - -Note that since the `v0.17` release `HEAD` requests are always skipped by [srcache_store](#srcache_store) because their responses never carry a response body. - -This directive was first introduced in the `v0.12rc7` release. - -[Back to TOC](#table-of-contents) - -srcache_ignore_content_encoding -------------------------------- -**syntax:** *srcache_ignore_content_encoding on|off* - -**default:** *srcache_ignore_content_encoding off* - -**context:** *http, server, location, location if* - -**phase:** *output-header-filter* - -When this directive is turned `off` (which is the default), non-empty `Content-Encoding` response header will cause [srcache_store](#srcache_store) skip storing the whole response into the cache and issue a warning into nginx's `error.log` file like this: - - - [warn] 12500#0: *1 srcache_store skipped due to response header "Content-Encoding: gzip" - (maybe you forgot to disable compression on the backend?) - - -Turning on this directive will ignore the `Content-Encoding` response header and store the response as usual (and also without warning). - -It's recommended to always disable gzip/deflate compression on your backend server by specifying the following line in your `nginx.conf` file: - -```nginx - - proxy_set_header Accept-Encoding ""; -``` - -This directive was first introduced in the `v0.12rc7` release. - -[Back to TOC](#table-of-contents) - -srcache_request_cache_control ------------------------------ -**syntax:** *srcache_request_cache_control on|off* - -**default:** *srcache_request_cache_control off* - -**context:** *http, server, location* - -**phase:** *post-access, output-header-filter* - -When this directive is turned `on`, the request headers `Cache-Control` and `Pragma` will be honored by this module in the following ways: - -1. [srcache_fetch](#srcache_fetch), i.e., the cache lookup operation, will be skipped when request headers `Cache-Control: no-cache` and/or `Pragma: no-cache` are present. -1. [srcache_store](#srcache_store), i.e., the cache store operation, will be skipped when the request header `Cache-Control: no-store` is specified. - -Turning off this directive will disable this functionality and is considered safer for busy sites mainly relying on cache for speed. - -This directive was first introduced in the `v0.12rc7` release. - -See also [srcache_response_cache_control](#srcache_response_cache_control). - -[Back to TOC](#table-of-contents) - -srcache_response_cache_control ------------------------------- -**syntax:** *srcache_response_cache_control on|off* - -**default:** *srcache_response_cache_control on* - -**context:** *http, server, location* - -**phase:** *output-header-filter* - -When this directive is turned `on`, the response headers `Cache-Control` and `Expires` will be honored by this module in the following ways: - -* `Cache-Control: private` skips [srcache_store](#srcache_store), -* `Cache-Control: no-store` skips [srcache_store](#srcache_store), -* `Cache-Control: no-cache` skips [srcache_store](#srcache_store), -* `Cache-Control: max-age=0` skips [srcache_store](#srcache_store), -* and `Expires: ` skips [srcache_store](#srcache_store). - -This directive takes priority over the [srcache_store_no_store](#srcache_store_no_store), [srcache_store_no_cache](#srcache_store_no_cache), and [srcache_store_private](#srcache_store_private) directives. - -This directive was first introduced in the `v0.12rc7` release. - -See also [srcache_request_cache_control](#srcache_request_cache_control). - -[Back to TOC](#table-of-contents) - -srcache_store_no_store ----------------------- -**syntax:** *srcache_store_no_store on|off* - -**default:** *srcache_store_no_store off* - -**context:** *http, server, location* - -**phase:** *output-header-filter* - -Turning this directive on will force responses with the header `Cache-Control: no-store` to be stored into the cache when [srcache_response_cache_control](#srcache_response_cache_control) is turned `on` *and* other conditions are met. Default to `off`. - -This directive was first introduced in the `v0.12rc7` release. - -[Back to TOC](#table-of-contents) - -srcache_store_no_cache ----------------------- -**syntax:** *srcache_store_no_cache on|off* - -**default:** *srcache_store_no_cache off* - -**context:** *http, server, location* - -**phase:** *output-header-filter* - -Turning this directive on will force responses with the header `Cache-Control: no-cache` to be stored into the cache when [srcache_response_cache_control](#srcache_response_cache_control) is turned `on` *and* other conditions are met. Default to `off`. - -This directive was first introduced in the `v0.12rc7` release. - -[Back to TOC](#table-of-contents) - -srcache_store_private ---------------------- -**syntax:** *srcache_store_private on|off* - -**default:** *srcache_store_private off* - -**context:** *http, server, location* - -**phase:** *output-header-filter* - -Turning this directive on will force responses with the header `Cache-Control: private` to be stored into the cache when [srcache_response_cache_control](#srcache_response_cache_control) is turned `on` *and* other conditions are met. Default to `off`. - -This directive was first introduced in the `v0.12rc7` release. - -[Back to TOC](#table-of-contents) - -srcache_default_expire ----------------------- -**syntax:** *srcache_default_expire <time>* - -**default:** *srcache_default_expire 60s* - -**context:** *http, server, location, location if* - -**phase:** *output-header-filter* - -This directive controls the default expiration time period that is allowed for the [$srcache_expire](#srcache_expire) variable value when neither `Cache-Control: max-age=N` nor `Expires` are specified in the response headers. - -The `