passenger 4.0.60 → 5.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of passenger might be problematic. Click here for more details.
- checksums.yaml +8 -8
- checksums.yaml.gz.asc +7 -7
- data.tar.gz.asc +7 -7
- data/.editorconfig +5 -0
- data/.travis.yml +3 -2
- data/CHANGELOG +31 -53
- data/CONTRIBUTING.md +4 -4
- data/CONTRIBUTORS +0 -1
- data/Gemfile +18 -0
- data/Gemfile.lock +41 -0
- data/Rakefile +16 -0
- data/bin/passenger +2 -2
- data/bin/passenger-install-apache2-module +12 -12
- data/bin/passenger-install-nginx-module +9 -14
- data/bin/passenger-status +125 -87
- data/build/agents.rb +112 -140
- data/build/apache2.rb +4 -9
- data/build/basics.rb +5 -3
- data/build/common_library.rb +1 -0
- data/build/cxx_tests.rb +69 -47
- data/build/debian.rb +4 -2
- data/build/documentation.rb +1 -0
- data/build/integration_tests.rb +28 -43
- data/build/misc.rb +0 -18
- data/build/nginx.rb +2 -6
- data/build/packaging.rb +33 -22
- data/build/preprocessor.rb +2 -4
- data/build/ruby_tests.rb +7 -26
- data/build/test_basics.rb +24 -25
- data/debian.template/control.template +2 -2
- data/debian.template/locations.ini.template +2 -3
- data/debian.template/passenger.install.template +2 -2
- data/debian.template/rules.template +1 -1
- data/dev/ci/run_jenkins.sh +0 -1
- data/dev/ci/run_rpm_tests.sh +3 -0
- data/dev/ci/run_travis.sh +63 -17
- data/dev/copy_boost_headers +22 -6
- data/dev/ruby_server.rb +244 -0
- data/dev/vagrant/provision.sh +3 -1
- data/doc/DebuggingAndStressTesting.md +3 -3
- data/doc/Design and Architecture.txt +5 -6
- data/doc/Packaging.txt.md +35 -6
- data/doc/ServerOptimizationGuide.txt.md +339 -0
- data/doc/Users guide Apache.idmap.txt +177 -187
- data/doc/Users guide Apache.txt +143 -219
- data/doc/Users guide Nginx.idmap.txt +166 -166
- data/doc/Users guide Nginx.txt +265 -223
- data/doc/Users guide Standalone.txt +3 -3
- data/doc/templates/markdown.html.erb +37 -6
- data/doc/users_guide_snippets/environment_variables.txt +1 -1
- data/doc/users_guide_snippets/support_information.txt +1 -1
- data/doc/users_guide_snippets/tips.txt +2 -2
- data/ext/apache2/Configuration.cpp +23 -81
- data/ext/apache2/Configuration.hpp +18 -92
- data/ext/apache2/ConfigurationCommands.cpp +64 -15
- data/ext/apache2/ConfigurationCommands.cpp.erb +8 -4
- data/ext/apache2/ConfigurationFields.hpp +12 -0
- data/ext/apache2/ConfigurationSetters.cpp +73 -1
- data/ext/apache2/ConfigurationSetters.cpp.erb +3 -2
- data/ext/apache2/CreateDirConfig.cpp +6 -0
- data/ext/apache2/DirectoryMapper.h +11 -6
- data/ext/apache2/Hooks.cpp +291 -408
- data/ext/apache2/MergeDirConfig.cpp +42 -0
- data/ext/apache2/SetHeaders.cpp +61 -16
- data/ext/apache2/SetHeaders.cpp.erb +9 -7
- data/ext/boost/container/allocator_traits.hpp +400 -0
- data/ext/boost/container/deque.hpp +2012 -0
- data/ext/boost/container/detail/adaptive_node_pool_impl.hpp +874 -0
- data/ext/boost/container/detail/advanced_insert_int.hpp +369 -0
- data/ext/boost/container/detail/algorithms.hpp +84 -0
- data/ext/boost/container/detail/allocation_type.hpp +54 -0
- data/ext/boost/container/detail/allocator_version_traits.hpp +163 -0
- data/ext/boost/container/detail/config_begin.hpp +49 -0
- data/ext/boost/container/detail/config_end.hpp +17 -0
- data/ext/boost/container/detail/destroyers.hpp +365 -0
- data/ext/boost/container/detail/flat_tree.hpp +1055 -0
- data/ext/boost/container/detail/function_detector.hpp +88 -0
- data/ext/boost/container/detail/iterators.hpp +611 -0
- data/ext/boost/container/detail/math_functions.hpp +113 -0
- data/ext/boost/container/detail/memory_util.hpp +83 -0
- data/ext/boost/container/detail/mpl.hpp +160 -0
- data/ext/boost/container/detail/multiallocation_chain.hpp +286 -0
- data/ext/boost/container/detail/node_alloc_holder.hpp +386 -0
- data/ext/boost/container/detail/node_pool_impl.hpp +365 -0
- data/ext/boost/container/detail/pair.hpp +354 -0
- data/ext/boost/container/detail/pool_common.hpp +52 -0
- data/ext/boost/container/detail/preprocessor.hpp +232 -0
- data/ext/boost/container/detail/transform_iterator.hpp +176 -0
- data/ext/boost/container/detail/tree.hpp +1134 -0
- data/ext/boost/container/detail/type_traits.hpp +210 -0
- data/ext/boost/container/detail/utilities.hpp +1141 -0
- data/ext/boost/container/detail/value_init.hpp +45 -0
- data/ext/boost/container/detail/variadic_templates_tools.hpp +153 -0
- data/ext/boost/container/detail/version_type.hpp +92 -0
- data/ext/boost/container/detail/workaround.hpp +44 -0
- data/ext/boost/container/flat_map.hpp +1674 -0
- data/ext/boost/container/flat_set.hpp +1408 -0
- data/ext/boost/container/list.hpp +1475 -0
- data/ext/boost/container/map.hpp +1508 -0
- data/ext/boost/container/scoped_allocator.hpp +1503 -0
- data/ext/boost/container/scoped_allocator_fwd.hpp +83 -0
- data/ext/boost/container/set.hpp +1280 -0
- data/ext/boost/container/slist.hpp +1706 -0
- data/ext/boost/container/stable_vector.hpp +1869 -0
- data/ext/boost/container/static_vector.hpp +1053 -0
- data/ext/boost/container/string.hpp +2856 -0
- data/ext/boost/container/throw_exception.hpp +110 -0
- data/ext/boost/container/vector.hpp +2671 -0
- data/ext/boost/detail/is_xxx.hpp +61 -0
- data/ext/boost/intrusive/any_hook.hpp +344 -0
- data/ext/boost/intrusive/avl_set.hpp +2528 -0
- data/ext/boost/intrusive/avl_set_hook.hpp +297 -0
- data/ext/boost/intrusive/avltree.hpp +1786 -0
- data/ext/boost/intrusive/avltree_algorithms.hpp +968 -0
- data/ext/boost/intrusive/bs_set_hook.hpp +296 -0
- data/ext/boost/intrusive/circular_list_algorithms.hpp +413 -0
- data/ext/boost/intrusive/circular_slist_algorithms.hpp +404 -0
- data/ext/boost/intrusive/derivation_value_traits.hpp +70 -0
- data/ext/boost/intrusive/detail/any_node_and_algorithms.hpp +297 -0
- data/ext/boost/intrusive/detail/assert.hpp +41 -0
- data/ext/boost/intrusive/detail/avltree_node.hpp +197 -0
- data/ext/boost/intrusive/detail/clear_on_destructor_base.hpp +36 -0
- data/ext/boost/intrusive/detail/common_slist_algorithms.hpp +102 -0
- data/ext/boost/intrusive/detail/config_begin.hpp +52 -0
- data/ext/boost/intrusive/detail/config_end.hpp +15 -0
- data/ext/boost/intrusive/detail/ebo_functor_holder.hpp +95 -0
- data/ext/boost/intrusive/detail/function_detector.hpp +88 -0
- data/ext/boost/intrusive/detail/generic_hook.hpp +209 -0
- data/ext/boost/intrusive/detail/has_member_function_callable_with.hpp +357 -0
- data/ext/boost/intrusive/detail/hashtable_node.hpp +249 -0
- data/ext/boost/intrusive/detail/is_stateful_value_traits.hpp +77 -0
- data/ext/boost/intrusive/detail/list_node.hpp +196 -0
- data/ext/boost/intrusive/detail/memory_util.hpp +288 -0
- data/ext/boost/intrusive/detail/mpl.hpp +383 -0
- data/ext/boost/intrusive/detail/parent_from_member.hpp +97 -0
- data/ext/boost/intrusive/detail/preprocessor.hpp +52 -0
- data/ext/boost/intrusive/detail/rbtree_node.hpp +201 -0
- data/ext/boost/intrusive/detail/slist_node.hpp +166 -0
- data/ext/boost/intrusive/detail/transform_iterator.hpp +173 -0
- data/ext/boost/intrusive/detail/tree_algorithms.hpp +1742 -0
- data/ext/boost/intrusive/detail/tree_node.hpp +199 -0
- data/ext/boost/intrusive/detail/utilities.hpp +858 -0
- data/ext/boost/intrusive/detail/workaround.hpp +22 -0
- data/ext/boost/intrusive/hashtable.hpp +3110 -0
- data/ext/boost/intrusive/intrusive_fwd.hpp +542 -0
- data/ext/boost/intrusive/linear_slist_algorithms.hpp +327 -0
- data/ext/boost/intrusive/link_mode.hpp +46 -0
- data/ext/boost/intrusive/list.hpp +1525 -0
- data/ext/boost/intrusive/list_hook.hpp +290 -0
- data/ext/boost/intrusive/member_value_traits.hpp +70 -0
- data/ext/boost/intrusive/options.hpp +810 -0
- data/ext/boost/intrusive/parent_from_member.hpp +42 -0
- data/ext/boost/intrusive/pointer_plus_bits.hpp +86 -0
- data/ext/boost/intrusive/pointer_traits.hpp +265 -0
- data/ext/boost/intrusive/priority_compare.hpp +39 -0
- data/ext/boost/intrusive/rbtree.hpp +1785 -0
- data/ext/boost/intrusive/rbtree_algorithms.hpp +934 -0
- data/ext/boost/intrusive/set.hpp +2554 -0
- data/ext/boost/intrusive/set_hook.hpp +300 -0
- data/ext/boost/intrusive/sg_set.hpp +2601 -0
- data/ext/boost/intrusive/sgtree.hpp +2009 -0
- data/ext/boost/intrusive/sgtree_algorithms.hpp +807 -0
- data/ext/boost/intrusive/slist.hpp +2219 -0
- data/ext/boost/intrusive/slist_hook.hpp +294 -0
- data/ext/boost/intrusive/splay_set.hpp +2575 -0
- data/ext/boost/intrusive/splay_set_hook.hpp +292 -0
- data/ext/boost/intrusive/splaytree.hpp +1784 -0
- data/ext/boost/intrusive/splaytree_algorithms.hpp +1008 -0
- data/ext/boost/intrusive/treap.hpp +1882 -0
- data/ext/boost/intrusive/treap_algorithms.hpp +919 -0
- data/ext/boost/intrusive/treap_set.hpp +2751 -0
- data/ext/boost/intrusive/trivial_value_traits.hpp +46 -0
- data/ext/boost/intrusive/unordered_set.hpp +2115 -0
- data/ext/boost/intrusive/unordered_set_hook.hpp +434 -0
- data/ext/boost/intrusive_ptr.hpp +18 -0
- data/ext/boost/math/common_factor_ct.hpp +180 -0
- data/ext/boost/math_fwd.hpp +108 -0
- data/ext/boost/move/detail/move_helpers.hpp +175 -0
- data/ext/boost/parameter.hpp +21 -0
- data/ext/boost/parameter/aux_/arg_list.hpp +459 -0
- data/ext/boost/parameter/aux_/cast.hpp +143 -0
- data/ext/boost/parameter/aux_/default.hpp +69 -0
- data/ext/boost/parameter/aux_/is_maybe.hpp +26 -0
- data/ext/boost/parameter/aux_/maybe.hpp +120 -0
- data/ext/boost/parameter/aux_/overloads.hpp +88 -0
- data/ext/boost/parameter/aux_/parameter_requirements.hpp +25 -0
- data/ext/boost/parameter/aux_/parenthesized_type.hpp +119 -0
- data/ext/boost/parameter/aux_/preprocessor/flatten.hpp +115 -0
- data/ext/boost/parameter/aux_/preprocessor/for_each.hpp +103 -0
- data/ext/boost/parameter/aux_/python/invoker.hpp +132 -0
- data/ext/boost/parameter/aux_/python/invoker_iterate.hpp +93 -0
- data/ext/boost/parameter/aux_/result_of0.hpp +36 -0
- data/ext/boost/parameter/aux_/set.hpp +67 -0
- data/ext/boost/parameter/aux_/tag.hpp +38 -0
- data/ext/boost/parameter/aux_/tagged_argument.hpp +188 -0
- data/ext/boost/parameter/aux_/template_keyword.hpp +47 -0
- data/ext/boost/parameter/aux_/unwrap_cv_reference.hpp +97 -0
- data/ext/boost/parameter/aux_/void.hpp +29 -0
- data/ext/boost/parameter/aux_/yesno.hpp +26 -0
- data/ext/boost/parameter/binding.hpp +106 -0
- data/ext/boost/parameter/config.hpp +14 -0
- data/ext/boost/parameter/keyword.hpp +152 -0
- data/ext/boost/parameter/macros.hpp +99 -0
- data/ext/boost/parameter/match.hpp +55 -0
- data/ext/boost/parameter/name.hpp +156 -0
- data/ext/boost/parameter/parameters.hpp +931 -0
- data/ext/boost/parameter/preprocessor.hpp +1178 -0
- data/ext/boost/parameter/python.hpp +735 -0
- data/ext/boost/parameter/value_type.hpp +108 -0
- data/ext/boost/pool/detail/for.m4 +107 -0
- data/ext/boost/pool/detail/guard.hpp +69 -0
- data/ext/boost/pool/detail/mutex.hpp +42 -0
- data/ext/boost/pool/detail/pool_construct.bat +24 -0
- data/ext/boost/pool/detail/pool_construct.ipp +852 -0
- data/ext/boost/pool/detail/pool_construct.m4 +84 -0
- data/ext/boost/pool/detail/pool_construct.sh +12 -0
- data/ext/boost/pool/detail/pool_construct_simple.bat +25 -0
- data/ext/boost/pool/detail/pool_construct_simple.ipp +43 -0
- data/ext/boost/pool/detail/pool_construct_simple.m4 +72 -0
- data/ext/boost/pool/detail/pool_construct_simple.sh +12 -0
- data/ext/boost/pool/object_pool.hpp +287 -0
- data/ext/boost/pool/pool.hpp +1024 -0
- data/ext/boost/pool/pool_alloc.hpp +488 -0
- data/ext/boost/pool/poolfwd.hpp +82 -0
- data/ext/boost/pool/simple_segregated_storage.hpp +377 -0
- data/ext/boost/pool/singleton_pool.hpp +251 -0
- data/ext/boost/preprocessor/arithmetic.hpp +25 -0
- data/ext/boost/preprocessor/arithmetic/detail/div_base.hpp +61 -0
- data/ext/boost/preprocessor/arithmetic/div.hpp +39 -0
- data/ext/boost/preprocessor/arithmetic/mod.hpp +39 -0
- data/ext/boost/preprocessor/arithmetic/mul.hpp +53 -0
- data/ext/boost/preprocessor/array.hpp +32 -0
- data/ext/boost/preprocessor/array/enum.hpp +33 -0
- data/ext/boost/preprocessor/array/insert.hpp +55 -0
- data/ext/boost/preprocessor/array/pop_back.hpp +37 -0
- data/ext/boost/preprocessor/array/pop_front.hpp +38 -0
- data/ext/boost/preprocessor/array/push_back.hpp +33 -0
- data/ext/boost/preprocessor/array/push_front.hpp +33 -0
- data/ext/boost/preprocessor/array/remove.hpp +54 -0
- data/ext/boost/preprocessor/array/replace.hpp +49 -0
- data/ext/boost/preprocessor/array/reverse.hpp +29 -0
- data/ext/boost/preprocessor/array/to_list.hpp +33 -0
- data/ext/boost/preprocessor/array/to_seq.hpp +33 -0
- data/ext/boost/preprocessor/array/to_tuple.hpp +22 -0
- data/ext/boost/preprocessor/assert_msg.hpp +17 -0
- data/ext/boost/preprocessor/comma.hpp +17 -0
- data/ext/boost/preprocessor/comparison.hpp +24 -0
- data/ext/boost/preprocessor/comparison/equal.hpp +34 -0
- data/ext/boost/preprocessor/comparison/greater.hpp +38 -0
- data/ext/boost/preprocessor/comparison/greater_equal.hpp +38 -0
- data/ext/boost/preprocessor/comparison/less.hpp +46 -0
- data/ext/boost/preprocessor/comparison/less_equal.hpp +39 -0
- data/ext/boost/preprocessor/comparison/not_equal.hpp +814 -0
- data/ext/boost/preprocessor/config/limits.hpp +30 -0
- data/ext/boost/preprocessor/control.hpp +22 -0
- data/ext/boost/preprocessor/control/deduce_d.hpp +22 -0
- data/ext/boost/preprocessor/control/detail/dmc/while.hpp +536 -0
- data/ext/boost/preprocessor/control/detail/edg/while.hpp +534 -0
- data/ext/boost/preprocessor/control/detail/msvc/while.hpp +277 -0
- data/ext/boost/preprocessor/control/expr_if.hpp +30 -0
- data/ext/boost/preprocessor/debug.hpp +18 -0
- data/ext/boost/preprocessor/debug/assert.hpp +44 -0
- data/ext/boost/preprocessor/debug/line.hpp +35 -0
- data/ext/boost/preprocessor/detail/dmc/auto_rec.hpp +286 -0
- data/ext/boost/preprocessor/detail/is_nullary.hpp +30 -0
- data/ext/boost/preprocessor/detail/is_unary.hpp +30 -0
- data/ext/boost/preprocessor/detail/null.hpp +17 -0
- data/ext/boost/preprocessor/detail/split.hpp +35 -0
- data/ext/boost/preprocessor/enum_params_with_defaults.hpp +17 -0
- data/ext/boost/preprocessor/enum_shifted.hpp +17 -0
- data/ext/boost/preprocessor/expand.hpp +17 -0
- data/ext/boost/preprocessor/expr_if.hpp +17 -0
- data/ext/boost/preprocessor/facilities.hpp +23 -0
- data/ext/boost/preprocessor/facilities/apply.hpp +34 -0
- data/ext/boost/preprocessor/facilities/expand.hpp +28 -0
- data/ext/boost/preprocessor/facilities/is_1.hpp +23 -0
- data/ext/boost/preprocessor/facilities/is_empty.hpp +43 -0
- data/ext/boost/preprocessor/facilities/is_empty_or_1.hpp +30 -0
- data/ext/boost/preprocessor/for.hpp +17 -0
- data/ext/boost/preprocessor/if.hpp +17 -0
- data/ext/boost/preprocessor/iteration.hpp +19 -0
- data/ext/boost/preprocessor/iteration/detail/bounds/lower3.hpp +99 -0
- data/ext/boost/preprocessor/iteration/detail/bounds/lower4.hpp +99 -0
- data/ext/boost/preprocessor/iteration/detail/bounds/lower5.hpp +99 -0
- data/ext/boost/preprocessor/iteration/detail/bounds/upper3.hpp +99 -0
- data/ext/boost/preprocessor/iteration/detail/bounds/upper4.hpp +99 -0
- data/ext/boost/preprocessor/iteration/detail/bounds/upper5.hpp +99 -0
- data/ext/boost/preprocessor/iteration/detail/finish.hpp +99 -0
- data/ext/boost/preprocessor/iteration/detail/iter/forward3.hpp +1338 -0
- data/ext/boost/preprocessor/iteration/detail/iter/forward4.hpp +1338 -0
- data/ext/boost/preprocessor/iteration/detail/iter/forward5.hpp +1338 -0
- data/ext/boost/preprocessor/iteration/detail/iter/reverse2.hpp +1296 -0
- data/ext/boost/preprocessor/iteration/detail/iter/reverse3.hpp +1296 -0
- data/ext/boost/preprocessor/iteration/detail/iter/reverse4.hpp +1296 -0
- data/ext/boost/preprocessor/iteration/detail/iter/reverse5.hpp +1296 -0
- data/ext/boost/preprocessor/iteration/detail/local.hpp +812 -0
- data/ext/boost/preprocessor/iteration/detail/rlocal.hpp +782 -0
- data/ext/boost/preprocessor/iteration/detail/self.hpp +21 -0
- data/ext/boost/preprocessor/iteration/detail/start.hpp +99 -0
- data/ext/boost/preprocessor/iteration/local.hpp +26 -0
- data/ext/boost/preprocessor/iteration/self.hpp +19 -0
- data/ext/boost/preprocessor/library.hpp +36 -0
- data/ext/boost/preprocessor/limits.hpp +17 -0
- data/ext/boost/preprocessor/list.hpp +37 -0
- data/ext/boost/preprocessor/list/at.hpp +39 -0
- data/ext/boost/preprocessor/list/cat.hpp +42 -0
- data/ext/boost/preprocessor/list/detail/dmc/fold_left.hpp +279 -0
- data/ext/boost/preprocessor/list/detail/edg/fold_left.hpp +536 -0
- data/ext/boost/preprocessor/list/detail/edg/fold_right.hpp +794 -0
- data/ext/boost/preprocessor/list/enum.hpp +41 -0
- data/ext/boost/preprocessor/list/filter.hpp +54 -0
- data/ext/boost/preprocessor/list/first_n.hpp +58 -0
- data/ext/boost/preprocessor/list/for_each.hpp +49 -0
- data/ext/boost/preprocessor/list/for_each_product.hpp +141 -0
- data/ext/boost/preprocessor/list/rest_n.hpp +55 -0
- data/ext/boost/preprocessor/list/size.hpp +58 -0
- data/ext/boost/preprocessor/list/to_array.hpp +123 -0
- data/ext/boost/preprocessor/list/to_seq.hpp +32 -0
- data/ext/boost/preprocessor/list/to_tuple.hpp +38 -0
- data/ext/boost/preprocessor/logical.hpp +29 -0
- data/ext/boost/preprocessor/logical/bitnor.hpp +38 -0
- data/ext/boost/preprocessor/logical/bitor.hpp +38 -0
- data/ext/boost/preprocessor/logical/bitxor.hpp +38 -0
- data/ext/boost/preprocessor/logical/nor.hpp +30 -0
- data/ext/boost/preprocessor/logical/not.hpp +30 -0
- data/ext/boost/preprocessor/logical/or.hpp +30 -0
- data/ext/boost/preprocessor/logical/xor.hpp +30 -0
- data/ext/boost/preprocessor/max.hpp +17 -0
- data/ext/boost/preprocessor/min.hpp +17 -0
- data/ext/boost/preprocessor/punctuation.hpp +20 -0
- data/ext/boost/preprocessor/punctuation/paren_if.hpp +38 -0
- data/ext/boost/preprocessor/repeat_3rd.hpp +17 -0
- data/ext/boost/preprocessor/repeat_from_to.hpp +17 -0
- data/ext/boost/preprocessor/repeat_from_to_2nd.hpp +17 -0
- data/ext/boost/preprocessor/repeat_from_to_3rd.hpp +17 -0
- data/ext/boost/preprocessor/repetition.hpp +32 -0
- data/ext/boost/preprocessor/repetition/deduce_r.hpp +22 -0
- data/ext/boost/preprocessor/repetition/deduce_z.hpp +22 -0
- data/ext/boost/preprocessor/repetition/detail/dmc/for.hpp +536 -0
- data/ext/boost/preprocessor/repetition/detail/edg/for.hpp +534 -0
- data/ext/boost/preprocessor/repetition/detail/msvc/for.hpp +277 -0
- data/ext/boost/preprocessor/repetition/enum_params_with_defaults.hpp +24 -0
- data/ext/boost/preprocessor/repetition/enum_shifted.hpp +68 -0
- data/ext/boost/preprocessor/repetition/enum_shifted_binary_params.hpp +51 -0
- data/ext/boost/preprocessor/repetition/enum_trailing.hpp +63 -0
- data/ext/boost/preprocessor/repetition/enum_trailing_binary_params.hpp +53 -0
- data/ext/boost/preprocessor/selection.hpp +18 -0
- data/ext/boost/preprocessor/selection/max.hpp +39 -0
- data/ext/boost/preprocessor/selection/min.hpp +39 -0
- data/ext/boost/preprocessor/seq.hpp +43 -0
- data/ext/boost/preprocessor/seq/cat.hpp +49 -0
- data/ext/boost/preprocessor/seq/detail/binary_transform.hpp +40 -0
- data/ext/boost/preprocessor/seq/detail/split.hpp +284 -0
- data/ext/boost/preprocessor/seq/filter.hpp +54 -0
- data/ext/boost/preprocessor/seq/first_n.hpp +30 -0
- data/ext/boost/preprocessor/seq/fold_left.hpp +1070 -0
- data/ext/boost/preprocessor/seq/fold_right.hpp +288 -0
- data/ext/boost/preprocessor/seq/for_each.hpp +60 -0
- data/ext/boost/preprocessor/seq/for_each_product.hpp +126 -0
- data/ext/boost/preprocessor/seq/insert.hpp +28 -0
- data/ext/boost/preprocessor/seq/pop_back.hpp +29 -0
- data/ext/boost/preprocessor/seq/pop_front.hpp +27 -0
- data/ext/boost/preprocessor/seq/push_back.hpp +19 -0
- data/ext/boost/preprocessor/seq/push_front.hpp +19 -0
- data/ext/boost/preprocessor/seq/remove.hpp +29 -0
- data/ext/boost/preprocessor/seq/replace.hpp +29 -0
- data/ext/boost/preprocessor/seq/rest_n.hpp +30 -0
- data/ext/boost/preprocessor/seq/reverse.hpp +39 -0
- data/ext/boost/preprocessor/seq/subseq.hpp +28 -0
- data/ext/boost/preprocessor/seq/to_array.hpp +28 -0
- data/ext/boost/preprocessor/seq/to_list.hpp +29 -0
- data/ext/boost/preprocessor/seq/to_tuple.hpp +27 -0
- data/ext/boost/preprocessor/seq/transform.hpp +48 -0
- data/ext/boost/preprocessor/slot.hpp +17 -0
- data/ext/boost/preprocessor/slot/counter.hpp +25 -0
- data/ext/boost/preprocessor/slot/detail/counter.hpp +269 -0
- data/ext/boost/preprocessor/slot/detail/slot1.hpp +267 -0
- data/ext/boost/preprocessor/slot/detail/slot2.hpp +267 -0
- data/ext/boost/preprocessor/slot/detail/slot3.hpp +267 -0
- data/ext/boost/preprocessor/slot/detail/slot4.hpp +267 -0
- data/ext/boost/preprocessor/slot/detail/slot5.hpp +267 -0
- data/ext/boost/preprocessor/tuple.hpp +28 -0
- data/ext/boost/preprocessor/tuple/enum.hpp +22 -0
- data/ext/boost/preprocessor/tuple/reverse.hpp +114 -0
- data/ext/boost/preprocessor/tuple/size.hpp +28 -0
- data/ext/boost/preprocessor/tuple/to_array.hpp +37 -0
- data/ext/boost/preprocessor/tuple/to_seq.hpp +114 -0
- data/ext/boost/preprocessor/variadic.hpp +23 -0
- data/ext/boost/preprocessor/variadic/to_array.hpp +32 -0
- data/ext/boost/preprocessor/variadic/to_list.hpp +25 -0
- data/ext/boost/preprocessor/variadic/to_seq.hpp +25 -0
- data/ext/boost/preprocessor/variadic/to_tuple.hpp +24 -0
- data/ext/boost/preprocessor/while.hpp +17 -0
- data/ext/boost/preprocessor/wstringize.hpp +29 -0
- data/ext/boost/smart_ptr/intrusive_ptr.hpp +324 -0
- data/ext/common/AccountsDatabase.h +3 -4
- data/ext/common/AgentsStarter.cpp +12 -15
- data/ext/common/AgentsStarter.h +54 -120
- data/ext/common/ApplicationPool2/AppTypes.cpp +12 -5
- data/ext/common/ApplicationPool2/AppTypes.h +21 -14
- data/ext/common/ApplicationPool2/Common.h +36 -19
- data/ext/common/ApplicationPool2/DirectSpawner.h +15 -16
- data/ext/common/ApplicationPool2/DummySpawner.h +9 -8
- data/ext/common/ApplicationPool2/ErrorRenderer.h +1 -1
- data/ext/common/ApplicationPool2/Group.h +304 -171
- data/ext/common/ApplicationPool2/Implementation.cpp +234 -125
- data/ext/common/ApplicationPool2/Options.h +50 -62
- data/ext/common/ApplicationPool2/Pool.h +285 -189
- data/ext/common/ApplicationPool2/Process.h +126 -115
- data/ext/common/ApplicationPool2/Session.h +70 -30
- data/ext/common/ApplicationPool2/SmartSpawner.h +19 -18
- data/ext/common/ApplicationPool2/Socket.h +57 -43
- data/ext/common/ApplicationPool2/SpawnObject.h +83 -0
- data/ext/common/ApplicationPool2/Spawner.h +59 -38
- data/ext/common/ApplicationPool2/SpawnerFactory.h +8 -14
- data/ext/common/ApplicationPool2/SuperGroup.h +69 -40
- data/ext/common/BackgroundEventLoop.cpp +48 -1
- data/ext/common/BackgroundEventLoop.h +3 -1
- data/ext/common/Constants.h +30 -8
- data/ext/common/DataStructures/HashedStaticString.h +103 -0
- data/ext/common/DataStructures/LString.h +396 -0
- data/ext/common/DataStructures/StringKeyTable.h +588 -0
- data/ext/common/EventedMessageServer.h +1 -0
- data/ext/common/FileDescriptor.h +5 -0
- data/ext/common/InstanceDirectory.h +240 -0
- data/ext/common/Logging.cpp +38 -13
- data/ext/common/Logging.h +53 -22
- data/ext/common/MemoryKit/mbuf.cpp +413 -0
- data/ext/common/MemoryKit/mbuf.h +266 -0
- data/ext/common/MemoryKit/palloc.cpp +337 -0
- data/ext/common/MemoryKit/palloc.h +121 -0
- data/ext/common/ResourceLocator.h +62 -6
- data/ext/common/SafeLibev.h +4 -4
- data/ext/common/ServerKit/AcceptLoadBalancer.h +275 -0
- data/ext/common/ServerKit/Channel.h +747 -0
- data/ext/common/ServerKit/Client.h +166 -0
- data/ext/common/ServerKit/ClientRef.h +130 -0
- data/ext/common/ServerKit/Context.h +129 -0
- data/ext/common/ServerKit/Errors.h +103 -0
- data/ext/common/ServerKit/FdSinkChannel.h +206 -0
- data/ext/common/ServerKit/FdSourceChannel.h +230 -0
- data/ext/common/ServerKit/FileBufferedChannel.h +1399 -0
- data/ext/common/ServerKit/FileBufferedFdSinkChannel.h +228 -0
- data/ext/common/ServerKit/HeaderTable.h +472 -0
- data/ext/common/ServerKit/Hooks.h +79 -0
- data/ext/common/ServerKit/HttpChunkedBodyParser.h +289 -0
- data/ext/common/ServerKit/HttpChunkedBodyParserState.h +70 -0
- data/ext/common/ServerKit/HttpClient.h +94 -0
- data/ext/common/ServerKit/HttpHeaderParser.h +477 -0
- data/ext/common/ServerKit/HttpHeaderParserState.h +60 -0
- data/ext/common/ServerKit/HttpRequest.h +276 -0
- data/ext/common/ServerKit/HttpRequestRef.h +130 -0
- data/ext/common/ServerKit/HttpServer.h +1152 -0
- data/ext/common/ServerKit/Implementation.cpp +47 -0
- data/ext/common/ServerKit/Server.h +1040 -0
- data/ext/common/ServerKit/http_parser.cpp +2259 -0
- data/ext/common/ServerKit/http_parser.h +330 -0
- data/ext/common/StaticString.h +8 -0
- data/ext/common/Utils.cpp +14 -12
- data/ext/common/Utils.h +9 -103
- data/ext/common/Utils/BufferedIO.h +1 -0
- data/ext/common/Utils/CachedFileStat.hpp +1 -7
- data/ext/common/Utils/DateParsing.h +379 -0
- data/ext/common/Utils/FileChangeChecker.h +3 -9
- data/ext/common/Utils/Hasher.cpp +52 -0
- data/ext/common/Utils/Hasher.h +58 -0
- data/ext/common/Utils/IOUtils.cpp +62 -62
- data/ext/common/Utils/JsonUtils.h +21 -0
- data/ext/common/Utils/OptionParsing.h +75 -0
- data/ext/common/Utils/StrIntUtils.cpp +112 -19
- data/ext/common/Utils/StrIntUtils.h +52 -12
- data/ext/common/Utils/StrIntUtilsNoStrictAliasing.cpp +174 -0
- data/ext/common/Utils/VariantMap.h +18 -7
- data/ext/common/Utils/modp_b64.cpp +290 -0
- data/ext/common/Utils/modp_b64.h +241 -0
- data/ext/common/Utils/modp_b64_data.h +479 -0
- data/ext/common/Utils/sysqueue.h +811 -0
- data/ext/common/agents/Base.cpp +71 -98
- data/ext/common/agents/Base.h +11 -3
- data/ext/common/agents/HelperAgent/AdminServer.h +690 -0
- data/ext/common/agents/HelperAgent/Main.cpp +899 -487
- data/ext/common/agents/HelperAgent/OptionParser.h +311 -0
- data/ext/common/agents/HelperAgent/RequestHandler.h +315 -2548
- data/ext/common/agents/HelperAgent/RequestHandler/AppResponse.h +225 -0
- data/ext/common/agents/HelperAgent/RequestHandler/BufferBody.cpp +93 -0
- data/ext/common/agents/HelperAgent/RequestHandler/CheckoutSession.cpp +346 -0
- data/ext/common/agents/HelperAgent/RequestHandler/Client.h +54 -0
- data/ext/common/agents/HelperAgent/RequestHandler/ForwardResponse.cpp +846 -0
- data/ext/common/agents/HelperAgent/RequestHandler/Hooks.cpp +231 -0
- data/ext/common/agents/HelperAgent/RequestHandler/InitRequest.cpp +434 -0
- data/ext/common/agents/HelperAgent/RequestHandler/Request.h +149 -0
- data/ext/common/agents/HelperAgent/RequestHandler/SendRequest.cpp +887 -0
- data/ext/common/agents/HelperAgent/RequestHandler/TurboCaching.h +293 -0
- data/ext/common/agents/HelperAgent/RequestHandler/Utils.cpp +301 -0
- data/ext/common/agents/HelperAgent/ResponseCache.h +624 -0
- data/ext/common/agents/HelperAgent/SystemMetricsTool.cpp +21 -23
- data/ext/common/agents/LoggingAgent/AdminServer.h +369 -0
- data/ext/common/agents/LoggingAgent/LoggingServer.h +1 -0
- data/ext/common/agents/LoggingAgent/Main.cpp +422 -215
- data/ext/common/agents/LoggingAgent/OptionParser.h +167 -0
- data/ext/common/agents/LoggingAgent/RemoteSender.h +3 -3
- data/ext/common/agents/Main.cpp +107 -0
- data/ext/common/agents/SpawnPreparer/Main.cpp +207 -0
- data/ext/common/agents/TempDirToucher/Main.cpp +429 -0
- data/ext/common/agents/Watchdog/AdminServer.h +390 -0
- data/ext/common/agents/Watchdog/AgentWatcher.cpp +7 -5
- data/ext/common/agents/Watchdog/HelperAgentWatcher.cpp +18 -39
- data/ext/common/agents/Watchdog/InstanceDirToucher.cpp +116 -0
- data/ext/common/agents/Watchdog/LoggingAgentWatcher.cpp +13 -17
- data/ext/common/agents/Watchdog/Main.cpp +743 -202
- data/ext/libeio/eio.c +17 -0
- data/ext/libeio/eio.h +2 -0
- data/ext/nginx/CacheLocationConfig.c +177 -198
- data/ext/nginx/CacheLocationConfig.c.erb +35 -22
- data/ext/nginx/Configuration.c +402 -236
- data/ext/nginx/Configuration.h +12 -5
- data/ext/nginx/ConfigurationCommands.c +35 -15
- data/ext/nginx/ConfigurationCommands.c.erb +4 -4
- data/ext/nginx/ConfigurationFields.h +9 -5
- data/ext/nginx/ConfigurationFields.h.erb +3 -1
- data/ext/nginx/ContentHandler.c +393 -362
- data/ext/nginx/CreateLocationConfig.c +8 -4
- data/ext/nginx/CreateLocationConfig.c.erb +8 -3
- data/ext/nginx/MergeLocationConfig.c +36 -6
- data/ext/nginx/MergeLocationConfig.c.erb +42 -1
- data/ext/nginx/ngx_http_passenger_module.c +28 -15
- data/ext/oxt/detail/backtrace_disabled.hpp +2 -1
- data/ext/oxt/detail/backtrace_enabled.hpp +15 -2
- data/ext/oxt/implementation.cpp +92 -20
- data/ext/oxt/thread.hpp +5 -0
- data/ext/ruby/extconf.rb +3 -6
- data/ext/ruby/passenger_native_support.c +13 -40
- data/helper-scripts/download_binaries/extconf.rb +4 -4
- data/helper-scripts/meteor-loader.rb +12 -112
- data/helper-scripts/node-loader.js +3 -91
- data/helper-scripts/rack-loader.rb +13 -14
- data/helper-scripts/rack-preloader.rb +16 -17
- data/helper-scripts/wsgi-loader.py +11 -7
- data/lib/phusion_passenger.rb +100 -79
- data/lib/phusion_passenger/abstract_installer.rb +28 -3
- data/lib/phusion_passenger/admin_tools.rb +3 -3
- data/lib/phusion_passenger/admin_tools/instance.rb +207 -0
- data/lib/phusion_passenger/admin_tools/instance_registry.rb +98 -0
- data/lib/phusion_passenger/apache2/config_options.rb +72 -22
- data/lib/phusion_passenger/common_library.rb +79 -14
- data/lib/phusion_passenger/config/about_command.rb +17 -23
- data/lib/phusion_passenger/config/admin_command_command.rb +175 -0
- data/lib/phusion_passenger/config/agent_compiler.rb +170 -0
- data/lib/phusion_passenger/config/command.rb +1 -4
- data/lib/phusion_passenger/config/compile_agent_command.rb +102 -0
- data/lib/phusion_passenger/config/compile_nginx_engine_command.rb +112 -0
- data/lib/phusion_passenger/config/detach_process_command.rb +32 -10
- data/lib/phusion_passenger/config/download_agent_command.rb +285 -0
- data/lib/phusion_passenger/config/download_nginx_engine_command.rb +281 -0
- data/lib/phusion_passenger/config/install_agent_command.rb +174 -0
- data/lib/phusion_passenger/config/install_standalone_runtime_command.rb +231 -0
- data/lib/phusion_passenger/config/installation_utils.rb +241 -0
- data/lib/phusion_passenger/config/list_instances_command.rb +13 -25
- data/lib/phusion_passenger/config/main.rb +43 -14
- data/lib/phusion_passenger/config/nginx_engine_compiler.rb +337 -0
- data/lib/phusion_passenger/config/reopen_logs_command.rb +110 -0
- data/lib/phusion_passenger/config/restart_app_command.rb +61 -14
- data/lib/phusion_passenger/config/system_metrics_command.rb +2 -1
- data/lib/phusion_passenger/config/utils.rb +64 -39
- data/lib/phusion_passenger/config/validate_install_command.rb +2 -2
- data/lib/phusion_passenger/constants.rb +27 -6
- data/lib/phusion_passenger/debug_logging.rb +32 -15
- data/lib/phusion_passenger/loader_shared_helpers.rb +2 -5
- data/lib/phusion_passenger/message_client.rb +21 -22
- data/lib/phusion_passenger/native_support.rb +26 -31
- data/lib/phusion_passenger/nginx/config_options.rb +32 -19
- data/lib/phusion_passenger/packaging.rb +7 -3
- data/lib/phusion_passenger/platform_info/cxx_portability.rb +1 -2
- data/lib/phusion_passenger/platform_info/depcheck_specs/libs.rb +3 -4
- data/lib/phusion_passenger/platform_info/operating_system.rb +6 -6
- data/lib/phusion_passenger/preloader_shared_helpers.rb +2 -2
- data/lib/phusion_passenger/rack/out_of_band_gc.rb +2 -2
- data/lib/phusion_passenger/rack/thread_handler_extension.rb +168 -65
- data/lib/phusion_passenger/request_handler.rb +47 -82
- data/lib/phusion_passenger/request_handler/thread_handler.rb +46 -10
- data/lib/phusion_passenger/ruby_core_enhancements.rb +25 -77
- data/lib/phusion_passenger/ruby_core_io_enhancements.rb +108 -0
- data/lib/phusion_passenger/standalone/app_finder.rb +39 -59
- data/lib/phusion_passenger/standalone/command.rb +27 -275
- data/lib/phusion_passenger/standalone/command2.rb +292 -0
- data/lib/phusion_passenger/standalone/config_utils.rb +87 -0
- data/lib/phusion_passenger/standalone/control_utils.rb +88 -0
- data/lib/phusion_passenger/standalone/main.rb +69 -71
- data/lib/phusion_passenger/standalone/start2_command.rb +799 -0
- data/lib/phusion_passenger/standalone/start_command.rb +406 -467
- data/lib/phusion_passenger/standalone/start_command/builtin_engine.rb +167 -0
- data/lib/phusion_passenger/standalone/start_command/nginx_engine.rb +165 -0
- data/lib/phusion_passenger/standalone/status_command.rb +64 -23
- data/lib/phusion_passenger/standalone/stop_command.rb +69 -32
- data/lib/phusion_passenger/standalone/version_command.rb +1 -5
- data/lib/phusion_passenger/utils.rb +0 -4
- data/lib/phusion_passenger/utils/json.rb +70 -4
- data/lib/phusion_passenger/utils/progress_bar.rb +56 -0
- data/lib/phusion_passenger/utils/tee_input.rb +3 -3
- data/lib/phusion_passenger/utils/unseekable_socket.rb +30 -0
- data/packaging/rpm/nginx_spec/nginx.spec.template +4 -3
- data/packaging/rpm/passenger_spec/passenger.spec.template +6 -10
- data/packaging/rpm/setup-system +2 -1
- data/resources/oss-binaries.phusionpassenger.com.crt +208 -0
- data/resources/templates/config/agent_compiler/confirm_enable_optimizations.txt.erb +5 -0
- data/resources/templates/config/installation_utils/cannot_create_user_support_binaries_dir.txt.erb +15 -0
- data/resources/templates/config/installation_utils/download_tool_missing.txt.erb +7 -0
- data/resources/templates/config/installation_utils/passenger_not_installed_as_root.txt.erb +12 -0
- data/resources/templates/config/installation_utils/support_binaries_dir_not_writable_despite_running_as_root.txt.erb +13 -0
- data/resources/templates/config/installation_utils/unexpected_filesystem_problem.txt.erb +16 -0
- data/{packaging/debian/debian_specs/passenger/patches/series → resources/templates/config/installation_utils/user_support_binaries_dir_not_writable.txt.erb} +0 -0
- data/resources/templates/nginx/nginx_module_sources_not_available.txt.erb +2 -2
- data/resources/templates/standalone/config.erb +14 -16
- data/resources/templates/standalone/possible_solutions_for_download_and_extraction_problems.txt.erb +1 -1
- data/test/.rspec +1 -0
- data/test/cxx/ApplicationPool2/DirectSpawnerTest.cpp +20 -17
- data/test/cxx/ApplicationPool2/OptionsTest.cpp +0 -14
- data/test/cxx/ApplicationPool2/PoolTest.cpp +113 -90
- data/test/cxx/ApplicationPool2/ProcessTest.cpp +18 -27
- data/test/cxx/ApplicationPool2/SmartSpawnerTest.cpp +51 -53
- data/test/cxx/ApplicationPool2/SpawnerTestCases.cpp +55 -57
- data/test/cxx/BufferedIOTest.cpp +40 -40
- data/test/cxx/CxxTestMain.cpp +4 -22
- data/test/cxx/DataStructures/LStringTest.cpp +275 -0
- data/test/cxx/DataStructures/StringKeyTableTest.cpp +199 -0
- data/test/cxx/MemoryKit/MbufTest.cpp +213 -0
- data/test/cxx/MessageServerTest.cpp +62 -55
- data/test/cxx/RequestHandlerTest.cpp +26 -27
- data/test/cxx/ServerKit/ChannelTest.cpp +1467 -0
- data/test/cxx/ServerKit/FileBufferedChannelTest.cpp +817 -0
- data/test/cxx/ServerKit/HeaderTableTest.cpp +171 -0
- data/test/cxx/ServerKit/HttpServerTest.cpp +1503 -0
- data/test/cxx/ServerKit/ServerTest.cpp +408 -0
- data/test/cxx/TestSupport.cpp +51 -15
- data/test/cxx/TestSupport.h +31 -21
- data/test/cxx/UnionStationTest.cpp +121 -122
- data/test/cxx/UtilsTest.cpp +9 -33
- data/test/integration_tests/apache2_tests.rb +65 -27
- data/test/integration_tests/downloaded_binaries_tests.rb +30 -6
- data/test/integration_tests/native_packaging_spec.rb +32 -17
- data/test/integration_tests/nginx_tests.rb +28 -10
- data/test/integration_tests/shared/example_webapp_tests.rb +40 -27
- data/test/integration_tests/standalone_tests.rb +232 -169
- data/test/ruby/debug_logging_spec.rb +44 -40
- data/test/ruby/rails3.0/preloader_spec.rb +1 -1
- data/test/ruby/rails3.1/preloader_spec.rb +1 -1
- data/test/ruby/rails3.2/preloader_spec.rb +1 -1
- data/test/ruby/rails4.0/preloader_spec.rb +1 -1
- data/test/ruby/rails4.1/preloader_spec.rb +1 -1
- data/test/ruby/request_handler_spec.rb +62 -24
- data/test/ruby/shared/loader_sharedspec.rb +10 -9
- data/test/ruby/shared/rails/union_station_extensions_sharedspec.rb +23 -22
- data/test/ruby/spec_helper.rb +2 -11
- data/test/ruby/standalone/runtime_installer_spec.rb +15 -13
- data/test/ruby/union_station_spec.rb +45 -40
- data/test/ruby/utils/tee_input_spec.rb +5 -5
- data/test/ruby/utils_spec.rb +3 -39
- data/test/stub/apache2/httpd.conf.erb +5 -2
- data/test/stub/nginx/nginx.conf.erb +3 -1
- data/test/support/apache2_controller.rb +25 -25
- data/test/support/nginx_controller.rb +14 -14
- data/test/support/test_helper.rb +74 -75
- metadata +439 -643
- metadata.gz.asc +7 -7
- data/ext/common/MultiLibeio.cpp +0 -204
- data/ext/common/MultiLibeio.h +0 -67
- data/ext/common/ServerInstanceDir.h +0 -402
- data/ext/common/Utils/Base64.cpp +0 -143
- data/ext/common/Utils/Base64.h +0 -83
- data/ext/common/Utils/HttpHeaderBufferer.h +0 -184
- data/ext/common/Utils/PriorityQueue.h +0 -54
- data/ext/common/Utils/StreamBoyerMooreHorspool.h +0 -512
- data/ext/common/Utils/fib.c +0 -699
- data/ext/common/Utils/fib.h +0 -101
- data/ext/common/Utils/fibpriv.h +0 -67
- data/ext/common/agents/EnvPrinter.c +0 -16
- data/ext/common/agents/HelperAgent/AgentOptions.h +0 -109
- data/ext/common/agents/HelperAgent/FileBackedPipe.h +0 -732
- data/ext/common/agents/HelperAgent/RequestHandler.cpp +0 -294
- data/ext/common/agents/HelperAgent/ScgiRequestParser.h +0 -457
- data/ext/common/agents/LoggingAgent/AdminController.h +0 -96
- data/ext/common/agents/SpawnPreparer.cpp +0 -206
- data/ext/common/agents/TempDirToucher.c +0 -383
- data/ext/common/agents/Watchdog/ServerInstanceDirToucher.cpp +0 -116
- data/helper-scripts/classic-rails-loader.rb +0 -166
- data/helper-scripts/classic-rails-preloader.rb +0 -193
- data/lib/phusion_passenger/admin_tools/server_instance.rb +0 -339
- data/lib/phusion_passenger/classic_rails/cgi_fixed.rb +0 -68
- data/lib/phusion_passenger/classic_rails/thread_handler_extension.rb +0 -40
- data/lib/phusion_passenger/platform_info/openssl.rb +0 -61
- data/lib/phusion_passenger/standalone/config_file.rb +0 -119
- data/lib/phusion_passenger/standalone/help_command.rb +0 -57
- data/lib/phusion_passenger/standalone/runtime_installer.rb +0 -712
- data/lib/phusion_passenger/standalone/runtime_locator.rb +0 -170
- data/lib/phusion_passenger/standalone/utils.rb +0 -58
- data/lib/phusion_passenger/utils/tmpdir.rb +0 -69
- data/packaging/debian/LICENSE.md +0 -19
- data/packaging/debian/README.md +0 -320
- data/packaging/debian/Vagrantfile +0 -25
- data/packaging/debian/build +0 -210
- data/packaging/debian/debian_specs/nginx/changelog +0 -1989
- data/packaging/debian/debian_specs/nginx/compat.erb +0 -5
- data/packaging/debian/debian_specs/nginx/conf/fastcgi.conf +0 -25
- data/packaging/debian/debian_specs/nginx/conf/fastcgi_params +0 -24
- data/packaging/debian/debian_specs/nginx/conf/koi-utf +0 -109
- data/packaging/debian/debian_specs/nginx/conf/koi-win +0 -103
- data/packaging/debian/debian_specs/nginx/conf/mime.types +0 -89
- data/packaging/debian/debian_specs/nginx/conf/nginx.conf.erb +0 -97
- data/packaging/debian/debian_specs/nginx/conf/proxy_params +0 -4
- data/packaging/debian/debian_specs/nginx/conf/scgi_params +0 -16
- data/packaging/debian/debian_specs/nginx/conf/sites-available/default.erb +0 -93
- data/packaging/debian/debian_specs/nginx/conf/snippets/fastcgi-php.conf +0 -13
- data/packaging/debian/debian_specs/nginx/conf/snippets/snakeoil.conf +0 -5
- data/packaging/debian/debian_specs/nginx/conf/uwsgi_params +0 -16
- data/packaging/debian/debian_specs/nginx/conf/win-utf +0 -125
- data/packaging/debian/debian_specs/nginx/control.erb +0 -226
- data/packaging/debian/debian_specs/nginx/copyright +0 -196
- data/packaging/debian/debian_specs/nginx/debian-full.lintian-overrides +0 -1
- data/packaging/debian/debian_specs/nginx/gbp.conf +0 -2
- data/packaging/debian/debian_specs/nginx/help/docs/fcgiwrap +0 -14
- data/packaging/debian/debian_specs/nginx/help/docs/php +0 -119
- data/packaging/debian/debian_specs/nginx/help/docs/support-irc +0 -28
- data/packaging/debian/debian_specs/nginx/help/docs/upstream +0 -51
- data/packaging/debian/debian_specs/nginx/help/examples/drupal +0 -114
- data/packaging/debian/debian_specs/nginx/help/examples/http +0 -59
- data/packaging/debian/debian_specs/nginx/help/examples/mail +0 -30
- data/packaging/debian/debian_specs/nginx/help/examples/mailman +0 -59
- data/packaging/debian/debian_specs/nginx/help/examples/nginx.conf +0 -34
- data/packaging/debian/debian_specs/nginx/help/examples/nginx_modsite +0 -162
- data/packaging/debian/debian_specs/nginx/help/examples/virtual_hosts +0 -155
- data/packaging/debian/debian_specs/nginx/help/examples/wordpress +0 -74
- data/packaging/debian/debian_specs/nginx/helpers.rb +0 -41
- data/packaging/debian/debian_specs/nginx/index-debian.html.in +0 -32
- data/packaging/debian/debian_specs/nginx/index-ubuntu.html.in +0 -32
- data/packaging/debian/debian_specs/nginx/index.html.erb +0 -10
- data/packaging/debian/debian_specs/nginx/modules/README.Modules-versions +0 -65
- data/packaging/debian/debian_specs/nginx/modules/headers-more-nginx-module/README.markdown +0 -510
- data/packaging/debian/debian_specs/nginx/modules/headers-more-nginx-module/config +0 -5
- data/packaging/debian/debian_specs/nginx/modules/headers-more-nginx-module/doc/HttpHeadersMoreModule.wiki +0 -395
- data/packaging/debian/debian_specs/nginx/modules/headers-more-nginx-module/src/ddebug.h +0 -119
- data/packaging/debian/debian_specs/nginx/modules/headers-more-nginx-module/src/ngx_http_headers_more_filter_module.c +0 -348
- data/packaging/debian/debian_specs/nginx/modules/headers-more-nginx-module/src/ngx_http_headers_more_filter_module.h +0 -80
- data/packaging/debian/debian_specs/nginx/modules/headers-more-nginx-module/src/ngx_http_headers_more_headers_in.c +0 -826
- data/packaging/debian/debian_specs/nginx/modules/headers-more-nginx-module/src/ngx_http_headers_more_headers_in.h +0 -26
- data/packaging/debian/debian_specs/nginx/modules/headers-more-nginx-module/src/ngx_http_headers_more_headers_out.c +0 -716
- data/packaging/debian/debian_specs/nginx/modules/headers-more-nginx-module/src/ngx_http_headers_more_headers_out.h +0 -26
- data/packaging/debian/debian_specs/nginx/modules/headers-more-nginx-module/src/ngx_http_headers_more_util.c +0 -380
- data/packaging/debian/debian_specs/nginx/modules/headers-more-nginx-module/src/ngx_http_headers_more_util.h +0 -52
- data/packaging/debian/debian_specs/nginx/modules/headers-more-nginx-module/util/build.sh +0 -32
- data/packaging/debian/debian_specs/nginx/modules/headers-more-nginx-module/valgrind.suppress +0 -215
- data/packaging/debian/debian_specs/nginx/modules/nginx-auth-pam/ChangeLog +0 -35
- data/packaging/debian/debian_specs/nginx/modules/nginx-auth-pam/LICENSE +0 -25
- data/packaging/debian/debian_specs/nginx/modules/nginx-auth-pam/README.md +0 -93
- data/packaging/debian/debian_specs/nginx/modules/nginx-auth-pam/config +0 -4
- data/packaging/debian/debian_specs/nginx/modules/nginx-auth-pam/ngx_http_auth_pam_module.c +0 -462
- data/packaging/debian/debian_specs/nginx/modules/nginx-cache-purge/CHANGES +0 -66
- data/packaging/debian/debian_specs/nginx/modules/nginx-cache-purge/LICENSE +0 -26
- data/packaging/debian/debian_specs/nginx/modules/nginx-cache-purge/README.md +0 -171
- data/packaging/debian/debian_specs/nginx/modules/nginx-cache-purge/TODO.md +0 -7
- data/packaging/debian/debian_specs/nginx/modules/nginx-cache-purge/config +0 -21
- data/packaging/debian/debian_specs/nginx/modules/nginx-cache-purge/ngx_cache_purge_module.c +0 -1803
- data/packaging/debian/debian_specs/nginx/modules/nginx-dav-ext-module/README +0 -29
- data/packaging/debian/debian_specs/nginx/modules/nginx-dav-ext-module/config +0 -9
- data/packaging/debian/debian_specs/nginx/modules/nginx-dav-ext-module/ngx_http_dav_ext_module.c +0 -824
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/README +0 -139
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/README_AUTO_LIB +0 -395
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/TODO +0 -1
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/auto/actions/array +0 -10
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/auto/actions/palloc +0 -8
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/auto/build +0 -597
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/auto/data/action_replacements +0 -5
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/auto/data/action_types +0 -12
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/auto/data/conf_args +0 -22
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/auto/data/conf_locs +0 -25
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/auto/data/conf_macros +0 -35
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/auto/data/contexts +0 -22
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/auto/data/header_files +0 -3
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/auto/data/headers +0 -4
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/auto/data/module_dependencies +0 -5
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/auto/data/modules_optional +0 -15
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/auto/data/prefixes +0 -2
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/auto/src/array.h +0 -7
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/auto/src/conf_cmd_basic.h +0 -43
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/auto/src/conf_merge.h +0 -78
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/auto/src/palloc.h +0 -6
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/auto/text/autogen +0 -12
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/config +0 -49
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/docs/core/action_macros +0 -63
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/docs/core/conf_cmds +0 -62
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/docs/modules/set_var +0 -124
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/docs/patches/more_logging_info +0 -48
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/docs/upstream/list +0 -45
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/examples/README +0 -12
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/examples/http/set_var/config +0 -4
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/examples/http/set_var/ngx_http_set_var_examples_module.c +0 -136
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/ngx_auto_lib_core +0 -797
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/notes/CHANGES +0 -17
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/notes/LICENSE +0 -24
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/objs/ndk_array.h +0 -113
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/objs/ndk_conf_cmd_basic.h +0 -2203
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/objs/ndk_conf_cmd_extra.h +0 -5423
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/objs/ndk_conf_merge.h +0 -227
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/objs/ndk_config.c +0 -72
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/objs/ndk_config.h +0 -98
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/objs/ndk_includes.h +0 -66
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/objs/ndk_palloc.h +0 -112
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/patches/auto_config +0 -16
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/patches/expose_rewrite_functions +0 -291
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/patches/rewrite_phase_handler +0 -19
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/hash/md5.h +0 -117
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/hash/murmurhash2.c +0 -77
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/hash/sha.h +0 -200
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk.c +0 -155
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk.h +0 -58
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_buf.c +0 -43
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_buf.h +0 -5
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_complex_path.c +0 -129
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_complex_path.h +0 -30
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_complex_value.c +0 -192
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_complex_value.h +0 -21
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_conf_file.c +0 -396
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_conf_file.h +0 -44
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_debug.c +0 -72
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_debug.h +0 -171
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_encoding.c +0 -57
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_encoding.h +0 -12
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_hash.c +0 -82
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_hash.h +0 -45
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_http.c +0 -138
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_http.h +0 -3
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_http_headers.h +0 -35
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_log.c +0 -3
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_log.h +0 -165
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_parse.h +0 -67
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_path.c +0 -583
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_path.h +0 -22
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_process.c +0 -20
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_process.h +0 -12
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_regex.c +0 -215
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_regex.h +0 -7
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_rewrite.c +0 -103
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_rewrite.h +0 -26
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_set_var.c +0 -602
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_set_var.h +0 -44
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_string.c +0 -434
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_string.h +0 -37
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_string_util.h +0 -14
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_upstream_list.c +0 -205
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_upstream_list.h +0 -27
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_uri.c +0 -45
- data/packaging/debian/debian_specs/nginx/modules/nginx-development-kit/src/ndk_uri.h +0 -6
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/LICENSE +0 -25
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/README.markdown +0 -1850
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/config +0 -5
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/doc/HttpEchoModule.wiki +0 -1558
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/src/ddebug.h +0 -109
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/src/ngx_http_echo_echo.c +0 -344
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/src/ngx_http_echo_echo.h +0 -25
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/src/ngx_http_echo_filter.c +0 -282
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/src/ngx_http_echo_filter.h +0 -15
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/src/ngx_http_echo_foreach.c +0 -183
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/src/ngx_http_echo_foreach.h +0 -16
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/src/ngx_http_echo_handler.c +0 -429
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/src/ngx_http_echo_handler.h +0 -18
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/src/ngx_http_echo_location.c +0 -178
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/src/ngx_http_echo_location.h +0 -13
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/src/ngx_http_echo_module.c +0 -667
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/src/ngx_http_echo_module.h +0 -137
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/src/ngx_http_echo_request_info.c +0 -452
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/src/ngx_http_echo_request_info.h +0 -31
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/src/ngx_http_echo_sleep.c +0 -208
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/src/ngx_http_echo_sleep.h +0 -16
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/src/ngx_http_echo_subrequest.c +0 -788
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/src/ngx_http_echo_subrequest.h +0 -19
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/src/ngx_http_echo_timer.c +0 -96
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/src/ngx_http_echo_timer.h +0 -13
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/src/ngx_http_echo_util.c +0 -298
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/src/ngx_http_echo_util.h +0 -58
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/src/ngx_http_echo_var.c +0 -110
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/src/ngx_http_echo_var.h +0 -9
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/util/build.sh +0 -45
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/util/releng +0 -8
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/util/wiki2pod.pl +0 -131
- data/packaging/debian/debian_specs/nginx/modules/nginx-echo/valgrind.suppress +0 -38
- data/packaging/debian/debian_specs/nginx/modules/nginx-http-push/LICENCE +0 -24
- data/packaging/debian/debian_specs/nginx/modules/nginx-http-push/README +0 -206
- data/packaging/debian/debian_specs/nginx/modules/nginx-http-push/changelog.txt +0 -54
- data/packaging/debian/debian_specs/nginx/modules/nginx-http-push/config +0 -26
- data/packaging/debian/debian_specs/nginx/modules/nginx-http-push/protocol.txt +0 -191
- data/packaging/debian/debian_specs/nginx/modules/nginx-http-push/src/ngx_http_push_defs.c +0 -59
- data/packaging/debian/debian_specs/nginx/modules/nginx-http-push/src/ngx_http_push_defs.h +0 -73
- data/packaging/debian/debian_specs/nginx/modules/nginx-http-push/src/ngx_http_push_module.c +0 -783
- data/packaging/debian/debian_specs/nginx/modules/nginx-http-push/src/ngx_http_push_module.h +0 -31
- data/packaging/debian/debian_specs/nginx/modules/nginx-http-push/src/ngx_http_push_module_setup.c +0 -361
- data/packaging/debian/debian_specs/nginx/modules/nginx-http-push/src/ngx_http_push_types.h +0 -120
- data/packaging/debian/debian_specs/nginx/modules/nginx-http-push/src/store/memory/store.c +0 -1180
- data/packaging/debian/debian_specs/nginx/modules/nginx-http-push/src/store/memory/store.h +0 -1
- data/packaging/debian/debian_specs/nginx/modules/nginx-http-push/src/store/ngx_http_push_module_ipc.c +0 -146
- data/packaging/debian/debian_specs/nginx/modules/nginx-http-push/src/store/ngx_http_push_module_ipc.h +0 -5
- data/packaging/debian/debian_specs/nginx/modules/nginx-http-push/src/store/ngx_http_push_store.h +0 -51
- data/packaging/debian/debian_specs/nginx/modules/nginx-http-push/src/store/ngx_rwlock.c +0 -178
- data/packaging/debian/debian_specs/nginx/modules/nginx-http-push/src/store/ngx_rwlock.h +0 -5
- data/packaging/debian/debian_specs/nginx/modules/nginx-http-push/src/store/rbtree_util.c +0 -246
- data/packaging/debian/debian_specs/nginx/modules/nginx-http-push/src/store/rbtree_util.h +0 -9
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/Changes +0 -51
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/README.markdown +0 -6954
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/config +0 -363
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/doc/HttpLuaModule.wiki +0 -5898
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/dtrace/ngx_lua_provider.d +0 -61
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/misc/recv-until-pm/Makefile +0 -3
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/misc/recv-until-pm/lib/RecvUntil.pm +0 -138
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/misc/recv-until-pm/t/sanity.t +0 -140
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/api/ngx_http_lua_api.h +0 -52
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ddebug.h +0 -82
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_accessby.c +0 -377
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_accessby.h +0 -22
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_api.c +0 -77
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_args.c +0 -537
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_args.h +0 -20
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_bodyfilterby.c +0 -632
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_bodyfilterby.h +0 -31
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_cache.c +0 -296
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_cache.h +0 -24
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_capturefilter.c +0 -175
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_capturefilter.h +0 -20
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_clfactory.c +0 -887
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_clfactory.h +0 -22
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_common.h +0 -478
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_config.c +0 -67
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_config.h +0 -19
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_consts.c +0 -148
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_consts.h +0 -20
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_contentby.c +0 -369
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_contentby.h +0 -26
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_control.c +0 -483
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_control.h +0 -20
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_coroutine.c +0 -379
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_coroutine.h +0 -23
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_ctx.c +0 -216
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_ctx.h +0 -23
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_directive.c +0 -1081
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_directive.h +0 -56
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_exception.c +0 -58
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_exception.h +0 -33
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_headerfilterby.c +0 -302
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_headerfilterby.h +0 -29
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_headers.c +0 -1370
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_headers.h +0 -22
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_headers_in.c +0 -782
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_headers_in.h +0 -22
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_headers_out.c +0 -625
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_headers_out.h +0 -23
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_initby.c +0 -42
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_initby.h +0 -23
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_initworkerby.c +0 -320
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_initworkerby.h +0 -25
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_log.c +0 -300
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_log.h +0 -20
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_logby.c +0 -227
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_logby.h +0 -22
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_misc.c +0 -252
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_misc.h +0 -20
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_module.c +0 -924
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_ndk.c +0 -184
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_ndk.h +0 -21
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_output.c +0 -794
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_output.h +0 -28
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_pcrefix.c +0 -106
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_pcrefix.h +0 -23
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_phase.c +0 -94
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_phase.h +0 -13
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_probe.h +0 -85
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_regex.c +0 -2468
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_regex.h +0 -22
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_req_body.c +0 -1169
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_req_body.h +0 -20
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_req_method.c +0 -252
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_req_method.h +0 -19
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_rewriteby.c +0 -351
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_rewriteby.h +0 -22
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_script.c +0 -538
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_script.h +0 -86
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_setby.c +0 -216
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_setby.h +0 -15
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_shdict.c +0 -1844
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_shdict.h +0 -52
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_sleep.c +0 -191
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_sleep.h +0 -20
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_socket_tcp.c +0 -5314
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_socket_tcp.h +0 -156
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_socket_udp.c +0 -1624
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_socket_udp.h +0 -56
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_string.c +0 -704
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_string.h +0 -20
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_subrequest.c +0 -1741
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_subrequest.h +0 -46
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_time.c +0 -278
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_time.h +0 -21
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_timer.c +0 -661
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_timer.h +0 -20
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_uri.c +0 -110
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_uri.h +0 -20
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_uthread.c +0 -283
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_uthread.h +0 -36
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_util.c +0 -3972
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_util.h +0 -423
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_variable.c +0 -499
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_variable.h +0 -20
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_worker.c +0 -64
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/src/ngx_http_lua_worker.h +0 -17
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/tapset/ngx_lua.stp +0 -5
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/util/build.sh +0 -39
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/util/build2.sh +0 -55
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/util/fix-comments +0 -27
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/util/gdbinit +0 -415
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/util/ngx-links +0 -62
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/util/reindex +0 -64
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/util/releng +0 -8
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/util/retab +0 -8
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/util/revim +0 -102
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/util/run_test.sh +0 -10
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/util/update-readme.sh +0 -4
- data/packaging/debian/debian_specs/nginx/modules/nginx-lua/valgrind.suppress +0 -144
- data/packaging/debian/debian_specs/nginx/modules/nginx-upload-progress/CHANGES +0 -107
- data/packaging/debian/debian_specs/nginx/modules/nginx-upload-progress/LICENSE +0 -25
- data/packaging/debian/debian_specs/nginx/modules/nginx-upload-progress/Makefile +0 -8
- data/packaging/debian/debian_specs/nginx/modules/nginx-upload-progress/README +0 -329
- data/packaging/debian/debian_specs/nginx/modules/nginx-upload-progress/config +0 -3
- data/packaging/debian/debian_specs/nginx/modules/nginx-upload-progress/ngx_http_uploadprogress_module.c +0 -1774
- data/packaging/debian/debian_specs/nginx/modules/nginx-upstream-fair/README +0 -53
- data/packaging/debian/debian_specs/nginx/modules/nginx-upstream-fair/config +0 -3
- data/packaging/debian/debian_specs/nginx/modules/nginx-upstream-fair/ngx_http_upstream_fair_module.c +0 -1356
- data/packaging/debian/debian_specs/nginx/modules/ngx-fancyindex/CHANGELOG.md +0 -37
- data/packaging/debian/debian_specs/nginx/modules/ngx-fancyindex/HACKING.md +0 -24
- data/packaging/debian/debian_specs/nginx/modules/ngx-fancyindex/LICENSE +0 -20
- data/packaging/debian/debian_specs/nginx/modules/ngx-fancyindex/README.rst +0 -182
- data/packaging/debian/debian_specs/nginx/modules/ngx-fancyindex/config +0 -8
- data/packaging/debian/debian_specs/nginx/modules/ngx-fancyindex/nginx-0.6-support.patch +0 -23
- data/packaging/debian/debian_specs/nginx/modules/ngx-fancyindex/ngx_http_fancyindex_module.c +0 -1305
- data/packaging/debian/debian_specs/nginx/modules/ngx-fancyindex/template.awk +0 -52
- data/packaging/debian/debian_specs/nginx/modules/ngx-fancyindex/template.h +0 -103
- data/packaging/debian/debian_specs/nginx/modules/ngx-fancyindex/template.html +0 -102
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/CHANGES +0 -37
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/README +0 -141
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/config +0 -3
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/doc/README.google_code_home_page.wiki +0 -120
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/doc/README.html +0 -199
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/doc/README.wiki +0 -123
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/ngx_http_subs_filter_module.c +0 -1298
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/test/README +0 -275
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/test/inc/Module/AutoInstall.pm +0 -820
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/test/inc/Module/Install.pm +0 -470
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/test/inc/Module/Install/AutoInstall.pm +0 -82
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/test/inc/Module/Install/Base.pm +0 -83
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/test/inc/Module/Install/Can.pm +0 -81
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/test/inc/Module/Install/Fetch.pm +0 -93
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/test/inc/Module/Install/Include.pm +0 -34
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/test/inc/Module/Install/Makefile.pm +0 -415
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/test/inc/Module/Install/Metadata.pm +0 -716
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/test/inc/Module/Install/TestBase.pm +0 -29
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/test/inc/Module/Install/Win32.pm +0 -64
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/test/inc/Module/Install/WriteAll.pm +0 -63
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/test/inc/Spiffy.pm +0 -539
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/test/inc/Test/Base.pm +0 -682
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/test/inc/Test/Base/Filter.pm +0 -341
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/test/inc/Test/Builder.pm +0 -1413
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/test/inc/Test/Builder/Module.pm +0 -81
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/test/inc/Test/More.pm +0 -735
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/test/lib/Test/Nginx.pm +0 -315
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/test/lib/Test/Nginx/LWP.pm +0 -524
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/test/lib/Test/Nginx/Socket.pm +0 -1749
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/test/lib/Test/Nginx/Util.pm +0 -874
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/test/t/subs.t +0 -136
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/test/t/subs_capture.t +0 -32
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/test/t/subs_fix_string.t +0 -32
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/test/t/subs_regex.t +0 -108
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/test/t/subs_types.t +0 -59
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/test/test.sh +0 -5
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/util/update-readme.sh +0 -7
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/util/wiki2google_code_homepage.pl +0 -29
- data/packaging/debian/debian_specs/nginx/modules/ngx_http_substitutions_filter_module/util/wiki2pod.pl +0 -129
- data/packaging/debian/debian_specs/nginx/nginx-common.NEWS +0 -135
- data/packaging/debian/debian_specs/nginx/nginx-common.README.Debian +0 -45
- data/packaging/debian/debian_specs/nginx/nginx-common.dirs.erb +0 -32
- data/packaging/debian/debian_specs/nginx/nginx-common.install +0 -3
- data/packaging/debian/debian_specs/nginx/nginx-common.lintian-overrides +0 -2
- data/packaging/debian/debian_specs/nginx/nginx-common.manpages +0 -1
- data/packaging/debian/debian_specs/nginx/nginx-common.nginx.default +0 -10
- data/packaging/debian/debian_specs/nginx/nginx-common.nginx.init.erb +0 -214
- data/packaging/debian/debian_specs/nginx/nginx-common.nginx.logrotate +0 -18
- data/packaging/debian/debian_specs/nginx/nginx-common.nginx.service.erb +0 -37
- data/packaging/debian/debian_specs/nginx/nginx-common.postinst.erb +0 -66
- data/packaging/debian/debian_specs/nginx/nginx-common.postrm.erb +0 -46
- data/packaging/debian/debian_specs/nginx/nginx-common.preinst +0 -47
- data/packaging/debian/debian_specs/nginx/nginx-common.prerm.erb +0 -28
- data/packaging/debian/debian_specs/nginx/nginx-doc.docs +0 -2
- data/packaging/debian/debian_specs/nginx/nginx-doc.examples +0 -1
- data/packaging/debian/debian_specs/nginx/nginx-extras.install.erb +0 -17
- data/packaging/debian/debian_specs/nginx/nginx-extras.lintian-overrides +0 -1
- data/packaging/debian/debian_specs/nginx/nginx-extras.postinst.erb +0 -44
- data/packaging/debian/debian_specs/nginx/nginx-extras.prerm +0 -22
- data/packaging/debian/debian_specs/nginx/nginx.1 +0 -47
- data/packaging/debian/debian_specs/nginx/patches/perl-use-dpkg-buildflags.patch +0 -23
- data/packaging/debian/debian_specs/nginx/patches/series +0 -1
- data/packaging/debian/debian_specs/nginx/rules.erb +0 -185
- data/packaging/debian/debian_specs/nginx/source/format +0 -1
- data/packaging/debian/debian_specs/nginx/tests/control +0 -4
- data/packaging/debian/debian_specs/nginx/ufw/nginx +0 -14
- data/packaging/debian/debian_specs/nginx/upstream/signing-key.asc +0 -34
- data/packaging/debian/debian_specs/nginx/watch +0 -3
- data/packaging/debian/debian_specs/passenger/README.Debian +0 -12
- data/packaging/debian/debian_specs/passenger/changelog +0 -316
- data/packaging/debian/debian_specs/passenger/compat +0 -1
- data/packaging/debian/debian_specs/passenger/control.erb +0 -123
- data/packaging/debian/debian_specs/passenger/copyright +0 -385
- data/packaging/debian/debian_specs/passenger/helpers.rb +0 -24
- data/packaging/debian/debian_specs/passenger/libapache2-mod-passenger.install +0 -3
- data/packaging/debian/debian_specs/passenger/libapache2-mod-passenger.postinst +0 -36
- data/packaging/debian/debian_specs/passenger/libapache2-mod-passenger.prerm +0 -15
- data/packaging/debian/debian_specs/passenger/locations.ini.erb +0 -14
- data/packaging/debian/debian_specs/passenger/passenger-dev.install.erb +0 -3
- data/packaging/debian/debian_specs/passenger/passenger-doc.install.erb +0 -2
- data/packaging/debian/debian_specs/passenger/passenger.conf +0 -6
- data/packaging/debian/debian_specs/passenger/passenger.docs +0 -4
- data/packaging/debian/debian_specs/passenger/passenger.install.erb +0 -16
- data/packaging/debian/debian_specs/passenger/passenger.load +0 -3
- data/packaging/debian/debian_specs/passenger/passenger.manpages +0 -3
- data/packaging/debian/debian_specs/passenger/passenger_free_ruby.c +0 -29
- data/packaging/debian/debian_specs/passenger/passenger_ruby_utils.c +0 -54
- data/packaging/debian/debian_specs/passenger/passenger_system_ruby.c.erb +0 -37
- data/packaging/debian/debian_specs/passenger/rules.erb +0 -84
- data/packaging/debian/debian_specs/passenger/source/format +0 -1
- data/packaging/debian/debian_specs/passenger_enterprise/README.Debian +0 -12
- data/packaging/debian/debian_specs/passenger_enterprise/changelog +0 -316
- data/packaging/debian/debian_specs/passenger_enterprise/compat +0 -1
- data/packaging/debian/debian_specs/passenger_enterprise/control.erb +0 -123
- data/packaging/debian/debian_specs/passenger_enterprise/copyright +0 -385
- data/packaging/debian/debian_specs/passenger_enterprise/helpers.rb +0 -2
- data/packaging/debian/debian_specs/passenger_enterprise/libapache2-mod-passenger-enterprise.install +0 -3
- data/packaging/debian/debian_specs/passenger_enterprise/libapache2-mod-passenger-enterprise.postinst +0 -36
- data/packaging/debian/debian_specs/passenger_enterprise/libapache2-mod-passenger-enterprise.prerm +0 -15
- data/packaging/debian/debian_specs/passenger_enterprise/locations.ini.erb +0 -14
- data/packaging/debian/debian_specs/passenger_enterprise/passenger-enterprise-dev.install.erb +0 -3
- data/packaging/debian/debian_specs/passenger_enterprise/passenger-enterprise-doc.install.erb +0 -2
- data/packaging/debian/debian_specs/passenger_enterprise/passenger-enterprise.docs +0 -4
- data/packaging/debian/debian_specs/passenger_enterprise/passenger-enterprise.install.erb +0 -14
- data/packaging/debian/debian_specs/passenger_enterprise/passenger-enterprise.manpages +0 -3
- data/packaging/debian/debian_specs/passenger_enterprise/passenger.conf +0 -6
- data/packaging/debian/debian_specs/passenger_enterprise/passenger.load +0 -3
- data/packaging/debian/debian_specs/passenger_enterprise/passenger_free_ruby.c.erb +0 -1
- data/packaging/debian/debian_specs/passenger_enterprise/passenger_ruby_utils.c.erb +0 -1
- data/packaging/debian/debian_specs/passenger_enterprise/passenger_system_ruby.c.erb +0 -1
- data/packaging/debian/debian_specs/passenger_enterprise/patches/series +0 -0
- data/packaging/debian/debian_specs/passenger_enterprise/rules.erb +0 -84
- data/packaging/debian/debian_specs/passenger_enterprise/source/format +0 -1
- data/packaging/debian/docker_images/Makefile +0 -38
- data/packaging/debian/docker_images/buildbox/CONTAINER_VERSION.txt +0 -0
- data/packaging/debian/docker_images/buildbox/Dockerfile +0 -3
- data/packaging/debian/docker_images/buildbox/Gemfile +0 -9
- data/packaging/debian/docker_images/buildbox/Gemfile.lock +0 -42
- data/packaging/debian/docker_images/buildbox/install.sh +0 -85
- data/packaging/debian/docker_images/buildbox/pbuilderrc +0 -4
- data/packaging/debian/docker_images/buildbox/sudoers.conf +0 -6
- data/packaging/debian/docker_images/setup-buildbox-docker-image +0 -7
- data/packaging/debian/docker_images/setup-testbox-docker-image-debian-6 +0 -7
- data/packaging/debian/docker_images/setup-testbox-docker-image-debian-7 +0 -7
- data/packaging/debian/docker_images/setup-testbox-docker-image-debian-8 +0 -7
- data/packaging/debian/docker_images/setup-testbox-docker-image-ubuntu-12.04 +0 -7
- data/packaging/debian/docker_images/setup-testbox-docker-image-ubuntu-14.04 +0 -7
- data/packaging/debian/docker_images/setup-testbox-docker-image-ubuntu-15.04 +0 -7
- data/packaging/debian/docker_images/setup-testbox-docker-image-ubuntu-15.10 +0 -7
- data/packaging/debian/docker_images/testbox-debian-6/Dockerfile +0 -3
- data/packaging/debian/docker_images/testbox-debian-6/Gemfile +0 -2
- data/packaging/debian/docker_images/testbox-debian-6/Gemfile.lock +0 -23
- data/packaging/debian/docker_images/testbox-debian-6/argparse.py +0 -2374
- data/packaging/debian/docker_images/testbox-debian-6/install.sh +0 -78
- data/packaging/debian/docker_images/testbox-debian-7/Dockerfile +0 -3
- data/packaging/debian/docker_images/testbox-debian-7/Gemfile +0 -2
- data/packaging/debian/docker_images/testbox-debian-7/Gemfile.lock +0 -23
- data/packaging/debian/docker_images/testbox-debian-7/install.sh +0 -71
- data/packaging/debian/docker_images/testbox-debian-8/Dockerfile +0 -3
- data/packaging/debian/docker_images/testbox-debian-8/Gemfile +0 -2
- data/packaging/debian/docker_images/testbox-debian-8/Gemfile.lock +0 -23
- data/packaging/debian/docker_images/testbox-debian-8/install.sh +0 -70
- data/packaging/debian/docker_images/testbox-ubuntu-12.04/Dockerfile +0 -3
- data/packaging/debian/docker_images/testbox-ubuntu-12.04/Gemfile +0 -2
- data/packaging/debian/docker_images/testbox-ubuntu-12.04/Gemfile.lock +0 -23
- data/packaging/debian/docker_images/testbox-ubuntu-12.04/install.sh +0 -69
- data/packaging/debian/docker_images/testbox-ubuntu-14.04/Dockerfile +0 -3
- data/packaging/debian/docker_images/testbox-ubuntu-14.04/Gemfile +0 -2
- data/packaging/debian/docker_images/testbox-ubuntu-14.04/Gemfile.lock +0 -23
- data/packaging/debian/docker_images/testbox-ubuntu-14.04/install.sh +0 -69
- data/packaging/debian/docker_images/testbox-ubuntu-15.04/Dockerfile +0 -3
- data/packaging/debian/docker_images/testbox-ubuntu-15.04/Gemfile +0 -2
- data/packaging/debian/docker_images/testbox-ubuntu-15.04/Gemfile.lock +0 -23
- data/packaging/debian/docker_images/testbox-ubuntu-15.04/install.sh +0 -69
- data/packaging/debian/docker_images/testbox-ubuntu-15.10/Dockerfile +0 -3
- data/packaging/debian/docker_images/testbox-ubuntu-15.10/Gemfile +0 -2
- data/packaging/debian/docker_images/testbox-ubuntu-15.10/Gemfile.lock +0 -23
- data/packaging/debian/docker_images/testbox-ubuntu-15.10/install.sh +0 -69
- data/packaging/debian/internal/build/Rakefile +0 -235
- data/packaging/debian/internal/build/build-passenger-orig-tarball.sh +0 -76
- data/packaging/debian/internal/build/build-source-package.rb +0 -121
- data/packaging/debian/internal/build/download-nginx-orig-tarball.sh +0 -17
- data/packaging/debian/internal/build/rakefile_support.rb +0 -96
- data/packaging/debian/internal/build/setup-environment-essentials.sh +0 -15
- data/packaging/debian/internal/build/setup-environment.sh +0 -29
- data/packaging/debian/internal/lib/distro_info.rb +0 -82
- data/packaging/debian/internal/lib/distro_info.sh +0 -303
- data/packaging/debian/internal/lib/distro_info.sh.erb +0 -65
- data/packaging/debian/internal/lib/library.sh +0 -83
- data/packaging/debian/internal/lib/preprocessor.rb +0 -173
- data/packaging/debian/internal/lib/tracking.rb +0 -95
- data/packaging/debian/internal/lib/tracking_category.rb +0 -45
- data/packaging/debian/internal/lib/tracking_database.rb +0 -132
- data/packaging/debian/internal/lib/tracking_task.rb +0 -148
- data/packaging/debian/internal/lib/utils.rb +0 -78
- data/packaging/debian/internal/publish/Rakefile +0 -97
- data/packaging/debian/internal/publish/oss-binaries.phusionpassenger.com-fingerprint.txt +0 -1
- data/packaging/debian/internal/publish/packagecloud_fingerprint.txt +0 -1
- data/packaging/debian/internal/publish/passenger_website_fingerprint.txt +0 -1
- data/packaging/debian/internal/publish/preinit.sh +0 -7
- data/packaging/debian/internal/publish/rakefile_support.rb +0 -183
- data/packaging/debian/internal/scripts/gpg_noninteractive/gpg +0 -11
- data/packaging/debian/internal/scripts/initccache.sh +0 -35
- data/packaging/debian/internal/scripts/inituidgid.sh +0 -19
- data/packaging/debian/internal/scripts/my_init +0 -340
- data/packaging/debian/internal/scripts/pin_certificates +0 -34
- data/packaging/debian/internal/scripts/regen_distro_info_script.sh +0 -3
- data/packaging/debian/internal/scripts/setup-vagrant.sh +0 -12
- data/packaging/debian/internal/scripts/setuser +0 -31
- data/packaging/debian/internal/shell/initpbuilder.sh +0 -3
- data/packaging/debian/internal/shell/preinit.sh +0 -28
- data/packaging/debian/internal/shell/sudoers.conf +0 -1
- data/packaging/debian/internal/test/apache/apache-24.conf +0 -5
- data/packaging/debian/internal/test/apache/apache-pre-24.conf +0 -4
- data/packaging/debian/internal/test/apache/vhost.conf +0 -17
- data/packaging/debian/internal/test/misc/config.json +0 -15
- data/packaging/debian/internal/test/misc/hosts.conf +0 -4
- data/packaging/debian/internal/test/misc/init.sh +0 -25
- data/packaging/debian/internal/test/misc/nodejs_test_app.js +0 -6
- data/packaging/debian/internal/test/misc/python_test_app.py +0 -3
- data/packaging/debian/internal/test/misc/ruby_test_app.rb +0 -5
- data/packaging/debian/internal/test/misc/test_support.rb +0 -61
- data/packaging/debian/internal/test/nginx/vhost.conf +0 -23
- data/packaging/debian/internal/test/system_web_server_test.rb +0 -126
- data/packaging/debian/internal/test/test.sh +0 -141
- data/packaging/debian/jenkins/publish/clear_caches.rb +0 -48
- data/packaging/debian/jenkins/publish/publish.sh +0 -69
- data/packaging/debian/jenkins/test/test.sh +0 -63
- data/packaging/debian/passenger_apt_automation.sublime-project +0 -14
- data/packaging/debian/publish +0 -172
- data/packaging/debian/shell +0 -116
- data/packaging/debian/test +0 -142
- data/packaging/rpm/passenger_spec/rubygem-passenger-4.0.18-gcc47-include-sys_types.patch +0 -45
- data/test/cxx/Base64Test.cpp +0 -50
- data/test/cxx/FileBackedPipeTest.cpp +0 -626
- data/test/cxx/HttpHeaderBuffererTest.cpp +0 -257
- data/test/cxx/ScgiRequestParserTest.cpp +0 -423
- data/test/cxx/ServerInstanceDirTest.cpp +0 -175
- data/test/ruby/admin_tools_spec.rb +0 -360
- data/test/ruby/classic_rails/loader_spec.rb +0 -46
- data/test/ruby/classic_rails/preloader_spec.rb +0 -52
- data/test/ruby/standalone/runtime_locator_spec.rb +0 -214
- data/test/stub/rails2.3/Rakefile +0 -10
- data/test/stub/rails2.3/app/controllers/application_controller.rb +0 -10
- data/test/stub/rails2.3/app/controllers/bar_controller_1.rb +0 -5
- data/test/stub/rails2.3/app/controllers/bar_controller_2.rb +0 -5
- data/test/stub/rails2.3/app/controllers/foo_controller.rb +0 -21
- data/test/stub/rails2.3/app/helpers/application_helper.rb +0 -3
- data/test/stub/rails2.3/app/helpers/bar_helper.rb +0 -2
- data/test/stub/rails2.3/app/helpers/foo_helper.rb +0 -2
- data/test/stub/rails2.3/config/boot.rb +0 -110
- data/test/stub/rails2.3/config/database.yml +0 -19
- data/test/stub/rails2.3/config/environment.rb +0 -62
- data/test/stub/rails2.3/config/environments/development.rb +0 -17
- data/test/stub/rails2.3/config/environments/production.rb +0 -18
- data/test/stub/rails2.3/config/environments/staging.rb +0 -18
- data/test/stub/rails2.3/config/initializers/inflections.rb +0 -10
- data/test/stub/rails2.3/config/initializers/mime_types.rb +0 -5
- data/test/stub/rails2.3/config/routes.rb +0 -35
- data/test/stub/rails2.3/log/.gitignore +0 -1
- data/test/stub/rails2.3/public/.gitignore +0 -1
- data/test/stub/rails2.3/script/about +0 -3
- data/test/stub/rails2.3/script/console +0 -3
- data/test/stub/rails2.3/script/dbconsole +0 -3
- data/test/stub/rails2.3/script/destroy +0 -3
- data/test/stub/rails2.3/script/generate +0 -3
- data/test/stub/rails2.3/script/performance/benchmarker +0 -3
- data/test/stub/rails2.3/script/performance/profiler +0 -3
- data/test/stub/rails2.3/script/performance/request +0 -3
- data/test/stub/rails2.3/script/plugin +0 -3
- data/test/stub/rails2.3/script/process/inspector +0 -3
- data/test/stub/rails2.3/script/process/reaper +0 -3
- data/test/stub/rails2.3/script/process/spawner +0 -3
- data/test/stub/rails2.3/script/runner +0 -3
- data/test/stub/rails2.3/script/server +0 -3
- data/test/stub/rails2.3/tmp/cache/.gitignore +0 -1
- data/test/stub/rails2.3/tmp/pids/.gitignore +0 -1
- data/test/stub/rails2.3/tmp/sessions/.gitignore +0 -1
- data/test/stub/rails2.3/tmp/sockets/.gitignore +0 -1
@@ -1,25 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* Copyright (C) 2007 Brice FIGUREAU
|
3
|
-
*
|
4
|
-
* Redistribution and use in source and binary forms, with or without
|
5
|
-
* modification, are permitted provided that the following conditions
|
6
|
-
* are met:
|
7
|
-
* 1. Redistributions of source code must retain the above copyright
|
8
|
-
* notice, this list of conditions and the following disclaimer.
|
9
|
-
* 2. Redistributions in binary form must reproduce the above copyright
|
10
|
-
* notice, this list of conditions and the following disclaimer in the
|
11
|
-
* documentation and/or other materials provided with the distribution.
|
12
|
-
*
|
13
|
-
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
14
|
-
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
15
|
-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
16
|
-
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
|
17
|
-
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
18
|
-
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
19
|
-
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
20
|
-
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
21
|
-
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
22
|
-
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
23
|
-
* SUCH DAMAGE.
|
24
|
-
*
|
25
|
-
*/
|
@@ -1,8 +0,0 @@
|
|
1
|
-
dist: CHANGES README LICENSE config ngx_http_uploadprogress_module.c
|
2
|
-
tar czvf ../nginx_uploadprogress_module-0.7.tar.gz \
|
3
|
-
../nginx_uploadprogress_module/CHANGES \
|
4
|
-
../nginx_uploadprogress_module/README \
|
5
|
-
../nginx_uploadprogress_module/LICENSE \
|
6
|
-
../nginx_uploadprogress_module/config \
|
7
|
-
../nginx_uploadprogress_module/ngx_http_uploadprogress_module.c
|
8
|
-
|
@@ -1,329 +0,0 @@
|
|
1
|
-
Nginx Upload Progress Module
|
2
|
-
============================
|
3
|
-
|
4
|
-
Introduction
|
5
|
-
============
|
6
|
-
|
7
|
-
nginx_uploadprogress_module is an implementation of an upload progress system, that monitors
|
8
|
-
RFC1867 POST upload as they are transmitted to upstream servers.
|
9
|
-
|
10
|
-
It works by tracking the uploads proxied by Nginx to upstream servers without
|
11
|
-
analysing the uploaded content and offers a web API to report upload progress in Javscript, Json or any
|
12
|
-
other format (through the help of templates).
|
13
|
-
|
14
|
-
It works because Nginx acts as an accelerator of an upstream server, storing uploaded POST content
|
15
|
-
on disk, before transmitting it to the upstream server. Each individual POST upload request
|
16
|
-
should contain a progress unique identifier.
|
17
|
-
|
18
|
-
This module is Copyright (c) 2007-2012 Brice Figureau, and is licensed under the BSD license (see LICENSE).
|
19
|
-
* rbtree and shm_zone code is based on Igor Sysoev limit_zone Nginx module.
|
20
|
-
* expire header code is based on Igor Sysoev header_filter Nginx module.
|
21
|
-
|
22
|
-
The JSON idea and the mechanism idea are based on Lighttpd mod_uploadprogress:
|
23
|
-
http://blog.lighttpd.net/articles/2006/08/01/mod_uploadprogress-is-back
|
24
|
-
|
25
|
-
|
26
|
-
WARNING:
|
27
|
-
* when compiled with --with-debug, this module will produce high number of log messages.
|
28
|
-
|
29
|
-
INCOMPATIBLE CHANGES
|
30
|
-
====================
|
31
|
-
|
32
|
-
v0.9.0:
|
33
|
-
|
34
|
-
JSONP is now the default output of the progress probes. If you rely on this module serving
|
35
|
-
the deprecated java output use:
|
36
|
-
upload_progress_java_output
|
37
|
-
in the progress probe location.
|
38
|
-
|
39
|
-
|
40
|
-
Installation
|
41
|
-
============
|
42
|
-
|
43
|
-
nginx_uploadprogress_module has been tested with Nginx 0.6.x, 0.7.x, 0.8.x and 1.0.x.
|
44
|
-
|
45
|
-
Download the Nginx sources from http://nginx.net/ and unpack it.
|
46
|
-
|
47
|
-
To build Nginx, change to the directory which contains the Nginx
|
48
|
-
sources, and run the configuration script making sure to add the path
|
49
|
-
to the nginx_uploadprogress_module sources using the --add-module option: ::
|
50
|
-
|
51
|
-
$ ./configure --add-module=/path/to/nginx_uploadprogress_module/
|
52
|
-
|
53
|
-
Now you can build and install the software:
|
54
|
-
|
55
|
-
$ make
|
56
|
-
|
57
|
-
and as root:
|
58
|
-
|
59
|
-
$ make install
|
60
|
-
|
61
|
-
|
62
|
-
Configuration
|
63
|
-
=============
|
64
|
-
|
65
|
-
Each upload request should be assigned a unique identifier. This unique identifier will be used
|
66
|
-
to store the request and reference it to report.
|
67
|
-
This identifier can be transmitted either as a GET argument or as an HTTP header whose name is X-Progress-ID.
|
68
|
-
|
69
|
-
upload_progress
|
70
|
-
+++++++++++++++
|
71
|
-
:Syntax: upload_progress <zone_name> <zone_size>
|
72
|
-
:Default: none
|
73
|
-
:Context: http
|
74
|
-
:Description:
|
75
|
-
This directive enables the upload progress module and reserve <zone_size> bytes to the <zone_name> which
|
76
|
-
will be used to store the per-connection tracking information.
|
77
|
-
|
78
|
-
track_uploads
|
79
|
-
+++++++++++++
|
80
|
-
:Syntax: track_uploads <zone_name> <timeout>
|
81
|
-
:Default: none
|
82
|
-
:Context: location
|
83
|
-
:Description:
|
84
|
-
This directive enables tracking uploads for the current location. Each POST landing in this location will register
|
85
|
-
the request in the <zone_name> upload progress tracker.
|
86
|
-
Since Nginx doesn't support yet RFC 1867 upload, the location must be a proxy_pass or fastcgi location.
|
87
|
-
The POST _must_ have a query parameter called X-Progress-ID (or an HTTP header of the same name) whose value is the
|
88
|
-
unique identifier used to get progress information. If the POST has no such information, the upload will not be tracked.
|
89
|
-
The tracked connections are kept at most <timeout> seconds after they have been finished to be able to serve
|
90
|
-
useful information to upload progress probes.
|
91
|
-
WARNING: this directive must be the last directive of the location. It must be in a proxy_pass or
|
92
|
-
fastcgi_pass location.
|
93
|
-
|
94
|
-
report_uploads
|
95
|
-
++++++++++++++
|
96
|
-
:Syntax: report_uploads <zone_name>
|
97
|
-
:Default: none
|
98
|
-
:Context: location
|
99
|
-
:Description:
|
100
|
-
This directive allows a location to report the upload progress that is tracked by track_uploads for <zone_name>.
|
101
|
-
The returned document is a Javascript text with the possible 4 results by default:
|
102
|
-
* the upload request hasn't been registered yet or is unknown:
|
103
|
-
new Object({ 'state' : 'starting' })
|
104
|
-
|
105
|
-
* the upload request has ended:
|
106
|
-
new Object({ 'state' : 'done' })
|
107
|
-
|
108
|
-
* the upload request generated an HTTP error
|
109
|
-
new Object({ 'state' : 'error', 'status' : <error code> })
|
110
|
-
one error code that can be of use to track for the client is 413 (request entity too large).
|
111
|
-
|
112
|
-
* the upload request is in progress:
|
113
|
-
new Object({ 'state' : 'uploading', 'received' : <size_received>, 'size' : <total_size>})
|
114
|
-
|
115
|
-
It is possible to return pure json instead of this javascript (see upload_progress_json_output).
|
116
|
-
It is also possible to configure completely the response format with the directive:
|
117
|
-
upload_progress_template
|
118
|
-
|
119
|
-
The HTTP request to this location must have a X-Progress-ID parameter or HTTP header containing a valid
|
120
|
-
unique identifier of an in progress upload.
|
121
|
-
|
122
|
-
upload_progress_content_type
|
123
|
-
++++++++++++++++++++++++++++
|
124
|
-
:Syntax: upload_progress_content_type <content_type>
|
125
|
-
:Default: text/javascript
|
126
|
-
:Context: location
|
127
|
-
:Description:
|
128
|
-
This directive allows to change the upload progress probe response content-type.
|
129
|
-
|
130
|
-
upload_progress_header
|
131
|
-
++++++++++++++++++++++
|
132
|
-
:Syntax: upload_progress_header <progress-id>
|
133
|
-
:Default: X-Progress-ID
|
134
|
-
:Context: location
|
135
|
-
:Description:
|
136
|
-
This directive allows to change the header name of the progress ID.
|
137
|
-
|
138
|
-
upload_progress_jsonp_parameter
|
139
|
-
++++++++++++++++++++++
|
140
|
-
:Syntax: upload_progress_jsonp_parameter <callback_parameter>
|
141
|
-
:Default: callback
|
142
|
-
:Context: location
|
143
|
-
:Description:
|
144
|
-
This directive allows to change the name of the GET parameter with the jsonp callback name.
|
145
|
-
|
146
|
-
upload_progress_java_output
|
147
|
-
+++++++++++++++++++++++++++
|
148
|
-
:Syntax: upload_progress_java_output
|
149
|
-
:Default: N/A
|
150
|
-
:Context: location
|
151
|
-
:Description:
|
152
|
-
This directive sets everything to output as eval() javascript compatible code.
|
153
|
-
|
154
|
-
upload_progress_json_output
|
155
|
-
+++++++++++++++++++++++++++
|
156
|
-
:Syntax: upload_progress_json_output
|
157
|
-
:Default: N/A
|
158
|
-
:Context: location
|
159
|
-
:Description:
|
160
|
-
This directive sets everything to output as pure json.
|
161
|
-
|
162
|
-
upload_progress_jsonp_output
|
163
|
-
++++++++++++++++++++++++++++
|
164
|
-
:Syntax: upload_progress_jsonp_output
|
165
|
-
:Default: N/A
|
166
|
-
:Context: location
|
167
|
-
:Description:
|
168
|
-
This directive sets everything to output as jsonp (like json output, but with callback).
|
169
|
-
|
170
|
-
upload_progress_template
|
171
|
-
++++++++++++++++++++++++
|
172
|
-
:Syntax: upload_progress_template <state> <template>
|
173
|
-
:Default: none
|
174
|
-
:Context: location
|
175
|
-
:Description:
|
176
|
-
This directive can be used to install a progress response template.
|
177
|
-
The available list of state is:
|
178
|
-
* starting
|
179
|
-
* uploading
|
180
|
-
* error
|
181
|
-
* done
|
182
|
-
|
183
|
-
Nginx will replace the value of the following variables with their respective
|
184
|
-
value for the upload:
|
185
|
-
* $uploadprogress_length: total size of the upload
|
186
|
-
* $uploadprogress_received: what the server has received so far
|
187
|
-
* $uploadprogress_status: error code in case of HTTP error
|
188
|
-
* $uploadprogress_callback: jsonp callback name if provided as a GET query parameter with name 'callback'
|
189
|
-
|
190
|
-
For instance to return XML (instead of the default Javascript or json):
|
191
|
-
|
192
|
-
upload_progress_content_type 'text/xml';
|
193
|
-
upload_progress_template starting '<upload><state>starting</state></upload>';
|
194
|
-
upload_progress_template uploading '<upload><state>uploading</state><size>$uploadprogress_length</size><uploaded>$uploadprogress_received</uploaded></upload>';
|
195
|
-
upload_progress_template done '<upload><state>done</state></upload>';
|
196
|
-
upload_progress_template error '<upload><state>error</state><code>$uploadprogress_status</code></upload>';
|
197
|
-
|
198
|
-
Example of jsonp response:
|
199
|
-
|
200
|
-
upload_progress_template starting "$uploadprogress_callback({ \"state\" : \"starting\"});";
|
201
|
-
upload_progress_template error "$uploadprogress_callback({ \"state\" : \"error\", \"status\" : $uploadprogress_status });";
|
202
|
-
upload_progress_template done "$uploadprogress_callback({ \"state\" : \"done\"});";
|
203
|
-
upload_progress_template uploading "$uploadprogress_callback({ \"state\" : \"uploading\", \"received\" : $uploadprogress_received, \"size\" : $uploadprogress_length });";
|
204
|
-
|
205
|
-
Configuration Example:
|
206
|
-
+++++++++++++++++++++
|
207
|
-
|
208
|
-
http {
|
209
|
-
|
210
|
-
# reserve 1MB under the name 'proxied' to track uploads
|
211
|
-
upload_progress proxied 1m;
|
212
|
-
|
213
|
-
server {
|
214
|
-
listen 127.0.0.1 default;
|
215
|
-
server_name _ *;
|
216
|
-
|
217
|
-
root /path/to/root;
|
218
|
-
|
219
|
-
location / {
|
220
|
-
# proxy to upstream server
|
221
|
-
proxy_pass http://127.0.0.1;
|
222
|
-
proxy_redirect default;
|
223
|
-
|
224
|
-
# track uploads in the 'proxied' zone
|
225
|
-
# remember connections for 30s after they finished
|
226
|
-
track_uploads proxied 30s;
|
227
|
-
}
|
228
|
-
|
229
|
-
location ^~ /progress {
|
230
|
-
# report uploads tracked in the 'proxied' zone
|
231
|
-
report_uploads proxied;
|
232
|
-
}
|
233
|
-
}
|
234
|
-
|
235
|
-
|
236
|
-
Usage Example
|
237
|
-
=============
|
238
|
-
|
239
|
-
(based on Lighttd mod_uploadprogress module example):
|
240
|
-
|
241
|
-
First we need a upload form:
|
242
|
-
|
243
|
-
<form id="upload" enctype="multipart/form-data"
|
244
|
-
action="/upload.php" method="post"
|
245
|
-
onsubmit="openProgressBar(); return true;">
|
246
|
-
<input type="hidden" name="MAX_FILE_SIZE" value="30000000" />
|
247
|
-
<input name="userfile" type="file" label="fileupload" />
|
248
|
-
<input type="submit" value="Send File" />
|
249
|
-
</form>
|
250
|
-
|
251
|
-
And a progress bar to visualize the progress:
|
252
|
-
|
253
|
-
<div>
|
254
|
-
<div id="progress" style="width: 400px; border: 1px solid black">
|
255
|
-
<div id="progressbar"
|
256
|
-
style="width: 1px; background-color: black; border: 1px solid white">
|
257
|
-
|
258
|
-
</div>
|
259
|
-
</div>
|
260
|
-
<div id="tp">(progress)</div>
|
261
|
-
</div>
|
262
|
-
|
263
|
-
Then we need to generate the Unique Identifier and launch the upload on submit
|
264
|
-
action. This also will start the ajax progress report mechanism.
|
265
|
-
|
266
|
-
interval = null;
|
267
|
-
|
268
|
-
function openProgressBar() {
|
269
|
-
/* generate random progress-id */
|
270
|
-
uuid = "";
|
271
|
-
for (i = 0; i < 32; i++) {
|
272
|
-
uuid += Math.floor(Math.random() * 16).toString(16);
|
273
|
-
}
|
274
|
-
/* patch the form-action tag to include the progress-id */
|
275
|
-
document.getElementById("upload").action="/upload.php?X-Progress-ID=" + uuid;
|
276
|
-
|
277
|
-
/* call the progress-updater every 1000ms */
|
278
|
-
interval = window.setInterval(
|
279
|
-
function () {
|
280
|
-
fetch(uuid);
|
281
|
-
},
|
282
|
-
1000
|
283
|
-
);
|
284
|
-
}
|
285
|
-
|
286
|
-
function fetch(uuid) {
|
287
|
-
req = new XMLHttpRequest();
|
288
|
-
req.open("GET", "/progress", 1);
|
289
|
-
req.setRequestHeader("X-Progress-ID", uuid);
|
290
|
-
req.onreadystatechange = function () {
|
291
|
-
if (req.readyState == 4) {
|
292
|
-
if (req.status == 200) {
|
293
|
-
/* poor-man JSON parser */
|
294
|
-
var upload = eval(req.responseText);
|
295
|
-
|
296
|
-
document.getElementById('tp').innerHTML = upload.state;
|
297
|
-
|
298
|
-
/* change the width if the inner progress-bar */
|
299
|
-
if (upload.state == 'done' || upload.state == 'uploading') {
|
300
|
-
bar = document.getElementById('progressbar');
|
301
|
-
w = 400 * upload.received / upload.size;
|
302
|
-
bar.style.width = w + 'px';
|
303
|
-
}
|
304
|
-
/* we are done, stop the interval */
|
305
|
-
if (upload.state == 'done') {
|
306
|
-
window.clearTimeout(interval);
|
307
|
-
}
|
308
|
-
}
|
309
|
-
}
|
310
|
-
}
|
311
|
-
req.send(null);
|
312
|
-
}
|
313
|
-
|
314
|
-
Companion Software
|
315
|
-
==================
|
316
|
-
|
317
|
-
This software can also work with Valery Kholodkov' Nginx Upload Module:
|
318
|
-
http://www.grid.net.ru/nginx/upload.en.html
|
319
|
-
|
320
|
-
You can also use the following javascript libraries client side:
|
321
|
-
http://drogomir.com/blog/2008/6/30/upload-progress-script-with-safari-support
|
322
|
-
|
323
|
-
Note that when using jQuery AJAX for progress monitoring, such as:
|
324
|
-
https://github.com/drogus/jquery-upload-progress
|
325
|
-
you should be sure to set a upload_progress template parameter:
|
326
|
-
upload_progress_json_output
|
327
|
-
or
|
328
|
-
upload_progress_jsonp_output
|
329
|
-
depending on your jQuery AJAX dataType setting.
|
@@ -1,1774 +0,0 @@
|
|
1
|
-
|
2
|
-
/*
|
3
|
-
* Copyright (C) 2007 Brice Figureau
|
4
|
-
* shm_zone and rbtree code Copyright (c) 2002-2007 Igor Sysoev
|
5
|
-
*/
|
6
|
-
|
7
|
-
#include <ngx_config.h>
|
8
|
-
#include <ngx_core.h>
|
9
|
-
#include <ngx_http.h>
|
10
|
-
|
11
|
-
#define TIMER_FREQUENCY 15 * 1000
|
12
|
-
|
13
|
-
typedef enum {
|
14
|
-
uploadprogress_state_starting = 0,
|
15
|
-
uploadprogress_state_error = 1,
|
16
|
-
uploadprogress_state_done = 2,
|
17
|
-
uploadprogress_state_uploading = 3,
|
18
|
-
uploadprogress_state_none
|
19
|
-
} ngx_http_uploadprogress_state_t;
|
20
|
-
|
21
|
-
typedef struct {
|
22
|
-
ngx_str_t name;
|
23
|
-
ngx_http_uploadprogress_state_t idx;
|
24
|
-
} ngx_http_uploadprogress_state_map_t;
|
25
|
-
|
26
|
-
typedef struct ngx_http_uploadprogress_node_s ngx_http_uploadprogress_node_t;
|
27
|
-
|
28
|
-
struct ngx_http_uploadprogress_node_s {
|
29
|
-
ngx_rbtree_node_t node;
|
30
|
-
ngx_uint_t err_status;
|
31
|
-
off_t rest;
|
32
|
-
off_t length;
|
33
|
-
ngx_uint_t done;
|
34
|
-
time_t timeout;
|
35
|
-
struct ngx_http_uploadprogress_node_s *prev;
|
36
|
-
struct ngx_http_uploadprogress_node_s *next;
|
37
|
-
u_char len;
|
38
|
-
u_char data[1];
|
39
|
-
};
|
40
|
-
|
41
|
-
typedef struct {
|
42
|
-
ngx_shm_zone_t *shm_zone;
|
43
|
-
ngx_rbtree_node_t *node;
|
44
|
-
ngx_http_request_t *r;
|
45
|
-
time_t timeout;
|
46
|
-
} ngx_http_uploadprogress_cleanup_t;
|
47
|
-
|
48
|
-
typedef struct {
|
49
|
-
ngx_rbtree_t *rbtree;
|
50
|
-
ngx_http_uploadprogress_node_t list_head;
|
51
|
-
ngx_http_uploadprogress_node_t list_tail;
|
52
|
-
} ngx_http_uploadprogress_ctx_t;
|
53
|
-
|
54
|
-
typedef struct {
|
55
|
-
ngx_array_t *values;
|
56
|
-
ngx_array_t *lengths;
|
57
|
-
} ngx_http_uploadprogress_template_t;
|
58
|
-
|
59
|
-
typedef struct {
|
60
|
-
ngx_shm_zone_t *shm_zone;
|
61
|
-
time_t timeout;
|
62
|
-
ngx_event_t cleanup;
|
63
|
-
ngx_http_handler_pt handler;
|
64
|
-
u_char track;
|
65
|
-
ngx_str_t content_type;
|
66
|
-
ngx_array_t templates;
|
67
|
-
ngx_str_t header;
|
68
|
-
ngx_str_t jsonp_parameter;
|
69
|
-
} ngx_http_uploadprogress_conf_t;
|
70
|
-
|
71
|
-
typedef struct {
|
72
|
-
ngx_http_event_handler_pt read_event_handler;
|
73
|
-
} ngx_http_uploadprogress_module_ctx_t;
|
74
|
-
|
75
|
-
static ngx_int_t ngx_http_reportuploads_handler(ngx_http_request_t *r);
|
76
|
-
static void ngx_http_uploadprogress_cleanup(void *data);
|
77
|
-
static char *ngx_http_report_uploads(ngx_conf_t * cf, ngx_command_t * cmd, void *conf);
|
78
|
-
static ngx_int_t ngx_http_uploadprogress_init_zone(ngx_shm_zone_t * shm_zone, void *data);
|
79
|
-
static ngx_int_t ngx_http_uploadprogress_init(ngx_conf_t * cf);
|
80
|
-
static void *ngx_http_uploadprogress_create_loc_conf(ngx_conf_t *cf);
|
81
|
-
static char *ngx_http_uploadprogress_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child);
|
82
|
-
static ngx_int_t ngx_http_uploadprogress_init_variables_and_templates(ngx_conf_t *cf);
|
83
|
-
|
84
|
-
static ngx_int_t ngx_http_uploadprogress_received_variable(ngx_http_request_t *r,
|
85
|
-
ngx_http_variable_value_t *v, uintptr_t data);
|
86
|
-
static ngx_int_t ngx_http_uploadprogress_offset_variable(ngx_http_request_t *r,
|
87
|
-
ngx_http_variable_value_t *v, uintptr_t data);
|
88
|
-
static ngx_int_t ngx_http_uploadprogress_status_variable(ngx_http_request_t *r,
|
89
|
-
ngx_http_variable_value_t *v, uintptr_t data);
|
90
|
-
static ngx_int_t ngx_http_uploadprogress_callback_variable(ngx_http_request_t *r,
|
91
|
-
ngx_http_variable_value_t *v, uintptr_t data);
|
92
|
-
static char* ngx_http_upload_progress_set_template(ngx_conf_t * cf, ngx_http_uploadprogress_template_t *t, ngx_str_t *source);
|
93
|
-
static char *ngx_http_track_uploads(ngx_conf_t * cf, ngx_command_t * cmd, void *conf);
|
94
|
-
static char *ngx_http_report_uploads(ngx_conf_t * cf, ngx_command_t * cmd, void *conf);
|
95
|
-
static char *ngx_http_upload_progress(ngx_conf_t * cf, ngx_command_t * cmd, void *conf);
|
96
|
-
static char* ngx_http_upload_progress_template(ngx_conf_t * cf, ngx_command_t * cmd, void *conf);
|
97
|
-
static char* ngx_http_upload_progress_java_output(ngx_conf_t * cf, ngx_command_t * cmd, void *conf);
|
98
|
-
static char* ngx_http_upload_progress_json_output(ngx_conf_t * cf, ngx_command_t * cmd, void *conf);
|
99
|
-
static char* ngx_http_upload_progress_jsonp_output(ngx_conf_t * cf, ngx_command_t * cmd, void *conf);
|
100
|
-
static void ngx_clean_old_connections(ngx_event_t * ev);
|
101
|
-
static ngx_int_t ngx_http_uploadprogress_content_handler(ngx_http_request_t *r);
|
102
|
-
|
103
|
-
static ngx_http_output_header_filter_pt ngx_http_next_header_filter;
|
104
|
-
|
105
|
-
static ngx_command_t ngx_http_uploadprogress_commands[] = {
|
106
|
-
|
107
|
-
{ngx_string("upload_progress"),
|
108
|
-
NGX_HTTP_MAIN_CONF | NGX_CONF_TAKE2,
|
109
|
-
ngx_http_upload_progress,
|
110
|
-
0,
|
111
|
-
0,
|
112
|
-
NULL},
|
113
|
-
|
114
|
-
{ngx_string("track_uploads"),
|
115
|
-
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_CONF_TAKE2,
|
116
|
-
ngx_http_track_uploads,
|
117
|
-
NGX_HTTP_LOC_CONF_OFFSET,
|
118
|
-
0,
|
119
|
-
NULL},
|
120
|
-
|
121
|
-
{ngx_string("report_uploads"),
|
122
|
-
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_CONF_TAKE1,
|
123
|
-
ngx_http_report_uploads,
|
124
|
-
NGX_HTTP_LOC_CONF_OFFSET,
|
125
|
-
0,
|
126
|
-
NULL},
|
127
|
-
|
128
|
-
{ngx_string("upload_progress_content_type"),
|
129
|
-
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_CONF_TAKE1,
|
130
|
-
ngx_conf_set_str_slot,
|
131
|
-
NGX_HTTP_LOC_CONF_OFFSET,
|
132
|
-
offsetof(ngx_http_uploadprogress_conf_t, content_type),
|
133
|
-
NULL},
|
134
|
-
|
135
|
-
{ngx_string("upload_progress_template"),
|
136
|
-
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_CONF_TAKE2,
|
137
|
-
ngx_http_upload_progress_template,
|
138
|
-
NGX_HTTP_LOC_CONF_OFFSET,
|
139
|
-
offsetof(ngx_http_uploadprogress_conf_t, templates),
|
140
|
-
NULL},
|
141
|
-
|
142
|
-
{ngx_string("upload_progress_java_output"),
|
143
|
-
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_CONF_NOARGS,
|
144
|
-
ngx_http_upload_progress_java_output,
|
145
|
-
NGX_HTTP_LOC_CONF_OFFSET,
|
146
|
-
0,
|
147
|
-
NULL},
|
148
|
-
|
149
|
-
{ngx_string("upload_progress_json_output"),
|
150
|
-
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_CONF_NOARGS,
|
151
|
-
ngx_http_upload_progress_json_output,
|
152
|
-
NGX_HTTP_LOC_CONF_OFFSET,
|
153
|
-
0,
|
154
|
-
NULL},
|
155
|
-
|
156
|
-
{ngx_string("upload_progress_jsonp_output"),
|
157
|
-
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_CONF_NOARGS,
|
158
|
-
ngx_http_upload_progress_jsonp_output,
|
159
|
-
NGX_HTTP_LOC_CONF_OFFSET,
|
160
|
-
0,
|
161
|
-
NULL},
|
162
|
-
|
163
|
-
{ngx_string("upload_progress_header"),
|
164
|
-
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_CONF_TAKE1,
|
165
|
-
ngx_conf_set_str_slot,
|
166
|
-
NGX_HTTP_LOC_CONF_OFFSET,
|
167
|
-
offsetof(ngx_http_uploadprogress_conf_t, header),
|
168
|
-
NULL},
|
169
|
-
|
170
|
-
{ngx_string("upload_progress_jsonp_parameter"),
|
171
|
-
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_CONF_TAKE1,
|
172
|
-
ngx_conf_set_str_slot,
|
173
|
-
NGX_HTTP_LOC_CONF_OFFSET,
|
174
|
-
offsetof(ngx_http_uploadprogress_conf_t, jsonp_parameter),
|
175
|
-
NULL},
|
176
|
-
|
177
|
-
ngx_null_command
|
178
|
-
};
|
179
|
-
|
180
|
-
static ngx_http_variable_t ngx_http_uploadprogress_variables[] = {
|
181
|
-
|
182
|
-
{ ngx_string("uploadprogress_received"), NULL, ngx_http_uploadprogress_received_variable,
|
183
|
-
(uintptr_t) offsetof(ngx_http_uploadprogress_node_t, rest),
|
184
|
-
NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH, 0 },
|
185
|
-
|
186
|
-
{ ngx_string("uploadprogress_remaining"), NULL, ngx_http_uploadprogress_offset_variable,
|
187
|
-
(uintptr_t) offsetof(ngx_http_uploadprogress_node_t, rest),
|
188
|
-
NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH, 0 },
|
189
|
-
|
190
|
-
{ ngx_string("uploadprogress_length"), NULL, ngx_http_uploadprogress_offset_variable,
|
191
|
-
(uintptr_t) offsetof(ngx_http_uploadprogress_node_t, length),
|
192
|
-
NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH, 0 },
|
193
|
-
|
194
|
-
{ ngx_string("uploadprogress_status"), NULL, ngx_http_uploadprogress_status_variable,
|
195
|
-
(uintptr_t) offsetof(ngx_http_uploadprogress_node_t, err_status),
|
196
|
-
NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH, 0 },
|
197
|
-
|
198
|
-
{ ngx_string("uploadprogress_callback"), NULL, ngx_http_uploadprogress_callback_variable,
|
199
|
-
(uintptr_t) NULL,
|
200
|
-
NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH, 0 },
|
201
|
-
|
202
|
-
{ ngx_null_string, NULL, NULL, 0, 0, 0 }
|
203
|
-
};
|
204
|
-
|
205
|
-
static ngx_http_module_t ngx_http_uploadprogress_module_ctx = {
|
206
|
-
ngx_http_uploadprogress_init_variables_and_templates, /* preconfiguration */
|
207
|
-
ngx_http_uploadprogress_init, /* postconfiguration */
|
208
|
-
|
209
|
-
NULL, /* create main configuration */
|
210
|
-
NULL, /* init main configuration */
|
211
|
-
|
212
|
-
NULL, /* create server configuration */
|
213
|
-
NULL, /* merge server configuration */
|
214
|
-
|
215
|
-
ngx_http_uploadprogress_create_loc_conf, /* create location configuration */
|
216
|
-
ngx_http_uploadprogress_merge_loc_conf /* merge location configuration */
|
217
|
-
};
|
218
|
-
|
219
|
-
|
220
|
-
ngx_module_t ngx_http_uploadprogress_module = {
|
221
|
-
NGX_MODULE_V1,
|
222
|
-
&ngx_http_uploadprogress_module_ctx, /* module context */
|
223
|
-
ngx_http_uploadprogress_commands, /* module directives */
|
224
|
-
NGX_HTTP_MODULE, /* module type */
|
225
|
-
NULL, /* init master */
|
226
|
-
NULL, /* init module */
|
227
|
-
NULL, /* init process */
|
228
|
-
NULL, /* init thread */
|
229
|
-
NULL, /* exit thread */
|
230
|
-
NULL, /* exit process */
|
231
|
-
NULL, /* exit master */
|
232
|
-
NGX_MODULE_V1_PADDING
|
233
|
-
};
|
234
|
-
|
235
|
-
static ngx_http_uploadprogress_state_map_t ngx_http_uploadprogress_state_map[] = {
|
236
|
-
{ngx_string("starting"), uploadprogress_state_starting},
|
237
|
-
{ngx_string("error"), uploadprogress_state_error},
|
238
|
-
{ngx_string("done"), uploadprogress_state_done},
|
239
|
-
{ngx_string("uploading"), uploadprogress_state_uploading},
|
240
|
-
{ngx_null_string, uploadprogress_state_none},
|
241
|
-
};
|
242
|
-
|
243
|
-
static ngx_str_t ngx_http_uploadprogress_java_defaults[] = {
|
244
|
-
ngx_string("new Object({ 'state' : 'starting' })\r\n"),
|
245
|
-
ngx_string("new Object({ 'state' : 'error', 'status' : $uploadprogress_status })\r\n"),
|
246
|
-
ngx_string("new Object({ 'state' : 'done' })\r\n"),
|
247
|
-
ngx_string("new Object({ 'state' : 'uploading', 'received' : $uploadprogress_received, 'size' : $uploadprogress_length })\r\n")
|
248
|
-
};
|
249
|
-
|
250
|
-
static ngx_str_t ngx_http_uploadprogress_json_defaults[] = {
|
251
|
-
ngx_string("{ \"state\" : \"starting\" }\r\n"),
|
252
|
-
ngx_string("{ \"state\" : \"error\", \"status\" : $uploadprogress_status }\r\n"),
|
253
|
-
ngx_string("{ \"state\" : \"done\" }\r\n"),
|
254
|
-
ngx_string("{ \"state\" : \"uploading\", \"received\" : $uploadprogress_received, \"size\" : $uploadprogress_length }\r\n")
|
255
|
-
};
|
256
|
-
|
257
|
-
static ngx_str_t ngx_http_uploadprogress_jsonp_defaults[] = {
|
258
|
-
ngx_string("$uploadprogress_callback({ \"state\" : \"starting\" });\r\n"),
|
259
|
-
ngx_string("$uploadprogress_callback({ \"state\" : \"error\", \"status\" : $uploadprogress_status });\r\n"),
|
260
|
-
ngx_string("$uploadprogress_callback({ \"state\" : \"done\" });\r\n"),
|
261
|
-
ngx_string("$uploadprogress_callback({ \"state\" : \"uploading\", \"received\" : $uploadprogress_received, \"size\" : $uploadprogress_length });\r\n")
|
262
|
-
};
|
263
|
-
|
264
|
-
|
265
|
-
static ngx_array_t ngx_http_uploadprogress_global_templates;
|
266
|
-
|
267
|
-
static ngx_str_t*
|
268
|
-
get_tracking_id(ngx_http_request_t * r)
|
269
|
-
{
|
270
|
-
u_char *p, *start_p;
|
271
|
-
ngx_uint_t i;
|
272
|
-
ngx_list_part_t *part;
|
273
|
-
ngx_table_elt_t *header;
|
274
|
-
ngx_str_t *ret, args;
|
275
|
-
ngx_http_uploadprogress_conf_t *upcf;
|
276
|
-
|
277
|
-
upcf = ngx_http_get_module_loc_conf(r, ngx_http_uploadprogress_module);
|
278
|
-
|
279
|
-
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "upload-progress: get_tracking_id");
|
280
|
-
|
281
|
-
part = &r->headers_in.headers.part;
|
282
|
-
header = part->elts;
|
283
|
-
|
284
|
-
for (i = 0; /* void */ ; i++) {
|
285
|
-
|
286
|
-
if (i >= part->nelts) {
|
287
|
-
if (part->next == NULL) {
|
288
|
-
break;
|
289
|
-
}
|
290
|
-
|
291
|
-
part = part->next;
|
292
|
-
header = part->elts;
|
293
|
-
i = 0;
|
294
|
-
}
|
295
|
-
|
296
|
-
if (header[i].key.len == upcf->header.len
|
297
|
-
&& ngx_strncasecmp(header[i].key.data, upcf->header.data,
|
298
|
-
header[i].key.len) == 0) {
|
299
|
-
ret = ngx_calloc(sizeof(ngx_str_t), r->connection->log );
|
300
|
-
ret->data = header[i].value.data;
|
301
|
-
ret->len = header[i].value.len;
|
302
|
-
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
303
|
-
"upload-progress: get_tracking_id found header: %V", ret);
|
304
|
-
return ret;
|
305
|
-
}
|
306
|
-
}
|
307
|
-
|
308
|
-
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
309
|
-
"upload-progress: get_tracking_id no header found");
|
310
|
-
|
311
|
-
/* not found, check as a request arg */
|
312
|
-
/* it is possible the request args have not been yet created (or already released) */
|
313
|
-
/* so let's try harder first from the request line */
|
314
|
-
args.len = r->args.len;
|
315
|
-
args.data = r->args.data;
|
316
|
-
|
317
|
-
if (args.len && args.data) {
|
318
|
-
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
319
|
-
"upload-progress: get_tracking_id no header found, args found");
|
320
|
-
i = 0;
|
321
|
-
p = args.data;
|
322
|
-
do {
|
323
|
-
ngx_uint_t len = args.len - (p - args.data);
|
324
|
-
if (len >= (upcf->header.len + 1) && ngx_strncasecmp(p, upcf->header.data, upcf->header.len) == 0
|
325
|
-
&& p[upcf->header.len] == '=') {
|
326
|
-
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
327
|
-
"upload-progress: get_tracking_id found args: %s",p);
|
328
|
-
i = 1;
|
329
|
-
break;
|
330
|
-
}
|
331
|
-
if (len<=0)
|
332
|
-
break;
|
333
|
-
}
|
334
|
-
while(p++);
|
335
|
-
|
336
|
-
if (i) {
|
337
|
-
start_p = p += upcf->header.len + 1;
|
338
|
-
while (p < args.data + args.len) {
|
339
|
-
if (*((p++) + 1) == '&') {
|
340
|
-
break;
|
341
|
-
}
|
342
|
-
}
|
343
|
-
|
344
|
-
ret = ngx_calloc(sizeof(ngx_str_t), r->connection->log);
|
345
|
-
ret->data = start_p;
|
346
|
-
ret->len = p - start_p;
|
347
|
-
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
348
|
-
"upload-progress: get_tracking_id found args: %V",ret);
|
349
|
-
return ret;
|
350
|
-
}
|
351
|
-
}
|
352
|
-
|
353
|
-
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
354
|
-
"upload-progress: get_tracking_id no id found");
|
355
|
-
return NULL;
|
356
|
-
}
|
357
|
-
|
358
|
-
static ngx_http_uploadprogress_node_t *
|
359
|
-
find_node(ngx_str_t * id, ngx_http_uploadprogress_ctx_t * ctx, ngx_log_t * log)
|
360
|
-
{
|
361
|
-
uint32_t hash;
|
362
|
-
ngx_rbtree_node_t *node, *sentinel;
|
363
|
-
ngx_int_t rc;
|
364
|
-
ngx_http_uploadprogress_node_t *up;
|
365
|
-
|
366
|
-
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, "upload-progress: find_node %V", id);
|
367
|
-
|
368
|
-
hash = ngx_crc32_short(id->data, id->len);
|
369
|
-
|
370
|
-
node = ctx->rbtree->root;
|
371
|
-
sentinel = ctx->rbtree->sentinel;
|
372
|
-
|
373
|
-
while (node != sentinel) {
|
374
|
-
|
375
|
-
if (hash < node->key) {
|
376
|
-
node = node->left;
|
377
|
-
continue;
|
378
|
-
}
|
379
|
-
|
380
|
-
if (hash > node->key) {
|
381
|
-
node = node->right;
|
382
|
-
continue;
|
383
|
-
}
|
384
|
-
|
385
|
-
/* hash == node->key */
|
386
|
-
|
387
|
-
do {
|
388
|
-
up = (ngx_http_uploadprogress_node_t *) node;
|
389
|
-
|
390
|
-
rc = ngx_memn2cmp(id->data, up->data, id->len, (size_t) up->len);
|
391
|
-
|
392
|
-
if (rc == 0) {
|
393
|
-
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, log, 0,
|
394
|
-
"upload-progress: found node");
|
395
|
-
return up;
|
396
|
-
}
|
397
|
-
|
398
|
-
node = (rc < 0) ? node->left : node->right;
|
399
|
-
|
400
|
-
} while (node != sentinel && hash == node->key);
|
401
|
-
|
402
|
-
/* found a key with unmatching hash (and value), let's keep comparing hashes then */
|
403
|
-
}
|
404
|
-
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, log, 0, "upload-progress: can't find node");
|
405
|
-
return NULL;
|
406
|
-
}
|
407
|
-
|
408
|
-
static void ngx_http_uploadprogress_event_handler(ngx_http_request_t *r);
|
409
|
-
|
410
|
-
static ngx_int_t
|
411
|
-
ngx_http_uploadprogress_content_handler(ngx_http_request_t *r)
|
412
|
-
{
|
413
|
-
ngx_int_t rc;
|
414
|
-
ngx_http_uploadprogress_module_ctx_t *ctx;
|
415
|
-
ngx_http_uploadprogress_conf_t *upcf;
|
416
|
-
|
417
|
-
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "upload-progress: ngx_http_uploadprogress_content_handler");
|
418
|
-
upcf = ngx_http_get_module_loc_conf(r, ngx_http_uploadprogress_module);
|
419
|
-
|
420
|
-
/* call the original request handler */
|
421
|
-
rc = upcf->handler(r);
|
422
|
-
|
423
|
-
/* bail out if error */
|
424
|
-
if (rc >= NGX_HTTP_SPECIAL_RESPONSE) {
|
425
|
-
return rc;
|
426
|
-
}
|
427
|
-
|
428
|
-
/* request is OK, hijack the read_event_handler if the request has to be tracked*/
|
429
|
-
ctx = ngx_http_get_module_ctx(r, ngx_http_uploadprogress_module);
|
430
|
-
if (ctx != NULL) {
|
431
|
-
ctx->read_event_handler = r->read_event_handler;
|
432
|
-
r->read_event_handler = ngx_http_uploadprogress_event_handler;
|
433
|
-
}
|
434
|
-
return rc;
|
435
|
-
}
|
436
|
-
|
437
|
-
static ngx_str_t* ngx_http_uploadprogress_strdup(ngx_str_t *src, ngx_log_t * log)
|
438
|
-
{
|
439
|
-
ngx_str_t *dst;
|
440
|
-
dst = ngx_alloc(src->len + sizeof(ngx_str_t), log);
|
441
|
-
if (dst == NULL) {
|
442
|
-
return NULL;
|
443
|
-
}
|
444
|
-
|
445
|
-
dst->len = src->len;
|
446
|
-
ngx_memcpy(((char*)dst + sizeof(ngx_str_t)) , src->data, src->len);
|
447
|
-
dst->data = ((u_char*)dst + sizeof(ngx_str_t));
|
448
|
-
return dst;
|
449
|
-
}
|
450
|
-
|
451
|
-
static void ngx_http_uploadprogress_strdupfree(ngx_str_t *str)
|
452
|
-
{
|
453
|
-
ngx_free(str);
|
454
|
-
}
|
455
|
-
|
456
|
-
static void ngx_http_uploadprogress_event_handler(ngx_http_request_t *r)
|
457
|
-
{
|
458
|
-
ngx_str_t *id, *oldid;
|
459
|
-
ngx_slab_pool_t *shpool;
|
460
|
-
ngx_shm_zone_t *shm_zone;
|
461
|
-
ngx_http_uploadprogress_ctx_t *ctx;
|
462
|
-
ngx_http_uploadprogress_node_t *up;
|
463
|
-
ngx_http_uploadprogress_conf_t *upcf;
|
464
|
-
ngx_http_uploadprogress_module_ctx_t *module_ctx;
|
465
|
-
size_t size;
|
466
|
-
off_t rest;
|
467
|
-
|
468
|
-
|
469
|
-
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "upload-progress: ngx_http_uploadprogress_event_handler");
|
470
|
-
|
471
|
-
/* find node, update rest */
|
472
|
-
oldid = id = get_tracking_id(r);
|
473
|
-
|
474
|
-
if (id == NULL) {
|
475
|
-
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0,
|
476
|
-
"upload-progress: read_event_handler cant find id");
|
477
|
-
return;
|
478
|
-
}
|
479
|
-
|
480
|
-
/* perform a deep copy of id */
|
481
|
-
id = ngx_http_uploadprogress_strdup(id, r->connection->log);
|
482
|
-
ngx_free(oldid);
|
483
|
-
|
484
|
-
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
485
|
-
"upload-progress: read_event_handler found id: %V", id);
|
486
|
-
upcf = ngx_http_get_module_loc_conf(r, ngx_http_uploadprogress_module);
|
487
|
-
shm_zone = upcf->shm_zone;
|
488
|
-
|
489
|
-
/* call the original read event handler */
|
490
|
-
module_ctx = ngx_http_get_module_ctx(r, ngx_http_uploadprogress_module);
|
491
|
-
if (module_ctx != NULL ) {
|
492
|
-
module_ctx->read_event_handler(r);
|
493
|
-
}
|
494
|
-
|
495
|
-
/* at this stage, r is not anymore safe to use */
|
496
|
-
/* the request could have been closed/freed behind our back */
|
497
|
-
/* and thats the same issue with any other material that was allocated in the request pool */
|
498
|
-
/* that's why we duplicate id afterward */
|
499
|
-
|
500
|
-
/* it's also possible that the id was null if we got a spurious (like abort) read */
|
501
|
-
/* event. In this case we still have called the original read event handler */
|
502
|
-
/* but we have to bail out, because we won't ever be able to find our upload node */
|
503
|
-
|
504
|
-
|
505
|
-
if (shm_zone == NULL) {
|
506
|
-
ngx_http_uploadprogress_strdupfree(id);
|
507
|
-
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0,
|
508
|
-
"upload-progress: read_event_handler no shm_zone for id: %V", id);
|
509
|
-
return;
|
510
|
-
}
|
511
|
-
|
512
|
-
ctx = shm_zone->data;
|
513
|
-
|
514
|
-
/* get the original connection of the upload */
|
515
|
-
shpool = (ngx_slab_pool_t *) shm_zone->shm.addr;
|
516
|
-
|
517
|
-
ngx_shmtx_lock(&shpool->mutex);
|
518
|
-
|
519
|
-
up = find_node(id, ctx, ngx_cycle->log);
|
520
|
-
if (up != NULL && !up->done) {
|
521
|
-
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0,
|
522
|
-
"upload-progress: read_event_handler found node: %V", id);
|
523
|
-
rest = r->request_body->rest;
|
524
|
-
size = r->request_body->buf->last - r->request_body->buf->pos;
|
525
|
-
if ((off_t) size < rest) {
|
526
|
-
rest -= size;
|
527
|
-
} else {
|
528
|
-
rest = 0;
|
529
|
-
}
|
530
|
-
|
531
|
-
up->rest = rest;
|
532
|
-
if(up->length == 0)
|
533
|
-
up->length = r->headers_in.content_length_n;
|
534
|
-
ngx_log_debug3(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0,
|
535
|
-
"upload-progress: read_event_handler storing rest %uO/%uO for %V", up->rest, up->length, id);
|
536
|
-
} else {
|
537
|
-
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0,
|
538
|
-
"upload-progress: read_event_handler not found: %V", id);
|
539
|
-
}
|
540
|
-
ngx_shmtx_unlock(&shpool->mutex);
|
541
|
-
ngx_http_uploadprogress_strdupfree(id);
|
542
|
-
}
|
543
|
-
|
544
|
-
/* This generates the response for the report */
|
545
|
-
static ngx_int_t
|
546
|
-
ngx_http_reportuploads_handler(ngx_http_request_t * r)
|
547
|
-
{
|
548
|
-
ngx_str_t *id, response;
|
549
|
-
ngx_buf_t *b;
|
550
|
-
ngx_chain_t out;
|
551
|
-
ngx_int_t rc, found=0, done=0, err_status=0;
|
552
|
-
off_t rest=0, length=0;
|
553
|
-
ngx_uint_t len, i;
|
554
|
-
ngx_slab_pool_t *shpool;
|
555
|
-
ngx_http_uploadprogress_conf_t *upcf;
|
556
|
-
ngx_http_uploadprogress_ctx_t *ctx;
|
557
|
-
ngx_http_uploadprogress_node_t *up;
|
558
|
-
ngx_table_elt_t *expires, *cc, **ccp;
|
559
|
-
ngx_http_uploadprogress_state_t state;
|
560
|
-
ngx_http_uploadprogress_template_t *t;
|
561
|
-
|
562
|
-
if (r->method != NGX_HTTP_GET && r->method != NGX_HTTP_HEAD) {
|
563
|
-
return NGX_HTTP_NOT_ALLOWED;
|
564
|
-
}
|
565
|
-
|
566
|
-
rc = ngx_http_discard_request_body(r);
|
567
|
-
|
568
|
-
if (rc != NGX_OK) {
|
569
|
-
return rc;
|
570
|
-
}
|
571
|
-
|
572
|
-
/* get the tracking id if any */
|
573
|
-
id = get_tracking_id(r);
|
574
|
-
|
575
|
-
|
576
|
-
if (id == NULL) {
|
577
|
-
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
578
|
-
"reportuploads handler cant find id");
|
579
|
-
return NGX_DECLINED;
|
580
|
-
}
|
581
|
-
|
582
|
-
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
583
|
-
"reportuploads handler found id: %V", id);
|
584
|
-
|
585
|
-
upcf = ngx_http_get_module_loc_conf(r, ngx_http_uploadprogress_module);
|
586
|
-
|
587
|
-
if (upcf->shm_zone == NULL) {
|
588
|
-
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
589
|
-
"reportuploads no shm_zone for id: %V", id);
|
590
|
-
ngx_free(id);
|
591
|
-
return NGX_DECLINED;
|
592
|
-
}
|
593
|
-
|
594
|
-
ctx = upcf->shm_zone->data;
|
595
|
-
|
596
|
-
/* get the original connection of the upload */
|
597
|
-
shpool = (ngx_slab_pool_t *) upcf->shm_zone->shm.addr;
|
598
|
-
|
599
|
-
ngx_shmtx_lock(&shpool->mutex);
|
600
|
-
|
601
|
-
up = find_node(id, ctx, r->connection->log);
|
602
|
-
if (up != NULL) {
|
603
|
-
ngx_log_debug5(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
604
|
-
"reportuploads found node: %V (rest: %uO, length: %uO, done: %ui, err_status: %ui)", id, up->rest, up->length, up->done, up->err_status);
|
605
|
-
rest = up->rest;
|
606
|
-
length = up->length;
|
607
|
-
done = up->done;
|
608
|
-
err_status = up->err_status;
|
609
|
-
found = 1;
|
610
|
-
} else {
|
611
|
-
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
612
|
-
"reportuploads not found: %V", id);
|
613
|
-
}
|
614
|
-
ngx_shmtx_unlock(&shpool->mutex);
|
615
|
-
ngx_free(id);
|
616
|
-
|
617
|
-
/* send the output */
|
618
|
-
r->headers_out.content_type = upcf->content_type;
|
619
|
-
|
620
|
-
/* force no-cache */
|
621
|
-
expires = r->headers_out.expires;
|
622
|
-
|
623
|
-
if (expires == NULL) {
|
624
|
-
|
625
|
-
expires = ngx_list_push(&r->headers_out.headers);
|
626
|
-
if (expires == NULL) {
|
627
|
-
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
628
|
-
}
|
629
|
-
|
630
|
-
r->headers_out.expires = expires;
|
631
|
-
|
632
|
-
expires->hash = 1;
|
633
|
-
expires->key.len = sizeof("Expires") - 1;
|
634
|
-
expires->key.data = (u_char *) "Expires";
|
635
|
-
}
|
636
|
-
|
637
|
-
len = sizeof("Mon, 28 Sep 1970 06:00:00 GMT");
|
638
|
-
expires->value.len = len - 1;
|
639
|
-
|
640
|
-
ccp = r->headers_out.cache_control.elts;
|
641
|
-
if (ccp == NULL) {
|
642
|
-
|
643
|
-
if (ngx_array_init(&r->headers_out.cache_control, r->pool,
|
644
|
-
1, sizeof(ngx_table_elt_t *))
|
645
|
-
!= NGX_OK) {
|
646
|
-
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
647
|
-
}
|
648
|
-
|
649
|
-
ccp = ngx_array_push(&r->headers_out.cache_control);
|
650
|
-
if (ccp == NULL) {
|
651
|
-
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
652
|
-
}
|
653
|
-
|
654
|
-
cc = ngx_list_push(&r->headers_out.headers);
|
655
|
-
if (cc == NULL) {
|
656
|
-
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
657
|
-
}
|
658
|
-
|
659
|
-
cc->hash = 1;
|
660
|
-
cc->key.len = sizeof("Cache-Control") - 1;
|
661
|
-
cc->key.data = (u_char *) "Cache-Control";
|
662
|
-
|
663
|
-
*ccp = cc;
|
664
|
-
|
665
|
-
} else {
|
666
|
-
for (i = 1; i < r->headers_out.cache_control.nelts; i++) {
|
667
|
-
ccp[i]->hash = 0;
|
668
|
-
}
|
669
|
-
|
670
|
-
cc = ccp[0];
|
671
|
-
}
|
672
|
-
|
673
|
-
expires->value.data = (u_char *) "Thu, 01 Jan 1970 00:00:01 GMT";
|
674
|
-
|
675
|
-
cc->value.len = sizeof("no-cache") - 1;
|
676
|
-
cc->value.data = (u_char *) "no-cache";
|
677
|
-
|
678
|
-
|
679
|
-
if (r->method == NGX_HTTP_HEAD) {
|
680
|
-
r->headers_out.status = NGX_HTTP_OK;
|
681
|
-
|
682
|
-
rc = ngx_http_send_header(r);
|
683
|
-
|
684
|
-
if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) {
|
685
|
-
return rc;
|
686
|
-
}
|
687
|
-
}
|
688
|
-
|
689
|
-
ngx_http_set_ctx(r, up, ngx_http_uploadprogress_module);
|
690
|
-
|
691
|
-
/*
|
692
|
-
There are 4 possibilities
|
693
|
-
* request not yet started: found = false
|
694
|
-
* request in error: err_status >= NGX_HTTP_BAD_REQUEST
|
695
|
-
* request finished: done = true
|
696
|
-
* request not yet started but registered: length==0 && rest ==0
|
697
|
-
* reauest in progress: rest > 0
|
698
|
-
*/
|
699
|
-
|
700
|
-
if (!found) {
|
701
|
-
state = uploadprogress_state_starting;
|
702
|
-
} else if (err_status >= NGX_HTTP_BAD_REQUEST) {
|
703
|
-
state = uploadprogress_state_error;
|
704
|
-
} else if (done) {
|
705
|
-
state = uploadprogress_state_done;
|
706
|
-
} else if ( length == 0 && rest == 0 ) {
|
707
|
-
state = uploadprogress_state_starting;
|
708
|
-
} else {
|
709
|
-
state = uploadprogress_state_uploading;
|
710
|
-
}
|
711
|
-
|
712
|
-
t = upcf->templates.elts;
|
713
|
-
|
714
|
-
if (ngx_http_script_run(r, &response, t[(ngx_uint_t)state].lengths->elts, 0,
|
715
|
-
t[(ngx_uint_t)state].values->elts) == NULL)
|
716
|
-
{
|
717
|
-
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
718
|
-
}
|
719
|
-
|
720
|
-
ngx_log_debug4(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
721
|
-
"upload progress: state=%d, err_status=%ui, remaining=%uO, length=%uO",
|
722
|
-
state, err_status, (length - rest), length);
|
723
|
-
|
724
|
-
b = ngx_calloc_buf(r->pool);
|
725
|
-
if (b == NULL) {
|
726
|
-
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
727
|
-
}
|
728
|
-
|
729
|
-
b->pos = b->start = response.data;
|
730
|
-
b->last = b->end = response.data + response.len;
|
731
|
-
|
732
|
-
b->temporary = 1;
|
733
|
-
b->memory = 1;
|
734
|
-
|
735
|
-
out.buf = b;
|
736
|
-
out.next = NULL;
|
737
|
-
|
738
|
-
r->headers_out.status = NGX_HTTP_OK;
|
739
|
-
r->headers_out.content_length_n = b->last - b->pos;
|
740
|
-
|
741
|
-
b->last_buf = 1;
|
742
|
-
rc = ngx_http_send_header(r);
|
743
|
-
|
744
|
-
if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) {
|
745
|
-
return rc;
|
746
|
-
}
|
747
|
-
|
748
|
-
return ngx_http_output_filter(r, &out);
|
749
|
-
}
|
750
|
-
|
751
|
-
/*
|
752
|
-
Let's register the upload connection in our connections rb-tree
|
753
|
-
*/
|
754
|
-
static ngx_int_t
|
755
|
-
ngx_http_uploadprogress_handler(ngx_http_request_t * r)
|
756
|
-
{
|
757
|
-
size_t n;
|
758
|
-
ngx_str_t *id;
|
759
|
-
uint32_t hash;
|
760
|
-
ngx_slab_pool_t *shpool;
|
761
|
-
ngx_rbtree_node_t *node;
|
762
|
-
ngx_http_uploadprogress_conf_t *upcf;
|
763
|
-
ngx_http_uploadprogress_ctx_t *ctx;
|
764
|
-
ngx_http_uploadprogress_node_t *up;
|
765
|
-
ngx_http_uploadprogress_cleanup_t *upcln;
|
766
|
-
ngx_pool_cleanup_t *cln;
|
767
|
-
|
768
|
-
/* Is it a POST connection */
|
769
|
-
if (r->method != NGX_HTTP_POST) {
|
770
|
-
return NGX_DECLINED;
|
771
|
-
}
|
772
|
-
|
773
|
-
id = get_tracking_id(r);
|
774
|
-
if (id == NULL) {
|
775
|
-
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
776
|
-
"trackuploads no id found in POST upload req");
|
777
|
-
return NGX_DECLINED;
|
778
|
-
}
|
779
|
-
|
780
|
-
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
781
|
-
"trackuploads id found: %V", id);
|
782
|
-
|
783
|
-
upcf = ngx_http_get_module_loc_conf(r, ngx_http_uploadprogress_module);
|
784
|
-
|
785
|
-
if (!upcf->track) {
|
786
|
-
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
787
|
-
"trackuploads not tracking in this location for id: %V", id);
|
788
|
-
ngx_free(id);
|
789
|
-
return NGX_DECLINED;
|
790
|
-
}
|
791
|
-
|
792
|
-
if (upcf->shm_zone == NULL) {
|
793
|
-
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
794
|
-
"trackuploads no shm_zone for id: %V", id);
|
795
|
-
ngx_free(id);
|
796
|
-
return NGX_DECLINED;
|
797
|
-
}
|
798
|
-
|
799
|
-
ctx = upcf->shm_zone->data;
|
800
|
-
|
801
|
-
hash = ngx_crc32_short(id->data, id->len);
|
802
|
-
|
803
|
-
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
804
|
-
"trackuploads hash %08XD for id: %V", hash, id);
|
805
|
-
|
806
|
-
shpool = (ngx_slab_pool_t *) upcf->shm_zone->shm.addr;
|
807
|
-
|
808
|
-
ngx_shmtx_lock(&shpool->mutex);
|
809
|
-
|
810
|
-
if (find_node(id, ctx, r->connection->log) != NULL) {
|
811
|
-
ngx_shmtx_unlock(&shpool->mutex);
|
812
|
-
/* already found a node with matching progress ID */
|
813
|
-
ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
|
814
|
-
"upload_progress: tracking already registered id: %V", id);
|
815
|
-
|
816
|
-
ngx_free(id);
|
817
|
-
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
818
|
-
}
|
819
|
-
|
820
|
-
cln = ngx_pool_cleanup_add(r->pool, sizeof(ngx_http_uploadprogress_cleanup_t));
|
821
|
-
if (cln == NULL) {
|
822
|
-
ngx_shmtx_unlock(&shpool->mutex);
|
823
|
-
ngx_free(id);
|
824
|
-
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
825
|
-
}
|
826
|
-
|
827
|
-
n = sizeof(ngx_http_uploadprogress_node_t)
|
828
|
-
+ id->len;
|
829
|
-
|
830
|
-
node = ngx_slab_alloc_locked(shpool, n);
|
831
|
-
if (node == NULL) {
|
832
|
-
ngx_shmtx_unlock(&shpool->mutex);
|
833
|
-
ngx_free(id);
|
834
|
-
return NGX_HTTP_SERVICE_UNAVAILABLE;
|
835
|
-
}
|
836
|
-
|
837
|
-
up = (ngx_http_uploadprogress_node_t *) node;
|
838
|
-
|
839
|
-
node->key = hash;
|
840
|
-
up->len = (u_char) id->len;
|
841
|
-
up->err_status = r->err_status;
|
842
|
-
up->done = 0;
|
843
|
-
up->rest = 0;
|
844
|
-
up->length = 0;
|
845
|
-
up->timeout = 0;
|
846
|
-
|
847
|
-
/* Properly handles small files where no read events happen after the */
|
848
|
-
/* request is first handled (apparently this can happen on linux with epoll) */
|
849
|
-
if (r->headers_in.content_length_n) {
|
850
|
-
up->length = r->headers_in.content_length_n;
|
851
|
-
if (r->request_body) {
|
852
|
-
up->rest = r->request_body->rest;
|
853
|
-
}
|
854
|
-
}
|
855
|
-
|
856
|
-
up->next = ctx->list_head.next;
|
857
|
-
up->next->prev = up;
|
858
|
-
up->prev = &ctx->list_head;
|
859
|
-
ctx->list_head.next = up;
|
860
|
-
|
861
|
-
ngx_memcpy(up->data, id->data, id->len);
|
862
|
-
|
863
|
-
ngx_rbtree_insert(ctx->rbtree, node);
|
864
|
-
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
865
|
-
"trackuploads: %08XD inserted in rbtree", node->key);
|
866
|
-
|
867
|
-
if (!upcf->cleanup.timer_set) {
|
868
|
-
upcf->cleanup.data = upcf->shm_zone;
|
869
|
-
upcf->cleanup.handler = ngx_clean_old_connections;
|
870
|
-
upcf->cleanup.log = upcf->shm_zone->shm.log;
|
871
|
-
ngx_add_timer(&upcf->cleanup, TIMER_FREQUENCY);
|
872
|
-
}
|
873
|
-
|
874
|
-
ngx_shmtx_unlock(&shpool->mutex);
|
875
|
-
|
876
|
-
cln->handler = ngx_http_uploadprogress_cleanup;
|
877
|
-
upcln = cln->data;
|
878
|
-
|
879
|
-
upcln->shm_zone = upcf->shm_zone;
|
880
|
-
upcln->node = node;
|
881
|
-
upcln->timeout = upcf->timeout;
|
882
|
-
upcln->r = r;
|
883
|
-
|
884
|
-
ngx_free(id);
|
885
|
-
|
886
|
-
ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_uploadprogress_module_ctx_t));
|
887
|
-
if (ctx == NULL) {
|
888
|
-
return NGX_ERROR;
|
889
|
-
}
|
890
|
-
|
891
|
-
ngx_http_set_ctx(r, ctx, ngx_http_uploadprogress_module);
|
892
|
-
|
893
|
-
/* finally says to the core we don't handle anything */
|
894
|
-
return NGX_DECLINED;
|
895
|
-
}
|
896
|
-
|
897
|
-
static void
|
898
|
-
ngx_http_uploadprogress_rbtree_insert_value(ngx_rbtree_node_t * temp,
|
899
|
-
ngx_rbtree_node_t * node,
|
900
|
-
ngx_rbtree_node_t * sentinel)
|
901
|
-
{
|
902
|
-
ngx_http_uploadprogress_node_t *upn, *upnt;
|
903
|
-
|
904
|
-
for (;;) {
|
905
|
-
|
906
|
-
if (node->key < temp->key) {
|
907
|
-
|
908
|
-
if (temp->left == sentinel) {
|
909
|
-
temp->left = node;
|
910
|
-
break;
|
911
|
-
}
|
912
|
-
|
913
|
-
temp = temp->left;
|
914
|
-
|
915
|
-
} else if (node->key > temp->key) {
|
916
|
-
|
917
|
-
if (temp->right == sentinel) {
|
918
|
-
temp->right = node;
|
919
|
-
break;
|
920
|
-
}
|
921
|
-
|
922
|
-
temp = temp->right;
|
923
|
-
|
924
|
-
} else { /* node->key == temp->key */
|
925
|
-
|
926
|
-
upn = (ngx_http_uploadprogress_node_t *) node;
|
927
|
-
upnt = (ngx_http_uploadprogress_node_t *) temp;
|
928
|
-
|
929
|
-
if (ngx_memn2cmp(upn->data, upnt->data, upn->len, upnt->len) < 0) {
|
930
|
-
|
931
|
-
if (temp->left == sentinel) {
|
932
|
-
temp->left = node;
|
933
|
-
break;
|
934
|
-
}
|
935
|
-
|
936
|
-
temp = temp->left;
|
937
|
-
|
938
|
-
} else {
|
939
|
-
|
940
|
-
if (temp->right == sentinel) {
|
941
|
-
temp->right = node;
|
942
|
-
break;
|
943
|
-
}
|
944
|
-
|
945
|
-
temp = temp->right;
|
946
|
-
}
|
947
|
-
}
|
948
|
-
}
|
949
|
-
|
950
|
-
node->parent = temp;
|
951
|
-
node->left = sentinel;
|
952
|
-
node->right = sentinel;
|
953
|
-
ngx_rbt_red(node);
|
954
|
-
}
|
955
|
-
|
956
|
-
|
957
|
-
static void
|
958
|
-
ngx_clean_old_connections(ngx_event_t * ev)
|
959
|
-
{
|
960
|
-
ngx_shm_zone_t *shm_zone;
|
961
|
-
ngx_http_uploadprogress_ctx_t *ctx;
|
962
|
-
ngx_slab_pool_t *shpool;
|
963
|
-
ngx_rbtree_node_t *node;
|
964
|
-
ngx_http_uploadprogress_node_t *up, *upprev;
|
965
|
-
time_t now = ngx_time();
|
966
|
-
int count = 0;
|
967
|
-
|
968
|
-
|
969
|
-
/* scan the rbtree */
|
970
|
-
shm_zone = ev->data;
|
971
|
-
ctx = shm_zone->data;
|
972
|
-
shpool = (ngx_slab_pool_t *) shm_zone->shm.addr;
|
973
|
-
|
974
|
-
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, shm_zone->shm.log, 0,
|
975
|
-
"uploadprogress clean old connections at %T", now);
|
976
|
-
|
977
|
-
ngx_shmtx_lock(&shpool->mutex);
|
978
|
-
node = (ngx_rbtree_node_t *) ctx->list_tail.prev;
|
979
|
-
for (;;) {
|
980
|
-
|
981
|
-
|
982
|
-
if (node == &ctx->list_head.node) {
|
983
|
-
break;
|
984
|
-
}
|
985
|
-
|
986
|
-
up = (ngx_http_uploadprogress_node_t *) node;
|
987
|
-
upprev = up->prev;
|
988
|
-
|
989
|
-
ngx_log_debug3(NGX_LOG_DEBUG_HTTP, shm_zone->shm.log, 0,
|
990
|
-
"uploadprogress clean: scanning %08XD (req done %ui) timeout at %T",
|
991
|
-
node->key, up->done, up->timeout);
|
992
|
-
|
993
|
-
if ( (up->done && up->timeout < now) || (ngx_quit || ngx_terminate || ngx_exiting) ) {
|
994
|
-
up->next->prev = up->prev;
|
995
|
-
up->prev->next = up->next;
|
996
|
-
|
997
|
-
ngx_log_debug3(NGX_LOG_DEBUG_HTTP, shm_zone->shm.log, 0,
|
998
|
-
"uploadprogress clean: removing %08XD (req %ui) ",
|
999
|
-
node->key, up->done, up->timeout);
|
1000
|
-
|
1001
|
-
ngx_rbtree_delete(ctx->rbtree, node);
|
1002
|
-
ngx_slab_free_locked(shpool, node);
|
1003
|
-
}
|
1004
|
-
else
|
1005
|
-
count++;
|
1006
|
-
node = (ngx_rbtree_node_t *) upprev;
|
1007
|
-
}
|
1008
|
-
|
1009
|
-
ngx_log_debug3(NGX_LOG_DEBUG_HTTP, shm_zone->shm.log, 0,
|
1010
|
-
"uploadprogress clean old connections: quit: %ui term: %ui count: %ui", ngx_quit, ngx_terminate, count);
|
1011
|
-
|
1012
|
-
/* don't reschedule timer if ngx_quit or ngx_terminate && nodes emtpy */
|
1013
|
-
if ( count > 0 || !(ngx_quit || ngx_terminate || ngx_exiting)) {
|
1014
|
-
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, shm_zone->shm.log, 0,
|
1015
|
-
"uploadprogress clean old connections restarting timer");
|
1016
|
-
ngx_add_timer(ev, TIMER_FREQUENCY); /* trigger again in 60s */
|
1017
|
-
} else if (ngx_quit || ngx_terminate || ngx_exiting) {
|
1018
|
-
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, shm_zone->shm.log, 0,
|
1019
|
-
"uploadprogress clean old connections quitting , no more active connections: not restarting timer");
|
1020
|
-
}
|
1021
|
-
ngx_shmtx_unlock(&shpool->mutex);
|
1022
|
-
}
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
/*
|
1027
|
-
removes the expired node from the upload rbtree
|
1028
|
-
*/
|
1029
|
-
static void
|
1030
|
-
ngx_http_uploadprogress_cleanup(void *data)
|
1031
|
-
{
|
1032
|
-
ngx_http_uploadprogress_cleanup_t *upcln = data;
|
1033
|
-
ngx_slab_pool_t *shpool;
|
1034
|
-
ngx_rbtree_node_t *node;
|
1035
|
-
ngx_http_uploadprogress_node_t *up;
|
1036
|
-
ngx_http_request_t *r;
|
1037
|
-
|
1038
|
-
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, upcln->shm_zone->shm.log, 0,
|
1039
|
-
"uploadprogress cleanup called");
|
1040
|
-
|
1041
|
-
shpool = (ngx_slab_pool_t *) upcln->shm_zone->shm.addr;
|
1042
|
-
node = upcln->node;
|
1043
|
-
r = upcln->r;
|
1044
|
-
up = (ngx_http_uploadprogress_node_t *) node;
|
1045
|
-
|
1046
|
-
ngx_shmtx_lock(&shpool->mutex);
|
1047
|
-
|
1048
|
-
up->done = 1; /* mark the original request as done */
|
1049
|
-
up->timeout = ngx_time() + upcln->timeout; /* keep tracking for 60s */
|
1050
|
-
|
1051
|
-
if (r != NULL ) {
|
1052
|
-
ngx_uint_t rc = r->err_status ? r->err_status : r->headers_out.status;
|
1053
|
-
if (rc >= NGX_HTTP_SPECIAL_RESPONSE) {
|
1054
|
-
up->err_status = rc;
|
1055
|
-
}
|
1056
|
-
}
|
1057
|
-
|
1058
|
-
ngx_shmtx_unlock(&shpool->mutex);
|
1059
|
-
|
1060
|
-
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, upcln->shm_zone->shm.log, 0,
|
1061
|
-
"uploadprogress cleanup: connection %08XD to be deleted at %T",
|
1062
|
-
node->key, up->timeout);
|
1063
|
-
|
1064
|
-
}
|
1065
|
-
|
1066
|
-
static ngx_int_t
|
1067
|
-
ngx_http_uploadprogress_init_zone(ngx_shm_zone_t * shm_zone, void *data)
|
1068
|
-
{
|
1069
|
-
ngx_http_uploadprogress_ctx_t *octx = data;
|
1070
|
-
|
1071
|
-
ngx_slab_pool_t *shpool;
|
1072
|
-
ngx_rbtree_node_t *sentinel;
|
1073
|
-
ngx_http_uploadprogress_ctx_t *ctx;
|
1074
|
-
|
1075
|
-
ctx = shm_zone->data;
|
1076
|
-
|
1077
|
-
if (octx) {
|
1078
|
-
ctx->rbtree = octx->rbtree;
|
1079
|
-
return NGX_OK;
|
1080
|
-
}
|
1081
|
-
|
1082
|
-
shpool = (ngx_slab_pool_t *) shm_zone->shm.addr;
|
1083
|
-
|
1084
|
-
ctx->rbtree = ngx_slab_alloc(shpool, sizeof(ngx_rbtree_t));
|
1085
|
-
if (ctx->rbtree == NULL) {
|
1086
|
-
return NGX_ERROR;
|
1087
|
-
}
|
1088
|
-
|
1089
|
-
sentinel = ngx_slab_alloc(shpool, sizeof(ngx_rbtree_node_t));
|
1090
|
-
if (sentinel == NULL) {
|
1091
|
-
return NGX_ERROR;
|
1092
|
-
}
|
1093
|
-
|
1094
|
-
ngx_rbtree_sentinel_init(sentinel);
|
1095
|
-
|
1096
|
-
ctx->rbtree->root = sentinel;
|
1097
|
-
ctx->rbtree->sentinel = sentinel;
|
1098
|
-
ctx->rbtree->insert = ngx_http_uploadprogress_rbtree_insert_value;
|
1099
|
-
|
1100
|
-
return NGX_OK;
|
1101
|
-
}
|
1102
|
-
|
1103
|
-
static ngx_int_t
|
1104
|
-
ngx_http_uploadprogress_errortracker(ngx_http_request_t * r)
|
1105
|
-
{
|
1106
|
-
size_t n;
|
1107
|
-
ngx_str_t *id;
|
1108
|
-
ngx_slab_pool_t *shpool;
|
1109
|
-
ngx_rbtree_node_t *node;
|
1110
|
-
ngx_http_uploadprogress_ctx_t *ctx;
|
1111
|
-
ngx_http_uploadprogress_node_t *up;
|
1112
|
-
ngx_http_uploadprogress_conf_t *upcf;
|
1113
|
-
uint32_t hash;
|
1114
|
-
ngx_http_uploadprogress_cleanup_t *upcln;
|
1115
|
-
ngx_pool_cleanup_t *cln;
|
1116
|
-
|
1117
|
-
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
1118
|
-
"uploadprogress error-tracker error: %D", r->err_status);
|
1119
|
-
if (r->err_status >= NGX_HTTP_SPECIAL_RESPONSE) {
|
1120
|
-
|
1121
|
-
upcf = ngx_http_get_module_loc_conf(r, ngx_http_uploadprogress_module);
|
1122
|
-
|
1123
|
-
if (!upcf->track) {
|
1124
|
-
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
1125
|
-
"uploadprogress error-tracker not tracking in this location");
|
1126
|
-
goto finish;
|
1127
|
-
}
|
1128
|
-
|
1129
|
-
id = get_tracking_id(r);
|
1130
|
-
if (id == NULL) {
|
1131
|
-
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
1132
|
-
"trackuploads error-tracker no id found in POST upload req");
|
1133
|
-
goto finish;
|
1134
|
-
}
|
1135
|
-
|
1136
|
-
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
1137
|
-
"trackuploads error-tracker id found: %V", id);
|
1138
|
-
|
1139
|
-
|
1140
|
-
if (upcf->shm_zone == NULL) {
|
1141
|
-
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
1142
|
-
"trackuploads no shm_zone for id: %V", id);
|
1143
|
-
ngx_free(id);
|
1144
|
-
goto finish;
|
1145
|
-
}
|
1146
|
-
|
1147
|
-
ctx = upcf->shm_zone->data;
|
1148
|
-
|
1149
|
-
hash = ngx_crc32_short(id->data, id->len);
|
1150
|
-
|
1151
|
-
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
1152
|
-
"trackuploads error-tracking hash %08XD for id: %V", hash,
|
1153
|
-
id);
|
1154
|
-
|
1155
|
-
shpool = (ngx_slab_pool_t *) upcf->shm_zone->shm.addr;
|
1156
|
-
|
1157
|
-
ngx_shmtx_lock(&shpool->mutex);
|
1158
|
-
|
1159
|
-
if ((up = find_node(id, ctx, r->connection->log)) != NULL) {
|
1160
|
-
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
1161
|
-
"trackuploads error-tracking found node for id: %V", id);
|
1162
|
-
up->err_status = r->err_status;
|
1163
|
-
ngx_shmtx_unlock(&shpool->mutex);
|
1164
|
-
ngx_free(id);
|
1165
|
-
goto finish;
|
1166
|
-
}
|
1167
|
-
|
1168
|
-
/* no lz found for this tracking id */
|
1169
|
-
n = sizeof(ngx_http_uploadprogress_node_t) + id->len;
|
1170
|
-
|
1171
|
-
cln = ngx_pool_cleanup_add(r->pool, sizeof(ngx_http_uploadprogress_cleanup_t));
|
1172
|
-
if (cln == NULL) {
|
1173
|
-
ngx_shmtx_unlock(&shpool->mutex);
|
1174
|
-
ngx_free(id);
|
1175
|
-
goto finish;
|
1176
|
-
}
|
1177
|
-
|
1178
|
-
|
1179
|
-
node = ngx_slab_alloc_locked(shpool, n);
|
1180
|
-
if (node == NULL) {
|
1181
|
-
ngx_shmtx_unlock(&shpool->mutex);
|
1182
|
-
ngx_free(id);
|
1183
|
-
goto finish;
|
1184
|
-
}
|
1185
|
-
|
1186
|
-
up = (ngx_http_uploadprogress_node_t *) node;
|
1187
|
-
|
1188
|
-
node->key = hash;
|
1189
|
-
up->len = (u_char) id->len;
|
1190
|
-
up->err_status = r->err_status;
|
1191
|
-
up->done = 0;
|
1192
|
-
up->rest = 0;
|
1193
|
-
up->length = 0;
|
1194
|
-
up->timeout = 0;
|
1195
|
-
|
1196
|
-
ngx_memcpy(up->data, id->data, id->len);
|
1197
|
-
|
1198
|
-
up->next = ctx->list_head.next;
|
1199
|
-
up->next->prev = up;
|
1200
|
-
up->prev = &ctx->list_head;
|
1201
|
-
ctx->list_head.next = up;
|
1202
|
-
|
1203
|
-
ngx_rbtree_insert(ctx->rbtree, node);
|
1204
|
-
|
1205
|
-
/* start the timer if needed */
|
1206
|
-
if (!upcf->cleanup.timer_set) {
|
1207
|
-
upcf->cleanup.data = upcf->shm_zone;
|
1208
|
-
upcf->cleanup.handler = ngx_clean_old_connections;
|
1209
|
-
upcf->cleanup.log = upcf->shm_zone->shm.log;
|
1210
|
-
ngx_add_timer(&upcf->cleanup, TIMER_FREQUENCY);
|
1211
|
-
}
|
1212
|
-
|
1213
|
-
ngx_shmtx_unlock(&shpool->mutex);
|
1214
|
-
|
1215
|
-
cln->handler = ngx_http_uploadprogress_cleanup;
|
1216
|
-
upcln = cln->data;
|
1217
|
-
upcln->shm_zone = upcf->shm_zone;
|
1218
|
-
upcln->node = node;
|
1219
|
-
upcln->timeout = upcf->timeout;
|
1220
|
-
upcln->r = r;
|
1221
|
-
|
1222
|
-
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
1223
|
-
"trackuploads error-tracking adding: %08XD", node->key);
|
1224
|
-
ngx_free(id);
|
1225
|
-
}
|
1226
|
-
|
1227
|
-
finish:
|
1228
|
-
/* call the filter chain as usual */
|
1229
|
-
return ngx_http_next_header_filter(r);
|
1230
|
-
}
|
1231
|
-
|
1232
|
-
|
1233
|
-
static ngx_int_t
|
1234
|
-
ngx_http_uploadprogress_init(ngx_conf_t * cf)
|
1235
|
-
{
|
1236
|
-
ngx_http_handler_pt *h;
|
1237
|
-
ngx_http_core_main_conf_t *cmcf;
|
1238
|
-
|
1239
|
-
cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
|
1240
|
-
|
1241
|
-
/* install the tracking handler */
|
1242
|
-
h = ngx_array_push(&cmcf->phases[NGX_HTTP_REWRITE_PHASE].handlers);
|
1243
|
-
if (h == NULL) {
|
1244
|
-
return NGX_ERROR;
|
1245
|
-
}
|
1246
|
-
|
1247
|
-
*h = ngx_http_uploadprogress_handler;
|
1248
|
-
|
1249
|
-
/*
|
1250
|
-
we also need to track HTTP errors
|
1251
|
-
unfortunately, the above handler is not called in case of
|
1252
|
-
errors.
|
1253
|
-
we have to register a header output filter that will be
|
1254
|
-
called in any case to track those errors
|
1255
|
-
*/
|
1256
|
-
ngx_http_next_header_filter = ngx_http_top_header_filter;
|
1257
|
-
ngx_http_top_header_filter = ngx_http_uploadprogress_errortracker;
|
1258
|
-
|
1259
|
-
return NGX_OK;
|
1260
|
-
}
|
1261
|
-
|
1262
|
-
static void*
|
1263
|
-
ngx_http_uploadprogress_create_loc_conf(ngx_conf_t * cf)
|
1264
|
-
{
|
1265
|
-
ngx_http_uploadprogress_conf_t *conf;
|
1266
|
-
ngx_uint_t i;
|
1267
|
-
|
1268
|
-
conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_uploadprogress_conf_t));
|
1269
|
-
if (conf == NULL) {
|
1270
|
-
return NGX_CONF_ERROR;
|
1271
|
-
}
|
1272
|
-
|
1273
|
-
if(ngx_array_init(&conf->templates, cf->pool, 4, sizeof(ngx_http_uploadprogress_template_t)) != NGX_OK) {
|
1274
|
-
return NGX_CONF_ERROR;
|
1275
|
-
}
|
1276
|
-
|
1277
|
-
for(i = 0;i < conf->templates.nalloc; i++) {
|
1278
|
-
ngx_http_uploadprogress_template_t *elt = ngx_array_push(&conf->templates);
|
1279
|
-
if (elt == NULL) {
|
1280
|
-
return NGX_CONF_ERROR;
|
1281
|
-
}
|
1282
|
-
|
1283
|
-
elt->values = NULL;
|
1284
|
-
elt->lengths = NULL;
|
1285
|
-
}
|
1286
|
-
|
1287
|
-
return conf;
|
1288
|
-
}
|
1289
|
-
|
1290
|
-
|
1291
|
-
static char*
|
1292
|
-
ngx_http_uploadprogress_merge_loc_conf(ngx_conf_t * cf, void *parent, void *child)
|
1293
|
-
{
|
1294
|
-
ngx_http_uploadprogress_conf_t *prev = parent;
|
1295
|
-
ngx_http_uploadprogress_conf_t *conf = child;
|
1296
|
-
ngx_http_uploadprogress_template_t *t, *pt, *gt;
|
1297
|
-
ngx_uint_t i;
|
1298
|
-
|
1299
|
-
if (conf->shm_zone == NULL) {
|
1300
|
-
conf->shm_zone = prev->shm_zone;
|
1301
|
-
conf->timeout = prev->timeout;
|
1302
|
-
conf->cleanup = prev->cleanup;
|
1303
|
-
conf->handler = prev->handler;
|
1304
|
-
conf->track = prev->track;
|
1305
|
-
}
|
1306
|
-
|
1307
|
-
ngx_conf_merge_str_value(conf->content_type, prev->content_type, "text/javascript");
|
1308
|
-
|
1309
|
-
t = conf->templates.elts;
|
1310
|
-
pt = prev->templates.elts;
|
1311
|
-
gt = ngx_http_uploadprogress_global_templates.elts;
|
1312
|
-
|
1313
|
-
for(i = 0;i < conf->templates.nelts; i++) {
|
1314
|
-
if(t[i].values == NULL) {
|
1315
|
-
if(pt[i].values == NULL && gt != NULL) {
|
1316
|
-
t[i].values = gt[i].values;
|
1317
|
-
t[i].lengths = gt[i].lengths;
|
1318
|
-
}
|
1319
|
-
else {
|
1320
|
-
t[i].values = pt[i].values;
|
1321
|
-
t[i].lengths = pt[i].lengths;
|
1322
|
-
}
|
1323
|
-
}
|
1324
|
-
}
|
1325
|
-
|
1326
|
-
ngx_conf_merge_str_value(conf->header, prev->header, "X-Progress-ID");
|
1327
|
-
ngx_conf_merge_str_value(conf->jsonp_parameter, prev->jsonp_parameter, "callback");
|
1328
|
-
|
1329
|
-
return NGX_CONF_OK;
|
1330
|
-
}
|
1331
|
-
|
1332
|
-
static ngx_int_t
|
1333
|
-
ngx_http_uploadprogress_init_variables_and_templates(ngx_conf_t *cf)
|
1334
|
-
{
|
1335
|
-
ngx_http_variable_t *var, *v;
|
1336
|
-
ngx_http_uploadprogress_state_map_t *m;
|
1337
|
-
ngx_uint_t i;
|
1338
|
-
|
1339
|
-
/* Add variables */
|
1340
|
-
for (v = ngx_http_uploadprogress_variables; v->name.len; v++) {
|
1341
|
-
var = ngx_http_add_variable(cf, &v->name, v->flags);
|
1342
|
-
if (var == NULL) {
|
1343
|
-
return NGX_ERROR;
|
1344
|
-
}
|
1345
|
-
|
1346
|
-
var->get_handler = v->get_handler;
|
1347
|
-
var->data = v->data;
|
1348
|
-
}
|
1349
|
-
|
1350
|
-
/* Compile global templates (containing Javascript output) */
|
1351
|
-
if(ngx_array_init(&ngx_http_uploadprogress_global_templates, cf->pool, 4,
|
1352
|
-
sizeof(ngx_http_uploadprogress_template_t)) != NGX_OK) {
|
1353
|
-
return NGX_ERROR;
|
1354
|
-
}
|
1355
|
-
|
1356
|
-
m = ngx_http_uploadprogress_state_map;
|
1357
|
-
i = 0;
|
1358
|
-
|
1359
|
-
while(m->name.data != NULL) {
|
1360
|
-
ngx_http_uploadprogress_template_t *elt = ngx_array_push(&ngx_http_uploadprogress_global_templates);
|
1361
|
-
ngx_http_script_variables_count(ngx_http_uploadprogress_jsonp_defaults + i);
|
1362
|
-
|
1363
|
-
if (ngx_http_upload_progress_set_template(cf, elt, ngx_http_uploadprogress_jsonp_defaults + i) != NGX_CONF_OK) {
|
1364
|
-
return NGX_ERROR;
|
1365
|
-
}
|
1366
|
-
|
1367
|
-
m++;
|
1368
|
-
i++;
|
1369
|
-
}
|
1370
|
-
|
1371
|
-
|
1372
|
-
return NGX_OK;
|
1373
|
-
}
|
1374
|
-
|
1375
|
-
static char*
|
1376
|
-
ngx_http_upload_progress(ngx_conf_t * cf, ngx_command_t * cmd, void *conf)
|
1377
|
-
{
|
1378
|
-
ssize_t n;
|
1379
|
-
ngx_str_t *value;
|
1380
|
-
ngx_shm_zone_t *shm_zone;
|
1381
|
-
ngx_http_uploadprogress_ctx_t *ctx;
|
1382
|
-
|
1383
|
-
value = cf->args->elts;
|
1384
|
-
|
1385
|
-
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, cf->log, 0,
|
1386
|
-
"ngx_upload_progress name: %V", &value[1]);
|
1387
|
-
|
1388
|
-
ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_uploadprogress_ctx_t));
|
1389
|
-
if (ctx == NULL) {
|
1390
|
-
return NGX_CONF_ERROR;
|
1391
|
-
}
|
1392
|
-
|
1393
|
-
ctx->list_head.prev = NULL;
|
1394
|
-
ctx->list_head.next = &ctx->list_tail;
|
1395
|
-
|
1396
|
-
ctx->list_tail.prev = &ctx->list_head;
|
1397
|
-
ctx->list_tail.next = NULL;
|
1398
|
-
|
1399
|
-
n = ngx_parse_size(&value[2]);
|
1400
|
-
|
1401
|
-
if (n == NGX_ERROR) {
|
1402
|
-
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
1403
|
-
"invalid size of track_uploads \"%V\"", &value[2]);
|
1404
|
-
return NGX_CONF_ERROR;
|
1405
|
-
}
|
1406
|
-
|
1407
|
-
if (n < (ngx_int_t) (8 * ngx_pagesize)) {
|
1408
|
-
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
1409
|
-
"track_uploads \"%V\" is too small", &value[1]);
|
1410
|
-
return NGX_CONF_ERROR;
|
1411
|
-
}
|
1412
|
-
|
1413
|
-
shm_zone = ngx_shared_memory_add(cf, &value[1], n,
|
1414
|
-
&ngx_http_uploadprogress_module);
|
1415
|
-
if (shm_zone == NULL) {
|
1416
|
-
return NGX_CONF_ERROR;
|
1417
|
-
}
|
1418
|
-
|
1419
|
-
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, cf->log, 0,
|
1420
|
-
"ngx_upload_progress name: %V, szhm_zone: %p", &value[1],
|
1421
|
-
shm_zone);
|
1422
|
-
|
1423
|
-
if (shm_zone->data) {
|
1424
|
-
ctx = shm_zone->data;
|
1425
|
-
|
1426
|
-
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
1427
|
-
"track_uploads \"%V\" is already created", &value[1]);
|
1428
|
-
return NGX_CONF_ERROR;
|
1429
|
-
}
|
1430
|
-
|
1431
|
-
shm_zone->init = ngx_http_uploadprogress_init_zone;
|
1432
|
-
shm_zone->data = ctx;
|
1433
|
-
|
1434
|
-
return NGX_CONF_OK;
|
1435
|
-
}
|
1436
|
-
|
1437
|
-
|
1438
|
-
|
1439
|
-
static char*
|
1440
|
-
ngx_http_track_uploads(ngx_conf_t * cf, ngx_command_t * cmd, void *conf)
|
1441
|
-
{
|
1442
|
-
ngx_http_core_loc_conf_t *clcf;
|
1443
|
-
ngx_http_uploadprogress_conf_t *lzcf = conf;
|
1444
|
-
ngx_str_t *value;
|
1445
|
-
|
1446
|
-
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, cf->log, 0, "ngx_track_uploads in");
|
1447
|
-
|
1448
|
-
value = cf->args->elts;
|
1449
|
-
|
1450
|
-
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, cf->log, 0,
|
1451
|
-
"ngx_track_uploads name: %V", &value[1]);
|
1452
|
-
|
1453
|
-
lzcf->shm_zone = ngx_shared_memory_add(cf, &value[1], 0,
|
1454
|
-
&ngx_http_uploadprogress_module);
|
1455
|
-
if (lzcf->shm_zone == NULL) {
|
1456
|
-
return NGX_CONF_ERROR;
|
1457
|
-
}
|
1458
|
-
|
1459
|
-
lzcf->track = (u_char) 1;
|
1460
|
-
|
1461
|
-
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, cf->log, 0,
|
1462
|
-
"ngx_track_uploads name: %V,szhm_zone: %p", &value[1],
|
1463
|
-
lzcf->shm_zone);
|
1464
|
-
|
1465
|
-
|
1466
|
-
lzcf->timeout = ngx_parse_time(&value[2], 1);
|
1467
|
-
if (lzcf->timeout == NGX_ERROR) {
|
1468
|
-
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
1469
|
-
"track_uploads \"%V\" timeout value invalid", &value[1]);
|
1470
|
-
return NGX_CONF_ERROR;
|
1471
|
-
}
|
1472
|
-
|
1473
|
-
clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
|
1474
|
-
lzcf->handler = clcf->handler;
|
1475
|
-
if ( lzcf->handler == NULL )
|
1476
|
-
{
|
1477
|
-
return "track_upload should be the last directive in the location, after either proxy_pass or fastcgi_pass";
|
1478
|
-
}
|
1479
|
-
clcf->handler = ngx_http_uploadprogress_content_handler;
|
1480
|
-
return NGX_CONF_OK;
|
1481
|
-
}
|
1482
|
-
|
1483
|
-
|
1484
|
-
static char*
|
1485
|
-
ngx_http_report_uploads(ngx_conf_t * cf, ngx_command_t * cmd, void *conf)
|
1486
|
-
{
|
1487
|
-
ngx_http_uploadprogress_conf_t *lzcf = conf;
|
1488
|
-
ngx_http_core_loc_conf_t *clcf;
|
1489
|
-
ngx_str_t *value;
|
1490
|
-
|
1491
|
-
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, cf->log, 0, "ngx_report_uploads in");
|
1492
|
-
|
1493
|
-
value = cf->args->elts;
|
1494
|
-
|
1495
|
-
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, cf->log, 0,
|
1496
|
-
"ngx_report_uploads name: %V", &value[1]);
|
1497
|
-
|
1498
|
-
lzcf->shm_zone = ngx_shared_memory_add(cf, &value[1], 0,
|
1499
|
-
&ngx_http_uploadprogress_module);
|
1500
|
-
if (lzcf->shm_zone == NULL) {
|
1501
|
-
return NGX_CONF_ERROR;
|
1502
|
-
}
|
1503
|
-
|
1504
|
-
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, cf->log, 0,
|
1505
|
-
"ngx_report_uploads name: %V, szhm_zone: %p", &value[1],
|
1506
|
-
lzcf->shm_zone);
|
1507
|
-
|
1508
|
-
lzcf->track = (u_char) 0;
|
1509
|
-
|
1510
|
-
/* install our report handler */
|
1511
|
-
clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
|
1512
|
-
clcf->handler = ngx_http_reportuploads_handler;
|
1513
|
-
|
1514
|
-
return NGX_CONF_OK;
|
1515
|
-
}
|
1516
|
-
|
1517
|
-
static char*
|
1518
|
-
ngx_http_upload_progress_set_template(ngx_conf_t * cf, ngx_http_uploadprogress_template_t *t, ngx_str_t *source)
|
1519
|
-
{
|
1520
|
-
ssize_t n;
|
1521
|
-
ngx_http_script_compile_t sc;
|
1522
|
-
|
1523
|
-
n = ngx_http_script_variables_count(source);
|
1524
|
-
|
1525
|
-
ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
|
1526
|
-
|
1527
|
-
t->lengths = NULL;
|
1528
|
-
t->values = NULL;
|
1529
|
-
|
1530
|
-
sc.cf = cf;
|
1531
|
-
sc.source = source;
|
1532
|
-
sc.lengths = &t->lengths;
|
1533
|
-
sc.values = &t->values;
|
1534
|
-
sc.variables = n;
|
1535
|
-
sc.complete_lengths = 1;
|
1536
|
-
sc.complete_values = 1;
|
1537
|
-
|
1538
|
-
if (ngx_http_script_compile(&sc) != NGX_OK) {
|
1539
|
-
return NGX_CONF_ERROR;
|
1540
|
-
}
|
1541
|
-
|
1542
|
-
return NGX_CONF_OK;
|
1543
|
-
}
|
1544
|
-
|
1545
|
-
static char*
|
1546
|
-
ngx_http_upload_progress_template(ngx_conf_t * cf, ngx_command_t * cmd, void *conf)
|
1547
|
-
{
|
1548
|
-
ngx_http_uploadprogress_conf_t *upcf = conf;
|
1549
|
-
ngx_str_t *value;
|
1550
|
-
ngx_http_uploadprogress_state_map_t *m = ngx_http_uploadprogress_state_map;
|
1551
|
-
ngx_http_uploadprogress_template_t *t;
|
1552
|
-
|
1553
|
-
value = cf->args->elts;
|
1554
|
-
|
1555
|
-
while(m->name.data != NULL) {
|
1556
|
-
if((value[1].len == m->name.len && !ngx_strncmp(value[1].data, m->name.data, m->name.len))
|
1557
|
-
|| (value[1].len == 2 && !ngx_strncmp(value[1].data, m->name.data, 2))) {
|
1558
|
-
break;
|
1559
|
-
}
|
1560
|
-
m++;
|
1561
|
-
}
|
1562
|
-
|
1563
|
-
if (m->name.data == NULL) {
|
1564
|
-
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
1565
|
-
"unknown state \"%V\"", &value[1]);
|
1566
|
-
return NGX_CONF_ERROR;
|
1567
|
-
}
|
1568
|
-
|
1569
|
-
t = (ngx_http_uploadprogress_template_t*)upcf->templates.elts + (ngx_uint_t)m->idx;
|
1570
|
-
|
1571
|
-
return ngx_http_upload_progress_set_template(cf, t, &value[2]);
|
1572
|
-
}
|
1573
|
-
|
1574
|
-
static char*
|
1575
|
-
ngx_http_upload_progress_java_output(ngx_conf_t * cf, ngx_command_t * cmd, void *conf)
|
1576
|
-
{
|
1577
|
-
ngx_http_uploadprogress_conf_t *upcf = conf;
|
1578
|
-
ngx_http_uploadprogress_template_t *t;
|
1579
|
-
ngx_uint_t i;
|
1580
|
-
char* rc;
|
1581
|
-
|
1582
|
-
t = (ngx_http_uploadprogress_template_t*)upcf->templates.elts;
|
1583
|
-
|
1584
|
-
for(i = 0;i < upcf->templates.nelts;i++) {
|
1585
|
-
rc = ngx_http_upload_progress_set_template(cf, t + i, ngx_http_uploadprogress_java_defaults + i);
|
1586
|
-
|
1587
|
-
if(rc != NGX_CONF_OK) {
|
1588
|
-
return rc;
|
1589
|
-
}
|
1590
|
-
}
|
1591
|
-
|
1592
|
-
upcf->content_type.data = (u_char*)"text/javascript";
|
1593
|
-
upcf->content_type.len = sizeof("text/javascript") - 1;
|
1594
|
-
|
1595
|
-
return NGX_CONF_OK;
|
1596
|
-
}
|
1597
|
-
|
1598
|
-
static char*
|
1599
|
-
ngx_http_upload_progress_json_output(ngx_conf_t * cf, ngx_command_t * cmd, void *conf)
|
1600
|
-
{
|
1601
|
-
ngx_http_uploadprogress_conf_t *upcf = conf;
|
1602
|
-
ngx_http_uploadprogress_template_t *t;
|
1603
|
-
ngx_uint_t i;
|
1604
|
-
char* rc;
|
1605
|
-
|
1606
|
-
t = (ngx_http_uploadprogress_template_t*)upcf->templates.elts;
|
1607
|
-
|
1608
|
-
for(i = 0;i < upcf->templates.nelts;i++) {
|
1609
|
-
rc = ngx_http_upload_progress_set_template(cf, t + i, ngx_http_uploadprogress_json_defaults + i);
|
1610
|
-
|
1611
|
-
if(rc != NGX_CONF_OK) {
|
1612
|
-
return rc;
|
1613
|
-
}
|
1614
|
-
}
|
1615
|
-
|
1616
|
-
upcf->content_type.data = (u_char*)"application/json";
|
1617
|
-
upcf->content_type.len = sizeof("application/json") - 1;
|
1618
|
-
|
1619
|
-
return NGX_CONF_OK;
|
1620
|
-
}
|
1621
|
-
|
1622
|
-
static char*
|
1623
|
-
ngx_http_upload_progress_jsonp_output(ngx_conf_t * cf, ngx_command_t * cmd, void *conf)
|
1624
|
-
{
|
1625
|
-
ngx_http_uploadprogress_conf_t *upcf = conf;
|
1626
|
-
ngx_http_uploadprogress_template_t *t;
|
1627
|
-
ngx_uint_t i;
|
1628
|
-
char* rc;
|
1629
|
-
|
1630
|
-
t = (ngx_http_uploadprogress_template_t*)upcf->templates.elts;
|
1631
|
-
|
1632
|
-
for(i = 0;i < upcf->templates.nelts;i++) {
|
1633
|
-
rc = ngx_http_upload_progress_set_template(cf, t + i, ngx_http_uploadprogress_jsonp_defaults + i);
|
1634
|
-
|
1635
|
-
if(rc != NGX_CONF_OK) {
|
1636
|
-
return rc;
|
1637
|
-
}
|
1638
|
-
}
|
1639
|
-
|
1640
|
-
upcf->content_type.data = (u_char*)"application/javascript";
|
1641
|
-
upcf->content_type.len = sizeof("application/javascript") - 1;
|
1642
|
-
|
1643
|
-
return NGX_CONF_OK;
|
1644
|
-
}
|
1645
|
-
|
1646
|
-
static ngx_int_t ngx_http_uploadprogress_received_variable(ngx_http_request_t *r,
|
1647
|
-
ngx_http_variable_value_t *v, uintptr_t data)
|
1648
|
-
{
|
1649
|
-
ngx_http_uploadprogress_node_t *up;
|
1650
|
-
u_char *p;
|
1651
|
-
off_t *value;
|
1652
|
-
|
1653
|
-
up = ngx_http_get_module_ctx(r, ngx_http_uploadprogress_module);
|
1654
|
-
|
1655
|
-
value = (off_t *) ((char *) up + data);
|
1656
|
-
|
1657
|
-
p = ngx_palloc(r->pool, NGX_OFF_T_LEN);
|
1658
|
-
if (p == NULL) {
|
1659
|
-
return NGX_ERROR;
|
1660
|
-
}
|
1661
|
-
|
1662
|
-
v->len = ngx_sprintf(p, "%O", up->length - *value) - p;
|
1663
|
-
v->valid = 1;
|
1664
|
-
v->no_cacheable = 0;
|
1665
|
-
v->not_found = 0;
|
1666
|
-
v->data = p;
|
1667
|
-
|
1668
|
-
return NGX_OK;
|
1669
|
-
}
|
1670
|
-
|
1671
|
-
static ngx_int_t ngx_http_uploadprogress_offset_variable(ngx_http_request_t *r,
|
1672
|
-
ngx_http_variable_value_t *v, uintptr_t data)
|
1673
|
-
{
|
1674
|
-
ngx_http_uploadprogress_node_t *up;
|
1675
|
-
u_char *p;
|
1676
|
-
off_t *value;
|
1677
|
-
|
1678
|
-
up = ngx_http_get_module_ctx(r, ngx_http_uploadprogress_module);
|
1679
|
-
|
1680
|
-
value = (off_t *) ((char *) up + data);
|
1681
|
-
|
1682
|
-
p = ngx_palloc(r->pool, NGX_OFF_T_LEN);
|
1683
|
-
if (p == NULL) {
|
1684
|
-
return NGX_ERROR;
|
1685
|
-
}
|
1686
|
-
|
1687
|
-
v->len = ngx_sprintf(p, "%O", *value) - p;
|
1688
|
-
v->valid = 1;
|
1689
|
-
v->no_cacheable = 0;
|
1690
|
-
v->not_found = 0;
|
1691
|
-
v->data = p;
|
1692
|
-
|
1693
|
-
return NGX_OK;
|
1694
|
-
}
|
1695
|
-
|
1696
|
-
static ngx_int_t
|
1697
|
-
ngx_http_uploadprogress_status_variable(ngx_http_request_t *r,
|
1698
|
-
ngx_http_variable_value_t *v, uintptr_t data)
|
1699
|
-
{
|
1700
|
-
ngx_http_uploadprogress_node_t *up;
|
1701
|
-
u_char *p;
|
1702
|
-
off_t *value;
|
1703
|
-
|
1704
|
-
up = ngx_http_get_module_ctx(r, ngx_http_uploadprogress_module);
|
1705
|
-
|
1706
|
-
value = (off_t *) ((char *) up + data);
|
1707
|
-
|
1708
|
-
p = ngx_palloc(r->pool, NGX_OFF_T_LEN);
|
1709
|
-
if (p == NULL) {
|
1710
|
-
return NGX_ERROR;
|
1711
|
-
}
|
1712
|
-
|
1713
|
-
v->len = ngx_sprintf(p, "%O", *value) - p;
|
1714
|
-
v->valid = 1;
|
1715
|
-
v->no_cacheable = 0;
|
1716
|
-
v->not_found = 0;
|
1717
|
-
v->data = p;
|
1718
|
-
|
1719
|
-
return NGX_OK;
|
1720
|
-
}
|
1721
|
-
|
1722
|
-
static ngx_int_t
|
1723
|
-
ngx_http_uploadprogress_callback_variable(ngx_http_request_t *r,
|
1724
|
-
ngx_http_variable_value_t *v, uintptr_t data)
|
1725
|
-
{
|
1726
|
-
u_char *p, *start_p, *val, prefix[1024];
|
1727
|
-
ngx_http_uploadprogress_conf_t *upcf;
|
1728
|
-
u_int len;
|
1729
|
-
|
1730
|
-
upcf = ngx_http_get_module_loc_conf(r, ngx_http_uploadprogress_module);
|
1731
|
-
|
1732
|
-
if (r->args.len) {
|
1733
|
-
/* '=' has to be appended to avoid matching parameters that have the */
|
1734
|
-
/* configured name as a prefix but are longer */
|
1735
|
-
ngx_snprintf(prefix, sizeof(prefix) - 1, "%s=", upcf->jsonp_parameter.data);
|
1736
|
-
len = upcf->jsonp_parameter.len + 1;
|
1737
|
-
prefix[len] = '\0'; /* Force termination of string */
|
1738
|
-
|
1739
|
-
p = (u_char *) ngx_strstr(r->args.data, prefix);
|
1740
|
-
|
1741
|
-
if (p) {
|
1742
|
-
p += len;
|
1743
|
-
start_p = p;
|
1744
|
-
while (p < r->args.data + r->args.len) {
|
1745
|
-
if (*((p++) + 1) == '&') {
|
1746
|
-
break;
|
1747
|
-
}
|
1748
|
-
}
|
1749
|
-
|
1750
|
-
v->len = p - start_p;
|
1751
|
-
|
1752
|
-
val = ngx_palloc(r->pool, v->len + 1);
|
1753
|
-
if (val == NULL) {
|
1754
|
-
return NGX_ERROR;
|
1755
|
-
}
|
1756
|
-
|
1757
|
-
ngx_memcpy(val, start_p, v->len);
|
1758
|
-
val[v->len] = '\0';
|
1759
|
-
|
1760
|
-
v->valid = 1;
|
1761
|
-
v->no_cacheable = 0;
|
1762
|
-
v->not_found = 0;
|
1763
|
-
v->data = val;
|
1764
|
-
} else {
|
1765
|
-
return NGX_ERROR;
|
1766
|
-
}
|
1767
|
-
} else {
|
1768
|
-
return NGX_ERROR;
|
1769
|
-
}
|
1770
|
-
|
1771
|
-
return NGX_OK;
|
1772
|
-
}
|
1773
|
-
|
1774
|
-
|