From: Ivan Udovichenko Date: Mon, 19 Mar 2018 11:47:43 +0000 (+0300) Subject: Update rabbitmq-server X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F77%2F38077%2F1;p=packages%2Ftrusty%2Frabbitmq-server.git Update rabbitmq-server Versoin: 3.6.15-1~u14.04+mcp1 * Update to 3.6.15 version. (PROD-16511) Change-Id: I142668b5c9993cc51c1b57b692bcc7e43ba1df53 Related-PROD: https://mirantis.jira.com/browse/PROD-16511 --- diff --git a/debian/changelog b/debian/changelog index 1f18ffc..fbc6426 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +rabbitmq-server (3.6.15-1~u14.04+mcp1) mcp; urgency=medium + + * Update to 3.6.15 version. (PROD-16511) + + -- Ivan Udovichenko Mon, 19 Mar 2018 14:47:21 +0300 + rabbitmq-server (3.6.11-1~u14.04+mcp1) mcp; urgency=medium * Update sources. diff --git a/rabbitmq-server/LICENSE b/rabbitmq-server/LICENSE index 1834aa5..61934c6 100644 --- a/rabbitmq-server/LICENSE +++ b/rabbitmq-server/LICENSE @@ -7,23 +7,6 @@ The files amqp-rabbitmq-0.8.json and amqp-rabbitmq-0.9.1.json are "Copyright (C) 2008-2016 Pivotal Software, Inc", Inc. and are covered by the MIT license. -jQuery is "Copyright (c) 2010 John Resig" and is covered by the MIT -license. It was downloaded from http://jquery.com/ - -EJS is "Copyright (c) 2007 Edward Benson" and is covered by the MIT -license. It was downloaded from http://embeddedjs.com/ - -Sammy is "Copyright (c) 2008 Aaron Quint, Quirkey NYC, LLC" and is -covered by the MIT license. It was downloaded from -http://code.quirkey.com/sammy/ - -ExplorerCanvas is "Copyright 2006 Google Inc" and is covered by the -Apache License version 2.0. It was downloaded from -http://code.google.com/p/explorercanvas/ - -Flot is "Copyright (c) 2007-2013 IOLA and Ole Laursen" and is covered -by the MIT license. It was downloaded from -http://www.flotcharts.org/ glMatrix is "Copyright (c) 2011, Brandon Jones" and is covered by the BSD 2-Clause license. It was downloaded from http://code.google.com/p/glmatrix/ diff --git a/rabbitmq-server/LICENSE-APACHE2 b/rabbitmq-server/LICENSE-APACHE2 new file mode 100644 index 0000000..7036191 --- /dev/null +++ b/rabbitmq-server/LICENSE-APACHE2 @@ -0,0 +1,204 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2007-2013 VMware, Inc. + Copyright 2011 Jon Brisbin. + Copyright 2013-2017 Pivotal Software, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/rabbitmq-server/deps/rabbitmq_management/LICENSE-APACHE2-ExplorerCanvas b/rabbitmq-server/LICENSE-APACHE2-excanvas similarity index 100% rename from rabbitmq-server/deps/rabbitmq_management/LICENSE-APACHE2-ExplorerCanvas rename to rabbitmq-server/LICENSE-APACHE2-excanvas diff --git a/rabbitmq-server/LICENSE-BSD-recon b/rabbitmq-server/LICENSE-BSD-recon new file mode 100644 index 0000000..be0aebb --- /dev/null +++ b/rabbitmq-server/LICENSE-BSD-recon @@ -0,0 +1,27 @@ +Copyright (c) 2012-2017, Frédéric Trottier-Hébert +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + The names of its contributors may not be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/rabbitmq-server/LICENSE-ISC-cowboy b/rabbitmq-server/LICENSE-ISC-cowboy new file mode 100644 index 0000000..9d28158 --- /dev/null +++ b/rabbitmq-server/LICENSE-ISC-cowboy @@ -0,0 +1,13 @@ +Copyright (c) 2011-2017, Loïc Hoguin + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/rabbitmq-server/deps/rabbitmq_management/LICENSE-MIT-EJS10 b/rabbitmq-server/LICENSE-MIT-EJS similarity index 96% rename from rabbitmq-server/deps/rabbitmq_management/LICENSE-MIT-EJS10 rename to rabbitmq-server/LICENSE-MIT-EJS index f3bdcd8..5990a35 100644 --- a/rabbitmq-server/deps/rabbitmq_management/LICENSE-MIT-EJS10 +++ b/rabbitmq-server/LICENSE-MIT-EJS @@ -1,6 +1,6 @@ EJS - Embedded JavaScript -Copyright (c) 2007 Edward Benson +Copyright (c) 2007 Edward Benson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,5 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - diff --git a/rabbitmq-server/LICENSE-MIT-Flot b/rabbitmq-server/LICENSE-MIT-Flot index 67f4625..719da06 100644 --- a/rabbitmq-server/LICENSE-MIT-Flot +++ b/rabbitmq-server/LICENSE-MIT-Flot @@ -1,4 +1,4 @@ -Copyright (c) 2007-2013 IOLA and Ole Laursen +Copyright (c) 2007-2014 IOLA and Ole Laursen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation diff --git a/rabbitmq-server/deps/rabbitmq_management/LICENSE-MIT-Sammy060 b/rabbitmq-server/LICENSE-MIT-Sammy similarity index 99% rename from rabbitmq-server/deps/rabbitmq_management/LICENSE-MIT-Sammy060 rename to rabbitmq-server/LICENSE-MIT-Sammy index 3debf5a..ad77bb8 100644 --- a/rabbitmq-server/deps/rabbitmq_management/LICENSE-MIT-Sammy060 +++ b/rabbitmq-server/LICENSE-MIT-Sammy @@ -20,6 +20,3 @@ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - - diff --git a/rabbitmq-server/deps/rabbitmq_management/LICENSE-MIT-jQuery164 b/rabbitmq-server/LICENSE-MIT-jQuery similarity index 99% rename from rabbitmq-server/deps/rabbitmq_management/LICENSE-MIT-jQuery164 rename to rabbitmq-server/LICENSE-MIT-jQuery index 5a87162..5327046 100644 --- a/rabbitmq-server/deps/rabbitmq_management/LICENSE-MIT-jQuery164 +++ b/rabbitmq-server/LICENSE-MIT-jQuery @@ -18,4 +18,3 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/rabbitmq-server/Makefile b/rabbitmq-server/Makefile index b625864..ee4d61a 100644 --- a/rabbitmq-server/Makefile +++ b/rabbitmq-server/Makefile @@ -210,8 +210,10 @@ clean-unpacked-source-dist: # archive. PACKAGES_SOURCE_DIST_FILE ?= $(firstword $(SOURCE_DIST_FILES)) -packages package-deb package-rpm package-rpm-fedora \ -package-rpm-suse package-windows package-standalone-macosx \ +packages package-deb package-rpm \ +package-rpm-redhat package-rpm-fedora package-rpm-rhel6 package-rpm-rhel7 \ +package-rpm-suse package-rpm-opensuse package-rpm-sles11 \ +package-windows package-standalone-macosx \ package-standalone-linux-x86_64 \ package-standalone-freebsd-x86_64 \ package-generic-unix: $(PACKAGES_SOURCE_DIST_FILE) diff --git a/rabbitmq-server/deps/amqp_client/Makefile b/rabbitmq-server/deps/amqp_client/Makefile index 8314d47..e30586c 100644 --- a/rabbitmq-server/deps/amqp_client/Makefile +++ b/rabbitmq-server/deps/amqp_client/Makefile @@ -49,6 +49,8 @@ DEP_PLUGINS = rabbit_common/mk/rabbitmq-build.mk \ ERLANG_MK_REPO = https://github.com/rabbitmq/erlang.mk.git ERLANG_MK_COMMIT = rabbitmq-tmp +WITHOUT = plugins/proper + include rabbitmq-components.mk include erlang.mk diff --git a/rabbitmq-server/deps/amqp_client/erlang.mk b/rabbitmq-server/deps/amqp_client/erlang.mk index 89ba561..4a24e46 100644 --- a/rabbitmq-server/deps/amqp_client/erlang.mk +++ b/rabbitmq-server/deps/amqp_client/erlang.mk @@ -17,8 +17,8 @@ ERLANG_MK_FILENAME := $(realpath $(lastword $(MAKEFILE_LIST))) export ERLANG_MK_FILENAME -ERLANG_MK_VERSION = 2.0.0-pre.2-256-g2cce185 -ERLANG_MK_WITHOUT = +ERLANG_MK_VERSION = 2.0.0-pre.2-278-gd9a9158 +ERLANG_MK_WITHOUT = plugins/proper # Make 3.81 and 3.82 are deprecated. @@ -2023,6 +2023,14 @@ pkg_ibrowse_fetch = git pkg_ibrowse_repo = https://github.com/cmullaparthi/ibrowse pkg_ibrowse_commit = master +PACKAGES += idna +pkg_idna_name = idna +pkg_idna_description = Erlang IDNA lib +pkg_idna_homepage = https://github.com/benoitc/erlang-idna +pkg_idna_fetch = git +pkg_idna_repo = https://github.com/benoitc/erlang-idna +pkg_idna_commit = master + PACKAGES += ierlang pkg_ierlang_name = ierlang pkg_ierlang_description = An Erlang language kernel for IPython. @@ -2298,9 +2306,9 @@ pkg_kvs_commit = master PACKAGES += lager pkg_lager_name = lager pkg_lager_description = A logging framework for Erlang/OTP. -pkg_lager_homepage = https://github.com/basho/lager +pkg_lager_homepage = https://github.com/erlang-lager/lager pkg_lager_fetch = git -pkg_lager_repo = https://github.com/basho/lager +pkg_lager_repo = https://github.com/erlang-lager/lager pkg_lager_commit = master PACKAGES += lager_amqp_backend @@ -2314,9 +2322,9 @@ pkg_lager_amqp_backend_commit = master PACKAGES += lager_syslog pkg_lager_syslog_name = lager_syslog pkg_lager_syslog_description = Syslog backend for lager -pkg_lager_syslog_homepage = https://github.com/basho/lager_syslog +pkg_lager_syslog_homepage = https://github.com/erlang-lager/lager_syslog pkg_lager_syslog_fetch = git -pkg_lager_syslog_repo = https://github.com/basho/lager_syslog +pkg_lager_syslog_repo = https://github.com/erlang-lager/lager_syslog pkg_lager_syslog_commit = master PACKAGES += lambdapad @@ -3786,9 +3794,9 @@ pkg_trie_commit = master PACKAGES += triq pkg_triq_name = triq pkg_triq_description = Trifork QuickCheck -pkg_triq_homepage = https://github.com/krestenkrab/triq +pkg_triq_homepage = https://github.com/triqng/triq pkg_triq_fetch = git -pkg_triq_repo = https://github.com/krestenkrab/triq +pkg_triq_repo = https://github.com/triqng/triq.git pkg_triq_commit = master PACKAGES += tunctl @@ -4280,7 +4288,7 @@ endef # if given. Do it for all 3 possible Makefile file names. ifeq ($(NO_AUTOPATCH_ERLANG_MK),) define dep_autopatch_erlang_mk - $t for f in Makefile makefile GNUmakefile; do \ + for f in Makefile makefile GNUmakefile; do \ if [ -f $(DEPS_DIR)/$1/$$f ]; then \ sed -i.bak s/'include *erlang.mk'/'include $$(if $$(ERLANG_MK_FILENAME),$$(ERLANG_MK_FILENAME),erlang.mk)'/ $(DEPS_DIR)/$1/$$f; \ fi \ @@ -4357,6 +4365,8 @@ define dep_autopatch_rebar.erl lists:foreach(fun ({d, D}) -> Write("ERLC_OPTS += -D" ++ atom_to_list(D) ++ "=1\n"); + ({d, DKey, DVal}) -> + Write("ERLC_OPTS += -D" ++ atom_to_list(DKey) ++ "=" ++ atom_to_list(DVal) ++ "\n"); ({i, I}) -> Write(["ERLC_OPTS += -I ", I, "\n"]); ({platform_define, Regex, D}) -> @@ -4579,7 +4589,7 @@ define dep_autopatch_appsrc_script.erl AppSrc = "$(call core_native_path,$(DEPS_DIR)/$1/src/$1.app.src)", AppSrcScript = AppSrc ++ ".script", Bindings = erl_eval:new_bindings(), - {ok, Conf} = file:script(AppSrcScript, Bindings), + {ok, [Conf]} = file:script(AppSrcScript, Bindings), ok = file:write_file(AppSrc, io_lib:format("~p.~n", [Conf])), halt() endef @@ -4731,6 +4741,87 @@ ERLANG_MK_RECURSIVE_REL_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-rel-deps-list.log ERLANG_MK_RECURSIVE_TEST_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-test-deps-list.log ERLANG_MK_RECURSIVE_SHELL_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-shell-deps-list.log +# Copyright (c) 2015-2017, Loïc Hoguin +# This file is part of erlang.mk and subject to the terms of the ISC License. + +.PHONY: distclean-kerl + +KERL_INSTALL_DIR ?= $(HOME)/erlang + +ifeq ($(strip $(KERL)),) +KERL := $(ERLANG_MK_TMP)/kerl/kerl +endif + +export KERL + +KERL_GIT ?= https://github.com/kerl/kerl +KERL_COMMIT ?= master + +KERL_MAKEFLAGS ?= + +OTP_GIT ?= https://github.com/erlang/otp + +define kerl_otp_target +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(1)),) +$(KERL_INSTALL_DIR)/$(1): $(KERL) + MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $(1) $(1) + $(KERL) install $(1) $(KERL_INSTALL_DIR)/$(1) +endif +endef + +define kerl_hipe_target +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$1-native),) +$(KERL_INSTALL_DIR)/$1-native: $(KERL) + KERL_CONFIGURE_OPTIONS=--enable-native-libs \ + MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $1 $1-native + $(KERL) install $1-native $(KERL_INSTALL_DIR)/$1-native +endif +endef + +$(KERL): + $(verbose) mkdir -p $(ERLANG_MK_TMP) + $(gen_verbose) git clone --depth 1 $(KERL_GIT) $(ERLANG_MK_TMP)/kerl + $(verbose) cd $(ERLANG_MK_TMP)/kerl && git checkout $(KERL_COMMIT) + $(verbose) chmod +x $(KERL) + +distclean:: distclean-kerl + +distclean-kerl: + $(gen_verbose) rm -rf $(KERL) + +# Allow users to select which version of Erlang/OTP to use for a project. + +ERLANG_OTP ?= +ERLANG_HIPE ?= + +# Use kerl to enforce a specific Erlang/OTP version for a project. +ifneq ($(strip $(ERLANG_OTP)),) +export PATH := $(KERL_INSTALL_DIR)/$(ERLANG_OTP)/bin:$(PATH) +SHELL := env PATH=$(PATH) $(SHELL) +$(eval $(call kerl_otp_target,$(ERLANG_OTP))) + +# Build Erlang/OTP only if it doesn't already exist. +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(ERLANG_OTP))$(BUILD_ERLANG_OTP),) +$(info Building Erlang/OTP $(ERLANG_OTP)... Please wait...) +$(shell $(MAKE) $(KERL_INSTALL_DIR)/$(ERLANG_OTP) ERLANG_OTP=$(ERLANG_OTP) BUILD_ERLANG_OTP=1 >&2) +endif + +else +# Same for a HiPE enabled VM. +ifneq ($(strip $(ERLANG_HIPE)),) +export PATH := $(KERL_INSTALL_DIR)/$(ERLANG_HIPE)-native/bin:$(PATH) +SHELL := env PATH=$(PATH) $(SHELL) +$(eval $(call kerl_hipe_target,$(ERLANG_HIPE))) + +# Build Erlang/OTP only if it doesn't already exist. +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(ERLANG_HIPE))$(BUILD_ERLANG_OTP),) +$(info Building HiPE-enabled Erlang/OTP $(ERLANG_OTP)... Please wait...) +$(shell $(MAKE) $(KERL_INSTALL_DIR)/$(ERLANG_HIPE) ERLANG_HIPE=$(ERLANG_HIPE) BUILD_ERLANG_OTP=1 >&2) +endif + +endif +endif + # Copyright (c) 2015-2016, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. @@ -5966,10 +6057,10 @@ else $(call render_template,bs_erl_nif,src/$n.erl) endif -# Copyright (c) 2015-2016, Loïc Hoguin +# Copyright (c) 2015-2017, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. -.PHONY: ci ci-prepare ci-setup distclean-kerl +.PHONY: ci ci-prepare ci-setup CI_OTP ?= CI_HIPE ?= @@ -5987,24 +6078,9 @@ ifeq ($(strip $(CI_OTP) $(CI_HIPE) $(CI_ERLLVM)),) ci:: else -ifeq ($(strip $(KERL)),) -KERL := $(ERLANG_MK_TMP)/kerl/kerl -endif - -export KERL - -KERL_GIT ?= https://github.com/kerl/kerl -KERL_COMMIT ?= master - -KERL_MAKEFLAGS ?= - -OTP_GIT ?= https://github.com/erlang/otp - -CI_INSTALL_DIR ?= $(HOME)/erlang - ci:: $(addprefix ci-,$(CI_OTP) $(addsuffix -native,$(CI_HIPE)) $(addsuffix -erllvm,$(CI_ERLLVM))) -ci-prepare: $(addprefix $(CI_INSTALL_DIR)/,$(CI_OTP) $(addsuffix -native,$(CI_HIPE))) +ci-prepare: $(addprefix $(KERL_INSTALL_DIR)/,$(CI_OTP) $(addsuffix -native,$(CI_HIPE))) ci-setup:: @@ -6014,10 +6090,10 @@ ci_verbose_0 = @echo " CI " $(1); ci_verbose = $(ci_verbose_$(V)) define ci_target -ci-$1: $(CI_INSTALL_DIR)/$2 +ci-$1: $(KERL_INSTALL_DIR)/$2 $(verbose) $(MAKE) --no-print-directory clean $(ci_verbose) \ - PATH="$(CI_INSTALL_DIR)/$2/bin:$(PATH)" \ + PATH="$(KERL_INSTALL_DIR)/$2/bin:$(PATH)" \ CI_OTP_RELEASE="$1" \ CT_OPTS="-label $1" \ CI_VM="$3" \ @@ -6029,32 +6105,8 @@ $(foreach otp,$(CI_OTP),$(eval $(call ci_target,$(otp),$(otp),otp))) $(foreach otp,$(CI_HIPE),$(eval $(call ci_target,$(otp)-native,$(otp)-native,native))) $(foreach otp,$(CI_ERLLVM),$(eval $(call ci_target,$(otp)-erllvm,$(otp)-native,erllvm))) -define ci_otp_target -ifeq ($(wildcard $(CI_INSTALL_DIR)/$(1)),) -$(CI_INSTALL_DIR)/$(1): $(KERL) - MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $(1) $(1) - $(KERL) install $(1) $(CI_INSTALL_DIR)/$(1) -endif -endef - -$(foreach otp,$(CI_OTP),$(eval $(call ci_otp_target,$(otp)))) - -define ci_hipe_target -ifeq ($(wildcard $(CI_INSTALL_DIR)/$1-native),) -$(CI_INSTALL_DIR)/$1-native: $(KERL) - KERL_CONFIGURE_OPTIONS=--enable-native-libs \ - MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $1 $1-native - $(KERL) install $1-native $(CI_INSTALL_DIR)/$1-native -endif -endef - -$(foreach otp,$(sort $(CI_HIPE) $(CI_ERLLLVM)),$(eval $(call ci_hipe_target,$(otp)))) - -$(KERL): - $(verbose) mkdir -p $(ERLANG_MK_TMP) - $(gen_verbose) git clone --depth 1 $(KERL_GIT) $(ERLANG_MK_TMP)/kerl - $(verbose) cd $(ERLANG_MK_TMP)/kerl && git checkout $(KERL_COMMIT) - $(verbose) chmod +x $(KERL) +$(foreach otp,$(CI_OTP),$(eval $(call kerl_otp_target,$(otp)))) +$(foreach otp,$(sort $(CI_HIPE) $(CI_ERLLLVM)),$(eval $(call kerl_hipe_target,$(otp)))) help:: $(verbose) printf "%s\n" "" \ @@ -6064,10 +6116,6 @@ help:: "The CI_OTP variable must be defined with the Erlang versions" \ "that must be tested. For example: CI_OTP = OTP-17.3.4 OTP-17.5.3" -distclean:: distclean-kerl - -distclean-kerl: - $(gen_verbose) rm -rf $(KERL) endif # Copyright (c) 2013-2016, Loïc Hoguin @@ -6443,7 +6491,7 @@ endif RELX ?= $(ERLANG_MK_TMP)/relx RELX_CONFIG ?= $(CURDIR)/relx.config -RELX_URL ?= https://github.com/erlware/relx/releases/download/v3.19.0/relx +RELX_URL ?= https://github.com/erlware/relx/releases/download/v3.23.0/relx RELX_OPTS ?= RELX_OUTPUT_DIR ?= _rel RELX_REL_EXT ?= @@ -6489,7 +6537,7 @@ distclean-relx-rel: # Run target. ifeq ($(wildcard $(RELX_CONFIG)),) -run: +run:: else define get_relx_release.erl @@ -6513,7 +6561,7 @@ ifeq ($(PLATFORM),msys2) RELX_REL_EXT := .cmd endif -run: all +run:: all $(verbose) $(RELX_OUTPUT_DIR)/$(RELX_REL_NAME)/bin/$(RELX_REL_NAME)$(RELX_REL_EXT) console help:: @@ -6579,7 +6627,10 @@ ifeq ($(filter triq,$(DEPS) $(TEST_DEPS)),triq) tests:: triq define triq_check.erl - code:add_pathsa(["$(call core_native_path,$(CURDIR)/ebin)", "$(call core_native_path,$(DEPS_DIR)/*/ebin)"]), + code:add_pathsa([ + "$(call core_native_path,$(CURDIR)/ebin)", + "$(call core_native_path,$(DEPS_DIR)/*/ebin)", + "$(call core_native_path,$(TEST_DIR))"]), try case $(1) of all -> [true] =:= lists:usort([triq:check(M) || M <- [$(call comma_list,$(3))]]); @@ -6590,7 +6641,7 @@ define triq_check.erl true -> halt(0); _ -> halt(1) catch error:undef -> - io:format("Undefined property or module~n"), + io:format("Undefined property or module?~n~p~n", [erlang:get_stacktrace()]), halt(0) end. endef @@ -6606,7 +6657,8 @@ triq: test-build endif else triq: test-build - $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename $(wildcard ebin/*.beam)))))) + $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename \ + $(wildcard ebin/*.beam) $(call core_find,$(TEST_DIR)/,*.beam)))))) $(gen_verbose) $(call erlang,$(call triq_check.erl,all,undefined,$(MODULES))) endif endif diff --git a/rabbitmq-server/deps/amqp_client/rabbitmq-components.mk b/rabbitmq-server/deps/amqp_client/rabbitmq-components.mk index 1e5d000..5292fa9 100644 --- a/rabbitmq-server/deps/amqp_client/rabbitmq-components.mk +++ b/rabbitmq-server/deps/amqp_client/rabbitmq-components.mk @@ -38,6 +38,8 @@ endif # base of the topic branch. dep_amqp_client = git_rmq rabbitmq-erlang-client $(current_rmq_ref) $(base_rmq_ref) master +dep_amqp10_client = git_rmq rabbitmq-amqp1.0-client $(current_rmq_ref) $(base_rmq_ref) master +dep_amqp10_common = git_rmq rabbitmq-amqp1.0-common $(current_rmq_ref) $(base_rmq_ref) master dep_rabbit = git_rmq rabbitmq-server $(current_rmq_ref) $(base_rmq_ref) master dep_rabbit_common = git_rmq rabbitmq-common $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_amqp1_0 = git_rmq rabbitmq-amqp1.0 $(current_rmq_ref) $(base_rmq_ref) master @@ -63,7 +65,7 @@ dep_rabbitmq_java_client = git_rmq rabbitmq-java-client $(current_r dep_rabbitmq_jms_client = git_rmq rabbitmq-jms-client $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_jms_cts = git_rmq rabbitmq-jms-cts $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_jms_topic_exchange = git_rmq rabbitmq-jms-topic-exchange $(current_rmq_ref) $(base_rmq_ref) master -dep_rabbitmq_lvc = git_rmq rabbitmq-lvc-plugin $(current_rmq_ref) $(base_rmq_ref) master +dep_rabbitmq_lvc_exchange = git_rmq rabbitmq-lvc-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management = git_rmq rabbitmq-management $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management_agent = git_rmq rabbitmq-management-agent $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management_exchange = git_rmq rabbitmq-management-exchange $(current_rmq_ref) $(base_rmq_ref) master @@ -78,6 +80,7 @@ dep_rabbitmq_peer_discovery_common = git_rmq rabbitmq-peer-discovery-common $ dep_rabbitmq_peer_discovery_consul = git_rmq rabbitmq-peer-discovery-consul $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_peer_discovery_etcd = git_rmq rabbitmq-peer-discovery-etcd $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_peer_discovery_k8s = git_rmq rabbitmq-peer-discovery-k8s $(current_rmq_ref) $(base_rmq_ref) master +dep_rabbitmq_random_exchange = git_rmq rabbitmq-random-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_recent_history_exchange = git_rmq rabbitmq-recent-history-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_routing_node_stamp = git_rmq rabbitmq-routing-node-stamp $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_rtopic_exchange = git_rmq rabbitmq-rtopic-exchange $(current_rmq_ref) $(base_rmq_ref) master @@ -107,16 +110,18 @@ dep_rabbitmq_public_umbrella = git_rmq rabbitmq-public-umbrella $(curre # all projects use the same versions. It avoids conflicts and makes it # possible to work with rabbitmq-public-umbrella. -dep_cowboy_commit = 1.0.4 -dep_mochiweb = git git://github.com/basho/mochiweb.git v2.9.0p2 +dep_cowboy = hex 1.0.4 +dep_ranch = hex 1.3.2 +dep_recon = hex 2.3.2 + # Last commit of PropEr supporting Erlang R16B03. dep_proper_commit = 735d972758d8bd85b12483626fe1b66450d6a6fe -dep_ranch_commit = 1.3.2 # Last commit of sockjs support Erlang R16B03 and 17.x. dep_sockjs = git https://github.com/rabbitmq/sockjs-erlang.git 5af2b588c812c318b19bc105b577a759c71c3e0a -dep_webmachine_commit = 1.10.8p2 RABBITMQ_COMPONENTS = amqp_client \ + amqp10_common \ + amqp10_client \ rabbit \ rabbit_common \ rabbitmq_amqp1_0 \ @@ -142,7 +147,7 @@ RABBITMQ_COMPONENTS = amqp_client \ rabbitmq_jms_client \ rabbitmq_jms_cts \ rabbitmq_jms_topic_exchange \ - rabbitmq_lvc \ + rabbitmq_lvc_exchange \ rabbitmq_management \ rabbitmq_management_agent \ rabbitmq_management_exchange \ @@ -157,6 +162,7 @@ RABBITMQ_COMPONENTS = amqp_client \ rabbitmq_peer_discovery_consul \ rabbitmq_peer_discovery_etcd \ rabbitmq_peer_discovery_k8s \ + rabbitmq_random_exchange \ rabbitmq_recent_history_exchange \ rabbitmq_routing_node_stamp \ rabbitmq_rtopic_exchange \ @@ -184,7 +190,7 @@ NO_AUTOPATCH += $(RABBITMQ_COMPONENTS) ifeq ($(origin current_rmq_ref),undefined) ifneq ($(wildcard .git),) current_rmq_ref := $(shell (\ - ref=$$(git branch --list | awk '/^\* \(.*detached / {ref=$$0; sub(/.*detached [^ ]+ /, "", ref); sub(/\)$$/, "", ref); print ref; exit;} /^\* / {ref=$$0; sub(/^\* /, "", ref); print ref; exit}');\ + ref=$$(LANG=C git branch --list | awk '/^\* \(.*detached / {ref=$$0; sub(/.*detached [^ ]+ /, "", ref); sub(/\)$$/, "", ref); print ref; exit;} /^\* / {ref=$$0; sub(/^\* /, "", ref); print ref; exit}');\ if test "$$(git rev-parse --short HEAD)" != "$$ref"; then echo "$$ref"; fi)) else current_rmq_ref := master @@ -194,11 +200,17 @@ export current_rmq_ref ifeq ($(origin base_rmq_ref),undefined) ifneq ($(wildcard .git),) +possible_base_rmq_ref := v3.6.x +ifeq ($(possible_base_rmq_ref),$(current_rmq_ref)) +base_rmq_ref := $(current_rmq_ref) +else base_rmq_ref := $(shell \ - (git rev-parse --verify -q stable >/dev/null && \ - git merge-base --is-ancestor $$(git merge-base master HEAD) stable && \ - echo stable) || \ + (git rev-parse --verify -q master >/dev/null && \ + git rev-parse --verify -q $(possible_base_rmq_ref) >/dev/null && \ + git merge-base --is-ancestor $$(git merge-base master HEAD) $(possible_base_rmq_ref) && \ + echo $(possible_base_rmq_ref)) || \ echo master) +endif else base_rmq_ref := master endif @@ -313,11 +325,16 @@ endif UPSTREAM_RMQ_COMPONENTS_MK = $(DEPS_DIR)/rabbit_common/mk/rabbitmq-components.mk +ifeq ($(PROJECT),rabbit_common) +check-rabbitmq-components.mk: + @: +else check-rabbitmq-components.mk: $(verbose) cmp -s rabbitmq-components.mk \ $(UPSTREAM_RMQ_COMPONENTS_MK) || \ (echo "error: rabbitmq-components.mk must be updated!" 1>&2; \ false) +endif ifeq ($(PROJECT),rabbit_common) rabbitmq-components-mk: diff --git a/rabbitmq-server/deps/amqp_client/src/amqp_client.erl b/rabbitmq-server/deps/amqp_client/src/amqp_client.erl index f7151e7..d3bdec8 100644 --- a/rabbitmq-server/deps/amqp_client/src/amqp_client.erl +++ b/rabbitmq-server/deps/amqp_client/src/amqp_client.erl @@ -31,11 +31,9 @@ start() -> %% %% * https://github.com/rabbitmq/rabbitmq-erlang-client/issues/72 %% * https://github.com/rabbitmq/rabbitmq-common/pull/149 - application:start(syntax_tools), - application:start(compiler), - application:start(xmerl), - application:start(rabbit_common), - application:start(amqp_client). + application:ensure_all_started(rabbit_common), + {ok, _} = application:ensure_all_started(amqp_client), + ok. %%--------------------------------------------------------------------------- %% application callbacks diff --git a/rabbitmq-server/deps/amqp_client/src/amqp_connection.erl b/rabbitmq-server/deps/amqp_client/src/amqp_connection.erl index 65bfc7f..1fd2ee1 100644 --- a/rabbitmq-server/deps/amqp_client/src/amqp_connection.erl +++ b/rabbitmq-server/deps/amqp_client/src/amqp_connection.erl @@ -201,8 +201,9 @@ ensure_started() -> ensure_started(App) -> case is_pid(application_controller:get_master(App)) andalso amqp_sup:is_ready() of true -> ok; - false -> case application:start(App) of + false -> case application:ensure_all_started(App) of ok -> ok; + {ok, _} -> ok; {error, {already_started, App}} -> ok; {error, _} = E -> throw(E) end diff --git a/rabbitmq-server/deps/cowboy/CHANGELOG.md b/rabbitmq-server/deps/cowboy/CHANGELOG.md deleted file mode 100644 index 117333b..0000000 --- a/rabbitmq-server/deps/cowboy/CHANGELOG.md +++ /dev/null @@ -1,915 +0,0 @@ -CHANGELOG -========= - -1.0.4 ------ - - * Fix a crash when using iolist() as payload for some Websocket frames - -1.0.3 ------ - - * Add CircleCI for automated testing across all supported Erlang versions - - * Only send the Connection header when necessary - - * Send Connection: keep-alive when HTTP/1.0 connections are kept open - - * Fix a typo in a return value of cowboy_http:asctime_date - - * Fix Dialyzer warnings in cowboy_clock - -1.0.2 ------ - - * Fix cowboy_clock inbox overflow when system clock changes (but see 1.0.3) - - * Fix stacktrace shown on REST handler crashes - - * Reply with 400 on if-match and if-not-match parsing crash - - * Improve static_world example by adding index.html file - -1.0.1 ------ - - * Add missing cowboy_req:part/2 export - - * Fix an issue building dependencies on FreeBSD - - * Improve support for requests with an absolute URI - - * Small fixes to the documentation - -1.0.0 ------ - - * Drop R15 support - - * Update erlang.mk, Ranch and Cowlib to 1.0.0 - - * Complete the user guide and simplify the Getting started chapter - - * Document the HTTP status codes Cowboy may send in the manual - - * Provide installable man pages (see README) - - * Support ad-hoc keep-alive for HTTP/1.0 clients - - * Fix SPDY parsing error when many frames were received in one packet - - * Reply with 400 instead of 422 in cowboy_rest - - * Reply with 400 instead of 500 on header parsing crash - - * Remove deprecated body reading interface (see 0.10.0 notes) - -0.10.0 ------- - - * Update Ranch to 0.10 and Cowlib to 0.6.2 - - * Update the body reading API to allow controlling rate of transfer - - The lack of this feature was causing various timeout issues - in some environments. - - The body/2 function now takes a Req and a list of options. The older - interface can still be used until Cowboy 1.0. - - The body_qs/2, part/2 and part_body/2 also accept this list of - options, and pass it down to the body/2 call. The default options - vary between the different functions. - - The return value of the function has changed. Older code should work - without modification but you should definitely still test it. - - All functions appropriately decode transfer and content encoding. - There is no need to have a special case for that anymore. - - The body/1,2 function supports streaming, with the same interface - as the part_body/1,2 function. - - * Deprecate the cowboy_req:init_stream, stream_body and skip_body functions - - They will be removed in Cowboy 1.0. - - * Add support for multipart - - The cowboy_req:part/1,2 and cowboy_req:part_body/1,2 can be - used for reading a multipart body. - - Documentation has been added. - - The old undocumented multipart functions were removed. - - * Allow the onresponse hook to override only status and headers - - Previously it wasn't possible to override them without also - overriding the body. The new return value is currently marked - as experimental. - - * Make loop handlers work with SPDY - - * Fix a race condition with loop handlers and keepalive requests - - * Fix parsing of accept-language header - - * Fix parsing of authorization header with empty passwords - - * Fix multiline headers handling - - * Various optimizations - - All code that is moved to cowlib is optimized at the same time - and benchmarks get added for all functions. - - The parsing of connection, content-length and transfer-encoding - has been optimized. - - Chunked transfer decoding has been optimized. - - * Enable +warn_missing_spec by default and fix specs - - * Remove the non-documented cowboy_client module; use gun instead - - * Numerous documentation updates and tweaks - - The guide now has a REST principles chapter and revised - and completed Websocket chapters, alongside a new multipart chapter. - - * Add a multipart file upload example - - * Test suites are being reworked and greatly improved - * Test Cowboy across all releases from R15B01 to 17.0, plus maint and master - * The Autobahn test suite is now always ran (as long as it's installed) - * Expected error reports are now silenced (but still logged) - * Applications are now only started once from a ct hook - -0.9.0 ------ - - * Update Ranch to 0.9.0 - - * SPDY is no longer experimental and is documented - - The SPDY development has been sponsored by the LeoFS project. - - * Review, improve and document cowboy_static - * Much simplified configuration - * Etag generation is now enabled by default - * Web mimetypes are now detected by default - * Optionally a huge list of mimetypes can also be used - * It not try to magically find the priv directory anymore, use ERL_LIBS - - * Remove the pretty printing of errors - - Cowboy will no longer print errors, it will instead let the process - crash properly, so that links can work with Cowboy. Ranch will catch - errors and print a one-liner containing all the error information - instead. - - * Trigger a human readable error when routes lack the starting slash - - * Add websocket_compress metadata - - * Fix parsing of hosts given as IPv6 addresses - - * Fix the decoding of chunked bodies - - * Fix handling of close, ping and pong Websocket replies - - * Fix the x-webkit-deflate-frame Websocket extension - - * Fix PUT behavior in cowboy_rest when creating a resource at the request URL - - * Fix warnings with the reltool GUI - - * Start moving code in a new dependency, cowlib - - The code moved there is mostly parsing code and utility functions. - Most of it was in the undocumented cowboy_http module before. - - * Optimize cookie date building and query string building/parsing - - * Great number of improvements and additions to the user guide - - * Convert all examples to releases using the erlang.mk+relx combo - - Some examples have also been fixed or slightly improved. - The elixir example is now on a separate repository maintained - independently. More examples in this language exist in that - other repository. - -0.8.6 ------ - - * Make sure Cowboy compiles on R16B01 - - * Update Ranch to 0.8.4 - - * Add experimental support for the x-webkit-deflate-frame Websocket extension - - This allows Cowboy to handle compressed Websocket frames, - lowering the amount of data that needs to be sent over the - socket. - - The extension will only be used if compression was enabled - using the `compress` protocol option. - - * Add experimental SPDY support - - SPDY is a new protocol implemented by most browsers. It is - the basis for what will become HTTP/2.0. - - To use SPDY, you need to call `start_spdy` where you would - have used `start_https` before. - - This protocol is still incomplete. It cannot accept request - bodies yet, making most methods other than GET and HEAD - not too useful at this point. - - * Allow an empty method list in allowed_methods - - * The charset parameter of content-types is now always lowercase - - * Don't overwrite the stacktrace when a REST handler crashes - - * Don't crash when the Cookie header is empty - - * Don't crash on invalid Accept-Encoding header when replying - -0.8.5 ------ - - * Add the Cowboy Function Reference - - Everything documented in the function reference is the API - that will make it to Cowboy 1.0. - - * Use erlang.mk - - The project is of course still compatible with rebar - and can be used as a dependency just fine. - - * Update Ranch to 0.8.3 - - * Remove cowboy_req:fragment/1 - - No well-written client is sending the fragment with the URL. - - * Add cowboy_req:set_resp_body_fun(chunked, Fun, Req) - - * Improve various typespecs - - * Change the return value of cowboy_req:version/1 - - We now have 'HTTP/1.1' instead of {1, 1} and 'HTTP/1.0' - instead of {1, 0}. - - * Change the return value of REST accept callbacks - - The Path return value becomes {true, Path}. - - * Change the return value of REST charsets_provided/2 - - It was incorrectly expecting a list of tuples instead of - a list of charsets. - - * Move various types to the cowboy module - * cowboy_http:version() to cowboy:http_version() - * cowboy_http:headers() to cowboy:http_headers() - * cowboy_http:status() to cowboy:http_status() - * cowboy_protocol:onrequest_fun() to cowboy:onrequest_fun() - * cowboy_protocol:onresponse_fun() to cowboy:onresponse_fun() - - * Add type cowboy_protocol:opts() - - * Fix a REST bug with the OPTIONS method - - * Fix a REST bug where iso-8859-1 would be incoditionally selected - -0.8.4 ------ - - * Cookie names are now back to being case sensitive - - This should be more in line with what browsers do and what - users would expect. - - * REST is no longer experimental and is documented - - * REST behavior fixed when used with the POST method - - Removes process_post, post_is_create, create_path, created_path - callbacks. It is up to the resource accept callback to decide - what to do when the POST method is used. Depending on the return - value Cowboy will determine if the resource was created or not. - - * Removes the put_path meta value in REST - - * Fix an issue in REST with the PATCH method - - Content-types were not normalized as expected, preventing the - use of the binary form for content-types. - - * Add default operations for the OPTIONS method in REST - - The default will be to set the Allow header in the response - based on the return value from allowed_methods. - - * Add default content_types_provided "text/html" maps to to_html - - This allows non-HEAD/GET methods to work without defining - the callback explicitly. - - * Reject invalid content-types explicitly in REST - - * Don't accept TRACE or CONNECT methods by default in REST - - * Remove cowboy_req:peer_addr/1 - - Because each server's proxy situation differs, it is better - that this function is implemented by the application directly. - - The X-Forwarded-For header can now be parsed using - cowboy_req:parse_header/2. - - * Switch the arguments to cowboy_req:stream_body/2 - - They were in the wrong order compared to the rest of the module. - - * Add parser for the Range header - - * Do not crash if connection times out while sending a file using sendfile - - * Ensure we can fetch the body in the info/3 function of loop handlers - - * Update Ranch to 0.8.1 - - * Reorganize and optimize the test suites - -0.8.3 ------ - - * Remove init_stream/5, add stream_body/2 - - It's better to allow configuring the streamed chunk size on - a per chunk basis. Also easier to use. - - * Update Ranch to 0.8.0 - - Much faster. Also improved stability. - -0.8.2 ------ - - * Add error_hook and ssl_hello_world example - - * Greatly improve the performance of body reading operations - - The streamed chunk size is now configurable through the new - function cowboy_req:init_stream/5. - - * Add cowboy_req:body/2 and cowboy_req:body_qs/2 - - These functions take an additional argument indicating the - maximum size of the body. They will return {error, badlength} - if the size is too large, or {error, chunked} if the body - was sent using the chunked Transfer-Encoding and its size - cannot be determined. - - The function body/1 is now an alias to body/2 with a maximum - body size of 8MB. Likewise, the function body_qs/1 is an alias - of body_qs/2 with a maximum body size of 16KB. - - * Properly handle explicit identity Transfer-Encoding in body_length/1 - - * Small but noticeable performance improvement in the critical path - - We stopped using binary:match/2 in favor of custom functions. - This makes Cowboy 0.5ms faster per request. - - * Prevent loop handlers from awakening after sending a response - - * Optimize cowboy_static initialization code - - * Make path checks in cowboy_static cross-platform - - * Allow '*' for REST content types parameters in content_types_provided - - * Fix cowboy_router types - - * Update Ranch to 0.6.2; adds support for two new SSL options - - * Improve documentation - -0.8.1 ------ - - * Add eventsource, web_server examples; improve rest_pastebin example - - * Add cowboy:set_env/3 to more conveniently update the dispatch list - - * Add cowboy_sub_protocol behaviour - - * Fix cowboy_req:has_body/1 when Content-Length == 0 - - * Fix passing of state to websocket_terminate/3 on server close - - * Fix compilation with +native - - * Compile with more warnings enabled by default; fix warnings - - * Set the socket in passive mode after the loop handler terminates - - * Improve typespecs - -0.8.0 ------ - - * This release drops R14 compatibility - - Behaviours now use the -callback attribute which is supported only - since R15B. - - * Add a user guide - - * Add or update many examples - - Add basic_auth, compress_response, cookie, elixir_hello_world, - markdown_middleware, rest_pastebin, rest_stream_response - and websocket examples. - - Rename the static example to static_world for clarity. - - * Add CONTRIBUTING.md file - - * Use Ranch 0.6.1 for connection handling - - To start listeners you can now use cowboy:start_http/4 for HTTP, - and cowboy:start_https/4 for HTTPS. The proper transport and - protocol modules will be used. - - * Add protection against slowloris vulnerability - - This protection is always enabled and has no impact on the performance - of the system. - - * Add a better routing syntax - - * If a binding is used twice in routing, values must now be identical - - * Add support for a configurable chain of middlewares - - Routing and handling are now two separate middlewares that can be - replaced as needed. - - * Fix application dependencies - - The crypto application must be started before Cowboy. - - The inets application is no longer needed. A few functions from - that application were used by mistake in the REST code. - - * Shorten the name of many modules - * cowboy_http_protocol becomes cowboy_protocol - * cowboy_http_req becomes cowboy_req - * cowboy_http_rest becomes cowboy_rest - * cowboy_http_static becomes cowboy_static - * cowboy_http_websocket becomes cowboy_websocket - - * Introduce the cowboy_req:req() opaque type - - The include/http.hrl file was removed. Users are expected to use - the cowboy_req API to access or modify the Req object. - - This required a lot of changes so cleanup and optimizations were - performed where possible. - - * Add many cowboy_req functions - * cowboy_req:delete_resp_header/2 deletes a previously set resp header - * cowboy_req:set_meta/3 sets metadata in the Req object - * cowboy_req:to_list/1 converts the Req object to a list of key/values - * cowboy_req:fragment/1 returns the request URL fragment - * cowboy_req:host_url/1 returns the request URL without the path or qs - * cowboy_req:url/1 returns the full request URL - * cowboy_req:set_resp_body_fun/2 for body streaming with no known length - - * Improve the body streaming interface in cowboy_req - - The function now receives the Transport and Socket directly as arguments. - - * Rename or drop many cowboy_req functions - * cowboy_req:raw_host/1 becomes cowboy_req:host/1, old function dropped - * cowboy_req:raw_path/1 becomes cowboy_req:path/1, old function dropped - * cowboy_req:raw_qs/1 becomes cowboy_req:qs/1 - * Remove cowboy_req:body/2 - * Remove cowboy_req:transport/1 - - * Change the signature of many cowboy_req functions - * parse_header now returns {ok, any(), Req} instead of {any(), Req} - * body_qs now returns {ok, QsVals, Req} instead of {QsVals, Req} - * multipart_data now returns {headers, Headers, Req} instead of - {{headers, Headers}, Req} and {body, Body, Req} instead of - {{body, Body}, Req} - * set_resp_* functions now return Req instead of {ok, Req} - * has_body now returns boolean() - - * Rewrote cookie code - - In short we now do the same thing as PHP when setting cookies. This - allows us to be fairly confident that our code will work on the vast - majority of browsers. - - * Fix consistency issues caused by erlang:decode_packet/3 - * The method is now always a case sensitive binary string - * Note that standard method names are uppercase (e.g. <<"GET">>) - * Header names are now always lowercase binary string - - * The max_line_length cowboy_protocol option was replaced by 3 new options: - * max_request_line_length, defaults to 4096 bytes - * max_header_name_length, defaults to 64 bytes - * max_header_value_length, defaults to 4096 bytes - - * Add max_headers option, limiting the number of headers; defaults to 100 - - * The max_keepalive option now defaults to 100 instead of infinity - - * Change terminate/2 to terminate/3 in the HTTP handler interface - - * Enhance the loop handler API - * Connection close is now better detected - * Fix an internal message leak - - * Enhance the Websocket API - * Change a websocket error from {error, protocol} to {error, badframe} - * Allow websocket handlers to reply more than one frame - * Check for errors when calling Transport:send/2 to avoid crashes - * Add close, {close, Payload}, {close, StatusCode, Payload}, - ping, pong frame types for replies - * Ensure websocket_terminate is always called - * Improve timeout handling - * Remove support for the old hixie76 protocol - * Add parsing support for Sec-Websocket-Protocol - * Check for UTF-8 correctness of text frames - * Perform unmasking and UTF-8 validation on the fly - * Reject clients that send unmasked frames - * Add cowboy_websocket:close_code/0 type - - * Enhance the REST API - * Fix charset handling - * Add PATCH support - * Add created_path callback, used if create_path was not defined - * Make sure rest_terminate is always called - - * Improved HTTP standard compatibility - * Revised status code used in responses - * Implement authorization header parsing - * Add opt-in automatic response body compression - - * Improve lager compatibility - - We format errors in a special way so that lager can recognize Cowboy - errors and put them on a single line. - - * Remove the urldecode cowboy_protocol option - - * Add cowboy_protocol:onrequest_fun/0 and :onresponse_fun/0 types - - * Add the body data to onresponse_fun/0 callback - - * Avoid a duplicate HTTP reply in cowboy_websocket:upgrade_error/1 - - * Fix use of the Vary header, was named Variances in the previous code - - * Improve returned status code for HTTP and REST - - * Fix charsets_provided return value - - * Allow passing {M, F} for the mimetype function to cowboy_static - - * Can now upgrade protocols with {upgrade, protocol, P, Req, Opts} - - * Cowboy now only expects universal time, never local time - - * Do not try skipping the body if the connection is to be closed - - * Add cowboy_bstr:to_upper/1, cowboy_bstr:capitalize_token/1 - - * Many, many optimizations for the most critical code path - -0.6.1 ------ - - * Add hello_world, rest_hello_world, chunked_hello_world, - echo_get, echo_post and static examples. - - * Add support for the "Expect: 100-continue" header. - - * Keep the original 'Host' header value instead of modifying it. - - * Fix use of parsed headers cache. - - * REST: fix the matching of charsets. - - * REST: allow <<"type/subtype">> format for content_types_accepted. - - * Improve typespecs. - -0.6.0 ------ - - * Add multipart support - - * Add chunked transfer decoding support - - Done by reworking the body reading API. Now all the body - reading goes through the cowboy_http_req:stream_body/1 - function. This function takes care of handling both the - Transfer-Encoding and the Content-Encoding, returning - properly decoded data ready for consumption. - - * Add fragmented websocket messages support - - Properly tested by the addition of the Autobahn websocket - test suite to our toolbox. All tests pass except a few - related to UTF-8 handling, as Cowboy does no checks on that - end at this point. - - * Add 'onrequest' and 'onresponse' hooks - - The first can be used for all the special cases you may have - that can't be dealt with otherwise. It's also pretty good for - writing access logs or rewriting URLs. - - The second can be used for logging errors or replacing error - pages, amongst others. - - * Add cowboy:get_protocol_options/1 and cowboy:set_protocol_options/2 - - These functions allow for retrieving a listener's protocol options, - and for modifying them while the listener is running. This is - most useful to upgrade the dispatch list. The upgrade applies - to all the future connections. - - * Add the sockname/1 function to TCP and SSL transports - - * Improve SSL transport support - - Add support for specifying the ciphers. Add CA support. Make - specifying the password optional. - - * Add new HTTP status codes from RFC 6585 - - * Add a 'file' option to cowboy_http_static - - This allows for mapping /folder/ paths to a /folder/index.html file. - - * Add the '*' catch all Content-Type for REST - - * Add {halt, Req, State} as a possible return value for REST - - * Add absolute URI support for requests - - * Add cowboy_http:x_www_form_urlencoded/2 - - * Various REST bug fixes - - * Do not send chunked replies for HTTP/1.0 connections - - * Fix a DST bug in the cookies code - - * Fix a bug with setting cookie values containing slashes - - * Fix a small timer leak when using loop/websocket timeouts - - * Make charset and media type parsing more relaxed - - This is to accomodate some widely used broken clients. - - * Make error messages more readable - - * Fix and improve type specifications - - * Fix a bug preventing documentation from being generated - - * Small improvements to the documentation - - * Rework the HTTP test suite - - The suite now uses an integrated Cowboy HTTP client. The client - is currently experimental and shouldn't be used. - - * Add many many tests. - -0.4.0 ------ - - * Set the cowboy_listener process priority to high - - As it is the central process used by all incoming requests - we need to set its priority to high to avoid timeouts that - would happen otherwise when reaching a huge number of - concurrent requests. - - * Add cowboy:child_spec/6 for embedding in other applications - - * Add cowboy_http_rest, an experimental REST protocol support - - Based on the Webmachine diagram and documentation. It is a - new implementation, not a port, therefore a few changes have - been made. However all the callback names are the same and - should behave similarly to Webmachine. - - There is currently no documentation other than the Webmachine - resource documentation and the comments found in cowboy_http_rest, - which itself should be fairly easy to read and understand. - - * Add cowboy_http_static, an experimental static file handler - - Makes use of the aforementioned REST protocol support to - deliver files with proper content type and cache headers. - - Note that this uses the new file:sendfile support when - appropriate, which currently requires the VM to be started - with the +A option defined, else errors may randomly appear. - - * Add cowboy_bstr module for binary strings related functions - - * Add cowboy_http module for HTTP parsing functions - - This module so far contains various functions for HTTP header - parsing along with URL encoding and decoding. - - * Remove quoted from the default dependencies - - This should make Cowboy much easier to compile and use by default. - It is of course still possible to use quoted as your URL decoding - library in Cowboy thanks to the newly added urldecode option. - - * Fix supervisor spec for non dynamic modules to allow upgrades to complete - - * Add cowboy:accept_ack/1 for a cleaner handling of the shoot message - - Before, when the listener accepted a connection, the newly created - process was waiting for a message containing the atom 'shoot' before - proceeding. This has been replaced by the cowboy:accept_ack/1 function. - - This function should be used where 'shoot' was received because the - contents of the message have changed (and could change again in the - distant future). - - * Update binary parsing expressions to avoid hype crashes - - More specifically, /bits was replaced by /binary. - - * Rename the type cowboy_dispatcher:path_tokens/0 to tokens/0 - - * Remove the cowboy_clock:date/0, time/0 and datetime/0 types - - The calendar module exports those same types properly since R14B04. - - * Add cacertfile configuration option to cowboy_ssl_transport - - * Add cowboy_protocol behaviour - - * Remove -Wbehaviours dialyzer option unavailable in R15B - - * Many tests and specs improvements - -### cowboy_http_req - - * Fix a crash when reading the request body - - * Add parse_header/2 and parse_header/3 - - The following headers can now be semantically parsed: Connection, Accept, - Accept-Charset, Accept-Encoding, Accept-Language, Content-Length, - Content-Type, If-Match, If-None-Match, If-Modified-Since, - If-Unmodified-Since, Upgrade - - * Add set_resp_header/3, set_resp_cookie/4 and set_resp_body/2 - - These functions allow handlers to set response headers and body - without having to reply directly. - - * Add set_resp_body_fun/3 - - This function allows handlers to stream the body of the response - using the given fun. The size of the response must be known beforehand. - - * Add transport/1 to obtain the transport and socket for the request - - This allows handlers to have low-level socket access in those cases - where they do need it, like when streaming a response body with - set_resp_body_fun/3. - - * Add peer_addr/1 - - This function tries to guess the real peer IP based on the HTTP - headers received. - - * Add meta/2 and meta/3 to save useful protocol information - - Currently used to save the Websocket protocol version currently used, - and to save request information in the REST protocol handler. - - * Add reply/2 and reply/3 aliases to reply/4 - - * Add upgrade_reply/3 for protocol upgrades - -### cowboy_http_protocol - - * Add the {urldecode, fun urldecode/2} option - - Added when quoted was removed from the default build. Can be used to - tell Cowboy to use quoted or any other URL decoding routine. - - * Add the max_keepalive option - - * Add the max_line_length option - - * Allow HTTP handlers to stop during init/3 - - To do so they can return {shutdown, Req, State}. - - * Add loops support in HTTP handlers for proper long-polling support - - A loop can be entered by returning either of {loop, Req, State}, - {loop, Req, State, hibernate}, {loop, Req, State, Timeout} or - {loop, Req, State, Timeout, hibernate} from init/3. - - Loops are useful when we cannot reply immediately and instead - are waiting for an Erlang message to be able to complete the request, - as would typically be done for long-polling. - - Loop support in the protocol means that timeouts and hibernating - are well tested and handled so you can use those options without - worrying. It is recommended to set the timeout option. - - When a loop is started, handle/2 will never be called so it does - not need to be defined. When the request process receives an Erlang - message, it will call the info/3 function with the message as the - first argument. - - Like in OTP, you do need to set timeout and hibernate again when - returning from info/3 to enable them until the next call. - - * Fix the sending of 500 errors when handlers crash - - Now we send an error response when no response has been sent, - and do nothing more than close the connection if anything - did get sent. - - * Fix a crash when the server is sent HTTP responses - - * Fix HTTP timeouts handling when the Request-Line wasn't received - - * Fix the handling of the max number of empty lines between requests - - * Fix the handling of HEAD requests - - * Fix HTTP/1.0 Host header handling - - * Reply status 400 if we receive an unexpected value or error for headers - - * Properly close when the application sends "Connection: close" header - - * Close HTTP connections on all errors - - * Improve the error message for HTTP handlers - -### cowboy_http_websocket - - * Add websocket support for all versions up to RFC 6455 - - Support isn't perfect yet according to the specifications, but - is working against all currently known client implementations. - - * Allow websocket_init/3 to return with the hibernate option set - - * Add {shutdown, Req} return value to websocket_init/3 to fail an upgrade - - * Fix websocket timeout handling - - * Fix error messages: wrong callback name was reported on error - - * Fix byte-by-byte websocket handling - - * Fix an issue when using hixie-76 with certain proxies - - * Fix a crash in the hixie-76 handshake - - * Fix the handshake when SSL is used on port 443 - - * Fix a crash in the handshake when cowboy_http_req:compact/1 is used - - * Fix handshake when a query string is present - - * Fix a crash when the Upgrade header contains more than one token - -0.2.0 ------ - - * Initial release. diff --git a/rabbitmq-server/deps/cowboy/CONTRIBUTING.md b/rabbitmq-server/deps/cowboy/CONTRIBUTING.md deleted file mode 100644 index 7bc005b..0000000 --- a/rabbitmq-server/deps/cowboy/CONTRIBUTING.md +++ /dev/null @@ -1,173 +0,0 @@ -Contributing -============ - -Introduction ------------- - -This document describes the usages and rules to follow when contributing -to this project. - -It uses the uppercase keywords SHOULD for optional but highly recommended -conditions and MUST for required conditions. - -`git` is a distributed source code versioning system. This document refers -to three different repositories hosting the source code of the project. -`Your local copy` refers to the copy of the repository that you have on -your computer. The remote repository `origin` refers to your fork of the -project's repository that you can find in your GitHub account. The remote -repository `upstream` refers to the official repository for this project. - -Following this document will ensure prompt merging of your work in the -`master` branch of the project. - -Reporting bugs --------------- - -Upon identifying a bug or a DoS vulnerability, you SHOULD submit a ticket, -regardless of your plans for fixing it. If you plan to fix the bug, you -SHOULD discuss your plans to avoid having your work rejected. - -Upon identifying a security vulnerability in Erlang/OTP that leaves Cowboy -vulnerable to attack, you SHOULD consult privately with the Erlang/OTP team -to get the issue resolved. - -Upon identifying a security vulnerability in Cowboy's `cowboy_static` module, -you SHOULD submit a ticket, regardless of your plans for fixing it. Please -ensure that all necessary details to reproduce are listed. You then SHOULD -inform users on the mailing list about the issue, advising that they use -another means for sending static files until the issue is resolved. - -Upon identifying a security vulnerability in any other part of Cowboy, you -SHOULD contact us directly by email. Please ensure that all necessary details -to reproduce are listed. - -Before implementing a new feature, you SHOULD submit a ticket for discussion -on your plans. The feature might have been rejected already, or the -implementation might already be decided. - -Cloning -------- - -You MUST fork the project's repository to your GitHub account by clicking -on the `Fork` button. - -Then, from your fork's page, copy the `Git Read-Only` URL to your clipboard. -You MUST perform the following commands in the folder you choose, replacing -`$URL` by the URL you just copied, `$UPSTREAM_URL` by the `Git Read-Only` -project of the official repository, and `$PROJECT` by the name of this project. - -``` bash -$ git clone "$URL" -$ cd $PROJECT -$ git remote add upstream $UPSTREAM_URL -``` - -Branching ---------- - -Before starting working on the code, you MUST update to `upstream`. The -project is always evolving, and as such you SHOULD always strive to keep -up to date when submitting patches to make sure they can be merged without -conflicts. - -To update the current branch to `upstream`, you can use the following commands. - -``` bash -$ git fetch upstream -$ git rebase upstream/master -``` - -It may ask you to stash your changes, in which case you stash with: - -``` bash -$ git stash -``` - -And put your changes back in with: - -``` bash -$ git stash pop -``` - -You SHOULD use these commands both before working on your patch and before -submitting the pull request. If conflicts arise it is your responsability -to deal with them. - -You MUST create a new branch for your work. First, ensure you are on `master`. -You MUST update `master` to `upstream` before doing anything. Then create a -new branch `$BRANCH` and switch to it. - -``` bash -$ git checkout -b $BRANCH -``` - -You MUST use a an insightful branch name. - -If you later need to switch back to an existing branch `$BRANCH`, you can use: - -``` bash -$ git checkout $BRANCH -``` - -Source editing --------------- - -The following rules MUST be followed: - * Indentation uses horizontal tabs (1 tab = 4 columns) - * Do NOT align code; only indentation is allowed - * Lines MUST NOT span more than 80 columns - -The following rules SHOULD be followed: - * Write small functions whenever possible - * Avoid having too many clauses containing clauses containing clauses - -Committing ----------- - -You MUST ensure that all commits pass all tests and do not have extra -Dialyzer warnings. - -Running tests is fairly straightforward. Note that you need at least -Erlang/OTP R16B01 for the SSL tests to run. - -``` bash -make tests -``` - -Running Dialyzer requires some initial setup. You need to build the PLT -file that Dialyzer will use for its analysis. This is a one-time operation. -Dialyzer will take care of updating that file when needed. - -``` bash -make build-plt -``` - -Once that is done, you can run Dialyzer. - -``` bash -make dialyze -``` - -You MUST put all the related work in a single commit. Fixing a bug is one -commit, adding a feature is one commit, adding two features is two commits. - -You MUST write a proper commit title and message. The commit title MUST be -at most 72 characters; it is the first line of the commit text. The second -line of the commit text MUST be left blank. The third line and beyond is the -commit message. You SHOULD write a commit message. If you do, you MUST make -all lines smaller than 80 characters. You SHOULD explain what the commit -does, what references you used and any other information that helps -understanding your work. - -Submitting the pull request ---------------------------- - -You MUST push your branch `$BRANCH` to GitHub, using the following command: - -``` bash -$ git push origin $BRANCH -``` - -You MUST then submit the pull request by using the GitHub interface. -You SHOULD provide an explanatory message and refer to any previous ticket -related to this patch. diff --git a/rabbitmq-server/deps/cowboy/ROADMAP.md b/rabbitmq-server/deps/cowboy/ROADMAP.md deleted file mode 100644 index db94461..0000000 --- a/rabbitmq-server/deps/cowboy/ROADMAP.md +++ /dev/null @@ -1,127 +0,0 @@ -ROADMAP -======= - -This document explains in as much details as possible the -list of planned changes and work to be done on the Cowboy -server. It is intended to be exhaustive but some elements -might still be missing. - -2.0 (R17 and R18) ------------------ - -The main features that will be added to Cowboy 2.0 are support -for HTTP/2.0 and Websocket permessage deflate compression. - -A complete analysis of the httpbis set of specifications -will be performed and extensive tests will be written to -ensure maximum compatibility. - -A number of backward incompatible changes are planned. These -changes are individually small, but together should result -in a large improvement in usability. - -### cowboy_req - -The interface of `cowboy_req` will be largely changed. The -number one complaint about Cowboy today is that you have -to keep track of the Req whenever you do anything. The new -interface will minimize that. - -All functions will return a single term, excluding the body -reading functions `body/{1,2}`, `body_qs/{1,2}`, `part/{1,2}`, -`part_body/{1,2}`. - -Of the functions returning a single term, some of them will -return a Req object. This includes the functions that already -return Req: `compact/1`, `delete_resp_header/2`, `set_meta/3`, -`set_resp_body/2`, `set_resp_body_fun/{2,3}`, `set_resp_cookie/4`, -`set_resp_header/3`, and adds the `chunked_reply/{2,3}` and -`reply/{2,3,4}` functions to the list. - -Of note is that this will allow chaining all the response -functions if that's what you fancy. - -The `parse_header/{2,3}` function will now only return the -parsed header value, and crash on error. It will also not -cache the parsed value anymore, except for headers that Cowboy -requires, like the connection header. - -It is unsure what will become of the `qs_val`, `qs_vals`, -`cookie` and `cookies` functions. The main idea at this point -is to replace them with a `parse_qs/2` and `parse_cookies/2` -that would return the parsed list, and let the user decide -how to access it. - -### init/terminate unification - -The first argument of the `init/3` function is too rarely used. -It will be removed. - -The return value of the `init/2` function will become -`{http, Req, State} | {loop, Req, State} | {Module, Req, State}` -with `Module` being `cowboy_rest`, `cowboy_websocket` or a -user provided module. - -The `rest_init` and `websocket_init` callbacks will be removed -as they become unnecessary with the new `init/2` interface. - -Similarly, the `rest_terminate` and `websocket_terminate` -callbacks will be removed in favor of a unified `terminate/3`. - -The `terminate/3` callback will become optional. - -### Middlewares - -The error tuple return value brings little value compared to -the halt tuple. The error tuple will therefore be removed. - -### Hooks - -The `onrequest` hook will be removed. It can easily be replaced -by a middleware. - -The interface of the `onresponse` hook will change. There has -been a number of issues and added complexity with the current -interface that warrant fixing. The main problem is that the -hook may be used to change the reply, by calling the reply -function again, forcing us to be careful not to reprocess -everything again. - -To fix that, we will cut the reply mechanism in two steps, -one that is basically some preprocessing of the response -header to follow the protocol requirements, and then the -actual response. The `onresponse` hook will fit in the -middle, being called from the first step and calling the -second step itself. - -If a body streaming function is provided, the hook will -also receive it (unlike today). It will not be able to -inspect its contents however. - -This should greatly simplify the code and allow users to -do any operation they wish. - -### Low-level interface documented - -A special chapter of the manual will document a low-level -interface that may be used in middlewares or hooks (but -nowhere else). This includes the Req access and update -functions and the new response function described above. - -### REST - -The `known_content_type` callback has no purpose, so it -is going to be removed. - -The documentation for all REST callbacks will be updated -to describe whether they can have side effects. This will -allows us to build introspection tools on top of a working -REST API. - -Range support will be added. - -Under consideration -------------------- - - * Convenience API for extracting query string and body - information, similar to PHP's $_GET, $_POST and $_FILES diff --git a/rabbitmq-server/deps/cowboy/all.sh b/rabbitmq-server/deps/cowboy/all.sh deleted file mode 100755 index 32b8302..0000000 --- a/rabbitmq-server/deps/cowboy/all.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -KERL_INSTALL_PATH=~/erlang -KERL_RELEASES="r16b01 r16b02 r16b03-1 17.0 17.1.2" - -make build-ct-suites - -for rel in $KERL_RELEASES -do - echo - echo " TESTING $rel" - echo - . $KERL_INSTALL_PATH/$rel/activate - cp ~/.kerl/builds/$rel/otp_src_*/lib/ssl/test/erl_make_certs.erl \ - deps/ct_helper/src/ - CT_OPTS="-label $rel" make tests -done - -xdg-open logs/all_runs.html diff --git a/rabbitmq-server/deps/cowboy/circle.yml b/rabbitmq-server/deps/cowboy/circle.yml deleted file mode 100644 index c18b8f8..0000000 --- a/rabbitmq-server/deps/cowboy/circle.yml +++ /dev/null @@ -1,23 +0,0 @@ -general: - artifacts: - - "logs" - -dependencies: - cache_directories: - - "~/.kerl" - - "~/erlang" - - pre: - - sudo pip install autobahntestsuite - - sudo apt-get update - - sudo apt-get install autoconf2.59 - - cd $HOME/bin && ln -s /usr/bin/autoconf2.59 autoconf - - cd $HOME/bin && ln -s /usr/bin/autoheader2.59 autoheader - - make ci-prepare: - timeout: 7200 - -test: - override: - - source $HOME/erlang/OTP-18.0.2/activate && make dialyze - - make -k ci: - timeout: 3600 diff --git a/rabbitmq-server/deps/licensing/LICENSE-APACHE2 b/rabbitmq-server/deps/licensing/LICENSE-APACHE2 new file mode 100644 index 0000000..7036191 --- /dev/null +++ b/rabbitmq-server/deps/licensing/LICENSE-APACHE2 @@ -0,0 +1,204 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2007-2013 VMware, Inc. + Copyright 2011 Jon Brisbin. + Copyright 2013-2017 Pivotal Software, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/rabbitmq-server/deps/licensing/LICENSE-APACHE2-excanvas b/rabbitmq-server/deps/licensing/LICENSE-APACHE2-excanvas new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/rabbitmq-server/deps/licensing/LICENSE-APACHE2-excanvas @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/rabbitmq-server/deps/licensing/LICENSE-BSD-recon b/rabbitmq-server/deps/licensing/LICENSE-BSD-recon new file mode 100644 index 0000000..be0aebb --- /dev/null +++ b/rabbitmq-server/deps/licensing/LICENSE-BSD-recon @@ -0,0 +1,27 @@ +Copyright (c) 2012-2017, Frédéric Trottier-Hébert +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + The names of its contributors may not be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/rabbitmq-server/deps/licensing/LICENSE-ISC-cowboy b/rabbitmq-server/deps/licensing/LICENSE-ISC-cowboy new file mode 100644 index 0000000..9d28158 --- /dev/null +++ b/rabbitmq-server/deps/licensing/LICENSE-ISC-cowboy @@ -0,0 +1,13 @@ +Copyright (c) 2011-2017, Loïc Hoguin + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/rabbitmq-server/deps/licensing/LICENSE-MIT-EJS b/rabbitmq-server/deps/licensing/LICENSE-MIT-EJS new file mode 100644 index 0000000..5990a35 --- /dev/null +++ b/rabbitmq-server/deps/licensing/LICENSE-MIT-EJS @@ -0,0 +1,21 @@ +EJS - Embedded JavaScript + +Copyright (c) 2007 Edward Benson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/rabbitmq-server/deps/licensing/LICENSE-MIT-Flot b/rabbitmq-server/deps/licensing/LICENSE-MIT-Flot index 67f4625..719da06 100644 --- a/rabbitmq-server/deps/licensing/LICENSE-MIT-Flot +++ b/rabbitmq-server/deps/licensing/LICENSE-MIT-Flot @@ -1,4 +1,4 @@ -Copyright (c) 2007-2013 IOLA and Ole Laursen +Copyright (c) 2007-2014 IOLA and Ole Laursen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation diff --git a/rabbitmq-server/deps/licensing/LICENSE-MIT-Sammy b/rabbitmq-server/deps/licensing/LICENSE-MIT-Sammy new file mode 100644 index 0000000..ad77bb8 --- /dev/null +++ b/rabbitmq-server/deps/licensing/LICENSE-MIT-Sammy @@ -0,0 +1,22 @@ +Copyright (c) 2008 Aaron Quint, Quirkey NYC, LLC + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/rabbitmq-server/deps/licensing/LICENSE-MIT-jQuery b/rabbitmq-server/deps/licensing/LICENSE-MIT-jQuery new file mode 100644 index 0000000..5327046 --- /dev/null +++ b/rabbitmq-server/deps/licensing/LICENSE-MIT-jQuery @@ -0,0 +1,20 @@ +Copyright (c) 2011 John Resig, http://jquery.com/ + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/rabbitmq-server/deps/licensing/license_info_rabbitmq_management b/rabbitmq-server/deps/licensing/license_info_rabbitmq_management deleted file mode 100644 index eabe119..0000000 --- a/rabbitmq-server/deps/licensing/license_info_rabbitmq_management +++ /dev/null @@ -1,17 +0,0 @@ -jQuery is "Copyright (c) 2010 John Resig" and is covered by the MIT -license. It was downloaded from http://jquery.com/ - -EJS is "Copyright (c) 2007 Edward Benson" and is covered by the MIT -license. It was downloaded from http://embeddedjs.com/ - -Sammy is "Copyright (c) 2008 Aaron Quint, Quirkey NYC, LLC" and is -covered by the MIT license. It was downloaded from -http://code.quirkey.com/sammy/ - -ExplorerCanvas is "Copyright 2006 Google Inc" and is covered by the -Apache License version 2.0. It was downloaded from -http://code.google.com/p/explorercanvas/ - -Flot is "Copyright (c) 2007-2013 IOLA and Ole Laursen" and is covered -by the MIT license. It was downloaded from -http://www.flotcharts.org/ diff --git a/rabbitmq-server/deps/rabbit/.travis.yml.patch b/rabbitmq-server/deps/rabbit/.travis.yml.patch new file mode 100644 index 0000000..9e6e46a --- /dev/null +++ b/rabbitmq-server/deps/rabbit/.travis.yml.patch @@ -0,0 +1,11 @@ +--- .travis.yml.orig 2017-11-08 14:23:22.036394000 +0100 ++++ .travis.yml 2017-11-08 15:26:19.264520000 +0100 +@@ -37,7 +37,7 @@ + + script: + - make xref +- - make tests ++ - make ct-fast + + after_failure: + - | diff --git a/rabbitmq-server/deps/rabbit/Makefile b/rabbitmq-server/deps/rabbit/Makefile index 46de9c6..2f91e3f 100644 --- a/rabbitmq-server/deps/rabbit/Makefile +++ b/rabbitmq-server/deps/rabbit/Makefile @@ -12,7 +12,7 @@ define PROJECT_ENV {tcp_listeners, [5672]}, {num_tcp_acceptors, 10}, {ssl_listeners, []}, - {num_ssl_acceptors, 1}, + {num_ssl_acceptors, 10}, {ssl_options, []}, {vm_memory_high_watermark, 0.4}, {vm_memory_high_watermark_paging_ratio, 0.5}, @@ -25,6 +25,7 @@ define PROJECT_ENV %% breaks the QPid Java client {frame_max, 131072}, {channel_max, 0}, + {connection_max, infinity}, {heartbeat, 60}, {msg_store_file_size_limit, 16777216}, {fhc_write_buffering, true}, @@ -114,7 +115,7 @@ define PROJECT_ENV ] endef -LOCAL_DEPS = sasl mnesia os_mon xmerl +LOCAL_DEPS = sasl mnesia os_mon DEPS = ranch rabbit_common TEST_DEPS = rabbitmq_ct_helpers rabbitmq_ct_client_helpers amqp_client meck proper @@ -149,6 +150,24 @@ ERLANG_MK_COMMIT = rabbitmq-tmp include rabbitmq-components.mk include erlang.mk +ifeq ($(strip $(BATS)),) +BATS := $(ERLANG_MK_TMP)/bats/bin/bats +endif + +BATS_GIT ?= https://github.com/sstephenson/bats +BATS_COMMIT ?= v0.4.0 + +$(BATS): + $(verbose) mkdir -p $(ERLANG_MK_TMP) + $(gen_verbose) git clone --depth 1 --branch=$(BATS_COMMIT) $(BATS_GIT) $(ERLANG_MK_TMP)/bats + +.PHONY: bats + +bats: $(BATS) + $(verbose) $(BATS) $(TEST_DIR) + +tests:: bats + SLOW_CT_SUITES := backing_queue \ cluster_rename \ clustering_management \ diff --git a/rabbitmq-server/deps/rabbit/docs/rabbitmq-server.service.example b/rabbitmq-server/deps/rabbit/docs/rabbitmq-server.service.example index 1aa6549..f1ab926 100644 --- a/rabbitmq-server/deps/rabbit/docs/rabbitmq-server.service.example +++ b/rabbitmq-server/deps/rabbit/docs/rabbitmq-server.service.example @@ -10,9 +10,18 @@ User=rabbitmq Group=rabbitmq NotifyAccess=all TimeoutStartSec=3600 +# Note: +# You *may* wish to add the following to automatically restart RabbitMQ +# in the event of a failure. systemd service restarts are not a +# replacement for service monitoring. Please see +# http://www.rabbitmq.com/monitoring.html +# +# Restart=on-failure +# RestartSec=10 WorkingDirectory=/var/lib/rabbitmq ExecStart=/usr/lib/rabbitmq/bin/rabbitmq-server ExecStop=/usr/lib/rabbitmq/bin/rabbitmqctl stop +ExecStop=/bin/sh -c "while ps -p $MAINPID >/dev/null 2>&1; do sleep 1; done" [Install] WantedBy=multi-user.target diff --git a/rabbitmq-server/deps/rabbit/docs/rabbitmq.config.example b/rabbitmq-server/deps/rabbit/docs/rabbitmq.config.example index 141e737..990ffcc 100644 --- a/rabbitmq-server/deps/rabbit/docs/rabbitmq.config.example +++ b/rabbitmq-server/deps/rabbit/docs/rabbitmq.config.example @@ -2,14 +2,16 @@ %% ---------------------------------------------------------------------------- %% RabbitMQ Sample Configuration File. %% -%% See http://www.rabbitmq.com/configure.html for details. +%% Related doc guide: http://www.rabbitmq.com/configure.html. See +%% http://rabbitmq.com/documentation.html for documentation ToC. %% ---------------------------------------------------------------------------- [ {rabbit, [%% - %% Network Connectivity + %% Networking %% ==================== %% + %% Related doc guide: http://www.rabbitmq.com/networking.html. %% By default, RabbitMQ will listen on all interfaces, using %% the standard (reserved) AMQP port. @@ -22,38 +24,43 @@ %% {tcp_listeners, [{"127.0.0.1", 5672}, %% {"::1", 5672}]}, - %% SSL listeners are configured in the same fashion as TCP listeners, + %% TLS listeners are configured in the same fashion as TCP listeners, %% including the option to control the choice of interface. %% %% {ssl_listeners, [5671]}, %% Number of Erlang processes that will accept connections for the TCP - %% and SSL listeners. + %% and TLS listeners. %% %% {num_tcp_acceptors, 10}, %% {num_ssl_acceptors, 1}, %% Maximum time for AMQP 0-8/0-9/0-9-1 handshake (after socket connection - %% and SSL handshake), in milliseconds. + %% and TLS handshake), in milliseconds. %% %% {handshake_timeout, 10000}, - %% Log levels (currently just used for connection logging). - %% One of 'debug', 'info', 'warning', 'error' or 'none', in decreasing - %% order of verbosity. Defaults to 'info'. + %% Log levels in decreasing order of verbosity: + %% * 'debug' + %% * 'info' + %% * 'warning' + %% * 'error' + %% * 'none' + %% Defaults to '{connection, info}' %% - %% {log_levels, [{connection, info}, {channel, info}]}, + %% {log_levels, [{channel, info}, {connection, info}, {federation, info}, {mirroring, info}]}, %% Set to 'true' to perform reverse DNS lookups when accepting a %% connection. Hostnames will then be shown instead of IP addresses %% in rabbitmqctl and the management plugin. %% - %% {reverse_dns_lookups, true}, + %% {reverse_dns_lookups, false}, %% - %% Security / AAA - %% ============== + %% Security, Access Control + %% ======================== %% + %% Related doc guide: http://www.rabbitmq.com/access-control.html. %% The default "guest" user is only permitted to access the server %% via a loopback interface (e.g. localhost). @@ -63,8 +70,10 @@ %% guest user from anywhere on the network. %% {loopback_users, []}, - %% Configuring SSL. - %% See http://www.rabbitmq.com/ssl.html for full documentation. + + %% TLS configuration. + %% + %% Related doc guide: http://www.rabbitmq.com/ssl.html. %% %% {ssl_options, [{cacertfile, "/path/to/testca/cacert.pem"}, %% {certfile, "/path/to/server/cert.pem"}, @@ -77,7 +86,7 @@ %% 'AMQPLAIN'. Additional mechanisms can be added via %% plugins. %% - %% See http://www.rabbitmq.com/authentication.html for more details. + %% Related doc guide: http://www.rabbitmq.com/authentication.html. %% %% {auth_mechanisms, ['PLAIN', 'AMQPLAIN']}, @@ -90,10 +99,10 @@ %% rabbitmq_auth_backend_ldap plugins. %% %% NB: These options require that the relevant plugin is enabled. - %% See http://www.rabbitmq.com/plugins.html for further details. + %% Related doc guide: http://www.rabbitmq.com/plugins.html for further details. %% The RabbitMQ-auth-mechanism-ssl plugin makes it possible to - %% authenticate a user based on the client's SSL certificate. + %% authenticate a user based on the client's TLS certificate. %% %% To use auth-mechanism-ssl, add to or replace the auth_mechanisms %% list with the entry 'EXTERNAL'. @@ -118,14 +127,19 @@ %% https://github.com/rabbitmq/rabbitmq-auth-mechanism-ssl for further %% details. %% - %% To use the SSL cert's CN instead of its DN as the username + %% To use the TLS cert's CN instead of its DN as the username %% - %% {ssl_cert_login_from, common_name}, + %% {ssl_cert_login_from, distinguished_name}, - %% SSL handshake timeout, in milliseconds. + %% TLS handshake timeout, in milliseconds. %% %% {ssl_handshake_timeout, 5000}, + %% Makes RabbitMQ accept SSLv3 client connections by default. + %% DO NOT DO THIS IF YOU CAN HELP IT. + %% + %% {ssl_allow_poodle_attack, false}, + %% Password hashing implementation. Will only affect newly %% created users. To recalculate hash for an existing user %% it's necessary to update her password. @@ -133,7 +147,7 @@ %% {password_hashing_module, rabbit_password_hashing_sha256}, %% Configuration entry encryption. - %% See http://www.rabbitmq.com/configure.html#configuration-encryption + %% Related doc guide: http://www.rabbitmq.com/configure.html#configuration-encryption %% %% To specify the passphrase in the configuration file: %% @@ -170,8 +184,7 @@ %% Tags for default user %% - %% For more details about tags, see the documentation for the - %% Management Plugin at http://www.rabbitmq.com/management.html. + %% Related doc guide: http://www.rabbitmq.com/management.html. %% %% {default_user_tags, [administrator]}, @@ -180,7 +193,14 @@ %% ===================================================== %% - %% Set the default AMQP heartbeat delay (in seconds). + %% Sets the default AMQP 0-9-1 heartbeat timeout in seconds. + %% Values lower than 6 can produce false positives and are not + %% recommended. + %% + %% Related doc guides: + %% + %% * http://www.rabbitmq.com/heartbeats.html + %% * http://www.rabbitmq.com/networking.html %% %% {heartbeat, 60}, @@ -196,12 +216,30 @@ %% Set the max permissible number of channels per connection. %% 0 means "no limit". %% - %% {channel_max, 128}, + %% {channel_max, 0}, - %% Customising Socket Options. + %% Set the max permissible number of client connections to the node. + %% `infinity` means "no limit". + %% + %% This limit applies to client connections to all listeners (regardless of + %% the protocol, whether TLS is used and so on). CLI tools and inter-node + %% connections are exempt. %% - %% See (http://www.erlang.org/doc/man/inet.html#setopts-2) for - %% further documentation. + %% When client connections are rapidly opened in succession, it is possible + %% for the total connection count to go slightly higher than the configured limit. + %% The limit works well as a general safety measure. + %% + %% Clients that are hitting the limit will see their TCP connections fail or time out. + %% + %% Introduced in 3.6.13. + %% + %% Related doc guide: http://www.rabbitmq.com/networking.html. + %% + %% {connection_max, infinity}, + + %% TCP socket options. + %% + %% Related doc guide: http://www.rabbitmq.com/networking.html. %% %% {tcp_listen_options, [{backlog, 128}, %% {nodelay, true}, @@ -211,7 +249,7 @@ %% Resource Limits & Flow Control %% ============================== %% - %% See http://www.rabbitmq.com/memory.html for full details. + %% Related doc guide: http://www.rabbitmq.com/memory.html, http://www.rabbitmq.com/memory-use.html. %% Memory-based Flow Control threshold. %% @@ -251,6 +289,11 @@ %% %% {vm_memory_high_watermark_paging_ratio, 0.5}, + %% Selects Erlang VM memory consumption calculation strategy. Can be `allocated`, `rss` or `legacy` (aliased as `erlang`), + %% Introduced in 3.6.11. `rss` is the default as of 3.6.12. + %% See https://github.com/rabbitmq/rabbitmq-server/issues/1223 and rabbitmq/rabbitmq-common#224 for background. + %% {vm_memory_calculation_strategy, rss}, + %% Interval (in milliseconds) at which we perform the check of the memory %% levels against the watermarks. %% @@ -283,19 +326,41 @@ %% NB: Change these only if you understand what you are doing! %% - %% To announce custom properties to clients on connection: + %% Queue master location strategy: + %% * <<"min-masters">> + %% * <<"client-local">> + %% * <<"random">> + %% + %% Related doc guide: https://www.rabbitmq.com/ha.html#queue-master-location + %% + %% {queue_master_locator, <<"client-local">>}, + + %% Batch size (number of messages) used during eager queue mirror synchronisation. + %% Related doc guide: https://www.rabbitmq.com/ha.html#batch-sync. When average message size is relatively large + %% (say, 10s of kilobytes or greater), reducing this value will decrease peak amount + %% of RAM used by newly joining nodes that need eager synchronisation. + %% + %% {mirroring_sync_batch_size, 4096}, + + %% Enables flow control between queue mirrors. + %% Disabling this can be dangerous and is not recommended. + %% When flow control is disablied, queue masters can outpace mirrors and not allow mirrors to catch up. + %% Mirrors will end up using increasingly more RAM, eventually triggering a memory alarm. + %% + %% {mirroring_flow_control, true}, + + %% Additional server properties to announce to connecting clients. %% %% {server_properties, []}, %% How to respond to cluster partitions. - %% See http://www.rabbitmq.com/partitions.html for further details. + %% Related doc guide: http://www.rabbitmq.com/partitions.html %% %% {cluster_partition_handling, ignore}, %% Make clustering happen *automatically* at startup - only applied %% to nodes that have just been reset or started for the first time. - %% See http://www.rabbitmq.com/clustering.html#auto-config for - %% further details. + %% Related doc guide: http://www.rabbitmq.com/clustering.html#auto-config %% %% {cluster_nodes, {['rabbit@my.host.com'], disc}}, @@ -314,39 +379,122 @@ %% %% {collect_statistics_interval, 5000}, - %% Explicitly enable/disable hipe compilation. + %% Enables vhosts tracing. %% - %% {hipe_compile, true}, + %% {trace_vhosts, []}, - %% Number of times to retry while waiting for Mnesia tables in a cluster to - %% become available. + %% Explicitly enable/disable HiPE compilation. + %% + %% {hipe_compile, false}, + + %% Number of delegate processes to use for intra-cluster communication. + %% On a node which is part of cluster, has more than 16 cores and plenty of network bandwidth, + %% it may make sense to increase this value. + %% + %% {delegate_count, 16}, + + %% Number of times to retry while waiting for internal database tables (Mnesia tables) to sync + %% from a peer. In deployments where nodes can take a long time to boot, this value + %% may need increasing. %% %% {mnesia_table_loading_retry_limit, 10}, - %% Time to wait per retry for Mnesia tables in a cluster to become - %% available. + %% Amount of time in milliseconds which this node will wait for internal database tables (Mnesia tables) to sync + %% from a peer. In deployments where nodes can take a long time to boot, this value + %% may need increasing. %% %% {mnesia_table_loading_retry_timeout, 30000}, - %% Size in bytes below which to embed messages in the queue index. See - %% http://www.rabbitmq.com/persistence-conf.html + %% Size in bytes below which to embed messages in the queue index. + %% Related doc guide: http://www.rabbitmq.com/persistence-conf.html %% %% {queue_index_embed_msgs_below, 4096}, + %% Maximum number of queue index entries to keep in journal + %% Related doc guide: http://www.rabbitmq.com/persistence-conf.html. + %% + %% {queue_index_max_journal_entries, 32768}, + + %% Number of credits that a queue process is given by the message store + %% By default, a queue process is given 4000 message store credits, + %% and then 800 for every 800 messages that it processes. + %% + %% {msg_store_credit_disc_bound, {4000, 800}}, + + %% Minimum number of messages with their queue position held in RAM required + %% to trigger writing their queue position to disk. + %% + %% This value MUST be higher than the initial msg_store_credit_disc_bound value, + %% otherwise paging performance may worsen. + %% + %% {msg_store_io_batch_size, 4096}, + + %% Number of credits that a connection, channel or queue are given. + %% + %% By default, every connection, channel or queue is given 400 credits, + %% and then 200 for every 200 messages that it sends to a peer process. + %% Increasing these values may help with throughput but also can be dangerous: + %% high credit flow values are no different from not having flow control at all. + %% + %% Related doc guide: https://www.rabbitmq.com/blog/2015/10/06/new-credit-flow-settings-on-rabbitmq-3-5-5/ + %% and http://alvaro-videla.com/2013/09/rabbitmq-internals-credit-flow-for-erlang-processes.html. + %% + %% {credit_flow_default_credit, {400, 200}}, + + %% Number of milliseconds before a channel operation times out. + %% + %% {channel_operation_timeout, 15000}, + + %% Number of queue operations required to trigger an explicit garbage collection. + %% Increasing this value may reduce CPU load and increase peak RAM consumption of queues. + %% + %% {queue_explicit_gc_run_operation_threshold, 1000}, + + %% Number of lazy queue operations required to trigger an explicit garbage collection. + %% Increasing this value may reduce CPU load and increase peak RAM consumption of lazy queues. + %% + %% {lazy_queue_explicit_gc_run_operation_threshold, 1000}, + + %% Number of times disk monitor will retry free disk space queries before + %% giving up. + %% + %% {disk_monitor_failure_retries, 10}, + + %% Milliseconds to wait between disk monitor retries on failures. + %% + %% {disk_monitor_failure_retry_interval, 120000}, + %% Whether or not to enable background GC. %% %% {background_gc_enabled, false}, - %% + %% Interval (in milliseconds) at which we run background GC. %% - %% {background_gc_target_interval, 60000} + %% {background_gc_target_interval, 60000}, + + %% Message store operations are stored in a sequence of files called segments. + %% This controls max size of a segment file. + %% Increasing this value may speed up (sequential) disk writes but will slow down segment GC process. + %% DO NOT CHANGE THIS for existing installations. + %% + %% {msg_store_file_size_limit, 16777216}, + + %% Whether or not to enable file write buffering. + %% + %% {fhc_write_buffering, true}, + + %% Whether or not to enable file read buffering. Enabling + %% this may slightly speed up reads but will also increase + %% node's memory consumption, in particular on boot. + %% + %% {fhc_read_buffering, false} ]}, %% ---------------------------------------------------------------------------- %% Advanced Erlang Networking/Clustering Options. %% - %% See http://www.rabbitmq.com/clustering.html for details + %% Related doc guide: http://www.rabbitmq.com/clustering.html %% ---------------------------------------------------------------------------- {kernel, [%% Sets the net_kernel tick time. @@ -359,22 +507,22 @@ %% ---------------------------------------------------------------------------- %% RabbitMQ Management Plugin %% - %% See http://www.rabbitmq.com/management.html for details + %% Related doc guide: http://www.rabbitmq.com/management.html %% ---------------------------------------------------------------------------- {rabbitmq_management, - [%% Pre-Load schema definitions from the following JSON file. See + [%% Preload schema definitions from a previously exported definitions file. See %% http://www.rabbitmq.com/management.html#load-definitions %% - %% {load_definitions, "/path/to/schema.json"}, + %% {load_definitions, "/path/to/exported/definitions.json"}, - %% Log all requests to the management HTTP API to a file. + %% Log all requests to the management HTTP API to a directory. %% - %% {http_log_dir, "/path/to/access.log"}, + %% {http_log_dir, "/path/to/rabbitmq/logs/http"}, %% Change the port on which the HTTP listener listens, %% specifying an interface for the web server to bind to. - %% Also set the listener to use SSL and provide SSL options. + %% Also set the listener to use TLS and provide TLS options. %% %% {listener, [{port, 12345}, %% {ip, "127.0.0.1"}, @@ -401,7 +549,7 @@ %% ---------------------------------------------------------------------------- %% RabbitMQ Shovel Plugin %% - %% See http://www.rabbitmq.com/shovel.html for details + %% Related doc guide: http://www.rabbitmq.com/shovel.html %% ---------------------------------------------------------------------------- {rabbitmq_shovel, @@ -467,9 +615,9 @@ ]}, %% ---------------------------------------------------------------------------- - %% RabbitMQ Stomp Adapter + %% RabbitMQ STOMP Plugin %% - %% See http://www.rabbitmq.com/stomp.html for details + %% Related doc guide: http://www.rabbitmq.com/stomp.html %% ---------------------------------------------------------------------------- {rabbitmq_stomp, @@ -479,18 +627,18 @@ %% {tcp_listeners, [{"127.0.0.1", 61613}, %% {"::1", 61613}]}, - %% Listen for SSL connections on a specific port. + %% Listen for TLS connections on a specific port. %% {ssl_listeners, [61614]}, %% Number of Erlang processes that will accept connections for the TCP - %% and SSL listeners. + %% and TLS listeners. %% %% {num_tcp_acceptors, 10}, %% {num_ssl_acceptors, 1}, - %% Additional SSL options + %% Additional TLS options - %% Extract a name from the client's certificate when using SSL. + %% Extract a name from the client's certificate when using TLS. %% %% {ssl_cert_login, true}, @@ -503,21 +651,21 @@ %% {default_user, [{login, "guest"}, %% {passcode, "guest"}]}, - %% If a default user is configured, or you have configured use SSL client + %% If a default user is configured, or you have configured use TLS client %% certificate based authentication, you can choose to allow clients to %% omit the CONNECT frame entirely. If set to true, the client is %% automatically connected as the default user or user supplied in the - %% SSL certificate whenever the first frame sent on a session is not a + %% TLS certificate whenever the first frame sent on a session is not a %% CONNECT frame. %% %% {implicit_connect, true} ]}, %% ---------------------------------------------------------------------------- - %% RabbitMQ MQTT Adapter + %% RabbitMQ MQTT Plugin + %% + %% Related doc guide: https://github.com/rabbitmq/rabbitmq-mqtt/blob/stable/README.md %% - %% See https://github.com/rabbitmq/rabbitmq-mqtt/blob/stable/README.md - %% for details %% ---------------------------------------------------------------------------- {rabbitmq_mqtt, @@ -554,28 +702,34 @@ %% %% {prefetch, 10}, - %% TCP/SSL Configuration (as per the broker configuration). + %% TLS listeners. + %% See http://www.rabbitmq.com/networking.html %% %% {tcp_listeners, [1883]}, %% {ssl_listeners, []}, %% Number of Erlang processes that will accept connections for the TCP - %% and SSL listeners. + %% and TLS listeners. + %% See http://www.rabbitmq.com/networking.html %% %% {num_tcp_acceptors, 10}, %% {num_ssl_acceptors, 1}, - %% TCP/Socket options (as per the broker configuration). + %% TCP socket options. + %% See http://www.rabbitmq.com/networking.html %% - %% {tcp_listen_options, [{backlog, 128}, - %% {nodelay, true}]} + %% {tcp_listen_options, [ + %% {backlog, 128}, + %% {linger, {true, 0}}, + %% {exit_on_close, false} + %% ]}, ]}, %% ---------------------------------------------------------------------------- %% RabbitMQ AMQP 1.0 Support %% - %% See https://github.com/rabbitmq/rabbitmq-amqp1.0/blob/stable/README.md - %% for details + %% Related doc guide: https://github.com/rabbitmq/rabbitmq-amqp1.0/blob/stable/README.md + %% %% ---------------------------------------------------------------------------- {rabbitmq_amqp1_0, @@ -595,7 +749,7 @@ %% ---------------------------------------------------------------------------- %% RabbitMQ LDAP Plugin %% - %% See http://www.rabbitmq.com/ldap.html for details. + %% Related doc guide: http://www.rabbitmq.com/ldap.html. %% %% ---------------------------------------------------------------------------- @@ -610,7 +764,7 @@ %% %% {servers, ["your-server-name-goes-here"]}, - %% Connect to the LDAP server using SSL + %% Connect to the LDAP server using TLS %% %% {use_ssl, false}, diff --git a/rabbitmq-server/deps/rabbit/erlang.mk b/rabbitmq-server/deps/rabbit/erlang.mk index 89ba561..1a45ad1 100644 --- a/rabbitmq-server/deps/rabbit/erlang.mk +++ b/rabbitmq-server/deps/rabbit/erlang.mk @@ -17,7 +17,7 @@ ERLANG_MK_FILENAME := $(realpath $(lastword $(MAKEFILE_LIST))) export ERLANG_MK_FILENAME -ERLANG_MK_VERSION = 2.0.0-pre.2-256-g2cce185 +ERLANG_MK_VERSION = 2.0.0-pre.2-278-gd9a9158 ERLANG_MK_WITHOUT = # Make 3.81 and 3.82 are deprecated. @@ -2023,6 +2023,14 @@ pkg_ibrowse_fetch = git pkg_ibrowse_repo = https://github.com/cmullaparthi/ibrowse pkg_ibrowse_commit = master +PACKAGES += idna +pkg_idna_name = idna +pkg_idna_description = Erlang IDNA lib +pkg_idna_homepage = https://github.com/benoitc/erlang-idna +pkg_idna_fetch = git +pkg_idna_repo = https://github.com/benoitc/erlang-idna +pkg_idna_commit = master + PACKAGES += ierlang pkg_ierlang_name = ierlang pkg_ierlang_description = An Erlang language kernel for IPython. @@ -2298,9 +2306,9 @@ pkg_kvs_commit = master PACKAGES += lager pkg_lager_name = lager pkg_lager_description = A logging framework for Erlang/OTP. -pkg_lager_homepage = https://github.com/basho/lager +pkg_lager_homepage = https://github.com/erlang-lager/lager pkg_lager_fetch = git -pkg_lager_repo = https://github.com/basho/lager +pkg_lager_repo = https://github.com/erlang-lager/lager pkg_lager_commit = master PACKAGES += lager_amqp_backend @@ -2314,9 +2322,9 @@ pkg_lager_amqp_backend_commit = master PACKAGES += lager_syslog pkg_lager_syslog_name = lager_syslog pkg_lager_syslog_description = Syslog backend for lager -pkg_lager_syslog_homepage = https://github.com/basho/lager_syslog +pkg_lager_syslog_homepage = https://github.com/erlang-lager/lager_syslog pkg_lager_syslog_fetch = git -pkg_lager_syslog_repo = https://github.com/basho/lager_syslog +pkg_lager_syslog_repo = https://github.com/erlang-lager/lager_syslog pkg_lager_syslog_commit = master PACKAGES += lambdapad @@ -3786,9 +3794,9 @@ pkg_trie_commit = master PACKAGES += triq pkg_triq_name = triq pkg_triq_description = Trifork QuickCheck -pkg_triq_homepage = https://github.com/krestenkrab/triq +pkg_triq_homepage = https://github.com/triqng/triq pkg_triq_fetch = git -pkg_triq_repo = https://github.com/krestenkrab/triq +pkg_triq_repo = https://github.com/triqng/triq.git pkg_triq_commit = master PACKAGES += tunctl @@ -4280,7 +4288,7 @@ endef # if given. Do it for all 3 possible Makefile file names. ifeq ($(NO_AUTOPATCH_ERLANG_MK),) define dep_autopatch_erlang_mk - $t for f in Makefile makefile GNUmakefile; do \ + for f in Makefile makefile GNUmakefile; do \ if [ -f $(DEPS_DIR)/$1/$$f ]; then \ sed -i.bak s/'include *erlang.mk'/'include $$(if $$(ERLANG_MK_FILENAME),$$(ERLANG_MK_FILENAME),erlang.mk)'/ $(DEPS_DIR)/$1/$$f; \ fi \ @@ -4357,6 +4365,8 @@ define dep_autopatch_rebar.erl lists:foreach(fun ({d, D}) -> Write("ERLC_OPTS += -D" ++ atom_to_list(D) ++ "=1\n"); + ({d, DKey, DVal}) -> + Write("ERLC_OPTS += -D" ++ atom_to_list(DKey) ++ "=" ++ atom_to_list(DVal) ++ "\n"); ({i, I}) -> Write(["ERLC_OPTS += -I ", I, "\n"]); ({platform_define, Regex, D}) -> @@ -4579,7 +4589,7 @@ define dep_autopatch_appsrc_script.erl AppSrc = "$(call core_native_path,$(DEPS_DIR)/$1/src/$1.app.src)", AppSrcScript = AppSrc ++ ".script", Bindings = erl_eval:new_bindings(), - {ok, Conf} = file:script(AppSrcScript, Bindings), + {ok, [Conf]} = file:script(AppSrcScript, Bindings), ok = file:write_file(AppSrc, io_lib:format("~p.~n", [Conf])), halt() endef @@ -4731,6 +4741,87 @@ ERLANG_MK_RECURSIVE_REL_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-rel-deps-list.log ERLANG_MK_RECURSIVE_TEST_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-test-deps-list.log ERLANG_MK_RECURSIVE_SHELL_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-shell-deps-list.log +# Copyright (c) 2015-2017, Loïc Hoguin +# This file is part of erlang.mk and subject to the terms of the ISC License. + +.PHONY: distclean-kerl + +KERL_INSTALL_DIR ?= $(HOME)/erlang + +ifeq ($(strip $(KERL)),) +KERL := $(ERLANG_MK_TMP)/kerl/kerl +endif + +export KERL + +KERL_GIT ?= https://github.com/kerl/kerl +KERL_COMMIT ?= master + +KERL_MAKEFLAGS ?= + +OTP_GIT ?= https://github.com/erlang/otp + +define kerl_otp_target +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(1)),) +$(KERL_INSTALL_DIR)/$(1): $(KERL) + MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $(1) $(1) + $(KERL) install $(1) $(KERL_INSTALL_DIR)/$(1) +endif +endef + +define kerl_hipe_target +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$1-native),) +$(KERL_INSTALL_DIR)/$1-native: $(KERL) + KERL_CONFIGURE_OPTIONS=--enable-native-libs \ + MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $1 $1-native + $(KERL) install $1-native $(KERL_INSTALL_DIR)/$1-native +endif +endef + +$(KERL): + $(verbose) mkdir -p $(ERLANG_MK_TMP) + $(gen_verbose) git clone --depth 1 $(KERL_GIT) $(ERLANG_MK_TMP)/kerl + $(verbose) cd $(ERLANG_MK_TMP)/kerl && git checkout $(KERL_COMMIT) + $(verbose) chmod +x $(KERL) + +distclean:: distclean-kerl + +distclean-kerl: + $(gen_verbose) rm -rf $(KERL) + +# Allow users to select which version of Erlang/OTP to use for a project. + +ERLANG_OTP ?= +ERLANG_HIPE ?= + +# Use kerl to enforce a specific Erlang/OTP version for a project. +ifneq ($(strip $(ERLANG_OTP)),) +export PATH := $(KERL_INSTALL_DIR)/$(ERLANG_OTP)/bin:$(PATH) +SHELL := env PATH=$(PATH) $(SHELL) +$(eval $(call kerl_otp_target,$(ERLANG_OTP))) + +# Build Erlang/OTP only if it doesn't already exist. +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(ERLANG_OTP))$(BUILD_ERLANG_OTP),) +$(info Building Erlang/OTP $(ERLANG_OTP)... Please wait...) +$(shell $(MAKE) $(KERL_INSTALL_DIR)/$(ERLANG_OTP) ERLANG_OTP=$(ERLANG_OTP) BUILD_ERLANG_OTP=1 >&2) +endif + +else +# Same for a HiPE enabled VM. +ifneq ($(strip $(ERLANG_HIPE)),) +export PATH := $(KERL_INSTALL_DIR)/$(ERLANG_HIPE)-native/bin:$(PATH) +SHELL := env PATH=$(PATH) $(SHELL) +$(eval $(call kerl_hipe_target,$(ERLANG_HIPE))) + +# Build Erlang/OTP only if it doesn't already exist. +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(ERLANG_HIPE))$(BUILD_ERLANG_OTP),) +$(info Building HiPE-enabled Erlang/OTP $(ERLANG_OTP)... Please wait...) +$(shell $(MAKE) $(KERL_INSTALL_DIR)/$(ERLANG_HIPE) ERLANG_HIPE=$(ERLANG_HIPE) BUILD_ERLANG_OTP=1 >&2) +endif + +endif +endif + # Copyright (c) 2015-2016, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. @@ -5966,10 +6057,10 @@ else $(call render_template,bs_erl_nif,src/$n.erl) endif -# Copyright (c) 2015-2016, Loïc Hoguin +# Copyright (c) 2015-2017, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. -.PHONY: ci ci-prepare ci-setup distclean-kerl +.PHONY: ci ci-prepare ci-setup CI_OTP ?= CI_HIPE ?= @@ -5987,24 +6078,9 @@ ifeq ($(strip $(CI_OTP) $(CI_HIPE) $(CI_ERLLVM)),) ci:: else -ifeq ($(strip $(KERL)),) -KERL := $(ERLANG_MK_TMP)/kerl/kerl -endif - -export KERL - -KERL_GIT ?= https://github.com/kerl/kerl -KERL_COMMIT ?= master - -KERL_MAKEFLAGS ?= - -OTP_GIT ?= https://github.com/erlang/otp - -CI_INSTALL_DIR ?= $(HOME)/erlang - ci:: $(addprefix ci-,$(CI_OTP) $(addsuffix -native,$(CI_HIPE)) $(addsuffix -erllvm,$(CI_ERLLVM))) -ci-prepare: $(addprefix $(CI_INSTALL_DIR)/,$(CI_OTP) $(addsuffix -native,$(CI_HIPE))) +ci-prepare: $(addprefix $(KERL_INSTALL_DIR)/,$(CI_OTP) $(addsuffix -native,$(CI_HIPE))) ci-setup:: @@ -6014,10 +6090,10 @@ ci_verbose_0 = @echo " CI " $(1); ci_verbose = $(ci_verbose_$(V)) define ci_target -ci-$1: $(CI_INSTALL_DIR)/$2 +ci-$1: $(KERL_INSTALL_DIR)/$2 $(verbose) $(MAKE) --no-print-directory clean $(ci_verbose) \ - PATH="$(CI_INSTALL_DIR)/$2/bin:$(PATH)" \ + PATH="$(KERL_INSTALL_DIR)/$2/bin:$(PATH)" \ CI_OTP_RELEASE="$1" \ CT_OPTS="-label $1" \ CI_VM="$3" \ @@ -6029,32 +6105,8 @@ $(foreach otp,$(CI_OTP),$(eval $(call ci_target,$(otp),$(otp),otp))) $(foreach otp,$(CI_HIPE),$(eval $(call ci_target,$(otp)-native,$(otp)-native,native))) $(foreach otp,$(CI_ERLLVM),$(eval $(call ci_target,$(otp)-erllvm,$(otp)-native,erllvm))) -define ci_otp_target -ifeq ($(wildcard $(CI_INSTALL_DIR)/$(1)),) -$(CI_INSTALL_DIR)/$(1): $(KERL) - MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $(1) $(1) - $(KERL) install $(1) $(CI_INSTALL_DIR)/$(1) -endif -endef - -$(foreach otp,$(CI_OTP),$(eval $(call ci_otp_target,$(otp)))) - -define ci_hipe_target -ifeq ($(wildcard $(CI_INSTALL_DIR)/$1-native),) -$(CI_INSTALL_DIR)/$1-native: $(KERL) - KERL_CONFIGURE_OPTIONS=--enable-native-libs \ - MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $1 $1-native - $(KERL) install $1-native $(CI_INSTALL_DIR)/$1-native -endif -endef - -$(foreach otp,$(sort $(CI_HIPE) $(CI_ERLLLVM)),$(eval $(call ci_hipe_target,$(otp)))) - -$(KERL): - $(verbose) mkdir -p $(ERLANG_MK_TMP) - $(gen_verbose) git clone --depth 1 $(KERL_GIT) $(ERLANG_MK_TMP)/kerl - $(verbose) cd $(ERLANG_MK_TMP)/kerl && git checkout $(KERL_COMMIT) - $(verbose) chmod +x $(KERL) +$(foreach otp,$(CI_OTP),$(eval $(call kerl_otp_target,$(otp)))) +$(foreach otp,$(sort $(CI_HIPE) $(CI_ERLLLVM)),$(eval $(call kerl_hipe_target,$(otp)))) help:: $(verbose) printf "%s\n" "" \ @@ -6064,10 +6116,6 @@ help:: "The CI_OTP variable must be defined with the Erlang versions" \ "that must be tested. For example: CI_OTP = OTP-17.3.4 OTP-17.5.3" -distclean:: distclean-kerl - -distclean-kerl: - $(gen_verbose) rm -rf $(KERL) endif # Copyright (c) 2013-2016, Loïc Hoguin @@ -6433,6 +6481,60 @@ apps-eunit: endif endif +# Copyright (c) 2015-2017, Loïc Hoguin +# This file is part of erlang.mk and subject to the terms of the ISC License. + +ifeq ($(filter proper,$(DEPS) $(TEST_DEPS)),proper) +.PHONY: proper + +# Targets. + +tests:: proper + +define proper_check.erl + code:add_pathsa(["$(call core_native_path,$(CURDIR)/ebin)", "$(call core_native_path,$(DEPS_DIR)/*/ebin)"]), + Module = fun(M) -> + [true] =:= lists:usort([ + case atom_to_list(F) of + "prop_" ++ _ -> + io:format("Testing ~p:~p/0~n", [M, F]), + proper:quickcheck(M:F()); + _ -> + true + end + || {F, 0} <- M:module_info(exports)]) + end, + try + case $(1) of + all -> [true] =:= lists:usort([Module(M) || M <- [$(call comma_list,$(3))]]); + module -> Module($(2)); + function -> proper:quickcheck($(2)) + end + of + true -> halt(0); + _ -> halt(1) + catch error:undef -> + io:format("Undefined property or module?~n~p~n", [erlang:get_stacktrace()]), + halt(0) + end. +endef + +ifdef t +ifeq (,$(findstring :,$(t))) +proper: test-build + $(verbose) $(call erlang,$(call proper_check.erl,module,$(t))) +else +proper: test-build + $(verbose) echo Testing $(t)/0 + $(verbose) $(call erlang,$(call proper_check.erl,function,$(t)())) +endif +else +proper: test-build + $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename $(wildcard ebin/*.beam)))))) + $(gen_verbose) $(call erlang,$(call proper_check.erl,all,undefined,$(MODULES))) +endif +endif + # Copyright (c) 2013-2016, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. @@ -6443,7 +6545,7 @@ endif RELX ?= $(ERLANG_MK_TMP)/relx RELX_CONFIG ?= $(CURDIR)/relx.config -RELX_URL ?= https://github.com/erlware/relx/releases/download/v3.19.0/relx +RELX_URL ?= https://github.com/erlware/relx/releases/download/v3.23.0/relx RELX_OPTS ?= RELX_OUTPUT_DIR ?= _rel RELX_REL_EXT ?= @@ -6489,7 +6591,7 @@ distclean-relx-rel: # Run target. ifeq ($(wildcard $(RELX_CONFIG)),) -run: +run:: else define get_relx_release.erl @@ -6513,7 +6615,7 @@ ifeq ($(PLATFORM),msys2) RELX_REL_EXT := .cmd endif -run: all +run:: all $(verbose) $(RELX_OUTPUT_DIR)/$(RELX_REL_NAME)/bin/$(RELX_REL_NAME)$(RELX_REL_EXT) console help:: @@ -6579,7 +6681,10 @@ ifeq ($(filter triq,$(DEPS) $(TEST_DEPS)),triq) tests:: triq define triq_check.erl - code:add_pathsa(["$(call core_native_path,$(CURDIR)/ebin)", "$(call core_native_path,$(DEPS_DIR)/*/ebin)"]), + code:add_pathsa([ + "$(call core_native_path,$(CURDIR)/ebin)", + "$(call core_native_path,$(DEPS_DIR)/*/ebin)", + "$(call core_native_path,$(TEST_DIR))"]), try case $(1) of all -> [true] =:= lists:usort([triq:check(M) || M <- [$(call comma_list,$(3))]]); @@ -6590,7 +6695,7 @@ define triq_check.erl true -> halt(0); _ -> halt(1) catch error:undef -> - io:format("Undefined property or module~n"), + io:format("Undefined property or module?~n~p~n", [erlang:get_stacktrace()]), halt(0) end. endef @@ -6606,7 +6711,8 @@ triq: test-build endif else triq: test-build - $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename $(wildcard ebin/*.beam)))))) + $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename \ + $(wildcard ebin/*.beam) $(call core_find,$(TEST_DIR)/,*.beam)))))) $(gen_verbose) $(call erlang,$(call triq_check.erl,all,undefined,$(MODULES))) endif endif diff --git a/rabbitmq-server/deps/rabbit/include/rabbit_cli.hrl b/rabbitmq-server/deps/rabbit/include/rabbit_cli.hrl index 12fa5b4..0908f82 100644 --- a/rabbitmq-server/deps/rabbit/include/rabbit_cli.hrl +++ b/rabbitmq-server/deps/rabbit/include/rabbit_cli.hrl @@ -72,3 +72,8 @@ -define(EX_SOFTWARE , 70). % Failed to execute command. -define(EX_TEMPFAIL , 75). % Temporary error (e.g. something has timed out). -define(EX_CONFIG , 78). % Misconfiguration detected + +% Non-standard code that indicates that node shutdown failed with an error +% other than an unsuccessfull RPC call or a timeout. See rabbitmq/rabbitmq-server#1396 +% for context. +-define(EX_SHUTDOWN_ERROR, 79). diff --git a/rabbitmq-server/deps/rabbit/rabbitmq-components.mk b/rabbitmq-server/deps/rabbit/rabbitmq-components.mk index 1e5d000..5292fa9 100644 --- a/rabbitmq-server/deps/rabbit/rabbitmq-components.mk +++ b/rabbitmq-server/deps/rabbit/rabbitmq-components.mk @@ -38,6 +38,8 @@ endif # base of the topic branch. dep_amqp_client = git_rmq rabbitmq-erlang-client $(current_rmq_ref) $(base_rmq_ref) master +dep_amqp10_client = git_rmq rabbitmq-amqp1.0-client $(current_rmq_ref) $(base_rmq_ref) master +dep_amqp10_common = git_rmq rabbitmq-amqp1.0-common $(current_rmq_ref) $(base_rmq_ref) master dep_rabbit = git_rmq rabbitmq-server $(current_rmq_ref) $(base_rmq_ref) master dep_rabbit_common = git_rmq rabbitmq-common $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_amqp1_0 = git_rmq rabbitmq-amqp1.0 $(current_rmq_ref) $(base_rmq_ref) master @@ -63,7 +65,7 @@ dep_rabbitmq_java_client = git_rmq rabbitmq-java-client $(current_r dep_rabbitmq_jms_client = git_rmq rabbitmq-jms-client $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_jms_cts = git_rmq rabbitmq-jms-cts $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_jms_topic_exchange = git_rmq rabbitmq-jms-topic-exchange $(current_rmq_ref) $(base_rmq_ref) master -dep_rabbitmq_lvc = git_rmq rabbitmq-lvc-plugin $(current_rmq_ref) $(base_rmq_ref) master +dep_rabbitmq_lvc_exchange = git_rmq rabbitmq-lvc-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management = git_rmq rabbitmq-management $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management_agent = git_rmq rabbitmq-management-agent $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management_exchange = git_rmq rabbitmq-management-exchange $(current_rmq_ref) $(base_rmq_ref) master @@ -78,6 +80,7 @@ dep_rabbitmq_peer_discovery_common = git_rmq rabbitmq-peer-discovery-common $ dep_rabbitmq_peer_discovery_consul = git_rmq rabbitmq-peer-discovery-consul $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_peer_discovery_etcd = git_rmq rabbitmq-peer-discovery-etcd $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_peer_discovery_k8s = git_rmq rabbitmq-peer-discovery-k8s $(current_rmq_ref) $(base_rmq_ref) master +dep_rabbitmq_random_exchange = git_rmq rabbitmq-random-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_recent_history_exchange = git_rmq rabbitmq-recent-history-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_routing_node_stamp = git_rmq rabbitmq-routing-node-stamp $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_rtopic_exchange = git_rmq rabbitmq-rtopic-exchange $(current_rmq_ref) $(base_rmq_ref) master @@ -107,16 +110,18 @@ dep_rabbitmq_public_umbrella = git_rmq rabbitmq-public-umbrella $(curre # all projects use the same versions. It avoids conflicts and makes it # possible to work with rabbitmq-public-umbrella. -dep_cowboy_commit = 1.0.4 -dep_mochiweb = git git://github.com/basho/mochiweb.git v2.9.0p2 +dep_cowboy = hex 1.0.4 +dep_ranch = hex 1.3.2 +dep_recon = hex 2.3.2 + # Last commit of PropEr supporting Erlang R16B03. dep_proper_commit = 735d972758d8bd85b12483626fe1b66450d6a6fe -dep_ranch_commit = 1.3.2 # Last commit of sockjs support Erlang R16B03 and 17.x. dep_sockjs = git https://github.com/rabbitmq/sockjs-erlang.git 5af2b588c812c318b19bc105b577a759c71c3e0a -dep_webmachine_commit = 1.10.8p2 RABBITMQ_COMPONENTS = amqp_client \ + amqp10_common \ + amqp10_client \ rabbit \ rabbit_common \ rabbitmq_amqp1_0 \ @@ -142,7 +147,7 @@ RABBITMQ_COMPONENTS = amqp_client \ rabbitmq_jms_client \ rabbitmq_jms_cts \ rabbitmq_jms_topic_exchange \ - rabbitmq_lvc \ + rabbitmq_lvc_exchange \ rabbitmq_management \ rabbitmq_management_agent \ rabbitmq_management_exchange \ @@ -157,6 +162,7 @@ RABBITMQ_COMPONENTS = amqp_client \ rabbitmq_peer_discovery_consul \ rabbitmq_peer_discovery_etcd \ rabbitmq_peer_discovery_k8s \ + rabbitmq_random_exchange \ rabbitmq_recent_history_exchange \ rabbitmq_routing_node_stamp \ rabbitmq_rtopic_exchange \ @@ -184,7 +190,7 @@ NO_AUTOPATCH += $(RABBITMQ_COMPONENTS) ifeq ($(origin current_rmq_ref),undefined) ifneq ($(wildcard .git),) current_rmq_ref := $(shell (\ - ref=$$(git branch --list | awk '/^\* \(.*detached / {ref=$$0; sub(/.*detached [^ ]+ /, "", ref); sub(/\)$$/, "", ref); print ref; exit;} /^\* / {ref=$$0; sub(/^\* /, "", ref); print ref; exit}');\ + ref=$$(LANG=C git branch --list | awk '/^\* \(.*detached / {ref=$$0; sub(/.*detached [^ ]+ /, "", ref); sub(/\)$$/, "", ref); print ref; exit;} /^\* / {ref=$$0; sub(/^\* /, "", ref); print ref; exit}');\ if test "$$(git rev-parse --short HEAD)" != "$$ref"; then echo "$$ref"; fi)) else current_rmq_ref := master @@ -194,11 +200,17 @@ export current_rmq_ref ifeq ($(origin base_rmq_ref),undefined) ifneq ($(wildcard .git),) +possible_base_rmq_ref := v3.6.x +ifeq ($(possible_base_rmq_ref),$(current_rmq_ref)) +base_rmq_ref := $(current_rmq_ref) +else base_rmq_ref := $(shell \ - (git rev-parse --verify -q stable >/dev/null && \ - git merge-base --is-ancestor $$(git merge-base master HEAD) stable && \ - echo stable) || \ + (git rev-parse --verify -q master >/dev/null && \ + git rev-parse --verify -q $(possible_base_rmq_ref) >/dev/null && \ + git merge-base --is-ancestor $$(git merge-base master HEAD) $(possible_base_rmq_ref) && \ + echo $(possible_base_rmq_ref)) || \ echo master) +endif else base_rmq_ref := master endif @@ -313,11 +325,16 @@ endif UPSTREAM_RMQ_COMPONENTS_MK = $(DEPS_DIR)/rabbit_common/mk/rabbitmq-components.mk +ifeq ($(PROJECT),rabbit_common) +check-rabbitmq-components.mk: + @: +else check-rabbitmq-components.mk: $(verbose) cmp -s rabbitmq-components.mk \ $(UPSTREAM_RMQ_COMPONENTS_MK) || \ (echo "error: rabbitmq-components.mk must be updated!" 1>&2; \ false) +endif ifeq ($(PROJECT),rabbit_common) rabbitmq-components-mk: diff --git a/rabbitmq-server/deps/rabbit/scripts/rabbitmq-env b/rabbitmq-server/deps/rabbit/scripts/rabbitmq-env index 52fb403..8cc3af5 100755 --- a/rabbitmq-server/deps/rabbit/scripts/rabbitmq-env +++ b/rabbitmq-server/deps/rabbit/scripts/rabbitmq-env @@ -76,6 +76,10 @@ RABBITMQ_HOME="$(rmq_realpath "${RABBITMQ_SCRIPTS_DIR}/..")" ## Set defaults . ${RABBITMQ_SCRIPTS_DIR}/rabbitmq-defaults +## Get configuration variables from the configure environment file +[ "x" = "x$RABBITMQ_CONF_ENV_FILE" ] && RABBITMQ_CONF_ENV_FILE=${CONF_ENV_FILE} +[ -f ${RABBITMQ_CONF_ENV_FILE} ] && . ${RABBITMQ_CONF_ENV_FILE} || true + DEFAULT_SCHEDULER_BIND_TYPE="db" [ "x" = "x$RABBITMQ_SCHEDULER_BIND_TYPE" ] && RABBITMQ_SCHEDULER_BIND_TYPE=${DEFAULT_SCHEDULER_BIND_TYPE} @@ -90,11 +94,6 @@ SERVER_ERL_ARGS="+P 1048576 +t 5000000 +stbt $RABBITMQ_SCHEDULER_BIND_TYPE +zdbb # it and warn the user. saved_RABBITMQ_PID_FILE=$RABBITMQ_PID_FILE -## Get configuration variables from the configure environment file -[ "x" = "x$RABBITMQ_CONF_ENV_FILE" ] && RABBITMQ_CONF_ENV_FILE=${CONF_ENV_FILE} - -[ -f ${RABBITMQ_CONF_ENV_FILE} ] && . ${RABBITMQ_CONF_ENV_FILE} || true - if [ "$saved_RABBITMQ_PID_FILE" -a \ "$saved_RABBITMQ_PID_FILE" != "$RABBITMQ_PID_FILE" ]; then echo "WARNING: RABBITMQ_PID_FILE was already set by the init script to:" 1>&2 diff --git a/rabbitmq-server/deps/rabbit/scripts/rabbitmq-env.bat b/rabbitmq-server/deps/rabbit/scripts/rabbitmq-env.bat index fcfab5e..6747cdd 100644 --- a/rabbitmq-server/deps/rabbit/scripts/rabbitmq-env.bat +++ b/rabbitmq-server/deps/rabbit/scripts/rabbitmq-env.bat @@ -289,7 +289,7 @@ if "!RABBITMQ_LOGS!"=="" ( set RABBITMQ_LOGS=!LOGS! ) ) -if not "!RABBITMQ_LOGS" == "-" ( +if not "!RABBITMQ_LOGS!" == "-" ( if not exist "!RABBITMQ_LOGS!" ( for /f "delims=" %%F in ("!RABBITMQ_LOGS!") do mkdir %%~dpF 2>NUL copy /y NUL "!RABBITMQ_LOGS!" >NUL @@ -306,7 +306,7 @@ if "!RABBITMQ_SASL_LOGS!"=="" ( set RABBITMQ_SASL_LOGS=!SASL_LOGS! ) ) -if not "!RABBITMQ_SASL_LOGS" == "-" ( +if not "!RABBITMQ_SASL_LOGS!" == "-" ( if not exist "!RABBITMQ_SASL_LOGS!" ( for /f "delims=" %%F in ("!RABBITMQ_SASL_LOGS!") do mkdir %%~dpF 2>NUL copy /y NUL "!RABBITMQ_SASL_LOGS!" >NUL diff --git a/rabbitmq-server/deps/rabbit/src/gm.erl b/rabbitmq-server/deps/rabbit/src/gm.erl index cf3e217..d6005fe 100644 --- a/rabbitmq-server/deps/rabbit/src/gm.erl +++ b/rabbitmq-server/deps/rabbit/src/gm.erl @@ -1354,9 +1354,12 @@ find_common(A, B, Common) -> find_common(A1, B1, queue:in(Val, Common)); {{empty, _A}, _} -> {Common, B}; - {_, {_, B1}} -> + %% Drop value from B. + %% Match value to avoid infinite loop, since {empty, B} = queue:out(B). + {_, {{value, _}, B1}} -> find_common(A, B1, Common); - {{_, A1}, _} -> + %% Drop value from A. Empty A should be matched by second close. + {{{value, _}, A1}, _} -> find_common(A1, B, Common) end. diff --git a/rabbitmq-server/deps/rabbit/src/rabbit.erl b/rabbitmq-server/deps/rabbit/src/rabbit.erl index fbd8840..8971c64 100644 --- a/rabbitmq-server/deps/rabbit/src/rabbit.erl +++ b/rabbitmq-server/deps/rabbit/src/rabbit.erl @@ -23,7 +23,7 @@ is_running/1, environment/0, rotate_logs/1, force_event_refresh/1, start_fhc/0]). -export([start/2, stop/1]). --export([start_apps/1, stop_apps/1]). +-export([start_apps/1, start_apps/2, stop_apps/1]). -export([log_location/1, config_files/0, decrypt_config/2]). %% for testing and mgmt-agent %%--------------------------------------------------------------------------- @@ -200,6 +200,11 @@ [rabbit_core_metrics_gc]}}, {enables, networking}]}). +-rabbit_boot_step({rabbit_looking_glass, + [{description, "Looking Glass tracer and profiler"}, + {mfa, {rabbit_looking_glass, boot, []}}, + {requires, networking}]}). + %%--------------------------------------------------------------------------- -include("rabbit_framing.hrl"). @@ -212,6 +217,7 @@ %%---------------------------------------------------------------------------- -type file_suffix() :: binary(). +-type restart_type() :: 'permanent' | 'transient' | 'temporary'. %% this really should be an abstract type -type log_location() :: 'tty' | 'undefined' | file:filename(). -type param() :: atom(). @@ -248,6 +254,7 @@ -spec boot_delegate() -> 'ok'. -spec recover() -> 'ok'. -spec start_apps([app_name()]) -> 'ok'. +-spec start_apps([app_name()], [{app_name(), restart_type()}]) -> 'ok'. -spec stop_apps([app_name()]) -> 'ok'. %%---------------------------------------------------------------------------- @@ -448,7 +455,7 @@ stop_and_halt() -> stop() catch Type:Reason -> rabbit_log:error("Error trying to stop RabbitMQ: ~p:~p", [Type, Reason]), - error({Type, Reason}) + erlang:error({Type, Reason}) after %% Enclose all the logging in the try block. %% init:stop() will be called regardless of any errors. @@ -469,6 +476,9 @@ stop_and_halt() -> ok. start_apps(Apps) -> + start_apps(Apps, []). + +start_apps(Apps, RestartTypes) -> app_utils:load_applications(Apps), ConfigEntryDecoder = case application:get_env(rabbit, config_entry_decoder) of @@ -508,7 +518,8 @@ start_apps(Apps) -> true -> ok %% will run during start of rabbit app end, ok = app_utils:start_applications(OrderedApps, - handle_app_error(could_not_start)). + handle_app_error(could_not_start), + RestartTypes). %% This function retrieves the correct IoDevice for requesting %% input. The problem with using the default IoDevice is that @@ -582,6 +593,8 @@ decrypt_list([{Key, Value}|Tail], Algo, Acc) when Key =/= encrypted -> decrypt_list([Value|Tail], Algo, Acc) -> decrypt_list(Tail, Algo, [decrypt(Value, Algo)|Acc]). +stop_apps([]) -> + ok; stop_apps(Apps) -> rabbit_log:info( lists:flatten(["Stopping RabbitMQ applications and their dependencies in the following order:~n", diff --git a/rabbitmq-server/deps/rabbit/src/rabbit_amqqueue_process.erl b/rabbitmq-server/deps/rabbit/src/rabbit_amqqueue_process.erl index 16a5a70..5918a2b 100644 --- a/rabbitmq-server/deps/rabbit/src/rabbit_amqqueue_process.erl +++ b/rabbitmq-server/deps/rabbit/src/rabbit_amqqueue_process.erl @@ -22,7 +22,7 @@ -define(SYNC_INTERVAL, 200). %% milliseconds -define(RAM_DURATION_UPDATE_INTERVAL, 5000). --define(CONSUMER_BIAS_RATIO, 1.1). %% i.e. consume 10% faster +-define(CONSUMER_BIAS_RATIO, 2.0). %% i.e. consume 100% faster -export([info_keys/0]). @@ -975,8 +975,8 @@ prioritise_call(Msg, _From, _Len, State) -> {info, _Items} -> 9; consumers -> 9; stat -> 7; - {basic_consume, _, _, _, _, _, _, _, _, _} -> consumer_bias(State); - {basic_cancel, _, _, _} -> consumer_bias(State); + {basic_consume, _, _, _, _, _, _, _, _, _} -> consumer_bias(State, 0, 2); + {basic_cancel, _, _, _} -> consumer_bias(State, 0, 2); _ -> 0 end. @@ -986,9 +986,9 @@ prioritise_cast(Msg, _Len, State) -> {set_ram_duration_target, _Duration} -> 8; {set_maximum_since_use, _Age} -> 8; {run_backing_queue, _Mod, _Fun} -> 6; - {ack, _AckTags, _ChPid} -> 3; %% [1] - {resume, _ChPid} -> 2; - {notify_sent, _ChPid, _Credit} -> consumer_bias(State); + {ack, _AckTags, _ChPid} -> 4; %% [1] + {resume, _ChPid} -> 3; + {notify_sent, _ChPid, _Credit} -> consumer_bias(State, 0, 2); _ -> 0 end. @@ -1000,12 +1000,15 @@ prioritise_cast(Msg, _Len, State) -> %% stack are optimised for that) and to make things easier to reason %% about. Finally, we prioritise ack over resume since it should %% always reduce memory use. +%% bump_reduce_memory_use is prioritised over publishes, because sending +%% credit to self is hard to reason about. Consumers can continue while +%% reduce_memory_use is in progress. -consumer_bias(#q{backing_queue = BQ, backing_queue_state = BQS}) -> +consumer_bias(#q{backing_queue = BQ, backing_queue_state = BQS}, Low, High) -> case BQ:msg_rates(BQS) of - {0.0, _} -> 0; - {Ingress, Egress} when Egress / Ingress < ?CONSUMER_BIAS_RATIO -> 1; - {_, _} -> 0 + {0.0, _} -> Low; + {Ingress, Egress} when Egress / Ingress < ?CONSUMER_BIAS_RATIO -> High; + {_, _} -> Low end. prioritise_info(Msg, _Len, #q{q = #amqqueue{exclusive_owner = DownPid}}) -> @@ -1016,6 +1019,7 @@ prioritise_info(Msg, _Len, #q{q = #amqqueue{exclusive_owner = DownPid}}) -> {drop_expired, _Version} -> 8; emit_stats -> 7; sync_timeout -> 6; + bump_reduce_memory_use -> 1; _ -> 0 end. @@ -1390,6 +1394,10 @@ handle_info({bump_credit, Msg}, State = #q{backing_queue = BQ, %% rabbit_variable_queue:msg_store_write/4. credit_flow:handle_bump_msg(Msg), noreply(State#q{backing_queue_state = BQ:resume(BQS)}); +handle_info(bump_reduce_memory_use, State = #q{backing_queue = BQ, + backing_queue_state = BQS}) -> + put(waiting_bump, false), + noreply(State#q{backing_queue_state = BQ:resume(BQS)}); handle_info(Info, State) -> {stop, {unhandled_info, Info}, State}. diff --git a/rabbitmq-server/deps/rabbit/src/rabbit_auth_backend_internal.erl b/rabbitmq-server/deps/rabbit/src/rabbit_auth_backend_internal.erl index 4933bd1..92ef666 100644 --- a/rabbitmq-server/deps/rabbit/src/rabbit_auth_backend_internal.erl +++ b/rabbitmq-server/deps/rabbit/src/rabbit_auth_backend_internal.erl @@ -93,10 +93,29 @@ hashing_module_for_user(#internal_user{ hashing_algorithm = ModOrUndefined}) -> rabbit_password:hashing_mod(ModOrUndefined). +-define(BLANK_PASSWORD_REJECTION_MESSAGE, + "user '~s' attempted to log in with a blank password, which is prohibited by the internal authN backend. " + "To use TLS/x509 certificate-based authentication, see the rabbitmq_auth_mechanism_ssl plugin and configure the client to use the EXTERNAL authentication mechanism. " + "Alternatively change the password for the user to be non-blank."). + +%% For cases when we do not have a set of credentials, +%% namely when x509 (TLS) certificates are used. This should only be +%% possible when the EXTERNAL authentication mechanism is used, see +%% rabbit_auth_mechanism_plain:handle_response/2 and rabbit_reader:auth_phase/2. user_login_authentication(Username, []) -> internal_check_user_login(Username, fun(_) -> true end); +%% For cases when we do have a set of credentials. rabbit_auth_mechanism_plain:handle_response/2 +%% performs initial validation. user_login_authentication(Username, AuthProps) -> case lists:keyfind(password, 1, AuthProps) of + %% Passwordless users are not supposed to be used with + %% this backend (and PLAIN authentication mechanism in general). + {password, <<"">>} -> + {refused, ?BLANK_PASSWORD_REJECTION_MESSAGE, + [Username]}; + {password, ""} -> + {refused, ?BLANK_PASSWORD_REJECTION_MESSAGE, + [Username]}; {password, Cleartext} -> internal_check_user_login( Username, @@ -105,6 +124,13 @@ user_login_authentication(Username, AuthProps) -> } = U) -> Hash =:= rabbit_password:salted_hash( hashing_module_for_user(U), Salt, Cleartext); + %% rabbitmqctl clear_password will set password_hash to an empty + %% binary. + %% + %% See the comment on passwordless users above. + (#internal_user{ + password_hash = <<"">>}) -> + false; (#internal_user{}) -> false end); diff --git a/rabbitmq-server/deps/rabbit/src/rabbit_auth_mechanism_plain.erl b/rabbitmq-server/deps/rabbit/src/rabbit_auth_mechanism_plain.erl index 7a34b0a..1f88678 100644 --- a/rabbitmq-server/deps/rabbit/src/rabbit_auth_mechanism_plain.erl +++ b/rabbitmq-server/deps/rabbit/src/rabbit_auth_mechanism_plain.erl @@ -28,12 +28,6 @@ {requires, rabbit_registry}, {enables, kernel_ready}]}). -%% SASL PLAIN, as used by the Qpid Java client and our clients. Also, -%% apparently, by OpenAMQ. - -%% TODO: reimplement this using the binary module? - that makes use of -%% BIFs to do binary matching and will thus be much faster. - description() -> [{description, <<"SASL PLAIN authentication mechanism">>}]. diff --git a/rabbitmq-server/deps/rabbit/src/rabbit_autoheal.erl b/rabbitmq-server/deps/rabbit/src/rabbit_autoheal.erl index 58f60bb..5324858 100644 --- a/rabbitmq-server/deps/rabbit/src/rabbit_autoheal.erl +++ b/rabbitmq-server/deps/rabbit/src/rabbit_autoheal.erl @@ -17,7 +17,7 @@ -module(rabbit_autoheal). -export([init/0, enabled/0, maybe_start/1, rabbit_down/2, node_down/2, - handle_msg/3]). + handle_msg/3, process_down/2]). %% The named process we are running in. -define(SERVER, rabbit_node_monitor). @@ -196,6 +196,16 @@ node_down(Node, _State) -> rabbit_log:info("Autoheal: aborting - ~p went down~n", [Node]), not_healing. +%% If the process that has to restart the node crashes for an unexpected reason, +%% we go back to a not healing state so the node is able to recover. +process_down({'EXIT', Pid, Reason}, {restarting, Pid}) when Reason =/= normal -> + rabbit_log:info("Autoheal: aborting - the process responsible for restarting the " + "node terminated with reason: ~p~n", [Reason]), + not_healing; + +process_down(_, State) -> + State. + %% By receiving this message we become the leader %% TODO should we try to debounce this? handle_msg({request_start, Node}, @@ -252,17 +262,19 @@ handle_msg({become_winner, _}, handle_msg({winner_is, Winner}, State = not_healing, _Partitions) -> %% This node is a loser, nothing else. - restart_loser(State, Winner), - restarting; + Pid = restart_loser(State, Winner), + {restarting, Pid}; handle_msg({winner_is, Winner}, State = {leader_waiting, Winner, _}, _Partitions) -> %% This node is the leader and a loser at the same time. - restart_loser(State, Winner), - restarting; + Pid = restart_loser(State, Winner), + {restarting, Pid}; -handle_msg(_, restarting, _Partitions) -> +handle_msg(Request, {restarting, Pid} = St, _Partitions) -> %% ignore, we can contribute no further - restarting; + rabbit_log:info("Autoheal: Received the request ~p while waiting for ~p " + "to restart the node. Ignoring it ~n", [Request, Pid]), + St; handle_msg(report_autoheal_status, not_healing, _Partitions) -> %% The leader is asking about the autoheal status to us (the diff --git a/rabbitmq-server/deps/rabbit/src/rabbit_channel.erl b/rabbitmq-server/deps/rabbit/src/rabbit_channel.erl index dae0612..6e1f506 100644 --- a/rabbitmq-server/deps/rabbit/src/rabbit_channel.erl +++ b/rabbitmq-server/deps/rabbit/src/rabbit_channel.erl @@ -174,10 +174,21 @@ -define(INFO_KEYS, ?CREATION_EVENT_KEYS ++ ?STATISTICS_KEYS -- [pid]). --define(INCR_STATS(Incs, Measure, State), +-define(INCR_STATS(Type, Key, Inc, Measure, State), case rabbit_event:stats_level(State, #ch.stats_timer) of - fine -> incr_stats(Incs, Measure); - _ -> ok + fine -> + rabbit_core_metrics:channel_stats(Type, Measure, {self(), Key}, Inc), + %% Keys in the process dictionary are used to clean up the core metrics + put({Type, Key}, none); + _ -> + ok + end). + +-define(INCR_STATS(Type, Key, Inc, Measure), + begin + rabbit_core_metrics:channel_stats(Type, Measure, {self(), Key}, Inc), + %% Keys in the process dictionary are used to clean up the core metrics + put({Type, Key}, none) end). %%---------------------------------------------------------------------------- @@ -1658,7 +1669,7 @@ basic_return(#basic_message{exchange_name = ExchangeName, content = Content}, State = #ch{protocol = Protocol, writer_pid = WriterPid}, Reason) -> - ?INCR_STATS([{exchange_stats, ExchangeName, 1}], return_unroutable, State), + ?INCR_STATS(exchange_stats, ExchangeName, 1, return_unroutable, State), {_Close, ReplyCode, ReplyText} = Protocol:lookup_amqp_exception(Reason), ok = rabbit_writer:send_command( WriterPid, @@ -1695,14 +1706,14 @@ record_sent(ConsumerTag, AckRequired, user = #user{username = Username}, conn_name = ConnName, channel = ChannelNum}) -> - ?INCR_STATS([{queue_stats, QName, 1}], case {ConsumerTag, AckRequired} of - {none, true} -> get; - {none, false} -> get_no_ack; - {_ , true} -> deliver; - {_ , false} -> deliver_no_ack - end, State), + ?INCR_STATS(queue_stats, QName, 1, case {ConsumerTag, AckRequired} of + {none, true} -> get; + {none, false} -> get_no_ack; + {_ , true} -> deliver; + {_ , false} -> deliver_no_ack + end, State), case Redelivered of - true -> ?INCR_STATS([{queue_stats, QName, 1}], redeliver, State); + true -> ?INCR_STATS(queue_stats, QName, 1, redeliver, State); false -> ok end, rabbit_trace:tap_out(Msg, ConnName, ChannelNum, Username, TraceState), @@ -1747,11 +1758,11 @@ ack(Acked, State = #ch{queue_names = QNames}) -> foreach_per_queue( fun (QPid, MsgIds) -> ok = rabbit_amqqueue:ack(QPid, MsgIds, self()), - ?INCR_STATS(case dict:find(QPid, QNames) of - {ok, QName} -> Count = length(MsgIds), - [{queue_stats, QName, Count}]; - error -> [] - end, ack, State) + case dict:find(QPid, QNames) of + {ok, QName} -> Count = length(MsgIds), + ?INCR_STATS(queue_stats, QName, Count, ack, State); + error -> ok + end end, Acked), ok = notify_limiter(State#ch.limiter, Acked). @@ -1816,7 +1827,7 @@ deliver_to_queues({#delivery{message = #basic_message{exchange_name = XName}, confirm = false, mandatory = false}, []}, State) -> %% optimisation - ?INCR_STATS([{exchange_stats, XName, 1}], publish, State), + ?INCR_STATS(exchange_stats, XName, 1, publish, State), State; deliver_to_queues({Delivery = #delivery{message = Message = #basic_message{ exchange_name = XName}, @@ -1853,11 +1864,15 @@ deliver_to_queues({Delivery = #delivery{message = Message = #basic_message{ Message, State1), State3 = process_routing_confirm( Confirm, DeliveredQPids, MsgSeqNo, XName, State2), - ?INCR_STATS([{exchange_stats, XName, 1} | - [{queue_exchange_stats, {QName, XName}, 1} || - QPid <- DeliveredQPids, - {ok, QName} <- [dict:find(QPid, QNames1)]]], - publish, State3), + case rabbit_event:stats_level(State3, #ch.stats_timer) of + fine -> + ?INCR_STATS(exchange_stats, XName, 1, publish), + [?INCR_STATS(queue_exchange_stats, {QName, XName}, 1, publish) || + QPid <- DeliveredQPids, + {ok, QName} <- [dict:find(QPid, QNames1)]]; + _ -> + ok + end, State3. process_routing_mandatory(false, _, _MsgSeqNo, _Msg, State) -> @@ -1900,7 +1915,7 @@ send_confirms(State = #ch{tx = none, confirmed = C}) -> ok -> MsgSeqNos = lists:foldl( fun ({MsgSeqNo, XName}, MSNs) -> - ?INCR_STATS([{exchange_stats, XName, 1}], + ?INCR_STATS(exchange_stats, XName, 1, confirm, State), [MsgSeqNo | MSNs] end, [], lists:append(C)), @@ -1997,17 +2012,14 @@ i(Item, _) -> name(#ch{conn_name = ConnName, channel = Channel}) -> list_to_binary(rabbit_misc:format("~s (~p)", [ConnName, Channel])). -incr_stats(Incs, Measure) -> - [begin - rabbit_core_metrics:channel_stats(Type, Measure, {self(), Key}, Inc), - %% Keys in the process dictionary are used to clean up the core metrics - put({Type, Key}, none) - end || {Type, Key, Inc} <- Incs]. - emit_stats(State) -> emit_stats(State, []). emit_stats(State, Extra) -> [{reductions, Red} | Coarse0] = infos(?STATISTICS_KEYS, State), + %% First metric must be `idle_since` (if available), as expected by + %% `rabbit_mgmt_format:format_channel_stats`. This is a performance + %% optimisation that avoids traversing the whole list when only + %% one element has to be formatted. rabbit_core_metrics:channel_stats(self(), Extra ++ Coarse0), rabbit_core_metrics:channel_stats(reductions, self(), Red). diff --git a/rabbitmq-server/deps/rabbit/src/rabbit_cli.erl b/rabbitmq-server/deps/rabbit/src/rabbit_cli.erl index 4d955f8..c4c7b8e 100644 --- a/rabbitmq-server/deps/rabbit/src/rabbit_cli.erl +++ b/rabbitmq-server/deps/rabbit/src/rabbit_cli.erl @@ -93,6 +93,10 @@ main(ParseFun, DoFun, UsageMod) -> {'EXIT', {function_clause, [{?MODULE, action, _, _} | _]}} -> %% >= R15 PrintInvalidCommandError(), usage(UsageMod); + {error, {error_during_shutdown, Err}} -> + print_error("Node ~w failed to shut down: ~p.", + [Node, Err]), + rabbit_misc:quit(?EX_SHUTDOWN_ERROR); {error, {missing_dependencies, Missing, Blame}} -> print_error("dependent plugins ~p not found; used by ~p.", [Missing, Blame]), @@ -122,15 +126,12 @@ main(ParseFun, DoFun, UsageMod) -> _ -> print_error("unable to connect to node ~w: ~w", [Node, Reason]), print_badrpc_diagnostics([Node]), - case Command of - stop -> rabbit_misc:quit(?EX_OK); - _ -> rabbit_misc:quit(?EX_UNAVAILABLE) - end + exit_badrpc(Command) end; {badrpc_multi, Reason, Nodes} -> print_error("unable to connect to nodes ~p: ~w", [Nodes, Reason]), print_badrpc_diagnostics(Nodes), - rabbit_misc:quit(?EX_UNAVAILABLE); + exit_badrpc(Command); function_clause -> print_error("operation ~w used with invalid parameter: ~p", [Command, Args]), @@ -143,6 +144,11 @@ main(ParseFun, DoFun, UsageMod) -> rabbit_misc:quit(?EX_SOFTWARE) end. +exit_badrpc(stop) -> + rabbit_misc:quit(?EX_OK); +exit_badrpc(_) -> + rabbit_misc:quit(?EX_UNAVAILABLE). + start_distribution_anon(0, LastError) -> {error, LastError}; start_distribution_anon(TriesLeft, _) -> diff --git a/rabbitmq-server/deps/rabbit/src/rabbit_control_main.erl b/rabbitmq-server/deps/rabbit/src/rabbit_control_main.erl index 50cf832..fe9777a 100644 --- a/rabbitmq-server/deps/rabbit/src/rabbit_control_main.erl +++ b/rabbitmq-server/deps/rabbit/src/rabbit_control_main.erl @@ -283,15 +283,31 @@ shutdown_node_and_wait_pid_to_stop(Node, Pid, Inform) -> wait_for_process_death(Pid), Inform( "RabbitMQ node ~p running at PID ~s successfully shut down", - [Node, Pid]); - _ -> ok - end, - Res. + [Node, Pid]), + Res; + % NB: this is the return value for any errors raised by + % an RPC call to rabbit:stop_and_halt. We return error_during_shutdown + % so that rabbit_cli:main can differentiate this error from + % other badrpc errors + {badrpc, {'EXIT', RpcErr}} -> + {error, {error_during_shutdown, RpcErr}}; + % NB: rabbit_cli:main pretty-prints other badrpc errors using + % rabbit_nodes:diagnostics, so don't modify the error here. + Error -> Error + end. action(shutdown, Node, [], _Opts, Inform) -> case rpc:call(Node, os, getpid, []) of Pid when is_list(Pid) -> shutdown_node_and_wait_pid_to_stop(Node, Pid, Inform); + % NB: this is the rpc return value for any errors raised by + % rpc:call. We return error_during_shutdown so that + % rabbit_cli:main can differentiate this error from other badrpc + % errors + {badrpc, {'EXIT', RpcErr}} -> + {error, {error_during_shutdown, RpcErr}}; + % NB: rabbit_cli:main pretty-prints other badrpc errors using + % rabbit_nodes:diagnostics, so don't modify the error here. Error -> Error end; diff --git a/rabbitmq-server/deps/rabbit/src/rabbit_core_metrics_gc.erl b/rabbitmq-server/deps/rabbit/src/rabbit_core_metrics_gc.erl index 3321f2b..9396368 100644 --- a/rabbitmq-server/deps/rabbit/src/rabbit_core_metrics_gc.erl +++ b/rabbitmq-server/deps/rabbit/src/rabbit_core_metrics_gc.erl @@ -70,10 +70,17 @@ gc_channels() -> ok. gc_queues() -> + gc_local_queues(), + gc_global_queues(). + +gc_local_queues() -> Queues = rabbit_amqqueue:list_local_names(), GbSet = gb_sets:from_list(Queues), gc_entity(queue_metrics, GbSet), - gc_entity(queue_coarse_metrics, GbSet), + gc_entity(queue_coarse_metrics, GbSet). + +gc_global_queues() -> + GbSet = gb_sets:from_list(rabbit_amqqueue:list_names()), gc_process_and_entity(channel_queue_metrics, GbSet), gc_process_and_entity(consumer_created, GbSet), ExchangeGbSet = gb_sets:from_list(rabbit_exchange:list_names()), diff --git a/rabbitmq-server/deps/rabbit/src/rabbit_direct.erl b/rabbitmq-server/deps/rabbit/src/rabbit_direct.erl index 3c3da5e..d01d004 100644 --- a/rabbitmq-server/deps/rabbit/src/rabbit_direct.erl +++ b/rabbitmq-server/deps/rabbit/src/rabbit_direct.erl @@ -80,17 +80,23 @@ connect({Username, Password}, VHost, Protocol, Pid, Infos) -> connect0(AuthFun, VHost, Protocol, Pid, Infos) -> case rabbit:is_running() of - true -> case AuthFun() of - {ok, User = #user{username = Username}} -> - notify_auth_result(Username, - user_authentication_success, []), - connect1(User, VHost, Protocol, Pid, Infos); - {refused, Username, Msg, Args} -> - notify_auth_result(Username, - user_authentication_failure, - [{error, rabbit_misc:format(Msg, Args)}]), - {error, {auth_failure, "Refused"}} - end; + true -> + case whereis(rabbit_direct_client_sup) of + undefined -> + {error, broker_is_booting}; + _ -> + case AuthFun() of + {ok, User = #user{username = Username}} -> + notify_auth_result(Username, + user_authentication_success, []), + connect1(User, VHost, Protocol, Pid, Infos); + {refused, Username, Msg, Args} -> + notify_auth_result(Username, + user_authentication_failure, + [{error, rabbit_misc:format(Msg, Args)}]), + {error, {auth_failure, "Refused"}} + end + end; false -> {error, broker_not_found_on_node} end. diff --git a/rabbitmq-server/deps/rabbit/src/rabbit_exchange_type_direct.erl b/rabbitmq-server/deps/rabbit/src/rabbit_exchange_type_direct.erl index 3544a82..312221c 100644 --- a/rabbitmq-server/deps/rabbit/src/rabbit_exchange_type_direct.erl +++ b/rabbitmq-server/deps/rabbit/src/rabbit_exchange_type_direct.erl @@ -32,7 +32,7 @@ {enables, kernel_ready}]}). description() -> - [{description, <<"AMQP direct exchange, as per the AMQP specification">>}]. + [{description, <<"AMQP 0-9-1 direct exchange, a built-in type">>}]. serialise_events() -> false. diff --git a/rabbitmq-server/deps/rabbit/src/rabbit_exchange_type_fanout.erl b/rabbitmq-server/deps/rabbit/src/rabbit_exchange_type_fanout.erl index 04dc2b8..8c38de7 100644 --- a/rabbitmq-server/deps/rabbit/src/rabbit_exchange_type_fanout.erl +++ b/rabbitmq-server/deps/rabbit/src/rabbit_exchange_type_fanout.erl @@ -32,7 +32,7 @@ {enables, kernel_ready}]}). description() -> - [{description, <<"AMQP fanout exchange, as per the AMQP specification">>}]. + [{description, <<"AMQP 0-9-1 fanout exchange, a built-in type">>}]. serialise_events() -> false. diff --git a/rabbitmq-server/deps/rabbit/src/rabbit_exchange_type_headers.erl b/rabbitmq-server/deps/rabbit/src/rabbit_exchange_type_headers.erl index 4702fba..bde01d5 100644 --- a/rabbitmq-server/deps/rabbit/src/rabbit_exchange_type_headers.erl +++ b/rabbitmq-server/deps/rabbit/src/rabbit_exchange_type_headers.erl @@ -37,7 +37,7 @@ boolean(). description() -> - [{description, <<"AMQP headers exchange, as per the AMQP specification">>}]. + [{description, <<"AMQP 0-9-1 headers exchange, a built-in type">>}]. serialise_events() -> false. diff --git a/rabbitmq-server/deps/rabbit/src/rabbit_exchange_type_topic.erl b/rabbitmq-server/deps/rabbit/src/rabbit_exchange_type_topic.erl index f04f68f..f00ebef 100644 --- a/rabbitmq-server/deps/rabbit/src/rabbit_exchange_type_topic.erl +++ b/rabbitmq-server/deps/rabbit/src/rabbit_exchange_type_topic.erl @@ -35,7 +35,7 @@ %%---------------------------------------------------------------------------- description() -> - [{description, <<"AMQP topic exchange, as per the AMQP specification">>}]. + [{description, <<"AMQP 0-9-1 topic exchange, a built-in type">>}]. serialise_events() -> false. diff --git a/rabbitmq-server/deps/rabbit/src/rabbit_looking_glass.erl b/rabbitmq-server/deps/rabbit/src/rabbit_looking_glass.erl new file mode 100644 index 0000000..6cd53db --- /dev/null +++ b/rabbitmq-server/deps/rabbit/src/rabbit_looking_glass.erl @@ -0,0 +1,56 @@ +%% The contents of this file are subject to the Mozilla Public License +%% Version 1.1 (the "License"); you may not use this file except in +%% compliance with the License. You may obtain a copy of the License +%% at http://www.mozilla.org/MPL/ +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and +%% limitations under the License. +%% +%% The Original Code is RabbitMQ. +%% +%% The Initial Developer of the Original Code is GoPivotal, Inc. +%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved. +%% + +-module(rabbit_looking_glass). + +-ignore_xref([{lg, trace, 4}]). +-ignore_xref([{maps, from_list, 1}]). + +-export([boot/0]). +-export([connections/0]). + +boot() -> + case os:getenv("RABBITMQ_TRACER") of + false -> + ok; + Value -> + Input = parse_value(Value), + rabbit_log:info( + "Enabling Looking Glass profiler, input value: ~p", + [Input] + ), + {ok, _} = application:ensure_all_started(looking_glass), + lg:trace( + Input, + lg_file_tracer, + "traces.lz4", + maps:from_list([ + {mode, profile}, + {running, true}, + {send, true}] + ) + ) + end. + +parse_value(Value) -> + [begin + [Mod, Fun] = string:tokens(C, ":"), + {callback, list_to_atom(Mod), list_to_atom(Fun)} + end || C <- string:tokens(Value, ",")]. + +connections() -> + Pids = [Pid || {{conns_sup, _}, Pid} <- ets:tab2list(ranch_server)], + [{app, rabbit}, {app, rabbit_common}, {scope, Pids}]. diff --git a/rabbitmq-server/deps/rabbit/src/rabbit_mirror_queue_misc.erl b/rabbitmq-server/deps/rabbit/src/rabbit_mirror_queue_misc.erl index 375a036..333aa2c 100644 --- a/rabbitmq-server/deps/rabbit/src/rabbit_mirror_queue_misc.erl +++ b/rabbitmq-server/deps/rabbit/src/rabbit_mirror_queue_misc.erl @@ -19,8 +19,9 @@ -export([remove_from_queue/3, on_node_up/0, add_mirrors/3, report_deaths/4, store_updated_slaves/1, - initial_queue_node/2, suggested_queue_nodes/1, - is_mirrored/1, update_mirrors/2, update_mirrors/1, validate_policy/1, + initial_queue_node/2, suggested_queue_nodes/1, actual_queue_nodes/1, + is_mirrored/1, is_mirrored_ha_nodes/1, + update_mirrors/2, update_mirrors/1, validate_policy/1, maybe_auto_sync/1, maybe_drop_master_after_sync/1, sync_batch_size/1, log_info/3, log_warning/3]). @@ -31,6 +32,8 @@ -include("rabbit.hrl"). +-define(HA_NODES_MODULE, rabbit_mirror_queue_mode_nodes). + -rabbit_boot_step( {?MODULE, [{description, "HA policy validation"}, @@ -355,6 +358,12 @@ is_mirrored(Q) -> _ -> false end. +is_mirrored_ha_nodes(Q) -> + case module(Q) of + {ok, ?HA_NODES_MODULE} -> true; + _ -> false + end. + actual_queue_nodes(#amqqueue{pid = MPid, slave_pids = SPids, sync_slave_pids = SSPids}) -> diff --git a/rabbitmq-server/deps/rabbit/src/rabbit_mirror_queue_slave.erl b/rabbitmq-server/deps/rabbit/src/rabbit_mirror_queue_slave.erl index 6017e5a..008d8ec 100644 --- a/rabbitmq-server/deps/rabbit/src/rabbit_mirror_queue_slave.erl +++ b/rabbitmq-server/deps/rabbit/src/rabbit_mirror_queue_slave.erl @@ -348,6 +348,9 @@ handle_info({bump_credit, Msg}, State) -> credit_flow:handle_bump_msg(Msg), noreply(State); +handle_info(bump_reduce_memory_use, State) -> + noreply(State); + %% In the event of a short partition during sync we can detect the %% master's 'death', drop out of sync, and then receive sync messages %% which were still in flight. Ignore them. diff --git a/rabbitmq-server/deps/rabbit/src/rabbit_networking.erl b/rabbitmq-server/deps/rabbit/src/rabbit_networking.erl index 8b201fd..d64b850 100644 --- a/rabbitmq-server/deps/rabbit/src/rabbit_networking.erl +++ b/rabbitmq-server/deps/rabbit/src/rabbit_networking.erl @@ -305,10 +305,16 @@ connection_info_all(Items, Ref, AggregatorPid) -> connections()). close_connection(Pid, Explanation) -> - rabbit_log:info("Closing connection ~p because ~p~n", [Pid, Explanation]), case lists:member(Pid, connections()) of - true -> rabbit_reader:shutdown(Pid, Explanation); - false -> throw({error, {not_a_connection_pid, Pid}}) + true -> + Res = rabbit_reader:shutdown(Pid, Explanation), + rabbit_log:info("Closing connection ~p because ~p~n", [Pid, Explanation]), + Res; + false -> + rabbit_log:warning("Asked to close connection ~p (reason: ~p) " + "but no running cluster node reported it as an active connection. Was it already closed? ~n", + [Pid, Explanation]), + ok end. force_connection_event_refresh(Ref) -> diff --git a/rabbitmq-server/deps/rabbit/src/rabbit_node_monitor.erl b/rabbitmq-server/deps/rabbit/src/rabbit_node_monitor.erl index 810df2d..8bf79f7 100644 --- a/rabbitmq-server/deps/rabbit/src/rabbit_node_monitor.erl +++ b/rabbitmq-server/deps/rabbit/src/rabbit_node_monitor.erl @@ -623,6 +623,10 @@ handle_info(ping_up_nodes, State) -> [cast(N, keepalive) || N <- alive_nodes() -- [node()]], {noreply, ensure_keepalive_timer(State#state{keepalive_timer = undefined})}; +handle_info({'EXIT', _, _} = Info, State = #state{autoheal = AState0}) -> + AState = rabbit_autoheal:process_down(Info, AState0), + {noreply, State#state{autoheal = AState}}; + handle_info(_Info, State) -> {noreply, State}. @@ -686,12 +690,18 @@ await_cluster_recovery(Condition) -> ok. run_outside_applications(Fun, WaitForExistingProcess) -> - spawn(fun () -> - %% If our group leader is inside an application we are about - %% to stop, application:stop/1 does not return. - group_leader(whereis(init), self()), - register_outside_app_process(Fun, WaitForExistingProcess) - end). + spawn_link(fun () -> + %% Ignore exit messages from the monitor - the link is needed + %% to ensure the monitor detects abnormal exits from this process + %% and can reset the 'restarting' status on the autoheal, avoiding + %% a deadlock. The monitor is restarted when rabbit does, so messages + %% in the other direction should be ignored. + process_flag(trap_exit, true), + %% If our group leader is inside an application we are about + %% to stop, application:stop/1 does not return. + group_leader(whereis(init), self()), + register_outside_app_process(Fun, WaitForExistingProcess) + end). register_outside_app_process(Fun, WaitForExistingProcess) -> %% Ensure only one such process at a time, the exit(badarg) is diff --git a/rabbitmq-server/deps/rabbit/src/rabbit_plugins.erl b/rabbitmq-server/deps/rabbit/src/rabbit_plugins.erl index 7c1217c..f5f2491 100644 --- a/rabbitmq-server/deps/rabbit/src/rabbit_plugins.erl +++ b/rabbitmq-server/deps/rabbit/src/rabbit_plugins.erl @@ -54,8 +54,19 @@ ensure(FileJustChanged0) -> {disabled, Stop}]), rabbit:stop_apps(Stop), clean_plugins(Stop), - rabbit_log:info("Plugins changed; enabled ~p, disabled ~p~n", - [Start, Stop]), + case {Start, Stop} of + {[], []} -> + ok; + {[], _} -> + rabbit_log:info("Plugins changed; disabled ~p~n", + [Stop]); + {_, []} -> + rabbit_log:info("Plugins changed; enabled ~p~n", + [Start]); + {_, _} -> + rabbit_log:info("Plugins changed; enabled ~p, disabled ~p~n", + [Start, Stop]) + end, {ok, Start, Stop}; _ -> {error, {enabled_plugins_mismatch, FileJustChanged, OurFile}} @@ -407,16 +418,31 @@ remove_duplicate_plugins([Plugin|Rest], {Plugins0, Problems0}) -> maybe_keep_required_deps(true, Plugins) -> Plugins; maybe_keep_required_deps(false, Plugins) -> - %% We load the "rabbit" application to be sure we can get the - %% "applications" key. This is required for rabbitmq-plugins for - %% instance. - application:load(rabbit), - {ok, RabbitDeps} = application:get_key(rabbit, applications), + RabbitDeps = list_all_deps([rabbit]), lists:filter(fun(#plugin{name = Name}) -> not lists:member(Name, RabbitDeps) end, Plugins). +list_all_deps(Applications) -> + list_all_deps(Applications, []). + +list_all_deps([Application | Applications], Deps) -> + %% We load the application to be sure we can get the "applications" key. + %% This is required for rabbitmq-plugins for instance. + application:load(Application), + NewDeps = [Application | Deps], + case application:get_key(Application, applications) of + {ok, ApplicationDeps} -> + RemainingApplications0 = ApplicationDeps ++ Applications, + RemainingApplications = RemainingApplications0 -- NewDeps, + list_all_deps(RemainingApplications, NewDeps); + undefined -> + list_all_deps(Applications, NewDeps) + end; +list_all_deps([], Deps) -> + Deps. + remove_otp_overrideable_plugins(Plugins) -> lists:filter(fun(P) -> not plugin_provided_by_otp(P) end, Plugins). diff --git a/rabbitmq-server/deps/rabbit/src/rabbit_queue_location_min_masters.erl b/rabbitmq-server/deps/rabbit/src/rabbit_queue_location_min_masters.erl index a1e73ee..5d6f568 100644 --- a/rabbitmq-server/deps/rabbit/src/rabbit_queue_location_min_masters.erl +++ b/rabbitmq-server/deps/rabbit/src/rabbit_queue_location_min_masters.erl @@ -37,8 +37,8 @@ description() -> [{description, <<"Locate queue master node from cluster node with least bound queues">>}]. -queue_master_location(#amqqueue{}) -> - Cluster = rabbit_queue_master_location_misc:all_nodes(), +queue_master_location(#amqqueue{} = Q) -> + Cluster = rabbit_queue_master_location_misc:all_nodes(Q), VHosts = rabbit_vhost:list(), BoundQueueMasters = get_bound_queue_masters_per_vhost(VHosts, []), {_Count, MinMaster}= get_min_master(Cluster, BoundQueueMasters), diff --git a/rabbitmq-server/deps/rabbit/src/rabbit_queue_location_random.erl b/rabbitmq-server/deps/rabbit/src/rabbit_queue_location_random.erl index 3a3a236..d103d3f 100644 --- a/rabbitmq-server/deps/rabbit/src/rabbit_queue_location_random.erl +++ b/rabbitmq-server/deps/rabbit/src/rabbit_queue_location_random.erl @@ -37,8 +37,8 @@ description() -> [{description, <<"Locate queue master node from cluster in a random manner">>}]. -queue_master_location(#amqqueue{}) -> - Cluster = rabbit_queue_master_location_misc:all_nodes(), +queue_master_location(#amqqueue{} = Q) -> + Cluster = rabbit_queue_master_location_misc:all_nodes(Q), RandomPos = erlang:phash2(time_compat:monotonic_time(), length(Cluster)), MasterNode = lists:nth(RandomPos + 1, Cluster), {ok, MasterNode}. diff --git a/rabbitmq-server/deps/rabbit/src/rabbit_queue_location_validator.erl b/rabbitmq-server/deps/rabbit/src/rabbit_queue_location_validator.erl index 2b0f8c7..e70bcd3 100644 --- a/rabbitmq-server/deps/rabbit/src/rabbit_queue_location_validator.erl +++ b/rabbitmq-server/deps/rabbit/src/rabbit_queue_location_validator.erl @@ -54,7 +54,6 @@ module(#amqqueue{} = Q) -> undefined -> no_location_strategy; Mode -> module(Mode) end; - module(Strategy) when is_binary(Strategy) -> case rabbit_registry:binary_to_type(Strategy) of {error, not_found} -> no_location_strategy; @@ -68,4 +67,6 @@ module(Strategy) when is_binary(Strategy) -> _ -> no_location_strategy end - end. + end; +module(Strategy) -> + module(rabbit_data_coercion:to_binary(Strategy)). diff --git a/rabbitmq-server/deps/rabbit/src/rabbit_queue_master_location_misc.erl b/rabbitmq-server/deps/rabbit/src/rabbit_queue_master_location_misc.erl index 0b9efdd..c2cc489 100644 --- a/rabbitmq-server/deps/rabbit/src/rabbit_queue_master_location_misc.erl +++ b/rabbitmq-server/deps/rabbit/src/rabbit_queue_master_location_misc.erl @@ -24,7 +24,7 @@ get_location_mod_by_config/1, get_location_mod_by_args/1, get_location_mod_by_policy/1, - all_nodes/0]). + all_nodes/1]). lookup_master(QueueNameBin, VHostPath) when is_binary(QueueNameBin), is_binary(VHostPath) -> @@ -92,4 +92,20 @@ get_location_mod_by_config(#amqqueue{}) -> _ -> {error, "queue_master_locator undefined"} end. -all_nodes() -> rabbit_mnesia:cluster_nodes(running). +all_nodes(Queue = #amqqueue{}) -> + handle_is_mirrored_ha_nodes(rabbit_mirror_queue_misc:is_mirrored_ha_nodes(Queue), Queue). + +handle_is_mirrored_ha_nodes(false, _Queue) -> + % Note: ha-mode is NOT 'nodes' - it is either exactly or all, which means + % that any node in the cluster is eligible to be the new queue master node + rabbit_nodes:all_running(); +handle_is_mirrored_ha_nodes(true, Queue) -> + % Note: ha-mode is 'nodes', which explicitly specifies allowed nodes. + % We must use suggested_queue_nodes to get that list of nodes as the + % starting point for finding the queue master location + handle_suggested_queue_nodes(rabbit_mirror_queue_misc:suggested_queue_nodes(Queue)). + +handle_suggested_queue_nodes({_MNode, []}) -> + rabbit_nodes:all_running(); +handle_suggested_queue_nodes({MNode, SNodes}) -> + [MNode | SNodes]. diff --git a/rabbitmq-server/deps/rabbit/src/rabbit_variable_queue.erl b/rabbitmq-server/deps/rabbit/src/rabbit_variable_queue.erl index de1fdbf..43bc0e7 100644 --- a/rabbitmq-server/deps/rabbit/src/rabbit_variable_queue.erl +++ b/rabbitmq-server/deps/rabbit/src/rabbit_variable_queue.erl @@ -178,12 +178,12 @@ %% (betas+gammas+delta)/(target_ram_count+betas+gammas+delta). I.e. as %% the target_ram_count shrinks to 0, so must betas and gammas. %% -%% The conversion of betas to gammas is done in batches of at least -%% ?IO_BATCH_SIZE. This value should not be too small, otherwise the -%% frequent operations on the queues of q2 and q3 will not be -%% effectively amortised (switching the direction of queue access -%% defeats amortisation). Note that there is a natural upper bound due -%% to credit_flow limits on the alpha to beta conversion. +%% The conversion of betas to deltas is done if there are at least +%% ?IO_BATCH_SIZE betas in q2 & q3. This value should not be too small, +%% otherwise the frequent operations on the queues of q2 and q3 will not be +%% effectively amortised (switching the direction of queue access defeats +%% amortisation). Note that there is a natural upper bound due to credit_flow +%% limits on the alpha to beta conversion. %% %% The conversion from alphas to betas is chunked due to the %% credit_flow limits of the msg_store. This further smooths the @@ -789,7 +789,7 @@ set_ram_duration_target( (TargetRamCount =/= infinity andalso TargetRamCount1 >= TargetRamCount) of true -> State1; - false -> maybe_reduce_memory_use(State1) + false -> reduce_memory_use(State1) end). maybe_update_rates(State = #vqstate{ in_counter = InCount, @@ -871,7 +871,7 @@ timeout(State = #vqstate { index_state = IndexState }) -> handle_pre_hibernate(State = #vqstate { index_state = IndexState }) -> State #vqstate { index_state = rabbit_queue_index:flush(IndexState) }. -resume(State) -> a(maybe_reduce_memory_use(State)). +resume(State) -> a(reduce_memory_use(State)). msg_rates(#vqstate { rates = #rates { in = AvgIngressRate, out = AvgEgressRate } }) -> @@ -2363,42 +2363,79 @@ reduce_memory_use(State = #vqstate { out = AvgEgress, ack_in = AvgAckIngress, ack_out = AvgAckEgress } }) -> - State1 = #vqstate { q2 = Q2, q3 = Q3 } = + {CreditDiscBound, _} =rabbit_misc:get_env(rabbit, + msg_store_credit_disc_bound, + ?CREDIT_DISC_BOUND), + {NeedResumeA2B, State1} = {_, #vqstate { q2 = Q2, q3 = Q3 }} = case chunk_size(RamMsgCount + gb_trees:size(RPA), TargetRamCount) of - 0 -> State; + 0 -> {false, State}; %% Reduce memory of pending acks and alphas. The order is %% determined based on which is growing faster. Whichever %% comes second may very well get a quota of 0 if the %% first manages to push out the max number of messages. - S1 -> Funs = case ((AvgAckIngress - AvgAckEgress) > + A2BChunk -> + %% In case there are few messages to be sent to a message store + %% and many messages to be embedded to the queue index, + %% we should limit the number of messages to be flushed + %% to avoid blocking the process. + A2BChunkActual = case A2BChunk > CreditDiscBound * 2 of + true -> CreditDiscBound * 2; + false -> A2BChunk + end, + Funs = case ((AvgAckIngress - AvgAckEgress) > (AvgIngress - AvgEgress)) of true -> [fun limit_ram_acks/2, fun push_alphas_to_betas/2]; false -> [fun push_alphas_to_betas/2, fun limit_ram_acks/2] end, - {_, State2} = lists:foldl(fun (ReduceFun, {QuotaN, StateN}) -> + {Quota, State2} = lists:foldl(fun (ReduceFun, {QuotaN, StateN}) -> ReduceFun(QuotaN, StateN) - end, {S1, State}, Funs), - State2 + end, {A2BChunkActual, State}, Funs), + {(Quota == 0) andalso (A2BChunk > A2BChunkActual), State2} end, - - State3 = + Permitted = permitted_beta_count(State1), + {NeedResumeB2D, State3} = + %% If there are more messages with their queue position held in RAM, + %% a.k.a. betas, in Q2 & Q3 than IoBatchSize, + %% write their queue position to disk, a.k.a. push_betas_to_deltas case chunk_size(?QUEUE:len(Q2) + ?QUEUE:len(Q3), - permitted_beta_count(State1)) of - S2 when S2 >= IoBatchSize -> - %% There is an implicit, but subtle, upper bound here. We - %% may shuffle a lot of messages from Q2/3 into delta, but - %% the number of these that require any disk operation, - %% namely index writing, i.e. messages that are genuine - %% betas and not gammas, is bounded by the credit_flow - %% limiting of the alpha->beta conversion above. - push_betas_to_deltas(S2, State1); + Permitted) of + B2DChunk when B2DChunk >= IoBatchSize -> + %% Same as for alphas to betas. Limit a number of messages + %% to be flushed to disk at once to avoid blocking the process. + B2DChunkActual = case B2DChunk > CreditDiscBound * 2 of + true -> CreditDiscBound * 2; + false -> B2DChunk + end, + StateBD = push_betas_to_deltas(B2DChunkActual, State1), + {B2DChunk > B2DChunkActual, StateBD}; _ -> - State1 + {false, State1} end, - %% See rabbitmq-server-290 for the reasons behind this GC call. - garbage_collect(), + %% We can be blocked by the credit flow, or limited by a batch size, + %% or finished with flushing. + %% If blocked by the credit flow - the credit grant will resume processing, + %% if limited by a batch - the batch continuation message should be sent. + %% The continuation message will be prioritised over publishes, + %% but not cinsumptions, so the queue can make progess. + Blocked = credit_flow:blocked(), + case {Blocked, NeedResumeA2B orelse NeedResumeB2D} of + %% Credit bump will continue paging + {true, _} -> ok; + %% Finished with paging + {false, false} -> ok; + %% Planning next batch + {false, true} -> + %% We don't want to use self-credit-flow, because it's harder to + %% reason about. So the process sends a (prioritised) message to + %% itself and sets a waiting_bump value to keep the message box clean + case get(waiting_bump) of + true -> ok; + _ -> self() ! bump_reduce_memory_use, + put(waiting_bump, true) + end + end, State3; %% When using lazy queues, there are no alphas, so we don't need to %% call push_alphas_to_betas/2. diff --git a/rabbitmq-server/deps/rabbit/src/rabbit_vm.erl b/rabbitmq-server/deps/rabbit/src/rabbit_vm.erl index 685cea2..c2fee7d 100644 --- a/rabbitmq-server/deps/rabbit/src/rabbit_vm.erl +++ b/rabbitmq-server/deps/rabbit/src/rabbit_vm.erl @@ -51,9 +51,6 @@ memory() -> 0 end, MgmtDbETS = ets_memory([rabbit_mgmt_storage]), - VMTotal = vm_memory_monitor:get_process_memory(), - - [{total, ErlangTotal}, {processes, Processes}, {ets, ETS}, @@ -63,48 +60,59 @@ memory() -> {system, System}] = erlang:memory([total, processes, ets, atom, binary, code, system]), - Unaccounted = case VMTotal - ErlangTotal of - GTZ when GTZ > 0 -> GTZ; - _LTZ -> 0 + Strategy = vm_memory_monitor:get_memory_calculation_strategy(), + {Allocated, VMTotal} = case Strategy of + erlang -> {ErlangTotal, ErlangTotal}; + allocated -> + Alloc = recon_alloc:memory(allocated), + {Alloc, Alloc}; + rss -> + Alloc = recon_alloc:memory(allocated), + Vm = vm_memory_monitor:get_process_memory(current), + {Alloc, Vm} end, + AllocatedUnused = max(Allocated - ErlangTotal, 0), + OSReserved = max(VMTotal - Allocated, 0), + OtherProc = Processes - ConnsReader - ConnsWriter - ConnsChannel - ConnsOther - Qs - QsSlave - MsgIndexProc - Plugins - MgmtDbProc - MetricsProc, [ %% Connections - {connection_readers, ConnsReader}, - {connection_writers, ConnsWriter}, - {connection_channels, ConnsChannel}, - {connection_other, ConnsOther}, + {connection_readers, ConnsReader}, + {connection_writers, ConnsWriter}, + {connection_channels, ConnsChannel}, + {connection_other, ConnsOther}, %% Queues - {queue_procs, Qs}, - {queue_slave_procs, QsSlave}, + {queue_procs, Qs}, + {queue_slave_procs, QsSlave}, %% Processes - {plugins, Plugins}, - {other_proc, lists:max([0, OtherProc])}, %% [1] + {plugins, Plugins}, + {other_proc, lists:max([0, OtherProc])}, %% [1] %% Metrics - {metrics, MetricsETS + MetricsProc}, - {mgmt_db, MgmtDbETS + MgmtDbProc}, + {metrics, MetricsETS + MetricsProc}, + {mgmt_db, MgmtDbETS + MgmtDbProc}, %% ETS - {mnesia, MnesiaETS}, - {other_ets, ETS - MnesiaETS - MetricsETS - MgmtDbETS - MsgIndexETS}, + {mnesia, MnesiaETS}, + {other_ets, ETS - MnesiaETS - MetricsETS - MgmtDbETS - MsgIndexETS}, %% Messages (mostly, some binaries are not messages) - {binary, Bin}, - {msg_index, MsgIndexETS + MsgIndexProc}, + {binary, Bin}, + {msg_index, MsgIndexETS + MsgIndexProc}, %% System - {code, Code}, - {atom, Atom}, - {other_system, System - ETS - Bin - Code - Atom + Unaccounted}, - - {total, VMTotal} + {code, Code}, + {atom, Atom}, + {other_system, System - ETS - Bin - Code - Atom}, + {allocated_unused, AllocatedUnused}, + {reserved_unallocated, OSReserved}, + {total, VMTotal} ]. %% [1] - erlang:memory(processes) can be less than the sum of its %% parts. Rather than display something nonsensical, just silence any diff --git a/rabbitmq-server/deps/rabbit/src/tcp_listener_sup.erl b/rabbitmq-server/deps/rabbit/src/tcp_listener_sup.erl index 1465453..7cb1214 100644 --- a/rabbitmq-server/deps/rabbit/src/tcp_listener_sup.erl +++ b/rabbitmq-server/deps/rabbit/src/tcp_listener_sup.erl @@ -49,10 +49,11 @@ start_link(IPAddress, Port, Transport, SocketOpts, ProtoSup, ProtoOpts, OnStartu init({IPAddress, Port, Transport, SocketOpts, ProtoSup, ProtoOpts, OnStartup, OnShutdown, ConcurrentAcceptorCount, Label}) -> {ok, AckTimeout} = application:get_env(rabbit, ssl_handshake_timeout), + MaxConnections = rabbit_misc:get_env(rabbit, connection_max, infinity), {ok, {{one_for_all, 10, 10}, [ ranch:child_spec({acceptor, IPAddress, Port}, ConcurrentAcceptorCount, Transport, [{port, Port}, {ip, IPAddress}, - {max_connections, infinity}, + {max_connections, MaxConnections}, {ack_timeout, AckTimeout}, {connection_type, supervisor}|SocketOpts], ProtoSup, ProtoOpts), diff --git a/rabbitmq-server/deps/rabbit_common/LICENSE-BSD-recon b/rabbitmq-server/deps/rabbit_common/LICENSE-BSD-recon new file mode 100644 index 0000000..be0aebb --- /dev/null +++ b/rabbitmq-server/deps/rabbit_common/LICENSE-BSD-recon @@ -0,0 +1,27 @@ +Copyright (c) 2012-2017, Frédéric Trottier-Hébert +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + The names of its contributors may not be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/rabbitmq-server/deps/rabbit_common/Makefile b/rabbitmq-server/deps/rabbit_common/Makefile index 5751b31..ddc53a7 100644 --- a/rabbitmq-server/deps/rabbit_common/Makefile +++ b/rabbitmq-server/deps/rabbit_common/Makefile @@ -19,6 +19,7 @@ define PROJECT_APP_EXTRA_KEYS ]} endef +DEPS = recon LOCAL_DEPS = compiler syntax_tools xmerl # FIXME: Use erlang.mk patched for RabbitMQ, while waiting for PRs to be @@ -44,6 +45,8 @@ DEP_PLUGINS = $(PROJECT)/mk/rabbitmq-build.mk \ $(PROJECT)/mk/rabbitmq-test.mk \ $(PROJECT)/mk/rabbitmq-tools.mk +WITHOUT = plugins/proper + include mk/rabbitmq-components.mk include erlang.mk @@ -57,6 +60,12 @@ ifeq ($(call compare_version,$(ERTS_VER),$(tls_atom_version_MAX_ERTS_VER),<),tru RMQ_ERLC_OPTS += -Ddefine_tls_atom_version endif +# supervisor state change from erts 7.0 (OTP 18) +new_sup2_state_MIN_ERTS_VER = 7.0 +ifeq ($(call compare_version,$(ERTS_VER),$(new_sup2_state_MIN_ERTS_VER),>),true) +RMQ_ERLC_OPTS += -Ddefine_new_sup2_state +endif + # For src/*_compat.erl modules, we don't want to set -Werror because for # instance, warnings about removed functions (e.g. ssl:connection_info/1 # in Erlang 20) can't be turned off. diff --git a/rabbitmq-server/deps/rabbit_common/erlang.mk b/rabbitmq-server/deps/rabbit_common/erlang.mk index 89ba561..4a24e46 100644 --- a/rabbitmq-server/deps/rabbit_common/erlang.mk +++ b/rabbitmq-server/deps/rabbit_common/erlang.mk @@ -17,8 +17,8 @@ ERLANG_MK_FILENAME := $(realpath $(lastword $(MAKEFILE_LIST))) export ERLANG_MK_FILENAME -ERLANG_MK_VERSION = 2.0.0-pre.2-256-g2cce185 -ERLANG_MK_WITHOUT = +ERLANG_MK_VERSION = 2.0.0-pre.2-278-gd9a9158 +ERLANG_MK_WITHOUT = plugins/proper # Make 3.81 and 3.82 are deprecated. @@ -2023,6 +2023,14 @@ pkg_ibrowse_fetch = git pkg_ibrowse_repo = https://github.com/cmullaparthi/ibrowse pkg_ibrowse_commit = master +PACKAGES += idna +pkg_idna_name = idna +pkg_idna_description = Erlang IDNA lib +pkg_idna_homepage = https://github.com/benoitc/erlang-idna +pkg_idna_fetch = git +pkg_idna_repo = https://github.com/benoitc/erlang-idna +pkg_idna_commit = master + PACKAGES += ierlang pkg_ierlang_name = ierlang pkg_ierlang_description = An Erlang language kernel for IPython. @@ -2298,9 +2306,9 @@ pkg_kvs_commit = master PACKAGES += lager pkg_lager_name = lager pkg_lager_description = A logging framework for Erlang/OTP. -pkg_lager_homepage = https://github.com/basho/lager +pkg_lager_homepage = https://github.com/erlang-lager/lager pkg_lager_fetch = git -pkg_lager_repo = https://github.com/basho/lager +pkg_lager_repo = https://github.com/erlang-lager/lager pkg_lager_commit = master PACKAGES += lager_amqp_backend @@ -2314,9 +2322,9 @@ pkg_lager_amqp_backend_commit = master PACKAGES += lager_syslog pkg_lager_syslog_name = lager_syslog pkg_lager_syslog_description = Syslog backend for lager -pkg_lager_syslog_homepage = https://github.com/basho/lager_syslog +pkg_lager_syslog_homepage = https://github.com/erlang-lager/lager_syslog pkg_lager_syslog_fetch = git -pkg_lager_syslog_repo = https://github.com/basho/lager_syslog +pkg_lager_syslog_repo = https://github.com/erlang-lager/lager_syslog pkg_lager_syslog_commit = master PACKAGES += lambdapad @@ -3786,9 +3794,9 @@ pkg_trie_commit = master PACKAGES += triq pkg_triq_name = triq pkg_triq_description = Trifork QuickCheck -pkg_triq_homepage = https://github.com/krestenkrab/triq +pkg_triq_homepage = https://github.com/triqng/triq pkg_triq_fetch = git -pkg_triq_repo = https://github.com/krestenkrab/triq +pkg_triq_repo = https://github.com/triqng/triq.git pkg_triq_commit = master PACKAGES += tunctl @@ -4280,7 +4288,7 @@ endef # if given. Do it for all 3 possible Makefile file names. ifeq ($(NO_AUTOPATCH_ERLANG_MK),) define dep_autopatch_erlang_mk - $t for f in Makefile makefile GNUmakefile; do \ + for f in Makefile makefile GNUmakefile; do \ if [ -f $(DEPS_DIR)/$1/$$f ]; then \ sed -i.bak s/'include *erlang.mk'/'include $$(if $$(ERLANG_MK_FILENAME),$$(ERLANG_MK_FILENAME),erlang.mk)'/ $(DEPS_DIR)/$1/$$f; \ fi \ @@ -4357,6 +4365,8 @@ define dep_autopatch_rebar.erl lists:foreach(fun ({d, D}) -> Write("ERLC_OPTS += -D" ++ atom_to_list(D) ++ "=1\n"); + ({d, DKey, DVal}) -> + Write("ERLC_OPTS += -D" ++ atom_to_list(DKey) ++ "=" ++ atom_to_list(DVal) ++ "\n"); ({i, I}) -> Write(["ERLC_OPTS += -I ", I, "\n"]); ({platform_define, Regex, D}) -> @@ -4579,7 +4589,7 @@ define dep_autopatch_appsrc_script.erl AppSrc = "$(call core_native_path,$(DEPS_DIR)/$1/src/$1.app.src)", AppSrcScript = AppSrc ++ ".script", Bindings = erl_eval:new_bindings(), - {ok, Conf} = file:script(AppSrcScript, Bindings), + {ok, [Conf]} = file:script(AppSrcScript, Bindings), ok = file:write_file(AppSrc, io_lib:format("~p.~n", [Conf])), halt() endef @@ -4731,6 +4741,87 @@ ERLANG_MK_RECURSIVE_REL_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-rel-deps-list.log ERLANG_MK_RECURSIVE_TEST_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-test-deps-list.log ERLANG_MK_RECURSIVE_SHELL_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-shell-deps-list.log +# Copyright (c) 2015-2017, Loïc Hoguin +# This file is part of erlang.mk and subject to the terms of the ISC License. + +.PHONY: distclean-kerl + +KERL_INSTALL_DIR ?= $(HOME)/erlang + +ifeq ($(strip $(KERL)),) +KERL := $(ERLANG_MK_TMP)/kerl/kerl +endif + +export KERL + +KERL_GIT ?= https://github.com/kerl/kerl +KERL_COMMIT ?= master + +KERL_MAKEFLAGS ?= + +OTP_GIT ?= https://github.com/erlang/otp + +define kerl_otp_target +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(1)),) +$(KERL_INSTALL_DIR)/$(1): $(KERL) + MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $(1) $(1) + $(KERL) install $(1) $(KERL_INSTALL_DIR)/$(1) +endif +endef + +define kerl_hipe_target +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$1-native),) +$(KERL_INSTALL_DIR)/$1-native: $(KERL) + KERL_CONFIGURE_OPTIONS=--enable-native-libs \ + MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $1 $1-native + $(KERL) install $1-native $(KERL_INSTALL_DIR)/$1-native +endif +endef + +$(KERL): + $(verbose) mkdir -p $(ERLANG_MK_TMP) + $(gen_verbose) git clone --depth 1 $(KERL_GIT) $(ERLANG_MK_TMP)/kerl + $(verbose) cd $(ERLANG_MK_TMP)/kerl && git checkout $(KERL_COMMIT) + $(verbose) chmod +x $(KERL) + +distclean:: distclean-kerl + +distclean-kerl: + $(gen_verbose) rm -rf $(KERL) + +# Allow users to select which version of Erlang/OTP to use for a project. + +ERLANG_OTP ?= +ERLANG_HIPE ?= + +# Use kerl to enforce a specific Erlang/OTP version for a project. +ifneq ($(strip $(ERLANG_OTP)),) +export PATH := $(KERL_INSTALL_DIR)/$(ERLANG_OTP)/bin:$(PATH) +SHELL := env PATH=$(PATH) $(SHELL) +$(eval $(call kerl_otp_target,$(ERLANG_OTP))) + +# Build Erlang/OTP only if it doesn't already exist. +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(ERLANG_OTP))$(BUILD_ERLANG_OTP),) +$(info Building Erlang/OTP $(ERLANG_OTP)... Please wait...) +$(shell $(MAKE) $(KERL_INSTALL_DIR)/$(ERLANG_OTP) ERLANG_OTP=$(ERLANG_OTP) BUILD_ERLANG_OTP=1 >&2) +endif + +else +# Same for a HiPE enabled VM. +ifneq ($(strip $(ERLANG_HIPE)),) +export PATH := $(KERL_INSTALL_DIR)/$(ERLANG_HIPE)-native/bin:$(PATH) +SHELL := env PATH=$(PATH) $(SHELL) +$(eval $(call kerl_hipe_target,$(ERLANG_HIPE))) + +# Build Erlang/OTP only if it doesn't already exist. +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(ERLANG_HIPE))$(BUILD_ERLANG_OTP),) +$(info Building HiPE-enabled Erlang/OTP $(ERLANG_OTP)... Please wait...) +$(shell $(MAKE) $(KERL_INSTALL_DIR)/$(ERLANG_HIPE) ERLANG_HIPE=$(ERLANG_HIPE) BUILD_ERLANG_OTP=1 >&2) +endif + +endif +endif + # Copyright (c) 2015-2016, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. @@ -5966,10 +6057,10 @@ else $(call render_template,bs_erl_nif,src/$n.erl) endif -# Copyright (c) 2015-2016, Loïc Hoguin +# Copyright (c) 2015-2017, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. -.PHONY: ci ci-prepare ci-setup distclean-kerl +.PHONY: ci ci-prepare ci-setup CI_OTP ?= CI_HIPE ?= @@ -5987,24 +6078,9 @@ ifeq ($(strip $(CI_OTP) $(CI_HIPE) $(CI_ERLLVM)),) ci:: else -ifeq ($(strip $(KERL)),) -KERL := $(ERLANG_MK_TMP)/kerl/kerl -endif - -export KERL - -KERL_GIT ?= https://github.com/kerl/kerl -KERL_COMMIT ?= master - -KERL_MAKEFLAGS ?= - -OTP_GIT ?= https://github.com/erlang/otp - -CI_INSTALL_DIR ?= $(HOME)/erlang - ci:: $(addprefix ci-,$(CI_OTP) $(addsuffix -native,$(CI_HIPE)) $(addsuffix -erllvm,$(CI_ERLLVM))) -ci-prepare: $(addprefix $(CI_INSTALL_DIR)/,$(CI_OTP) $(addsuffix -native,$(CI_HIPE))) +ci-prepare: $(addprefix $(KERL_INSTALL_DIR)/,$(CI_OTP) $(addsuffix -native,$(CI_HIPE))) ci-setup:: @@ -6014,10 +6090,10 @@ ci_verbose_0 = @echo " CI " $(1); ci_verbose = $(ci_verbose_$(V)) define ci_target -ci-$1: $(CI_INSTALL_DIR)/$2 +ci-$1: $(KERL_INSTALL_DIR)/$2 $(verbose) $(MAKE) --no-print-directory clean $(ci_verbose) \ - PATH="$(CI_INSTALL_DIR)/$2/bin:$(PATH)" \ + PATH="$(KERL_INSTALL_DIR)/$2/bin:$(PATH)" \ CI_OTP_RELEASE="$1" \ CT_OPTS="-label $1" \ CI_VM="$3" \ @@ -6029,32 +6105,8 @@ $(foreach otp,$(CI_OTP),$(eval $(call ci_target,$(otp),$(otp),otp))) $(foreach otp,$(CI_HIPE),$(eval $(call ci_target,$(otp)-native,$(otp)-native,native))) $(foreach otp,$(CI_ERLLVM),$(eval $(call ci_target,$(otp)-erllvm,$(otp)-native,erllvm))) -define ci_otp_target -ifeq ($(wildcard $(CI_INSTALL_DIR)/$(1)),) -$(CI_INSTALL_DIR)/$(1): $(KERL) - MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $(1) $(1) - $(KERL) install $(1) $(CI_INSTALL_DIR)/$(1) -endif -endef - -$(foreach otp,$(CI_OTP),$(eval $(call ci_otp_target,$(otp)))) - -define ci_hipe_target -ifeq ($(wildcard $(CI_INSTALL_DIR)/$1-native),) -$(CI_INSTALL_DIR)/$1-native: $(KERL) - KERL_CONFIGURE_OPTIONS=--enable-native-libs \ - MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $1 $1-native - $(KERL) install $1-native $(CI_INSTALL_DIR)/$1-native -endif -endef - -$(foreach otp,$(sort $(CI_HIPE) $(CI_ERLLLVM)),$(eval $(call ci_hipe_target,$(otp)))) - -$(KERL): - $(verbose) mkdir -p $(ERLANG_MK_TMP) - $(gen_verbose) git clone --depth 1 $(KERL_GIT) $(ERLANG_MK_TMP)/kerl - $(verbose) cd $(ERLANG_MK_TMP)/kerl && git checkout $(KERL_COMMIT) - $(verbose) chmod +x $(KERL) +$(foreach otp,$(CI_OTP),$(eval $(call kerl_otp_target,$(otp)))) +$(foreach otp,$(sort $(CI_HIPE) $(CI_ERLLLVM)),$(eval $(call kerl_hipe_target,$(otp)))) help:: $(verbose) printf "%s\n" "" \ @@ -6064,10 +6116,6 @@ help:: "The CI_OTP variable must be defined with the Erlang versions" \ "that must be tested. For example: CI_OTP = OTP-17.3.4 OTP-17.5.3" -distclean:: distclean-kerl - -distclean-kerl: - $(gen_verbose) rm -rf $(KERL) endif # Copyright (c) 2013-2016, Loïc Hoguin @@ -6443,7 +6491,7 @@ endif RELX ?= $(ERLANG_MK_TMP)/relx RELX_CONFIG ?= $(CURDIR)/relx.config -RELX_URL ?= https://github.com/erlware/relx/releases/download/v3.19.0/relx +RELX_URL ?= https://github.com/erlware/relx/releases/download/v3.23.0/relx RELX_OPTS ?= RELX_OUTPUT_DIR ?= _rel RELX_REL_EXT ?= @@ -6489,7 +6537,7 @@ distclean-relx-rel: # Run target. ifeq ($(wildcard $(RELX_CONFIG)),) -run: +run:: else define get_relx_release.erl @@ -6513,7 +6561,7 @@ ifeq ($(PLATFORM),msys2) RELX_REL_EXT := .cmd endif -run: all +run:: all $(verbose) $(RELX_OUTPUT_DIR)/$(RELX_REL_NAME)/bin/$(RELX_REL_NAME)$(RELX_REL_EXT) console help:: @@ -6579,7 +6627,10 @@ ifeq ($(filter triq,$(DEPS) $(TEST_DEPS)),triq) tests:: triq define triq_check.erl - code:add_pathsa(["$(call core_native_path,$(CURDIR)/ebin)", "$(call core_native_path,$(DEPS_DIR)/*/ebin)"]), + code:add_pathsa([ + "$(call core_native_path,$(CURDIR)/ebin)", + "$(call core_native_path,$(DEPS_DIR)/*/ebin)", + "$(call core_native_path,$(TEST_DIR))"]), try case $(1) of all -> [true] =:= lists:usort([triq:check(M) || M <- [$(call comma_list,$(3))]]); @@ -6590,7 +6641,7 @@ define triq_check.erl true -> halt(0); _ -> halt(1) catch error:undef -> - io:format("Undefined property or module~n"), + io:format("Undefined property or module?~n~p~n", [erlang:get_stacktrace()]), halt(0) end. endef @@ -6606,7 +6657,8 @@ triq: test-build endif else triq: test-build - $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename $(wildcard ebin/*.beam)))))) + $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename \ + $(wildcard ebin/*.beam) $(call core_find,$(TEST_DIR)/,*.beam)))))) $(gen_verbose) $(call erlang,$(call triq_check.erl,all,undefined,$(MODULES))) endif endif diff --git a/rabbitmq-server/deps/rabbit_common/include/rabbit.hrl b/rabbitmq-server/deps/rabbit_common/include/rabbit.hrl index 6c75284..bc2bce1 100644 --- a/rabbitmq-server/deps/rabbit_common/include/rabbit.hrl +++ b/rabbitmq-server/deps/rabbit_common/include/rabbit.hrl @@ -132,7 +132,7 @@ %%---------------------------------------------------------------------------- --define(COPYRIGHT_MESSAGE, "Copyright (C) 2007-2017 Pivotal Software, Inc."). +-define(COPYRIGHT_MESSAGE, "Copyright (C) 2007-2018 Pivotal Software, Inc."). -define(INFORMATION_MESSAGE, "Licensed under the MPL. See http://www.rabbitmq.com/"). -define(OTP_MINIMUM, "R16B03"). -define(ERTS_MINIMUM, "5.10.4"). diff --git a/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-build.mk b/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-build.mk index adf710c..6c4e2d6 100644 --- a/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-build.mk +++ b/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-build.mk @@ -2,23 +2,11 @@ # Compiler flags. # -------------------------------------------------------------------- -TEST_ERLC_OPTS += +nowarn_export_all - -define compare_version -$(shell awk 'BEGIN { - split("$(1)", v1, "."); - version1 = v1[1] * 1000000 + v1[2] * 10000 + v1[3] * 100 + v1[4]; - - split("$(2)", v2, "."); - version2 = v2[1] * 1000000 + v2[2] * 10000 + v2[3] * 100 + v2[4]; +ifeq ($(filter rabbitmq-macros.mk,$(notdir $(MAKEFILE_LIST))),) +include $(dir $(lastword $(MAKEFILE_LIST)))rabbitmq-macros.mk +endif - if (version1 $(3) version2) { - print "true"; - } else { - print "false"; - } -}') -endef +TEST_ERLC_OPTS += +nowarn_export_all # Erlang R16B03 has no support for new types in Erlang 17.0, leading to # a build-time error. diff --git a/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-components.hexpm.mk b/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-components.hexpm.mk index 2b55b69..4b11017 100644 --- a/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-components.hexpm.mk +++ b/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-components.hexpm.mk @@ -34,10 +34,3 @@ dep_amqp_client = hex $(PROJECT_VERSION) dep_rabbit_common = hex $(PROJECT_VERSION) # Third-party dependencies version pinning. -# -# We do that in this file, which is copied in all projects, to ensure -# all projects use the same versions. It avoids conflicts and makes it -# possible to work with rabbitmq-public-umbrella. - -dep_cowboy = hex 1.0.4 -dep_ranch = hex 1.3.0 diff --git a/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-components.mk b/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-components.mk index 1e5d000..5292fa9 100644 --- a/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-components.mk +++ b/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-components.mk @@ -38,6 +38,8 @@ endif # base of the topic branch. dep_amqp_client = git_rmq rabbitmq-erlang-client $(current_rmq_ref) $(base_rmq_ref) master +dep_amqp10_client = git_rmq rabbitmq-amqp1.0-client $(current_rmq_ref) $(base_rmq_ref) master +dep_amqp10_common = git_rmq rabbitmq-amqp1.0-common $(current_rmq_ref) $(base_rmq_ref) master dep_rabbit = git_rmq rabbitmq-server $(current_rmq_ref) $(base_rmq_ref) master dep_rabbit_common = git_rmq rabbitmq-common $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_amqp1_0 = git_rmq rabbitmq-amqp1.0 $(current_rmq_ref) $(base_rmq_ref) master @@ -63,7 +65,7 @@ dep_rabbitmq_java_client = git_rmq rabbitmq-java-client $(current_r dep_rabbitmq_jms_client = git_rmq rabbitmq-jms-client $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_jms_cts = git_rmq rabbitmq-jms-cts $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_jms_topic_exchange = git_rmq rabbitmq-jms-topic-exchange $(current_rmq_ref) $(base_rmq_ref) master -dep_rabbitmq_lvc = git_rmq rabbitmq-lvc-plugin $(current_rmq_ref) $(base_rmq_ref) master +dep_rabbitmq_lvc_exchange = git_rmq rabbitmq-lvc-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management = git_rmq rabbitmq-management $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management_agent = git_rmq rabbitmq-management-agent $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management_exchange = git_rmq rabbitmq-management-exchange $(current_rmq_ref) $(base_rmq_ref) master @@ -78,6 +80,7 @@ dep_rabbitmq_peer_discovery_common = git_rmq rabbitmq-peer-discovery-common $ dep_rabbitmq_peer_discovery_consul = git_rmq rabbitmq-peer-discovery-consul $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_peer_discovery_etcd = git_rmq rabbitmq-peer-discovery-etcd $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_peer_discovery_k8s = git_rmq rabbitmq-peer-discovery-k8s $(current_rmq_ref) $(base_rmq_ref) master +dep_rabbitmq_random_exchange = git_rmq rabbitmq-random-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_recent_history_exchange = git_rmq rabbitmq-recent-history-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_routing_node_stamp = git_rmq rabbitmq-routing-node-stamp $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_rtopic_exchange = git_rmq rabbitmq-rtopic-exchange $(current_rmq_ref) $(base_rmq_ref) master @@ -107,16 +110,18 @@ dep_rabbitmq_public_umbrella = git_rmq rabbitmq-public-umbrella $(curre # all projects use the same versions. It avoids conflicts and makes it # possible to work with rabbitmq-public-umbrella. -dep_cowboy_commit = 1.0.4 -dep_mochiweb = git git://github.com/basho/mochiweb.git v2.9.0p2 +dep_cowboy = hex 1.0.4 +dep_ranch = hex 1.3.2 +dep_recon = hex 2.3.2 + # Last commit of PropEr supporting Erlang R16B03. dep_proper_commit = 735d972758d8bd85b12483626fe1b66450d6a6fe -dep_ranch_commit = 1.3.2 # Last commit of sockjs support Erlang R16B03 and 17.x. dep_sockjs = git https://github.com/rabbitmq/sockjs-erlang.git 5af2b588c812c318b19bc105b577a759c71c3e0a -dep_webmachine_commit = 1.10.8p2 RABBITMQ_COMPONENTS = amqp_client \ + amqp10_common \ + amqp10_client \ rabbit \ rabbit_common \ rabbitmq_amqp1_0 \ @@ -142,7 +147,7 @@ RABBITMQ_COMPONENTS = amqp_client \ rabbitmq_jms_client \ rabbitmq_jms_cts \ rabbitmq_jms_topic_exchange \ - rabbitmq_lvc \ + rabbitmq_lvc_exchange \ rabbitmq_management \ rabbitmq_management_agent \ rabbitmq_management_exchange \ @@ -157,6 +162,7 @@ RABBITMQ_COMPONENTS = amqp_client \ rabbitmq_peer_discovery_consul \ rabbitmq_peer_discovery_etcd \ rabbitmq_peer_discovery_k8s \ + rabbitmq_random_exchange \ rabbitmq_recent_history_exchange \ rabbitmq_routing_node_stamp \ rabbitmq_rtopic_exchange \ @@ -184,7 +190,7 @@ NO_AUTOPATCH += $(RABBITMQ_COMPONENTS) ifeq ($(origin current_rmq_ref),undefined) ifneq ($(wildcard .git),) current_rmq_ref := $(shell (\ - ref=$$(git branch --list | awk '/^\* \(.*detached / {ref=$$0; sub(/.*detached [^ ]+ /, "", ref); sub(/\)$$/, "", ref); print ref; exit;} /^\* / {ref=$$0; sub(/^\* /, "", ref); print ref; exit}');\ + ref=$$(LANG=C git branch --list | awk '/^\* \(.*detached / {ref=$$0; sub(/.*detached [^ ]+ /, "", ref); sub(/\)$$/, "", ref); print ref; exit;} /^\* / {ref=$$0; sub(/^\* /, "", ref); print ref; exit}');\ if test "$$(git rev-parse --short HEAD)" != "$$ref"; then echo "$$ref"; fi)) else current_rmq_ref := master @@ -194,11 +200,17 @@ export current_rmq_ref ifeq ($(origin base_rmq_ref),undefined) ifneq ($(wildcard .git),) +possible_base_rmq_ref := v3.6.x +ifeq ($(possible_base_rmq_ref),$(current_rmq_ref)) +base_rmq_ref := $(current_rmq_ref) +else base_rmq_ref := $(shell \ - (git rev-parse --verify -q stable >/dev/null && \ - git merge-base --is-ancestor $$(git merge-base master HEAD) stable && \ - echo stable) || \ + (git rev-parse --verify -q master >/dev/null && \ + git rev-parse --verify -q $(possible_base_rmq_ref) >/dev/null && \ + git merge-base --is-ancestor $$(git merge-base master HEAD) $(possible_base_rmq_ref) && \ + echo $(possible_base_rmq_ref)) || \ echo master) +endif else base_rmq_ref := master endif @@ -313,11 +325,16 @@ endif UPSTREAM_RMQ_COMPONENTS_MK = $(DEPS_DIR)/rabbit_common/mk/rabbitmq-components.mk +ifeq ($(PROJECT),rabbit_common) +check-rabbitmq-components.mk: + @: +else check-rabbitmq-components.mk: $(verbose) cmp -s rabbitmq-components.mk \ $(UPSTREAM_RMQ_COMPONENTS_MK) || \ (echo "error: rabbitmq-components.mk must be updated!" 1>&2; \ false) +endif ifeq ($(PROJECT),rabbit_common) rabbitmq-components-mk: diff --git a/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-early-test.mk b/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-early-test.mk index 13141fb..3bfadbc 100644 --- a/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-early-test.mk +++ b/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-early-test.mk @@ -38,8 +38,10 @@ endif # from its UI. Furthermore, it displays a graph showing evolution of the # results over time. +ifndef TRAVIS CT_HOOKS ?= cth_styledout TEST_DEPS += cth_styledout +endif RMQ_CI_CT_HOOKS = cth_fail_fast ifdef TRAVIS diff --git a/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-hexpm.mk b/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-hexpm.mk index a04ea60..c7fe9e2 100644 --- a/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-hexpm.mk +++ b/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-hexpm.mk @@ -8,11 +8,15 @@ HEXPM_URL = https://github.com/rabbitmq/hexpm-cli/releases/download/v0.1.0/hexpm HEXPM_CLI = $(ERLANG_MK_TMP)/hexpm $(HEXPM_CLI): + $(verbose) mkdir -p $(ERLANG_MK_TMP) $(gen_verbose) $(call core_http_get,$@,$(HEXPM_URL)) $(verbose) chmod +x $@ -rebar.config: dep_rabbit_common = hex $(PROJECT_VERSION) -rebar.config: dep_amqp_client = hex $(PROJECT_VERSION) +RABBIT_COMMON_HEXPM_VERSION = $(PROJECT_VERSION) +AMQP_CLIENT_HEXPM_VERSION = $(PROJECT_VERSION) + +rebar.config: dep_rabbit_common = hex $(RABBIT_COMMON_HEXPM_VERSION) +rebar.config: dep_amqp_client = hex $(AMQP_CLIENT_HEXPM_VERSION) define RABBITMQ_HEXPM_DEFAULT_FILES "erlang.mk", @@ -26,21 +30,35 @@ define RABBITMQ_HEXPM_DEFAULT_FILES "src" endef +ifeq ($(PROJECT),rabbit_common) +RMQ_COMPONENTS_PREFIX = mk +RMQ_COMPONENTS_HEXPM = mk/rabbitmq-components.hexpm.mk +else +RMQ_COMPONENTS_PREFIX = . +RMQ_COMPONENTS_HEXPM = $(DEPS_DIR)/rabbit_common/mk/rabbitmq-components.hexpm.mk +endif + hex-publish: $(HEXPM_CLI) app rebar.config $(gen_verbose) echo "$(PROJECT_DESCRIPTION) $(PROJECT_VERSION)" \ > git-revisions.txt -ifneq ($(PROJECT),rabbit_common) - $(verbose) mv rabbitmq-components.mk rabbitmq-components.mk.not-hexpm + $(verbose) mv \ + $(RMQ_COMPONENTS_PREFIX)/rabbitmq-components.mk \ + rabbitmq-components.mk.not-hexpm $(verbose) cp \ - $(DEPS_DIR)/rabbit_common/mk/rabbitmq-components.hexpm.mk \ - rabbitmq-components.mk - $(verbose) touch -r rabbitmq-components.mk.not-hexpm \ - rabbitmq-components.mk -endif + $(RMQ_COMPONENTS_HEXPM) \ + $(RMQ_COMPONENTS_PREFIX)/rabbitmq-components.mk + $(verbose) grep -E '^dep.* = hex' \ + rabbitmq-components.mk.not-hexpm \ + >> $(RMQ_COMPONENTS_PREFIX)/rabbitmq-components.mk + $(verbose) touch -r \ + rabbitmq-components.mk.not-hexpm \ + $(RMQ_COMPONENTS_PREFIX)/rabbitmq-components.mk $(verbose) trap '\ rm -f git-revisions.txt rebar.lock; \ if test -f rabbitmq-components.mk.not-hexpm; then \ - mv rabbitmq-components.mk.not-hexpm rabbitmq-components.mk; \ + mv \ + rabbitmq-components.mk.not-hexpm \ + $(RMQ_COMPONENTS_PREFIX)/rabbitmq-components.mk; \ fi' EXIT INT; \ $(HEXPM_CLI) publish diff --git a/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-macros.mk b/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-macros.mk new file mode 100644 index 0000000..048745a --- /dev/null +++ b/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-macros.mk @@ -0,0 +1,22 @@ +# Macro to compare two x.y.z versions. +# +# Usage: +# ifeq ($(call compare_version,$(ERTS_VER),$(MAX_ERTS_VER),<),true) +# # Only evaluated if $(ERTS_VER) < $(MAX_ERTS_VER) +# endif + +define compare_version +$(shell awk 'BEGIN { + split("$(1)", v1, "."); + version1 = v1[1] * 1000000 + v1[2] * 10000 + v1[3] * 100 + v1[4]; + + split("$(2)", v2, "."); + version2 = v2[1] * 1000000 + v2[2] * 10000 + v2[3] * 100 + v2[4]; + + if (version1 $(3) version2) { + print "true"; + } else { + print "false"; + } +}') +endef diff --git a/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-run.mk b/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-run.mk index a79cb91..abb107f 100644 --- a/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-run.mk +++ b/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-run.mk @@ -171,7 +171,7 @@ define test_rabbitmq_config_with_tls {port, 15671}, {ssl, true}, {ssl_opts, [ - {cacertfile, "$(TEST_TLS_CERTS_DIR_in_config)/testca/cacert.pem"}, + {cacertfile, "$(TEST_TLS_CERTS_DIR_in_config)/testca/cacert.pem"}, {certfile, "$(TEST_TLS_CERTS_DIR_in_config)/server/cert.pem"}, {keyfile, "$(TEST_TLS_CERTS_DIR_in_config)/server/key.pem"}, {verify, verify_peer}, @@ -196,7 +196,7 @@ $(TEST_CONFIG_FILE): node-tmpdir $(TEST_TLS_CERTS_DIR): node-tmpdir $(gen_verbose) $(MAKE) -C $(DEPS_DIR)/rabbitmq_ct_helpers/tools/tls-certs \ - DIR=$(TEST_TLS_CERTS_DIR) all + DIR=$(TEST_TLS_CERTS_DIR) all show-test-tls-certs-dir: $(TEST_TLS_CERTS_DIR) @echo $(TEST_TLS_CERTS_DIR) @@ -233,7 +233,7 @@ run-background-node: virgin-node-tmpdir $(RABBITMQ_ENABLED_PLUGINS_FILE) $(RABBITMQ_SERVER) -detached # -------------------------------------------------------------------- -# Used by testsuites. +# Start RabbitMQ in the background. # -------------------------------------------------------------------- ifneq ($(LOG_TO_STDIO),yes) @@ -266,6 +266,54 @@ start-rabbit-on-node: stop-rabbit-on-node: $(exec_verbose) echo 'rabbit:stop().' | $(ERL_CALL) $(ERL_CALL_OPTS) | sed -E '/^\{ok, ok\}$$/d' +stop-node: + $(exec_verbose) ( \ + pid=$$(test -f $(RABBITMQ_PID_FILE) && cat $(RABBITMQ_PID_FILE)) && \ + $(ERL_CALL) $(ERL_CALL_OPTS) -q && \ + while ps -p "$$pid" >/dev/null 2>&1; do sleep 1; done \ + ) || : + +# " <-- To please Vim syntax hilighting. + +# -------------------------------------------------------------------- +# Start a RabbitMQ cluster in the background. +# -------------------------------------------------------------------- + +NODES ?= 2 + +start-brokers start-cluster: + @for n in $$(seq $(NODES)); do \ + nodename="rabbit-$$n@$$(hostname -s)"; \ + $(MAKE) start-background-broker \ + RABBITMQ_NODENAME="$$nodename" \ + RABBITMQ_NODE_PORT="$$((5672 + $$n - 1))" \ + RABBITMQ_SERVER_START_ARGS=" \ + -rabbit loopback_users [] \ + -rabbitmq_management listener [{port,$$((15672 + $$n - 1))}] \ + "; \ + if test '$@' = 'start-cluster' && test "$$nodename1"; then \ + ERL_LIBS="$(DIST_ERL_LIBS)" \ + $(RABBITMQCTL) -n "$$nodename" stop_app; \ + ERL_LIBS="$(DIST_ERL_LIBS)" \ + $(RABBITMQCTL) -n "$$nodename" join_cluster "$$nodename1"; \ + ERL_LIBS="$(DIST_ERL_LIBS)" \ + $(RABBITMQCTL) -n "$$nodename" start_app; \ + else \ + nodename1=$$nodename; \ + fi; \ + done + +stop-brokers stop-cluster: + @for n in $$(seq $(NODES) 1); do \ + nodename="rabbit-$$n@$$(hostname -s)"; \ + $(MAKE) stop-node \ + RABBITMQ_NODENAME="$$nodename"; \ + done + +# -------------------------------------------------------------------- +# Used by testsuites. +# -------------------------------------------------------------------- + set-resource-alarm: $(exec_verbose) echo 'rabbit_alarm:set_alarm({{resource_limit, $(SOURCE), node()}, []}).' | \ $(ERL_CALL) $(ERL_CALL_OPTS) @@ -273,10 +321,3 @@ set-resource-alarm: clear-resource-alarm: $(exec-verbose) echo 'rabbit_alarm:clear_alarm({resource_limit, $(SOURCE), node()}).' | \ $(ERL_CALL) $(ERL_CALL_OPTS) - -stop-node: - $(exec_verbose) ( \ - pid=$$(test -f $(RABBITMQ_PID_FILE) && cat $(RABBITMQ_PID_FILE)) && \ - $(ERL_CALL) $(ERL_CALL_OPTS) -q && \ - while ps -p "$$pid" >/dev/null 2>&1; do sleep 1; done \ - ) || : diff --git a/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-tools.mk b/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-tools.mk index 769519b..00e1e96 100644 --- a/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-tools.mk +++ b/rabbitmq-server/deps/rabbit_common/mk/rabbitmq-tools.mk @@ -2,6 +2,8 @@ READY_DEPS = $(foreach DEP,\ $(filter $(RABBITMQ_COMPONENTS),$(DEPS) $(BUILD_DEPS) $(TEST_DEPS)), \ $(if $(wildcard $(DEPS_DIR)/$(DEP)),$(DEP),)) +RELEASED_RMQ_DEPS = $(filter $(RABBITMQ_COMPONENTS),$(DEPS) $(BUILD_DEPS)) + .PHONY: update-erlang-mk update-rabbitmq-components.mk update-erlang-mk: erlang-mk @@ -31,6 +33,71 @@ update-contributor-code-of-conduct: cp $(DEPS_DIR)/rabbit_common/CONTRIBUTING.md $$repo/CONTRIBUTING.md; \ done +ifdef CREDS +define replace_aws_creds + set -e; \ + if test -f "$(CREDS)"; then \ + key_id=$(shell travis encrypt --no-interactive \ + "AWS_ACCESS_KEY_ID=$$(awk '/^rabbitmq-s3-access-key-id/ { print $$2; }' < "$(CREDS)")"); \ + access_key=$(shell travis encrypt --no-interactive \ + "AWS_SECRET_ACCESS_KEY=$$(awk '/^rabbitmq-s3-secret-access-key/ { print $$2; }' < "$(CREDS)")"); \ + mv .travis.yml .travis.yml.orig; \ + awk "\ + /^ global:/ { \ + print; \ + print \" - secure: $$key_id\"; \ + print \" - secure: $$access_key\"; \ + next; \ + } \ + /- secure:/ { next; } \ + { print; }" < .travis.yml.orig > .travis.yml; \ + rm -f .travis.yml.orig; \ + else \ + echo " INFO: CREDS file missing; not setting/updating AWS credentials"; \ + fi +endef +else +define replace_aws_creds + echo " INFO: CREDS not set; not setting/updating AWS credentials" +endef +endif + +ifeq ($(PROJECT),rabbit_common) +travis-yml: + $(gen_verbose) $(replace_aws_creds) +else +travis-yml: + $(gen_verbose) ! test -f .travis.yml || \ + (grep -E -- '- secure:' .travis.yml || :) > .travis.yml.creds + $(verbose) cp -a $(DEPS_DIR)/rabbit_common/.travis.yml .travis.yml.orig + $(verbose) awk ' \ + /^ global:/ { \ + print; \ + system("test -f .travis.yml.creds && cat .travis.yml.creds"); \ + next; \ + } \ + /- secure:/ { next; } \ + { print; } \ + ' < .travis.yml.orig > .travis.yml + $(verbose) rm -f .travis.yml.orig .travis.yml.creds + $(verbose) set -e; \ + if test -f .travis.yml.patch; then \ + patch -p0 < .travis.yml.patch; \ + rm -f .travis.yml.orig; \ + fi + $(verbose) $(replace_aws_creds) +ifeq ($(DO_COMMIT),yes) + $(verbose) git diff --quiet .travis.yml \ + || git commit -m 'Travis CI: Update config from rabbitmq-common' .travis.yml +endif +endif + +update-travis-yml: travis-yml + $(verbose) for repo in $(READY_DEPS:%=$(DEPS_DIR)/%); do \ + ! test -f $$repo/rabbitmq-components.mk \ + || $(MAKE) -C $$repo travis-yml; \ + done + ifneq ($(wildcard .git),) .PHONY: sync-gitremote sync-gituser @@ -66,10 +133,89 @@ else $(verbose) cd $* && git config user.email "$(RMQ_GIT_USER_EMAIL)" endif +.PHONY: show-branch + show-branch: $(READY_DEPS:%=$(DEPS_DIR)/%+show-branch) $(verbose) printf '%-34s %s\n' $(PROJECT): "$$(git symbolic-ref -q --short HEAD || git describe --tags --exact-match)" %+show-branch: $(verbose) printf '%-34s %s\n' $(notdir $*): "$$(cd $* && (git symbolic-ref -q --short HEAD || git describe --tags --exact-match))" +SINCE_TAG ?= last-release +COMMITS_LOG_OPTS ?= --oneline --decorate --no-merges +MARKDOWN ?= no + +define show_commits_since_tag +set -e; \ +if test "$1"; then \ + erlang_app=$(notdir $1); \ + repository=$(call rmq_cmp_repo_name,$(notdir $1)); \ + git_dir=-C\ "$1"; \ +else \ + erlang_app=$(PROJECT); \ + repository=$(call rmq_cmp_repo_name,$(PROJECT)); \ +fi; \ +case "$(SINCE_TAG)" in \ +last-release) \ + ref=$$(git $$git_dir describe --abbrev=0 --tags \ + --exclude "*-beta*" \ + --exclude "*_milestone*" \ + --exclude "*[-_]rc*"); \ + ;; \ +last-prerelease) \ + ref=$$(git $$git_dir describe --abbrev=0 --tags); \ + ;; \ +*) \ + git $$git_dir rev-parse "$(SINCE_TAG)" -- >/dev/null; \ + ref=$(SINCE_TAG); \ + ;; \ +esac; \ +commits_count=$$(git $$git_dir log --oneline "$$ref.." | wc -l); \ +if test "$$commits_count" -gt 0; then \ + if test "$(MARKDOWN)" = yes; then \ + printf "\n## [\`$$repository\`](https://github.com/rabbitmq/$$repository)\n\nCommits since \`$$ref\`:\n\n"; \ + git $$git_dir --no-pager log $(COMMITS_LOG_OPTS) \ + --format="format:* %s ([\`%h\`](https://github.com/rabbitmq/$$repository/commit/%H))" \ + "$$ref.."; \ + echo; \ + else \ + echo; \ + echo "# $$repository - Commits since $$ref"; \ + git $$git_dir log $(COMMITS_LOG_OPTS) "$$ref.."; \ + fi; \ +fi +endef + +.PHONY: commits-since-release + +commits-since-release: commits-since-release-title \ + $(RELEASED_RMQ_DEPS:%=$(DEPS_DIR)/%+commits-since-release) + $(verbose) $(call show_commits_since_tag) + +commits-since-release-title: + $(verbose) set -e; \ + case "$(SINCE_TAG)" in \ + last-release) \ + ref=$$(git $$git_dir describe --abbrev=0 --tags \ + --exclude "*-beta*" \ + --exclude "*_milestone*" \ + --exclude "*[-_]rc*"); \ + ;; \ + last-prerelease) \ + ref=$$(git $$git_dir describe --abbrev=0 --tags); \ + ;; \ + *) \ + ref=$(SINCE_TAG); \ + ;; \ + esac; \ + version=$$(echo "$$ref" | sed -E \ + -e 's/rabbitmq_v([0-9]+)_([0-9]+)_([0-9]+)/v\1.\2.\3/' \ + -e 's/_milestone/-beta./' \ + -e 's/_rc/-rc./' \ + -e 's/^v//'); \ + echo "# Changes since RabbitMQ $$version"; \ + +%+commits-since-release: + $(verbose) $(call show_commits_since_tag,$*) + endif # ($(wildcard .git),) diff --git a/rabbitmq-server/deps/rabbit_common/src/app_utils.erl b/rabbitmq-server/deps/rabbit_common/src/app_utils.erl index 0ae5376..e08645b 100644 --- a/rabbitmq-server/deps/rabbit_common/src/app_utils.erl +++ b/rabbitmq-server/deps/rabbit_common/src/app_utils.erl @@ -15,16 +15,19 @@ %% -module(app_utils). --export([load_applications/1, start_applications/1, start_applications/2, +-export([load_applications/1, + start_applications/1, start_applications/2, start_applications/3, stop_applications/1, stop_applications/2, app_dependency_order/2, app_dependencies/1]). -type error_handler() :: fun((atom(), any()) -> 'ok'). +-type restart_type() :: 'permanent' | 'transient' | 'temporary'. -spec load_applications([atom()]) -> 'ok'. -spec start_applications([atom()]) -> 'ok'. -spec stop_applications([atom()]) -> 'ok'. -spec start_applications([atom()], error_handler()) -> 'ok'. +-spec start_applications([atom()], error_handler(), [{atom(), restart_type()}]) -> 'ok'. -spec stop_applications([atom()], error_handler()) -> 'ok'. -spec app_dependency_order([atom()], boolean()) -> [digraph:vertex()]. -spec app_dependencies(atom()) -> [atom()]. @@ -49,8 +52,11 @@ stop_applications(Apps) -> end). start_applications(Apps, ErrorHandler) -> + start_applications(Apps, ErrorHandler, []). + +start_applications(Apps, ErrorHandler, RestartTypes) -> manage_applications(fun lists:foldl/3, - fun application:start/1, + fun(App) -> ensure_all_started(App, RestartTypes) end, fun application:stop/1, already_started, ErrorHandler, @@ -62,7 +68,7 @@ stop_applications(Apps, ErrorHandler) -> rabbit_log:info("Stopping application '~s'", [App]), application:stop(App) end, - fun application:start/1, + fun application:ensure_all_started/1, not_started, ErrorHandler, Apps). @@ -116,6 +122,9 @@ manage_applications(Iterate, Do, Undo, SkipError, ErrorHandler, Apps) -> Iterate(fun (App, Acc) -> case Do(App) of ok -> [App | Acc]; + {ok, []} -> Acc; + {ok, [App]} -> [App | Acc]; + {ok, StartedApps} -> StartedApps ++ Acc; {error, {SkipError, _}} -> Acc; {error, Reason} -> lists:foreach(Undo, Acc), @@ -124,3 +133,39 @@ manage_applications(Iterate, Do, Undo, SkipError, ErrorHandler, Apps) -> end, [], Apps), ok. +%% Stops the Erlang VM when the rabbit application stops abnormally +%% i.e. message store reaches its restart limit +default_restart_type(rabbit) -> transient; +default_restart_type(_) -> temporary. + +%% Copyright Ericsson AB 1996-2016. All Rights Reserved. +%% +%% Code orignially from Erlang/OTP source lib/kernel/src/application.erl +%% and modified to use RestartTypes +%% +ensure_all_started(Application, RestartTypes) -> + case ensure_all_started(Application, RestartTypes, []) of + {ok, Started} -> + {ok, lists:reverse(Started)}; + {error, Reason, Started} -> + _ = [application:stop(App) || App <- Started], + {error, Reason} + end. + +ensure_all_started(Application, RestartTypes, Started) -> + RestartType = proplists:get_value(Application, RestartTypes, default_restart_type(Application)), + case application:start(Application, RestartType) of + ok -> + {ok, [Application | Started]}; + {error, {already_started, Application}} -> + {ok, Started}; + {error, {not_started, Dependency}} -> + case ensure_all_started(Dependency, RestartTypes, Started) of + {ok, NewStarted} -> + ensure_all_started(Application, RestartTypes, NewStarted); + Error -> + Error + end; + {error, Reason} -> + {error, {Application, Reason}, Started} + end. diff --git a/rabbitmq-server/deps/rabbit_common/src/gen_server2.erl b/rabbitmq-server/deps/rabbit_common/src/gen_server2.erl index ae1284c..d9140dd 100644 --- a/rabbitmq-server/deps/rabbit_common/src/gen_server2.erl +++ b/rabbitmq-server/deps/rabbit_common/src/gen_server2.erl @@ -220,7 +220,7 @@ %% State record -record(gs2_state, {parent, name, state, mod, time, timeout_state, queue, debug, prioritisers, - timer, init_stats_fun, emit_stats_fun, stop_stats_fun}). + timer, emit_stats_fun, stop_stats_fun}). %%%========================================================================= %%% Specs. These exist only to shut up dialyzer's warnings @@ -331,21 +331,15 @@ call(Name, Request, Timeout) -> %% Make a cast to a generic server. %% ----------------------------------------------------------------- cast({global,Name}, Request) -> - catch global:send(Name, cast_msg(Request)), + catch global:send(Name, {'$gen_cast', Request}), ok; cast({Name,Node}=Dest, Request) when is_atom(Name), is_atom(Node) -> - do_cast(Dest, Request); -cast(Dest, Request) when is_atom(Dest) -> - do_cast(Dest, Request); -cast(Dest, Request) when is_pid(Dest) -> - do_cast(Dest, Request). - -do_cast(Dest, Request) -> - do_send(Dest, cast_msg(Request)), + catch (Dest ! {'$gen_cast', Request}), + ok; +cast(Dest, Request) when is_atom(Dest); is_pid(Dest) -> + catch (Dest ! {'$gen_cast', Request}), ok. -cast_msg(Request) -> {'$gen_cast',Request}. - %% ----------------------------------------------------------------- %% Send a reply to the client. %% ----------------------------------------------------------------- @@ -356,13 +350,13 @@ reply({To, Tag}, Reply) -> %% Asyncronous broadcast, returns nothing, it's just send'n pray %% ----------------------------------------------------------------- abcast(Name, Request) when is_atom(Name) -> - do_abcast([node() | nodes()], Name, cast_msg(Request)). + do_abcast([node() | nodes()], Name, {'$gen_cast', Request}). abcast(Nodes, Name, Request) when is_list(Nodes), is_atom(Name) -> - do_abcast(Nodes, Name, cast_msg(Request)). + do_abcast(Nodes, Name, {'$gen_cast', Request}). do_abcast([Node|Nodes], Name, Msg) when is_atom(Node) -> - do_send({Name,Node},Msg), + catch ({Name, Node} ! Msg), do_abcast(Nodes, Name, Msg); do_abcast([], _,_) -> abcast. @@ -515,12 +509,11 @@ enter_loop(Mod, Options, State, ServerName, Timeout, Backoff) -> Debug = debug_options(Name, Options), Queue = priority_queue:new(), Backoff1 = extend_backoff(Backoff), - {InitStatsFun, EmitStatsFun, StopStatsFun} = stats_funs(), - loop(InitStatsFun(find_prioritisers( + {EmitStatsFun, StopStatsFun} = stats_funs(), + loop(init_stats(find_prioritisers( #gs2_state { parent = Parent, name = Name, state = State, mod = Mod, time = Timeout, timeout_state = Backoff1, - queue = Queue, debug = Debug, - init_stats_fun = InitStatsFun, + queue = Queue, debug = Debug, emit_stats_fun = EmitStatsFun, stop_stats_fun = StopStatsFun }))). @@ -541,38 +534,37 @@ init_it(Starter, Parent, Name0, Mod, Args, Options) -> Name = name(Name0), Debug = debug_options(Name, Options), Queue = priority_queue:new(), - {InitStatsFun, EmitStatsFun, StopStatsFun} = stats_funs(), + {EmitStatsFun, StopStatsFun} = stats_funs(), GS2State = find_prioritisers( #gs2_state { parent = Parent, name = Name, mod = Mod, queue = Queue, debug = Debug, - init_stats_fun = InitStatsFun, emit_stats_fun = EmitStatsFun, stop_stats_fun = StopStatsFun }), case catch Mod:init(Args) of {ok, State} -> proc_lib:init_ack(Starter, {ok, self()}), - loop(InitStatsFun(GS2State#gs2_state { state = State, + loop(init_stats(GS2State#gs2_state { state = State, time = infinity, timeout_state = undefined })); {ok, State, Timeout} -> proc_lib:init_ack(Starter, {ok, self()}), - loop(InitStatsFun( + loop(init_stats( GS2State#gs2_state { state = State, time = Timeout, timeout_state = undefined })); {ok, State, Timeout, Backoff = {backoff, _, _, _}} -> Backoff1 = extend_backoff(Backoff), proc_lib:init_ack(Starter, {ok, self()}), - loop(InitStatsFun(GS2State#gs2_state { state = State, + loop(init_stats(GS2State#gs2_state { state = State, time = Timeout, timeout_state = Backoff1 })); {ok, State, Timeout, Backoff = {backoff, _, _, _}, Mod1} -> Backoff1 = extend_backoff(Backoff), proc_lib:init_ack(Starter, {ok, self()}), - loop(InitStatsFun(find_prioritisers( + loop(init_stats(find_prioritisers( GS2State#gs2_state { mod = Mod1, state = State, time = Timeout, @@ -648,17 +640,18 @@ drain(GS2State) -> after 0 -> GS2State end. -process_next_msg(GS2State = #gs2_state { time = Time, +process_next_msg(GS2State0 = #gs2_state { time = Time, timeout_state = TimeoutState, queue = Queue }) -> case priority_queue:out(Queue) of {{value, Msg}, Queue1} -> - process_msg(Msg, GS2State #gs2_state { queue = Queue1 }); + GS2State = ensure_stats_timer(GS2State0), + process_msg(Msg, GS2State#gs2_state { queue = Queue1 }); {empty, Queue1} -> - {Time1, HibOnTimeout} + {Time1, HibOnTimeout, GS2State} = case {Time, TimeoutState} of {hibernate, {backoff, Current, _Min, _Desired, _RSt}} -> - {Current, true}; + {Current, true, stop_stats_timer(GS2State0)}; {hibernate, _} -> %% wake_hib/7 will set Time to hibernate. If %% we were woken and didn't receive a msg @@ -667,8 +660,8 @@ process_next_msg(GS2State = #gs2_state { time = Time, %% R13B1 always waits infinitely when waking %% from hibernation, so that's what we do %% here too. - {infinity, false}; - _ -> {Time, false} + {infinity, false, GS2State0}; + _ -> {Time, false, GS2State0} end, receive Input -> @@ -708,9 +701,10 @@ hibernate(GS2State = #gs2_state { timeout_state = TimeoutState }) -> proc_lib:hibernate(?MODULE, wake_hib, [GS2State #gs2_state { timeout_state = TS }]). -pre_hibernate(GS2State0 = #gs2_state { state = State, - mod = Mod }) -> - GS2State = maybe_stop_stats(GS2State0), +pre_hibernate(GS2State0 = #gs2_state { state = State, + mod = Mod, + emit_stats_fun = EmitStatsFun }) -> + GS2State = EmitStatsFun(stop_stats_timer(GS2State0)), case erlang:function_exported(Mod, handle_pre_hibernate, 1) of true -> case catch Mod:handle_pre_hibernate(State) of @@ -724,9 +718,8 @@ pre_hibernate(GS2State0 = #gs2_state { state = State, end. post_hibernate(GS2State0 = #gs2_state { state = State, - mod = Mod, - init_stats_fun = InitStatsFun }) -> - GS2State = InitStatsFun(GS2State0), + mod = Mod }) -> + GS2State = ensure_stats_timer(GS2State0), case erlang:function_exported(Mod, handle_post_hibernate, 1) of true -> case catch Mod:handle_post_hibernate(State) of @@ -780,8 +773,8 @@ in({'EXIT', Parent, _R} = Input, GS2State = #gs2_state { parent = Parent }) -> in(Input, infinity, GS2State); in({system, _From, _Req} = Input, GS2State) -> in(Input, infinity, GS2State); -in(emit_gen_server2_stats, GS2State = #gs2_state{ emit_stats_fun = EmitStatsFun }) -> - EmitStatsFun(GS2State); +in(emit_gen_server2_stats, GS2State = #gs2_state{ emit_stats_fun = EmitStatsFun}) -> + next_stats_timer(EmitStatsFun(GS2State)); in(Input, GS2State = #gs2_state { prioritisers = {_, _, F} }) -> in(Input, F(Input, GS2State), GS2State). @@ -793,9 +786,18 @@ in(Input, Priority, GS2State = #gs2_state { queue = Queue }) -> process_msg({system, From, Req}, GS2State = #gs2_state { parent = Parent, debug = Debug }) -> - %% gen_server puts Hib on the end as the 7th arg, but that version - %% of the fun seems not to be documented so leaving out for now. - sys:handle_system_msg(Req, From, Parent, ?MODULE, Debug, GS2State); + case Req of + %% This clause will match only in R16B03. + %% Since 17.0 replace_state is not a system message. + {replace_state, StateFun} -> + GS2State1 = StateFun(GS2State), + gen:reply(From, GS2State1), + system_continue(Parent, Debug, GS2State1); + _ -> + %% gen_server puts Hib on the end as the 7th arg, but that version + %% of the fun seems not to be documented so leaving out for now. + sys:handle_system_msg(Req, From, Parent, ?MODULE, Debug, GS2State) + end; process_msg({'$with_state', From, Fun}, GS2State = #gs2_state{state = State}) -> reply(From, catch Fun(State)), @@ -812,9 +814,6 @@ process_msg(Msg, GS2State = #gs2_state { name = Name, debug = Debug }) -> %%% --------------------------------------------------- %%% Send/recive functions %%% --------------------------------------------------- -do_send(Dest, Msg) -> - catch erlang:send(Dest, Msg). - do_multi_call(Nodes, Name, Req, infinity) -> Tag = make_ref(), Monitors = send_nodes(Nodes, Name, Tag, Req), @@ -1142,8 +1141,9 @@ terminate(Reason, Msg, #gs2_state { name = Name, mod = Mod, state = State, debug = Debug, - stop_stats_fun = StopStatsFun} = GS2State) -> - StopStatsFun(GS2State), + stop_stats_fun = StopStatsFun + } = GS2State) -> + StopStatsFun(stop_stats_timer(GS2State)), case catch Mod:terminate(Reason, State) of {'EXIT', R} -> error_info(R, Reason, Name, Msg, State, Debug), @@ -1368,26 +1368,30 @@ stats_funs() -> case ets:info(gen_server2_metrics) of undefined -> {fun(GS2State) -> GS2State end, - fun(GS2State) -> GS2State end, fun(GS2State) -> GS2State end}; _ -> - {fun init_stats/1, fun emit_stats/1, fun stop_stats/1} + {fun emit_stats/1, fun stop_stats/1} end. -init_stats(GS2State) -> - emit_stats(rabbit_event:init_stats_timer(GS2State, #gs2_state.timer)). +init_stats(State = #gs2_state{ emit_stats_fun = EmitStatsFun }) -> + StateWithInitTimer = rabbit_event:init_stats_timer(State, #gs2_state.timer), + next_stats_timer(EmitStatsFun(StateWithInitTimer)). -emit_stats(GS2State = #gs2_state{queue = Queue}) -> - rabbit_core_metrics:gen_server2_stats(self(), priority_queue:len(Queue)), - rabbit_event:ensure_stats_timer( - rabbit_event:reset_stats_timer(GS2State, #gs2_state.timer), - #gs2_state.timer, emit_gen_server2_stats). +next_stats_timer(State) -> + ensure_stats_timer(rabbit_event:reset_stats_timer(State, #gs2_state.timer)). -stop_stats(GS2State) -> - maybe_stop_stats(GS2State), - rabbit_core_metrics:gen_server2_deleted(self()). +ensure_stats_timer(State) -> + rabbit_event:ensure_stats_timer(State, + #gs2_state.timer, + emit_gen_server2_stats). -maybe_stop_stats(#gs2_state{timer = undefined} = GS2State) -> - GS2State; -maybe_stop_stats(GS2State) -> - rabbit_event:stop_stats_timer(GS2State, #gs2_state.timer). +stop_stats_timer(State) -> + rabbit_event:stop_stats_timer(State, #gs2_state.timer). + +emit_stats(State = #gs2_state{queue = Queue}) -> + rabbit_core_metrics:gen_server2_stats(self(), priority_queue:len(Queue)), + State. + +stop_stats(State) -> + rabbit_core_metrics:gen_server2_deleted(self()), + State. diff --git a/rabbitmq-server/deps/rabbit_common/src/rabbit_core_metrics.erl b/rabbitmq-server/deps/rabbit_common/src/rabbit_core_metrics.erl index 3c4fda1..b4b850c 100644 --- a/rabbitmq-server/deps/rabbit_common/src/rabbit_core_metrics.erl +++ b/rabbitmq-server/deps/rabbit_common/src/rabbit_core_metrics.erl @@ -19,6 +19,7 @@ -include("rabbit_core_metrics.hrl"). -export([init/0]). +-export([terminate/0]). -export([connection_created/2, connection_closed/1, @@ -99,10 +100,16 @@ %% API %%---------------------------------------------------------------------------- init() -> - [ets:new(Table, [Type, public, named_table, {write_concurrency, true}]) + [ets:new(Table, [Type, public, named_table, {write_concurrency, true}, + {read_concurrency, true}]) || {Table, Type} <- ?CORE_TABLES ++ ?CORE_EXTRA_TABLES], ok. +terminate() -> + [ets:delete(Table) + || {Table, _Type} <- ?CORE_TABLES ++ ?CORE_EXTRA_TABLES], + ok. + connection_created(Pid, Infos) -> ets:insert(connection_created, {Pid, Infos}), ok. diff --git a/rabbitmq-server/deps/rabbit_common/src/rabbit_event.erl b/rabbitmq-server/deps/rabbit_common/src/rabbit_event.erl index 2bfdd96..e083a7b 100644 --- a/rabbitmq-server/deps/rabbit_common/src/rabbit_event.erl +++ b/rabbitmq-server/deps/rabbit_common/src/rabbit_event.erl @@ -90,8 +90,9 @@ start_link() -> %% notify(stats) init_stats_timer(C, P) -> - {ok, StatsLevel} = application:get_env(rabbit, collect_statistics), - {ok, Interval} = application:get_env(rabbit, collect_statistics_interval), + %% If the rabbit app is not loaded - use default none:5000 + StatsLevel = application:get_env(rabbit, collect_statistics, none), + Interval = application:get_env(rabbit, collect_statistics_interval, 5000), setelement(P, C, #state{level = StatsLevel, interval = Interval, timer = undefined}). diff --git a/rabbitmq-server/deps/rabbit_common/src/supervisor2.erl b/rabbitmq-server/deps/rabbit_common/src/supervisor2.erl index 6af2693..dfb1aa1 100644 --- a/rabbitmq-server/deps/rabbit_common/src/supervisor2.erl +++ b/rabbitmq-server/deps/rabbit_common/src/supervisor2.erl @@ -118,6 +118,7 @@ -include("include/old_builtin_types.hrl"). +-ifndef(define_new_sup2_state). -record(state, {name, strategy :: strategy(), children = [] :: [child_rec()], @@ -127,6 +128,18 @@ restarts = [], module, args}). +-else. +-record(state, {name, + strategy :: strategy(), + children = [] :: [child_rec()], + dynamics :: ?DICT_TYPE() | ?SET_TYPE(), + intensity :: non_neg_integer(), + period :: pos_integer(), + restarts = [], + dynamic_restarts = 0 :: non_neg_integer(), + module, + args}). +-endif. -type state() :: #state{}. -define(is_simple(State), State#state.strategy =:= simple_one_for_one). diff --git a/rabbitmq-server/deps/rabbit_common/src/vm_memory_monitor.erl b/rabbitmq-server/deps/rabbit_common/src/vm_memory_monitor.erl index 50232da..0490dfc 100644 --- a/rabbitmq-server/deps/rabbit_common/src/vm_memory_monitor.erl +++ b/rabbitmq-server/deps/rabbit_common/src/vm_memory_monitor.erl @@ -35,8 +35,12 @@ -export([get_total_memory/0, get_vm_limit/0, get_check_interval/0, set_check_interval/1, get_vm_memory_high_watermark/0, set_vm_memory_high_watermark/1, - get_memory_limit/0, get_memory_use/1, - get_process_memory/0, get_memory_calculation_strategy/0]). + get_memory_limit/0, + %% TODO: refactor in master + get_memory_use/1, + get_process_memory/0, + get_process_memory/1, + get_memory_calculation_strategy/0]). %% for tests -export([parse_line_linux/1, parse_mem_limit/1]). @@ -45,17 +49,22 @@ -record(state, {total_memory, memory_limit, + process_memory, memory_config_limit, timeout, timer, alarmed, - alarm_funs - }). + alarm_funs, + os_type = undefined, + os_pid = undefined, + page_size = undefined, + proc_file = undefined}). -include("rabbit_memory.hrl"). %%---------------------------------------------------------------------------- +-type memory_calculation_strategy() :: rss | erlang | allocated. -type vm_memory_high_watermark() :: (float() | {'absolute', integer() | string()}). -spec start_link(float()) -> rabbit_types:ok_pid_or_error(). -spec start_link(float(), fun ((any()) -> 'ok'), @@ -69,7 +78,9 @@ -spec get_memory_limit() -> non_neg_integer(). -spec get_memory_use(bytes) -> {non_neg_integer(), float() | infinity}; (ratio) -> float() | infinity. +-spec get_cached_process_memory_and_limit() -> {non_neg_integer(), non_neg_integer()}. +-export_type([memory_calculation_strategy/0]). %%---------------------------------------------------------------------------- %% Public API %%---------------------------------------------------------------------------- @@ -110,15 +121,15 @@ get_memory_limit() -> gen_server:call(?MODULE, get_memory_limit, infinity). get_memory_use(bytes) -> - MemoryLimit = get_memory_limit(), - {get_process_memory(), case MemoryLimit > 0.0 of - true -> MemoryLimit; - false -> infinity - end}; + {ProcessMemory, MemoryLimit} = get_cached_process_memory_and_limit(), + {ProcessMemory, case MemoryLimit > 0.0 of + true -> MemoryLimit; + false -> infinity + end}; get_memory_use(ratio) -> - MemoryLimit = get_memory_limit(), + {ProcessMemory, MemoryLimit} = get_cached_process_memory_and_limit(), case MemoryLimit > 0.0 of - true -> get_process_memory() / MemoryLimit; + true -> ProcessMemory / MemoryLimit; false -> infinity end. @@ -126,92 +137,42 @@ get_memory_use(ratio) -> %% be equal to the total size of all pages mapped to the emulator, %% according to http://erlang.org/doc/man/erlang.html#memory-0 %% erlang:memory(total) under-reports memory usage by around 20% +%% +%% Win32 Note: 3.6.12 shipped with code that used wmic.exe to get the +%% WorkingSetSize value for the running erl.exe process. Unfortunately +%% even with a moderate invocation rate of 1 ops/second that uses more +%% CPU resources than some Windows users are willing to tolerate. +%% See rabbitmq/rabbitmq-server#1343 and rabbitmq/rabbitmq-common#224 +%% for details. -spec get_process_memory() -> Bytes :: integer(). get_process_memory() -> - case get_memory_calculation_strategy() of - rss -> - case get_system_process_resident_memory() of - {ok, MemInBytes} -> - MemInBytes; - {error, Reason} -> - rabbit_log:debug("Unable to get system memory used. Reason: ~p." - " Falling back to erlang memory reporting", - [Reason]), - erlang:memory(total) - end; - erlang -> - erlang:memory(total) - end. + {ProcMem, _} = get_memory_use(bytes), + ProcMem. + +-spec get_process_memory(cached | current) -> Bytes :: integer(). +get_process_memory(cached) -> + {ProcMem, _} = get_memory_use(bytes), + ProcMem; +get_process_memory(current) -> + get_process_memory_uncached(). --spec get_memory_calculation_strategy() -> rss | erlang. +-spec get_memory_calculation_strategy() -> memory_calculation_strategy(). get_memory_calculation_strategy() -> case rabbit_misc:get_env(rabbit, vm_memory_calculation_strategy, rss) of - erlang -> - erlang; - rss -> - rss; + allocated -> allocated; + erlang -> erlang; + legacy -> erlang; %% backwards compatibility + rss -> rss; UnsupportedValue -> rabbit_log:warning( "Unsupported value '~p' for vm_memory_calculation_strategy. " - "Supported values: (rss|erlang). " + "Supported values: (allocated|erlang|legacy|rss). " "Defaulting to 'rss'", [UnsupportedValue] ), rss end. --spec get_system_process_resident_memory() -> {ok, Bytes :: integer()} | {error, term()}. -get_system_process_resident_memory() -> - try - get_system_process_resident_memory(os:type()) - catch _:Error -> - {error, {"Failed to get process resident memory", Error}} - end. - -get_system_process_resident_memory({unix,darwin}) -> - get_ps_memory(); - -get_system_process_resident_memory({unix, linux}) -> - get_ps_memory(); - -get_system_process_resident_memory({unix,freebsd}) -> - get_ps_memory(); - -get_system_process_resident_memory({unix,openbsd}) -> - get_ps_memory(); - -get_system_process_resident_memory({win32,_OSname}) -> - OsPid = os:getpid(), - Cmd = "wmic process where processid=" ++ OsPid ++ " get WorkingSetSize /value 2>&1", - CmdOutput = os:cmd(Cmd), - %% Memory usage is displayed in bytes - case re:run(CmdOutput, "WorkingSetSize=([0-9]+)", [{capture, all_but_first, binary}]) of - {match, [Match]} -> - {ok, binary_to_integer(Match)}; - _ -> - {error, {unexpected_output_from_command, Cmd, CmdOutput}} - end; - -get_system_process_resident_memory({unix, sunos}) -> - get_ps_memory(); - -get_system_process_resident_memory({unix, aix}) -> - get_ps_memory(); - -get_system_process_resident_memory(_OsType) -> - {error, not_implemented_for_os}. - -get_ps_memory() -> - OsPid = os:getpid(), - Cmd = "ps -p " ++ OsPid ++ " -o rss=", - CmdOutput = os:cmd(Cmd), - case re:run(CmdOutput, "[0-9]+", [{capture, first, list}]) of - {match, [Match]} -> - {ok, list_to_integer(Match) * 1024}; - _ -> - {error, {unexpected_output_from_command, Cmd, CmdOutput}} - end. - %%---------------------------------------------------------------------------- %% gen_server callbacks %%---------------------------------------------------------------------------- @@ -225,12 +186,13 @@ start_link(MemFraction, AlarmSet, AlarmClear) -> [MemFraction, {AlarmSet, AlarmClear}], []). init([MemFraction, AlarmFuns]) -> - TRef = start_timer(?DEFAULT_MEMORY_CHECK_INTERVAL), - State = #state { timeout = ?DEFAULT_MEMORY_CHECK_INTERVAL, - timer = TRef, - alarmed = false, - alarm_funs = AlarmFuns }, - {ok, set_mem_limits(State, MemFraction)}. + TRef = erlang:send_after(?DEFAULT_MEMORY_CHECK_INTERVAL, self(), update), + State0 = #state{timeout = ?DEFAULT_MEMORY_CHECK_INTERVAL, + timer = TRef, + alarmed = false, + alarm_funs = AlarmFuns}, + State1 = init_state_by_os(State0), + {ok, set_mem_limits(State1, MemFraction)}. handle_call(get_vm_memory_high_watermark, _From, #state{memory_config_limit = MemLimit} = State) -> @@ -243,12 +205,21 @@ handle_call(get_check_interval, _From, State) -> {reply, State#state.timeout, State}; handle_call({set_check_interval, Timeout}, _From, State) -> - {ok, cancel} = timer:cancel(State#state.timer), - {reply, ok, State#state{timeout = Timeout, timer = start_timer(Timeout)}}; + State1 = case erlang:cancel_timer(State#state.timer) of + false -> + State#state{timeout = Timeout}; + _ -> + State#state{timeout = Timeout, + timer = erlang:send_after(Timeout, self(), update)} + end, + {reply, ok, State1}; handle_call(get_memory_limit, _From, State) -> {reply, State#state.memory_limit, State}; +handle_call(get_cached_process_memory_and_limit, _From, State) -> + {reply, {State#state.process_memory, State#state.memory_limit}, State}; + handle_call(_Request, _From, State) -> {noreply, State}. @@ -256,7 +227,10 @@ handle_cast(_Request, State) -> {noreply, State}. handle_info(update, State) -> - {noreply, internal_update(State)}; + erlang:cancel_timer(State#state.timer), + State1 = internal_update(State), + TRef = erlang:send_after(State1#state.timeout, self(), update), + {noreply, State1#state{ timer = TRef }}; handle_info(_Info, State) -> {noreply, State}. @@ -270,6 +244,62 @@ code_change(_OldVsn, State, _Extra) -> %%---------------------------------------------------------------------------- %% Server Internals %%---------------------------------------------------------------------------- + +get_cached_process_memory_and_limit() -> + try + gen_server:call(?MODULE, get_cached_process_memory_and_limit, infinity) + catch exit:{noproc, Error} -> + rabbit_log:warning("Memory monitor process not yet started: ~p~n", [Error]), + ProcessMemory = get_process_memory_uncached(), + {ProcessMemory, infinity} + end. + +get_process_memory_uncached() -> + TmpState = init_state_by_os(#state{}), + TmpState#state.process_memory. + +update_process_memory(State) -> + Strategy = get_memory_calculation_strategy(), + {ok, ProcMem} = get_process_memory_using_strategy(Strategy, State), + State#state{process_memory = ProcMem}. + +init_state_by_os(State = #state{os_type = undefined}) -> + OsType = os:type(), + OsPid = os:getpid(), + init_state_by_os(State#state{os_type = OsType, os_pid = OsPid}); +init_state_by_os(State0 = #state{os_type = {unix, linux}, os_pid = OsPid}) -> + PageSize = get_linux_pagesize(), + ProcFile = io_lib:format("/proc/~s/statm", [OsPid]), + State1 = State0#state{page_size = PageSize, proc_file = ProcFile}, + update_process_memory(State1); +init_state_by_os(State) -> + update_process_memory(State). + +get_process_memory_using_strategy(rss, #state{os_type = {unix, linux}, + page_size = PageSize, + proc_file = ProcFile}) -> + Data = read_proc_file(ProcFile), + [_|[RssPagesStr|_]] = string:tokens(Data, " "), + ProcMem = list_to_integer(RssPagesStr) * PageSize, + {ok, ProcMem}; +get_process_memory_using_strategy(rss, #state{os_type = {unix, _}, + os_pid = OsPid}) -> + Cmd = "ps -p " ++ OsPid ++ " -o rss=", + CmdOutput = os:cmd(Cmd), + case re:run(CmdOutput, "[0-9]+", [{capture, first, list}]) of + {match, [Match]} -> + ProcMem = list_to_integer(Match) * 1024, + {ok, ProcMem}; + _ -> + {error, {unexpected_output_from_command, Cmd, CmdOutput}} + end; +get_process_memory_using_strategy(rss, _State) -> + {ok, recon_alloc:memory(allocated)}; +get_process_memory_using_strategy(allocated, _State) -> + {ok, recon_alloc:memory(allocated)}; +get_process_memory_using_strategy(erlang, _State) -> + {ok, erlang:memory(total)}. + get_total_memory_from_os() -> try get_total_memory(os:type()) @@ -362,29 +392,26 @@ parse_mem_limit(MemLimit) -> ), ?DEFAULT_VM_MEMORY_HIGH_WATERMARK. -internal_update(State = #state { memory_limit = MemLimit, - alarmed = Alarmed, - alarm_funs = {AlarmSet, AlarmClear} }) -> - MemUsed = get_process_memory(), - NewAlarmed = MemUsed > MemLimit, +internal_update(State0 = #state{memory_limit = MemLimit, + alarmed = Alarmed, + alarm_funs = {AlarmSet, AlarmClear}}) -> + State1 = update_process_memory(State0), + ProcMem = State1#state.process_memory, + NewAlarmed = ProcMem > MemLimit, case {Alarmed, NewAlarmed} of - {false, true} -> emit_update_info(set, MemUsed, MemLimit), + {false, true} -> emit_update_info(set, ProcMem, MemLimit), AlarmSet({{resource_limit, memory, node()}, []}); - {true, false} -> emit_update_info(clear, MemUsed, MemLimit), + {true, false} -> emit_update_info(clear, ProcMem, MemLimit), AlarmClear({resource_limit, memory, node()}); _ -> ok end, - State #state {alarmed = NewAlarmed}. + State1#state{alarmed = NewAlarmed}. emit_update_info(AlarmState, MemUsed, MemLimit) -> rabbit_log:info( "vm_memory_high_watermark ~p. Memory used:~p allowed:~p~n", [AlarmState, MemUsed, MemLimit]). -start_timer(Timeout) -> - {ok, TRef} = timer:send_interval(Timeout, update), - TRef. - %% According to http://msdn.microsoft.com/en-us/library/aa366778(VS.85).aspx %% Windows has 2GB and 8TB of address space for 32 and 64 bit accordingly. get_vm_limit({win32,_OSname}) -> @@ -412,22 +439,33 @@ cmd(Command) -> _ -> os:cmd(Command) end. +get_linux_pagesize() -> + CmdOutput = cmd("getconf PAGESIZE"), + case re:run(CmdOutput, "^[0-9]+", [{capture, first, list}]) of + {match, [Match]} -> list_to_integer(Match); + _ -> + rabbit_log:warning( + "Failed to get memory page size, using 4096:~n~p~n", + [CmdOutput]), + 4096 + end. + %% get_total_memory(OS) -> Total %% Windows and Freebsd code based on: memsup:get_memory_usage/1 %% Original code was part of OTP and released under "Erlang Public License". -get_total_memory({unix,darwin}) -> +get_total_memory({unix, darwin}) -> sysctl("hw.memsize"); -get_total_memory({unix,freebsd}) -> +get_total_memory({unix, freebsd}) -> PageSize = sysctl("vm.stats.vm.v_page_size"), PageCount = sysctl("vm.stats.vm.v_page_count"), PageCount * PageSize; -get_total_memory({unix,openbsd}) -> +get_total_memory({unix, openbsd}) -> sysctl("hw.usermem"); -get_total_memory({win32,_OSname}) -> +get_total_memory({win32, _OSname}) -> [Result|_] = os_mon_sysinfo:get_mem_info(), {ok, [_MemLoad, TotPhys, _AvailPhys, _TotPage, _AvailPage, _TotV, _AvailV], _RestStr} = diff --git a/rabbitmq-server/deps/rabbitmq_amqp1_0/.travis.yml.patch b/rabbitmq-server/deps/rabbitmq_amqp1_0/.travis.yml.patch new file mode 100644 index 0000000..afe06fc --- /dev/null +++ b/rabbitmq-server/deps/rabbitmq_amqp1_0/.travis.yml.patch @@ -0,0 +1,16 @@ +--- .travis.yml.orig 2017-11-06 19:22:19.544851000 +0100 ++++ .travis.yml 2017-11-06 19:26:26.097256000 +0100 +@@ -7,8 +7,13 @@ + - alerts@rabbitmq.com + addons: + apt: ++ sources: ++ - sourceline: deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main ++ key_url: https://packages.microsoft.com/keys/microsoft.asc + packages: + - awscli ++ - dotnet-sdk-2.0.0 ++ - maven + - xsltproc + cache: + apt: true diff --git a/rabbitmq-server/deps/rabbitmq_amqp1_0/README.md b/rabbitmq-server/deps/rabbitmq_amqp1_0/README.md index 22bac87..e593537 100644 --- a/rabbitmq-server/deps/rabbitmq_amqp1_0/README.md +++ b/rabbitmq-server/deps/rabbitmq_amqp1_0/README.md @@ -4,20 +4,17 @@ This plugin adds AMQP 1.0 support to RabbitMQ. # Status -This is mostly a prototype, but it is supported. We describe it as a -prototype since the amount of real world use and thus battle-testing -it has received is not so large as that of the STOMP or MQTT -plugins. Howver, bugs do get fixed as they are reported. +This plugin is several years old and is moderately mature. It may have certain +limitations with its current architecture but most major AMQP 1.0 features should be in place. -You can send and receive messages between 0-9-1 or 0-8 clients and 1.0 -clients with broadly the same semantics as you would get with 0-9-1. +This plugin supports 0-9-1 and 1.0 client interoperability with certain limitations. -# Building and configuring +# Configuration -The plugin uses the standard RabbitMQ plugin build environment; see . +This plugin ships with modern versions of RabbitMQ. It will listen on the standard AMQP port, 5672. To reconfigure this, -do so as you would for 0-9-1. Clients connecting with 0-9-1 and 0-8 +do so [as you would for 0-9-1](http://www.rabbitmq.com/configure.html). Clients connecting with 0-9-1 will continue to work on the same port. The following two configuration options (which are specific to the AMQP 1.0 adapter) diff --git a/rabbitmq-server/deps/rabbitmq_amqp1_0/erlang.mk b/rabbitmq-server/deps/rabbitmq_amqp1_0/erlang.mk index 89ba561..1a45ad1 100644 --- a/rabbitmq-server/deps/rabbitmq_amqp1_0/erlang.mk +++ b/rabbitmq-server/deps/rabbitmq_amqp1_0/erlang.mk @@ -17,7 +17,7 @@ ERLANG_MK_FILENAME := $(realpath $(lastword $(MAKEFILE_LIST))) export ERLANG_MK_FILENAME -ERLANG_MK_VERSION = 2.0.0-pre.2-256-g2cce185 +ERLANG_MK_VERSION = 2.0.0-pre.2-278-gd9a9158 ERLANG_MK_WITHOUT = # Make 3.81 and 3.82 are deprecated. @@ -2023,6 +2023,14 @@ pkg_ibrowse_fetch = git pkg_ibrowse_repo = https://github.com/cmullaparthi/ibrowse pkg_ibrowse_commit = master +PACKAGES += idna +pkg_idna_name = idna +pkg_idna_description = Erlang IDNA lib +pkg_idna_homepage = https://github.com/benoitc/erlang-idna +pkg_idna_fetch = git +pkg_idna_repo = https://github.com/benoitc/erlang-idna +pkg_idna_commit = master + PACKAGES += ierlang pkg_ierlang_name = ierlang pkg_ierlang_description = An Erlang language kernel for IPython. @@ -2298,9 +2306,9 @@ pkg_kvs_commit = master PACKAGES += lager pkg_lager_name = lager pkg_lager_description = A logging framework for Erlang/OTP. -pkg_lager_homepage = https://github.com/basho/lager +pkg_lager_homepage = https://github.com/erlang-lager/lager pkg_lager_fetch = git -pkg_lager_repo = https://github.com/basho/lager +pkg_lager_repo = https://github.com/erlang-lager/lager pkg_lager_commit = master PACKAGES += lager_amqp_backend @@ -2314,9 +2322,9 @@ pkg_lager_amqp_backend_commit = master PACKAGES += lager_syslog pkg_lager_syslog_name = lager_syslog pkg_lager_syslog_description = Syslog backend for lager -pkg_lager_syslog_homepage = https://github.com/basho/lager_syslog +pkg_lager_syslog_homepage = https://github.com/erlang-lager/lager_syslog pkg_lager_syslog_fetch = git -pkg_lager_syslog_repo = https://github.com/basho/lager_syslog +pkg_lager_syslog_repo = https://github.com/erlang-lager/lager_syslog pkg_lager_syslog_commit = master PACKAGES += lambdapad @@ -3786,9 +3794,9 @@ pkg_trie_commit = master PACKAGES += triq pkg_triq_name = triq pkg_triq_description = Trifork QuickCheck -pkg_triq_homepage = https://github.com/krestenkrab/triq +pkg_triq_homepage = https://github.com/triqng/triq pkg_triq_fetch = git -pkg_triq_repo = https://github.com/krestenkrab/triq +pkg_triq_repo = https://github.com/triqng/triq.git pkg_triq_commit = master PACKAGES += tunctl @@ -4280,7 +4288,7 @@ endef # if given. Do it for all 3 possible Makefile file names. ifeq ($(NO_AUTOPATCH_ERLANG_MK),) define dep_autopatch_erlang_mk - $t for f in Makefile makefile GNUmakefile; do \ + for f in Makefile makefile GNUmakefile; do \ if [ -f $(DEPS_DIR)/$1/$$f ]; then \ sed -i.bak s/'include *erlang.mk'/'include $$(if $$(ERLANG_MK_FILENAME),$$(ERLANG_MK_FILENAME),erlang.mk)'/ $(DEPS_DIR)/$1/$$f; \ fi \ @@ -4357,6 +4365,8 @@ define dep_autopatch_rebar.erl lists:foreach(fun ({d, D}) -> Write("ERLC_OPTS += -D" ++ atom_to_list(D) ++ "=1\n"); + ({d, DKey, DVal}) -> + Write("ERLC_OPTS += -D" ++ atom_to_list(DKey) ++ "=" ++ atom_to_list(DVal) ++ "\n"); ({i, I}) -> Write(["ERLC_OPTS += -I ", I, "\n"]); ({platform_define, Regex, D}) -> @@ -4579,7 +4589,7 @@ define dep_autopatch_appsrc_script.erl AppSrc = "$(call core_native_path,$(DEPS_DIR)/$1/src/$1.app.src)", AppSrcScript = AppSrc ++ ".script", Bindings = erl_eval:new_bindings(), - {ok, Conf} = file:script(AppSrcScript, Bindings), + {ok, [Conf]} = file:script(AppSrcScript, Bindings), ok = file:write_file(AppSrc, io_lib:format("~p.~n", [Conf])), halt() endef @@ -4731,6 +4741,87 @@ ERLANG_MK_RECURSIVE_REL_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-rel-deps-list.log ERLANG_MK_RECURSIVE_TEST_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-test-deps-list.log ERLANG_MK_RECURSIVE_SHELL_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-shell-deps-list.log +# Copyright (c) 2015-2017, Loïc Hoguin +# This file is part of erlang.mk and subject to the terms of the ISC License. + +.PHONY: distclean-kerl + +KERL_INSTALL_DIR ?= $(HOME)/erlang + +ifeq ($(strip $(KERL)),) +KERL := $(ERLANG_MK_TMP)/kerl/kerl +endif + +export KERL + +KERL_GIT ?= https://github.com/kerl/kerl +KERL_COMMIT ?= master + +KERL_MAKEFLAGS ?= + +OTP_GIT ?= https://github.com/erlang/otp + +define kerl_otp_target +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(1)),) +$(KERL_INSTALL_DIR)/$(1): $(KERL) + MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $(1) $(1) + $(KERL) install $(1) $(KERL_INSTALL_DIR)/$(1) +endif +endef + +define kerl_hipe_target +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$1-native),) +$(KERL_INSTALL_DIR)/$1-native: $(KERL) + KERL_CONFIGURE_OPTIONS=--enable-native-libs \ + MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $1 $1-native + $(KERL) install $1-native $(KERL_INSTALL_DIR)/$1-native +endif +endef + +$(KERL): + $(verbose) mkdir -p $(ERLANG_MK_TMP) + $(gen_verbose) git clone --depth 1 $(KERL_GIT) $(ERLANG_MK_TMP)/kerl + $(verbose) cd $(ERLANG_MK_TMP)/kerl && git checkout $(KERL_COMMIT) + $(verbose) chmod +x $(KERL) + +distclean:: distclean-kerl + +distclean-kerl: + $(gen_verbose) rm -rf $(KERL) + +# Allow users to select which version of Erlang/OTP to use for a project. + +ERLANG_OTP ?= +ERLANG_HIPE ?= + +# Use kerl to enforce a specific Erlang/OTP version for a project. +ifneq ($(strip $(ERLANG_OTP)),) +export PATH := $(KERL_INSTALL_DIR)/$(ERLANG_OTP)/bin:$(PATH) +SHELL := env PATH=$(PATH) $(SHELL) +$(eval $(call kerl_otp_target,$(ERLANG_OTP))) + +# Build Erlang/OTP only if it doesn't already exist. +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(ERLANG_OTP))$(BUILD_ERLANG_OTP),) +$(info Building Erlang/OTP $(ERLANG_OTP)... Please wait...) +$(shell $(MAKE) $(KERL_INSTALL_DIR)/$(ERLANG_OTP) ERLANG_OTP=$(ERLANG_OTP) BUILD_ERLANG_OTP=1 >&2) +endif + +else +# Same for a HiPE enabled VM. +ifneq ($(strip $(ERLANG_HIPE)),) +export PATH := $(KERL_INSTALL_DIR)/$(ERLANG_HIPE)-native/bin:$(PATH) +SHELL := env PATH=$(PATH) $(SHELL) +$(eval $(call kerl_hipe_target,$(ERLANG_HIPE))) + +# Build Erlang/OTP only if it doesn't already exist. +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(ERLANG_HIPE))$(BUILD_ERLANG_OTP),) +$(info Building HiPE-enabled Erlang/OTP $(ERLANG_OTP)... Please wait...) +$(shell $(MAKE) $(KERL_INSTALL_DIR)/$(ERLANG_HIPE) ERLANG_HIPE=$(ERLANG_HIPE) BUILD_ERLANG_OTP=1 >&2) +endif + +endif +endif + # Copyright (c) 2015-2016, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. @@ -5966,10 +6057,10 @@ else $(call render_template,bs_erl_nif,src/$n.erl) endif -# Copyright (c) 2015-2016, Loïc Hoguin +# Copyright (c) 2015-2017, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. -.PHONY: ci ci-prepare ci-setup distclean-kerl +.PHONY: ci ci-prepare ci-setup CI_OTP ?= CI_HIPE ?= @@ -5987,24 +6078,9 @@ ifeq ($(strip $(CI_OTP) $(CI_HIPE) $(CI_ERLLVM)),) ci:: else -ifeq ($(strip $(KERL)),) -KERL := $(ERLANG_MK_TMP)/kerl/kerl -endif - -export KERL - -KERL_GIT ?= https://github.com/kerl/kerl -KERL_COMMIT ?= master - -KERL_MAKEFLAGS ?= - -OTP_GIT ?= https://github.com/erlang/otp - -CI_INSTALL_DIR ?= $(HOME)/erlang - ci:: $(addprefix ci-,$(CI_OTP) $(addsuffix -native,$(CI_HIPE)) $(addsuffix -erllvm,$(CI_ERLLVM))) -ci-prepare: $(addprefix $(CI_INSTALL_DIR)/,$(CI_OTP) $(addsuffix -native,$(CI_HIPE))) +ci-prepare: $(addprefix $(KERL_INSTALL_DIR)/,$(CI_OTP) $(addsuffix -native,$(CI_HIPE))) ci-setup:: @@ -6014,10 +6090,10 @@ ci_verbose_0 = @echo " CI " $(1); ci_verbose = $(ci_verbose_$(V)) define ci_target -ci-$1: $(CI_INSTALL_DIR)/$2 +ci-$1: $(KERL_INSTALL_DIR)/$2 $(verbose) $(MAKE) --no-print-directory clean $(ci_verbose) \ - PATH="$(CI_INSTALL_DIR)/$2/bin:$(PATH)" \ + PATH="$(KERL_INSTALL_DIR)/$2/bin:$(PATH)" \ CI_OTP_RELEASE="$1" \ CT_OPTS="-label $1" \ CI_VM="$3" \ @@ -6029,32 +6105,8 @@ $(foreach otp,$(CI_OTP),$(eval $(call ci_target,$(otp),$(otp),otp))) $(foreach otp,$(CI_HIPE),$(eval $(call ci_target,$(otp)-native,$(otp)-native,native))) $(foreach otp,$(CI_ERLLVM),$(eval $(call ci_target,$(otp)-erllvm,$(otp)-native,erllvm))) -define ci_otp_target -ifeq ($(wildcard $(CI_INSTALL_DIR)/$(1)),) -$(CI_INSTALL_DIR)/$(1): $(KERL) - MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $(1) $(1) - $(KERL) install $(1) $(CI_INSTALL_DIR)/$(1) -endif -endef - -$(foreach otp,$(CI_OTP),$(eval $(call ci_otp_target,$(otp)))) - -define ci_hipe_target -ifeq ($(wildcard $(CI_INSTALL_DIR)/$1-native),) -$(CI_INSTALL_DIR)/$1-native: $(KERL) - KERL_CONFIGURE_OPTIONS=--enable-native-libs \ - MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $1 $1-native - $(KERL) install $1-native $(CI_INSTALL_DIR)/$1-native -endif -endef - -$(foreach otp,$(sort $(CI_HIPE) $(CI_ERLLLVM)),$(eval $(call ci_hipe_target,$(otp)))) - -$(KERL): - $(verbose) mkdir -p $(ERLANG_MK_TMP) - $(gen_verbose) git clone --depth 1 $(KERL_GIT) $(ERLANG_MK_TMP)/kerl - $(verbose) cd $(ERLANG_MK_TMP)/kerl && git checkout $(KERL_COMMIT) - $(verbose) chmod +x $(KERL) +$(foreach otp,$(CI_OTP),$(eval $(call kerl_otp_target,$(otp)))) +$(foreach otp,$(sort $(CI_HIPE) $(CI_ERLLLVM)),$(eval $(call kerl_hipe_target,$(otp)))) help:: $(verbose) printf "%s\n" "" \ @@ -6064,10 +6116,6 @@ help:: "The CI_OTP variable must be defined with the Erlang versions" \ "that must be tested. For example: CI_OTP = OTP-17.3.4 OTP-17.5.3" -distclean:: distclean-kerl - -distclean-kerl: - $(gen_verbose) rm -rf $(KERL) endif # Copyright (c) 2013-2016, Loïc Hoguin @@ -6433,6 +6481,60 @@ apps-eunit: endif endif +# Copyright (c) 2015-2017, Loïc Hoguin +# This file is part of erlang.mk and subject to the terms of the ISC License. + +ifeq ($(filter proper,$(DEPS) $(TEST_DEPS)),proper) +.PHONY: proper + +# Targets. + +tests:: proper + +define proper_check.erl + code:add_pathsa(["$(call core_native_path,$(CURDIR)/ebin)", "$(call core_native_path,$(DEPS_DIR)/*/ebin)"]), + Module = fun(M) -> + [true] =:= lists:usort([ + case atom_to_list(F) of + "prop_" ++ _ -> + io:format("Testing ~p:~p/0~n", [M, F]), + proper:quickcheck(M:F()); + _ -> + true + end + || {F, 0} <- M:module_info(exports)]) + end, + try + case $(1) of + all -> [true] =:= lists:usort([Module(M) || M <- [$(call comma_list,$(3))]]); + module -> Module($(2)); + function -> proper:quickcheck($(2)) + end + of + true -> halt(0); + _ -> halt(1) + catch error:undef -> + io:format("Undefined property or module?~n~p~n", [erlang:get_stacktrace()]), + halt(0) + end. +endef + +ifdef t +ifeq (,$(findstring :,$(t))) +proper: test-build + $(verbose) $(call erlang,$(call proper_check.erl,module,$(t))) +else +proper: test-build + $(verbose) echo Testing $(t)/0 + $(verbose) $(call erlang,$(call proper_check.erl,function,$(t)())) +endif +else +proper: test-build + $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename $(wildcard ebin/*.beam)))))) + $(gen_verbose) $(call erlang,$(call proper_check.erl,all,undefined,$(MODULES))) +endif +endif + # Copyright (c) 2013-2016, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. @@ -6443,7 +6545,7 @@ endif RELX ?= $(ERLANG_MK_TMP)/relx RELX_CONFIG ?= $(CURDIR)/relx.config -RELX_URL ?= https://github.com/erlware/relx/releases/download/v3.19.0/relx +RELX_URL ?= https://github.com/erlware/relx/releases/download/v3.23.0/relx RELX_OPTS ?= RELX_OUTPUT_DIR ?= _rel RELX_REL_EXT ?= @@ -6489,7 +6591,7 @@ distclean-relx-rel: # Run target. ifeq ($(wildcard $(RELX_CONFIG)),) -run: +run:: else define get_relx_release.erl @@ -6513,7 +6615,7 @@ ifeq ($(PLATFORM),msys2) RELX_REL_EXT := .cmd endif -run: all +run:: all $(verbose) $(RELX_OUTPUT_DIR)/$(RELX_REL_NAME)/bin/$(RELX_REL_NAME)$(RELX_REL_EXT) console help:: @@ -6579,7 +6681,10 @@ ifeq ($(filter triq,$(DEPS) $(TEST_DEPS)),triq) tests:: triq define triq_check.erl - code:add_pathsa(["$(call core_native_path,$(CURDIR)/ebin)", "$(call core_native_path,$(DEPS_DIR)/*/ebin)"]), + code:add_pathsa([ + "$(call core_native_path,$(CURDIR)/ebin)", + "$(call core_native_path,$(DEPS_DIR)/*/ebin)", + "$(call core_native_path,$(TEST_DIR))"]), try case $(1) of all -> [true] =:= lists:usort([triq:check(M) || M <- [$(call comma_list,$(3))]]); @@ -6590,7 +6695,7 @@ define triq_check.erl true -> halt(0); _ -> halt(1) catch error:undef -> - io:format("Undefined property or module~n"), + io:format("Undefined property or module?~n~p~n", [erlang:get_stacktrace()]), halt(0) end. endef @@ -6606,7 +6711,8 @@ triq: test-build endif else triq: test-build - $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename $(wildcard ebin/*.beam)))))) + $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename \ + $(wildcard ebin/*.beam) $(call core_find,$(TEST_DIR)/,*.beam)))))) $(gen_verbose) $(call erlang,$(call triq_check.erl,all,undefined,$(MODULES))) endif endif diff --git a/rabbitmq-server/deps/rabbitmq_amqp1_0/rabbitmq-components.mk b/rabbitmq-server/deps/rabbitmq_amqp1_0/rabbitmq-components.mk index 1e5d000..5292fa9 100644 --- a/rabbitmq-server/deps/rabbitmq_amqp1_0/rabbitmq-components.mk +++ b/rabbitmq-server/deps/rabbitmq_amqp1_0/rabbitmq-components.mk @@ -38,6 +38,8 @@ endif # base of the topic branch. dep_amqp_client = git_rmq rabbitmq-erlang-client $(current_rmq_ref) $(base_rmq_ref) master +dep_amqp10_client = git_rmq rabbitmq-amqp1.0-client $(current_rmq_ref) $(base_rmq_ref) master +dep_amqp10_common = git_rmq rabbitmq-amqp1.0-common $(current_rmq_ref) $(base_rmq_ref) master dep_rabbit = git_rmq rabbitmq-server $(current_rmq_ref) $(base_rmq_ref) master dep_rabbit_common = git_rmq rabbitmq-common $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_amqp1_0 = git_rmq rabbitmq-amqp1.0 $(current_rmq_ref) $(base_rmq_ref) master @@ -63,7 +65,7 @@ dep_rabbitmq_java_client = git_rmq rabbitmq-java-client $(current_r dep_rabbitmq_jms_client = git_rmq rabbitmq-jms-client $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_jms_cts = git_rmq rabbitmq-jms-cts $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_jms_topic_exchange = git_rmq rabbitmq-jms-topic-exchange $(current_rmq_ref) $(base_rmq_ref) master -dep_rabbitmq_lvc = git_rmq rabbitmq-lvc-plugin $(current_rmq_ref) $(base_rmq_ref) master +dep_rabbitmq_lvc_exchange = git_rmq rabbitmq-lvc-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management = git_rmq rabbitmq-management $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management_agent = git_rmq rabbitmq-management-agent $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management_exchange = git_rmq rabbitmq-management-exchange $(current_rmq_ref) $(base_rmq_ref) master @@ -78,6 +80,7 @@ dep_rabbitmq_peer_discovery_common = git_rmq rabbitmq-peer-discovery-common $ dep_rabbitmq_peer_discovery_consul = git_rmq rabbitmq-peer-discovery-consul $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_peer_discovery_etcd = git_rmq rabbitmq-peer-discovery-etcd $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_peer_discovery_k8s = git_rmq rabbitmq-peer-discovery-k8s $(current_rmq_ref) $(base_rmq_ref) master +dep_rabbitmq_random_exchange = git_rmq rabbitmq-random-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_recent_history_exchange = git_rmq rabbitmq-recent-history-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_routing_node_stamp = git_rmq rabbitmq-routing-node-stamp $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_rtopic_exchange = git_rmq rabbitmq-rtopic-exchange $(current_rmq_ref) $(base_rmq_ref) master @@ -107,16 +110,18 @@ dep_rabbitmq_public_umbrella = git_rmq rabbitmq-public-umbrella $(curre # all projects use the same versions. It avoids conflicts and makes it # possible to work with rabbitmq-public-umbrella. -dep_cowboy_commit = 1.0.4 -dep_mochiweb = git git://github.com/basho/mochiweb.git v2.9.0p2 +dep_cowboy = hex 1.0.4 +dep_ranch = hex 1.3.2 +dep_recon = hex 2.3.2 + # Last commit of PropEr supporting Erlang R16B03. dep_proper_commit = 735d972758d8bd85b12483626fe1b66450d6a6fe -dep_ranch_commit = 1.3.2 # Last commit of sockjs support Erlang R16B03 and 17.x. dep_sockjs = git https://github.com/rabbitmq/sockjs-erlang.git 5af2b588c812c318b19bc105b577a759c71c3e0a -dep_webmachine_commit = 1.10.8p2 RABBITMQ_COMPONENTS = amqp_client \ + amqp10_common \ + amqp10_client \ rabbit \ rabbit_common \ rabbitmq_amqp1_0 \ @@ -142,7 +147,7 @@ RABBITMQ_COMPONENTS = amqp_client \ rabbitmq_jms_client \ rabbitmq_jms_cts \ rabbitmq_jms_topic_exchange \ - rabbitmq_lvc \ + rabbitmq_lvc_exchange \ rabbitmq_management \ rabbitmq_management_agent \ rabbitmq_management_exchange \ @@ -157,6 +162,7 @@ RABBITMQ_COMPONENTS = amqp_client \ rabbitmq_peer_discovery_consul \ rabbitmq_peer_discovery_etcd \ rabbitmq_peer_discovery_k8s \ + rabbitmq_random_exchange \ rabbitmq_recent_history_exchange \ rabbitmq_routing_node_stamp \ rabbitmq_rtopic_exchange \ @@ -184,7 +190,7 @@ NO_AUTOPATCH += $(RABBITMQ_COMPONENTS) ifeq ($(origin current_rmq_ref),undefined) ifneq ($(wildcard .git),) current_rmq_ref := $(shell (\ - ref=$$(git branch --list | awk '/^\* \(.*detached / {ref=$$0; sub(/.*detached [^ ]+ /, "", ref); sub(/\)$$/, "", ref); print ref; exit;} /^\* / {ref=$$0; sub(/^\* /, "", ref); print ref; exit}');\ + ref=$$(LANG=C git branch --list | awk '/^\* \(.*detached / {ref=$$0; sub(/.*detached [^ ]+ /, "", ref); sub(/\)$$/, "", ref); print ref; exit;} /^\* / {ref=$$0; sub(/^\* /, "", ref); print ref; exit}');\ if test "$$(git rev-parse --short HEAD)" != "$$ref"; then echo "$$ref"; fi)) else current_rmq_ref := master @@ -194,11 +200,17 @@ export current_rmq_ref ifeq ($(origin base_rmq_ref),undefined) ifneq ($(wildcard .git),) +possible_base_rmq_ref := v3.6.x +ifeq ($(possible_base_rmq_ref),$(current_rmq_ref)) +base_rmq_ref := $(current_rmq_ref) +else base_rmq_ref := $(shell \ - (git rev-parse --verify -q stable >/dev/null && \ - git merge-base --is-ancestor $$(git merge-base master HEAD) stable && \ - echo stable) || \ + (git rev-parse --verify -q master >/dev/null && \ + git rev-parse --verify -q $(possible_base_rmq_ref) >/dev/null && \ + git merge-base --is-ancestor $$(git merge-base master HEAD) $(possible_base_rmq_ref) && \ + echo $(possible_base_rmq_ref)) || \ echo master) +endif else base_rmq_ref := master endif @@ -313,11 +325,16 @@ endif UPSTREAM_RMQ_COMPONENTS_MK = $(DEPS_DIR)/rabbit_common/mk/rabbitmq-components.mk +ifeq ($(PROJECT),rabbit_common) +check-rabbitmq-components.mk: + @: +else check-rabbitmq-components.mk: $(verbose) cmp -s rabbitmq-components.mk \ $(UPSTREAM_RMQ_COMPONENTS_MK) || \ (echo "error: rabbitmq-components.mk must be updated!" 1>&2; \ false) +endif ifeq ($(PROJECT),rabbit_common) rabbitmq-components-mk: diff --git a/rabbitmq-server/deps/rabbitmq_auth_backend_ldap/.travis.yml.patch b/rabbitmq-server/deps/rabbitmq_auth_backend_ldap/.travis.yml.patch new file mode 100644 index 0000000..9597b6d --- /dev/null +++ b/rabbitmq-server/deps/rabbitmq_auth_backend_ldap/.travis.yml.patch @@ -0,0 +1,10 @@ +--- .travis.yml.orig 2017-11-07 16:55:19.382911000 +0100 ++++ .travis.yml 2017-11-07 16:55:32.539698000 +0100 +@@ -37,7 +37,6 @@ + + script: + - make xref +- - make tests + + after_failure: + - | diff --git a/rabbitmq-server/deps/rabbitmq_auth_backend_ldap/erlang.mk b/rabbitmq-server/deps/rabbitmq_auth_backend_ldap/erlang.mk index 89ba561..1a45ad1 100644 --- a/rabbitmq-server/deps/rabbitmq_auth_backend_ldap/erlang.mk +++ b/rabbitmq-server/deps/rabbitmq_auth_backend_ldap/erlang.mk @@ -17,7 +17,7 @@ ERLANG_MK_FILENAME := $(realpath $(lastword $(MAKEFILE_LIST))) export ERLANG_MK_FILENAME -ERLANG_MK_VERSION = 2.0.0-pre.2-256-g2cce185 +ERLANG_MK_VERSION = 2.0.0-pre.2-278-gd9a9158 ERLANG_MK_WITHOUT = # Make 3.81 and 3.82 are deprecated. @@ -2023,6 +2023,14 @@ pkg_ibrowse_fetch = git pkg_ibrowse_repo = https://github.com/cmullaparthi/ibrowse pkg_ibrowse_commit = master +PACKAGES += idna +pkg_idna_name = idna +pkg_idna_description = Erlang IDNA lib +pkg_idna_homepage = https://github.com/benoitc/erlang-idna +pkg_idna_fetch = git +pkg_idna_repo = https://github.com/benoitc/erlang-idna +pkg_idna_commit = master + PACKAGES += ierlang pkg_ierlang_name = ierlang pkg_ierlang_description = An Erlang language kernel for IPython. @@ -2298,9 +2306,9 @@ pkg_kvs_commit = master PACKAGES += lager pkg_lager_name = lager pkg_lager_description = A logging framework for Erlang/OTP. -pkg_lager_homepage = https://github.com/basho/lager +pkg_lager_homepage = https://github.com/erlang-lager/lager pkg_lager_fetch = git -pkg_lager_repo = https://github.com/basho/lager +pkg_lager_repo = https://github.com/erlang-lager/lager pkg_lager_commit = master PACKAGES += lager_amqp_backend @@ -2314,9 +2322,9 @@ pkg_lager_amqp_backend_commit = master PACKAGES += lager_syslog pkg_lager_syslog_name = lager_syslog pkg_lager_syslog_description = Syslog backend for lager -pkg_lager_syslog_homepage = https://github.com/basho/lager_syslog +pkg_lager_syslog_homepage = https://github.com/erlang-lager/lager_syslog pkg_lager_syslog_fetch = git -pkg_lager_syslog_repo = https://github.com/basho/lager_syslog +pkg_lager_syslog_repo = https://github.com/erlang-lager/lager_syslog pkg_lager_syslog_commit = master PACKAGES += lambdapad @@ -3786,9 +3794,9 @@ pkg_trie_commit = master PACKAGES += triq pkg_triq_name = triq pkg_triq_description = Trifork QuickCheck -pkg_triq_homepage = https://github.com/krestenkrab/triq +pkg_triq_homepage = https://github.com/triqng/triq pkg_triq_fetch = git -pkg_triq_repo = https://github.com/krestenkrab/triq +pkg_triq_repo = https://github.com/triqng/triq.git pkg_triq_commit = master PACKAGES += tunctl @@ -4280,7 +4288,7 @@ endef # if given. Do it for all 3 possible Makefile file names. ifeq ($(NO_AUTOPATCH_ERLANG_MK),) define dep_autopatch_erlang_mk - $t for f in Makefile makefile GNUmakefile; do \ + for f in Makefile makefile GNUmakefile; do \ if [ -f $(DEPS_DIR)/$1/$$f ]; then \ sed -i.bak s/'include *erlang.mk'/'include $$(if $$(ERLANG_MK_FILENAME),$$(ERLANG_MK_FILENAME),erlang.mk)'/ $(DEPS_DIR)/$1/$$f; \ fi \ @@ -4357,6 +4365,8 @@ define dep_autopatch_rebar.erl lists:foreach(fun ({d, D}) -> Write("ERLC_OPTS += -D" ++ atom_to_list(D) ++ "=1\n"); + ({d, DKey, DVal}) -> + Write("ERLC_OPTS += -D" ++ atom_to_list(DKey) ++ "=" ++ atom_to_list(DVal) ++ "\n"); ({i, I}) -> Write(["ERLC_OPTS += -I ", I, "\n"]); ({platform_define, Regex, D}) -> @@ -4579,7 +4589,7 @@ define dep_autopatch_appsrc_script.erl AppSrc = "$(call core_native_path,$(DEPS_DIR)/$1/src/$1.app.src)", AppSrcScript = AppSrc ++ ".script", Bindings = erl_eval:new_bindings(), - {ok, Conf} = file:script(AppSrcScript, Bindings), + {ok, [Conf]} = file:script(AppSrcScript, Bindings), ok = file:write_file(AppSrc, io_lib:format("~p.~n", [Conf])), halt() endef @@ -4731,6 +4741,87 @@ ERLANG_MK_RECURSIVE_REL_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-rel-deps-list.log ERLANG_MK_RECURSIVE_TEST_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-test-deps-list.log ERLANG_MK_RECURSIVE_SHELL_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-shell-deps-list.log +# Copyright (c) 2015-2017, Loïc Hoguin +# This file is part of erlang.mk and subject to the terms of the ISC License. + +.PHONY: distclean-kerl + +KERL_INSTALL_DIR ?= $(HOME)/erlang + +ifeq ($(strip $(KERL)),) +KERL := $(ERLANG_MK_TMP)/kerl/kerl +endif + +export KERL + +KERL_GIT ?= https://github.com/kerl/kerl +KERL_COMMIT ?= master + +KERL_MAKEFLAGS ?= + +OTP_GIT ?= https://github.com/erlang/otp + +define kerl_otp_target +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(1)),) +$(KERL_INSTALL_DIR)/$(1): $(KERL) + MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $(1) $(1) + $(KERL) install $(1) $(KERL_INSTALL_DIR)/$(1) +endif +endef + +define kerl_hipe_target +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$1-native),) +$(KERL_INSTALL_DIR)/$1-native: $(KERL) + KERL_CONFIGURE_OPTIONS=--enable-native-libs \ + MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $1 $1-native + $(KERL) install $1-native $(KERL_INSTALL_DIR)/$1-native +endif +endef + +$(KERL): + $(verbose) mkdir -p $(ERLANG_MK_TMP) + $(gen_verbose) git clone --depth 1 $(KERL_GIT) $(ERLANG_MK_TMP)/kerl + $(verbose) cd $(ERLANG_MK_TMP)/kerl && git checkout $(KERL_COMMIT) + $(verbose) chmod +x $(KERL) + +distclean:: distclean-kerl + +distclean-kerl: + $(gen_verbose) rm -rf $(KERL) + +# Allow users to select which version of Erlang/OTP to use for a project. + +ERLANG_OTP ?= +ERLANG_HIPE ?= + +# Use kerl to enforce a specific Erlang/OTP version for a project. +ifneq ($(strip $(ERLANG_OTP)),) +export PATH := $(KERL_INSTALL_DIR)/$(ERLANG_OTP)/bin:$(PATH) +SHELL := env PATH=$(PATH) $(SHELL) +$(eval $(call kerl_otp_target,$(ERLANG_OTP))) + +# Build Erlang/OTP only if it doesn't already exist. +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(ERLANG_OTP))$(BUILD_ERLANG_OTP),) +$(info Building Erlang/OTP $(ERLANG_OTP)... Please wait...) +$(shell $(MAKE) $(KERL_INSTALL_DIR)/$(ERLANG_OTP) ERLANG_OTP=$(ERLANG_OTP) BUILD_ERLANG_OTP=1 >&2) +endif + +else +# Same for a HiPE enabled VM. +ifneq ($(strip $(ERLANG_HIPE)),) +export PATH := $(KERL_INSTALL_DIR)/$(ERLANG_HIPE)-native/bin:$(PATH) +SHELL := env PATH=$(PATH) $(SHELL) +$(eval $(call kerl_hipe_target,$(ERLANG_HIPE))) + +# Build Erlang/OTP only if it doesn't already exist. +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(ERLANG_HIPE))$(BUILD_ERLANG_OTP),) +$(info Building HiPE-enabled Erlang/OTP $(ERLANG_OTP)... Please wait...) +$(shell $(MAKE) $(KERL_INSTALL_DIR)/$(ERLANG_HIPE) ERLANG_HIPE=$(ERLANG_HIPE) BUILD_ERLANG_OTP=1 >&2) +endif + +endif +endif + # Copyright (c) 2015-2016, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. @@ -5966,10 +6057,10 @@ else $(call render_template,bs_erl_nif,src/$n.erl) endif -# Copyright (c) 2015-2016, Loïc Hoguin +# Copyright (c) 2015-2017, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. -.PHONY: ci ci-prepare ci-setup distclean-kerl +.PHONY: ci ci-prepare ci-setup CI_OTP ?= CI_HIPE ?= @@ -5987,24 +6078,9 @@ ifeq ($(strip $(CI_OTP) $(CI_HIPE) $(CI_ERLLVM)),) ci:: else -ifeq ($(strip $(KERL)),) -KERL := $(ERLANG_MK_TMP)/kerl/kerl -endif - -export KERL - -KERL_GIT ?= https://github.com/kerl/kerl -KERL_COMMIT ?= master - -KERL_MAKEFLAGS ?= - -OTP_GIT ?= https://github.com/erlang/otp - -CI_INSTALL_DIR ?= $(HOME)/erlang - ci:: $(addprefix ci-,$(CI_OTP) $(addsuffix -native,$(CI_HIPE)) $(addsuffix -erllvm,$(CI_ERLLVM))) -ci-prepare: $(addprefix $(CI_INSTALL_DIR)/,$(CI_OTP) $(addsuffix -native,$(CI_HIPE))) +ci-prepare: $(addprefix $(KERL_INSTALL_DIR)/,$(CI_OTP) $(addsuffix -native,$(CI_HIPE))) ci-setup:: @@ -6014,10 +6090,10 @@ ci_verbose_0 = @echo " CI " $(1); ci_verbose = $(ci_verbose_$(V)) define ci_target -ci-$1: $(CI_INSTALL_DIR)/$2 +ci-$1: $(KERL_INSTALL_DIR)/$2 $(verbose) $(MAKE) --no-print-directory clean $(ci_verbose) \ - PATH="$(CI_INSTALL_DIR)/$2/bin:$(PATH)" \ + PATH="$(KERL_INSTALL_DIR)/$2/bin:$(PATH)" \ CI_OTP_RELEASE="$1" \ CT_OPTS="-label $1" \ CI_VM="$3" \ @@ -6029,32 +6105,8 @@ $(foreach otp,$(CI_OTP),$(eval $(call ci_target,$(otp),$(otp),otp))) $(foreach otp,$(CI_HIPE),$(eval $(call ci_target,$(otp)-native,$(otp)-native,native))) $(foreach otp,$(CI_ERLLVM),$(eval $(call ci_target,$(otp)-erllvm,$(otp)-native,erllvm))) -define ci_otp_target -ifeq ($(wildcard $(CI_INSTALL_DIR)/$(1)),) -$(CI_INSTALL_DIR)/$(1): $(KERL) - MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $(1) $(1) - $(KERL) install $(1) $(CI_INSTALL_DIR)/$(1) -endif -endef - -$(foreach otp,$(CI_OTP),$(eval $(call ci_otp_target,$(otp)))) - -define ci_hipe_target -ifeq ($(wildcard $(CI_INSTALL_DIR)/$1-native),) -$(CI_INSTALL_DIR)/$1-native: $(KERL) - KERL_CONFIGURE_OPTIONS=--enable-native-libs \ - MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $1 $1-native - $(KERL) install $1-native $(CI_INSTALL_DIR)/$1-native -endif -endef - -$(foreach otp,$(sort $(CI_HIPE) $(CI_ERLLLVM)),$(eval $(call ci_hipe_target,$(otp)))) - -$(KERL): - $(verbose) mkdir -p $(ERLANG_MK_TMP) - $(gen_verbose) git clone --depth 1 $(KERL_GIT) $(ERLANG_MK_TMP)/kerl - $(verbose) cd $(ERLANG_MK_TMP)/kerl && git checkout $(KERL_COMMIT) - $(verbose) chmod +x $(KERL) +$(foreach otp,$(CI_OTP),$(eval $(call kerl_otp_target,$(otp)))) +$(foreach otp,$(sort $(CI_HIPE) $(CI_ERLLLVM)),$(eval $(call kerl_hipe_target,$(otp)))) help:: $(verbose) printf "%s\n" "" \ @@ -6064,10 +6116,6 @@ help:: "The CI_OTP variable must be defined with the Erlang versions" \ "that must be tested. For example: CI_OTP = OTP-17.3.4 OTP-17.5.3" -distclean:: distclean-kerl - -distclean-kerl: - $(gen_verbose) rm -rf $(KERL) endif # Copyright (c) 2013-2016, Loïc Hoguin @@ -6433,6 +6481,60 @@ apps-eunit: endif endif +# Copyright (c) 2015-2017, Loïc Hoguin +# This file is part of erlang.mk and subject to the terms of the ISC License. + +ifeq ($(filter proper,$(DEPS) $(TEST_DEPS)),proper) +.PHONY: proper + +# Targets. + +tests:: proper + +define proper_check.erl + code:add_pathsa(["$(call core_native_path,$(CURDIR)/ebin)", "$(call core_native_path,$(DEPS_DIR)/*/ebin)"]), + Module = fun(M) -> + [true] =:= lists:usort([ + case atom_to_list(F) of + "prop_" ++ _ -> + io:format("Testing ~p:~p/0~n", [M, F]), + proper:quickcheck(M:F()); + _ -> + true + end + || {F, 0} <- M:module_info(exports)]) + end, + try + case $(1) of + all -> [true] =:= lists:usort([Module(M) || M <- [$(call comma_list,$(3))]]); + module -> Module($(2)); + function -> proper:quickcheck($(2)) + end + of + true -> halt(0); + _ -> halt(1) + catch error:undef -> + io:format("Undefined property or module?~n~p~n", [erlang:get_stacktrace()]), + halt(0) + end. +endef + +ifdef t +ifeq (,$(findstring :,$(t))) +proper: test-build + $(verbose) $(call erlang,$(call proper_check.erl,module,$(t))) +else +proper: test-build + $(verbose) echo Testing $(t)/0 + $(verbose) $(call erlang,$(call proper_check.erl,function,$(t)())) +endif +else +proper: test-build + $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename $(wildcard ebin/*.beam)))))) + $(gen_verbose) $(call erlang,$(call proper_check.erl,all,undefined,$(MODULES))) +endif +endif + # Copyright (c) 2013-2016, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. @@ -6443,7 +6545,7 @@ endif RELX ?= $(ERLANG_MK_TMP)/relx RELX_CONFIG ?= $(CURDIR)/relx.config -RELX_URL ?= https://github.com/erlware/relx/releases/download/v3.19.0/relx +RELX_URL ?= https://github.com/erlware/relx/releases/download/v3.23.0/relx RELX_OPTS ?= RELX_OUTPUT_DIR ?= _rel RELX_REL_EXT ?= @@ -6489,7 +6591,7 @@ distclean-relx-rel: # Run target. ifeq ($(wildcard $(RELX_CONFIG)),) -run: +run:: else define get_relx_release.erl @@ -6513,7 +6615,7 @@ ifeq ($(PLATFORM),msys2) RELX_REL_EXT := .cmd endif -run: all +run:: all $(verbose) $(RELX_OUTPUT_DIR)/$(RELX_REL_NAME)/bin/$(RELX_REL_NAME)$(RELX_REL_EXT) console help:: @@ -6579,7 +6681,10 @@ ifeq ($(filter triq,$(DEPS) $(TEST_DEPS)),triq) tests:: triq define triq_check.erl - code:add_pathsa(["$(call core_native_path,$(CURDIR)/ebin)", "$(call core_native_path,$(DEPS_DIR)/*/ebin)"]), + code:add_pathsa([ + "$(call core_native_path,$(CURDIR)/ebin)", + "$(call core_native_path,$(DEPS_DIR)/*/ebin)", + "$(call core_native_path,$(TEST_DIR))"]), try case $(1) of all -> [true] =:= lists:usort([triq:check(M) || M <- [$(call comma_list,$(3))]]); @@ -6590,7 +6695,7 @@ define triq_check.erl true -> halt(0); _ -> halt(1) catch error:undef -> - io:format("Undefined property or module~n"), + io:format("Undefined property or module?~n~p~n", [erlang:get_stacktrace()]), halt(0) end. endef @@ -6606,7 +6711,8 @@ triq: test-build endif else triq: test-build - $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename $(wildcard ebin/*.beam)))))) + $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename \ + $(wildcard ebin/*.beam) $(call core_find,$(TEST_DIR)/,*.beam)))))) $(gen_verbose) $(call erlang,$(call triq_check.erl,all,undefined,$(MODULES))) endif endif diff --git a/rabbitmq-server/deps/rabbitmq_auth_backend_ldap/rabbitmq-components.mk b/rabbitmq-server/deps/rabbitmq_auth_backend_ldap/rabbitmq-components.mk index 1e5d000..5292fa9 100644 --- a/rabbitmq-server/deps/rabbitmq_auth_backend_ldap/rabbitmq-components.mk +++ b/rabbitmq-server/deps/rabbitmq_auth_backend_ldap/rabbitmq-components.mk @@ -38,6 +38,8 @@ endif # base of the topic branch. dep_amqp_client = git_rmq rabbitmq-erlang-client $(current_rmq_ref) $(base_rmq_ref) master +dep_amqp10_client = git_rmq rabbitmq-amqp1.0-client $(current_rmq_ref) $(base_rmq_ref) master +dep_amqp10_common = git_rmq rabbitmq-amqp1.0-common $(current_rmq_ref) $(base_rmq_ref) master dep_rabbit = git_rmq rabbitmq-server $(current_rmq_ref) $(base_rmq_ref) master dep_rabbit_common = git_rmq rabbitmq-common $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_amqp1_0 = git_rmq rabbitmq-amqp1.0 $(current_rmq_ref) $(base_rmq_ref) master @@ -63,7 +65,7 @@ dep_rabbitmq_java_client = git_rmq rabbitmq-java-client $(current_r dep_rabbitmq_jms_client = git_rmq rabbitmq-jms-client $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_jms_cts = git_rmq rabbitmq-jms-cts $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_jms_topic_exchange = git_rmq rabbitmq-jms-topic-exchange $(current_rmq_ref) $(base_rmq_ref) master -dep_rabbitmq_lvc = git_rmq rabbitmq-lvc-plugin $(current_rmq_ref) $(base_rmq_ref) master +dep_rabbitmq_lvc_exchange = git_rmq rabbitmq-lvc-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management = git_rmq rabbitmq-management $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management_agent = git_rmq rabbitmq-management-agent $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management_exchange = git_rmq rabbitmq-management-exchange $(current_rmq_ref) $(base_rmq_ref) master @@ -78,6 +80,7 @@ dep_rabbitmq_peer_discovery_common = git_rmq rabbitmq-peer-discovery-common $ dep_rabbitmq_peer_discovery_consul = git_rmq rabbitmq-peer-discovery-consul $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_peer_discovery_etcd = git_rmq rabbitmq-peer-discovery-etcd $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_peer_discovery_k8s = git_rmq rabbitmq-peer-discovery-k8s $(current_rmq_ref) $(base_rmq_ref) master +dep_rabbitmq_random_exchange = git_rmq rabbitmq-random-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_recent_history_exchange = git_rmq rabbitmq-recent-history-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_routing_node_stamp = git_rmq rabbitmq-routing-node-stamp $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_rtopic_exchange = git_rmq rabbitmq-rtopic-exchange $(current_rmq_ref) $(base_rmq_ref) master @@ -107,16 +110,18 @@ dep_rabbitmq_public_umbrella = git_rmq rabbitmq-public-umbrella $(curre # all projects use the same versions. It avoids conflicts and makes it # possible to work with rabbitmq-public-umbrella. -dep_cowboy_commit = 1.0.4 -dep_mochiweb = git git://github.com/basho/mochiweb.git v2.9.0p2 +dep_cowboy = hex 1.0.4 +dep_ranch = hex 1.3.2 +dep_recon = hex 2.3.2 + # Last commit of PropEr supporting Erlang R16B03. dep_proper_commit = 735d972758d8bd85b12483626fe1b66450d6a6fe -dep_ranch_commit = 1.3.2 # Last commit of sockjs support Erlang R16B03 and 17.x. dep_sockjs = git https://github.com/rabbitmq/sockjs-erlang.git 5af2b588c812c318b19bc105b577a759c71c3e0a -dep_webmachine_commit = 1.10.8p2 RABBITMQ_COMPONENTS = amqp_client \ + amqp10_common \ + amqp10_client \ rabbit \ rabbit_common \ rabbitmq_amqp1_0 \ @@ -142,7 +147,7 @@ RABBITMQ_COMPONENTS = amqp_client \ rabbitmq_jms_client \ rabbitmq_jms_cts \ rabbitmq_jms_topic_exchange \ - rabbitmq_lvc \ + rabbitmq_lvc_exchange \ rabbitmq_management \ rabbitmq_management_agent \ rabbitmq_management_exchange \ @@ -157,6 +162,7 @@ RABBITMQ_COMPONENTS = amqp_client \ rabbitmq_peer_discovery_consul \ rabbitmq_peer_discovery_etcd \ rabbitmq_peer_discovery_k8s \ + rabbitmq_random_exchange \ rabbitmq_recent_history_exchange \ rabbitmq_routing_node_stamp \ rabbitmq_rtopic_exchange \ @@ -184,7 +190,7 @@ NO_AUTOPATCH += $(RABBITMQ_COMPONENTS) ifeq ($(origin current_rmq_ref),undefined) ifneq ($(wildcard .git),) current_rmq_ref := $(shell (\ - ref=$$(git branch --list | awk '/^\* \(.*detached / {ref=$$0; sub(/.*detached [^ ]+ /, "", ref); sub(/\)$$/, "", ref); print ref; exit;} /^\* / {ref=$$0; sub(/^\* /, "", ref); print ref; exit}');\ + ref=$$(LANG=C git branch --list | awk '/^\* \(.*detached / {ref=$$0; sub(/.*detached [^ ]+ /, "", ref); sub(/\)$$/, "", ref); print ref; exit;} /^\* / {ref=$$0; sub(/^\* /, "", ref); print ref; exit}');\ if test "$$(git rev-parse --short HEAD)" != "$$ref"; then echo "$$ref"; fi)) else current_rmq_ref := master @@ -194,11 +200,17 @@ export current_rmq_ref ifeq ($(origin base_rmq_ref),undefined) ifneq ($(wildcard .git),) +possible_base_rmq_ref := v3.6.x +ifeq ($(possible_base_rmq_ref),$(current_rmq_ref)) +base_rmq_ref := $(current_rmq_ref) +else base_rmq_ref := $(shell \ - (git rev-parse --verify -q stable >/dev/null && \ - git merge-base --is-ancestor $$(git merge-base master HEAD) stable && \ - echo stable) || \ + (git rev-parse --verify -q master >/dev/null && \ + git rev-parse --verify -q $(possible_base_rmq_ref) >/dev/null && \ + git merge-base --is-ancestor $$(git merge-base master HEAD) $(possible_base_rmq_ref) && \ + echo $(possible_base_rmq_ref)) || \ echo master) +endif else base_rmq_ref := master endif @@ -313,11 +325,16 @@ endif UPSTREAM_RMQ_COMPONENTS_MK = $(DEPS_DIR)/rabbit_common/mk/rabbitmq-components.mk +ifeq ($(PROJECT),rabbit_common) +check-rabbitmq-components.mk: + @: +else check-rabbitmq-components.mk: $(verbose) cmp -s rabbitmq-components.mk \ $(UPSTREAM_RMQ_COMPONENTS_MK) || \ (echo "error: rabbitmq-components.mk must be updated!" 1>&2; \ false) +endif ifeq ($(PROJECT),rabbit_common) rabbitmq-components-mk: diff --git a/rabbitmq-server/deps/rabbitmq_auth_mechanism_ssl/erlang.mk b/rabbitmq-server/deps/rabbitmq_auth_mechanism_ssl/erlang.mk index 89ba561..1a45ad1 100644 --- a/rabbitmq-server/deps/rabbitmq_auth_mechanism_ssl/erlang.mk +++ b/rabbitmq-server/deps/rabbitmq_auth_mechanism_ssl/erlang.mk @@ -17,7 +17,7 @@ ERLANG_MK_FILENAME := $(realpath $(lastword $(MAKEFILE_LIST))) export ERLANG_MK_FILENAME -ERLANG_MK_VERSION = 2.0.0-pre.2-256-g2cce185 +ERLANG_MK_VERSION = 2.0.0-pre.2-278-gd9a9158 ERLANG_MK_WITHOUT = # Make 3.81 and 3.82 are deprecated. @@ -2023,6 +2023,14 @@ pkg_ibrowse_fetch = git pkg_ibrowse_repo = https://github.com/cmullaparthi/ibrowse pkg_ibrowse_commit = master +PACKAGES += idna +pkg_idna_name = idna +pkg_idna_description = Erlang IDNA lib +pkg_idna_homepage = https://github.com/benoitc/erlang-idna +pkg_idna_fetch = git +pkg_idna_repo = https://github.com/benoitc/erlang-idna +pkg_idna_commit = master + PACKAGES += ierlang pkg_ierlang_name = ierlang pkg_ierlang_description = An Erlang language kernel for IPython. @@ -2298,9 +2306,9 @@ pkg_kvs_commit = master PACKAGES += lager pkg_lager_name = lager pkg_lager_description = A logging framework for Erlang/OTP. -pkg_lager_homepage = https://github.com/basho/lager +pkg_lager_homepage = https://github.com/erlang-lager/lager pkg_lager_fetch = git -pkg_lager_repo = https://github.com/basho/lager +pkg_lager_repo = https://github.com/erlang-lager/lager pkg_lager_commit = master PACKAGES += lager_amqp_backend @@ -2314,9 +2322,9 @@ pkg_lager_amqp_backend_commit = master PACKAGES += lager_syslog pkg_lager_syslog_name = lager_syslog pkg_lager_syslog_description = Syslog backend for lager -pkg_lager_syslog_homepage = https://github.com/basho/lager_syslog +pkg_lager_syslog_homepage = https://github.com/erlang-lager/lager_syslog pkg_lager_syslog_fetch = git -pkg_lager_syslog_repo = https://github.com/basho/lager_syslog +pkg_lager_syslog_repo = https://github.com/erlang-lager/lager_syslog pkg_lager_syslog_commit = master PACKAGES += lambdapad @@ -3786,9 +3794,9 @@ pkg_trie_commit = master PACKAGES += triq pkg_triq_name = triq pkg_triq_description = Trifork QuickCheck -pkg_triq_homepage = https://github.com/krestenkrab/triq +pkg_triq_homepage = https://github.com/triqng/triq pkg_triq_fetch = git -pkg_triq_repo = https://github.com/krestenkrab/triq +pkg_triq_repo = https://github.com/triqng/triq.git pkg_triq_commit = master PACKAGES += tunctl @@ -4280,7 +4288,7 @@ endef # if given. Do it for all 3 possible Makefile file names. ifeq ($(NO_AUTOPATCH_ERLANG_MK),) define dep_autopatch_erlang_mk - $t for f in Makefile makefile GNUmakefile; do \ + for f in Makefile makefile GNUmakefile; do \ if [ -f $(DEPS_DIR)/$1/$$f ]; then \ sed -i.bak s/'include *erlang.mk'/'include $$(if $$(ERLANG_MK_FILENAME),$$(ERLANG_MK_FILENAME),erlang.mk)'/ $(DEPS_DIR)/$1/$$f; \ fi \ @@ -4357,6 +4365,8 @@ define dep_autopatch_rebar.erl lists:foreach(fun ({d, D}) -> Write("ERLC_OPTS += -D" ++ atom_to_list(D) ++ "=1\n"); + ({d, DKey, DVal}) -> + Write("ERLC_OPTS += -D" ++ atom_to_list(DKey) ++ "=" ++ atom_to_list(DVal) ++ "\n"); ({i, I}) -> Write(["ERLC_OPTS += -I ", I, "\n"]); ({platform_define, Regex, D}) -> @@ -4579,7 +4589,7 @@ define dep_autopatch_appsrc_script.erl AppSrc = "$(call core_native_path,$(DEPS_DIR)/$1/src/$1.app.src)", AppSrcScript = AppSrc ++ ".script", Bindings = erl_eval:new_bindings(), - {ok, Conf} = file:script(AppSrcScript, Bindings), + {ok, [Conf]} = file:script(AppSrcScript, Bindings), ok = file:write_file(AppSrc, io_lib:format("~p.~n", [Conf])), halt() endef @@ -4731,6 +4741,87 @@ ERLANG_MK_RECURSIVE_REL_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-rel-deps-list.log ERLANG_MK_RECURSIVE_TEST_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-test-deps-list.log ERLANG_MK_RECURSIVE_SHELL_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-shell-deps-list.log +# Copyright (c) 2015-2017, Loïc Hoguin +# This file is part of erlang.mk and subject to the terms of the ISC License. + +.PHONY: distclean-kerl + +KERL_INSTALL_DIR ?= $(HOME)/erlang + +ifeq ($(strip $(KERL)),) +KERL := $(ERLANG_MK_TMP)/kerl/kerl +endif + +export KERL + +KERL_GIT ?= https://github.com/kerl/kerl +KERL_COMMIT ?= master + +KERL_MAKEFLAGS ?= + +OTP_GIT ?= https://github.com/erlang/otp + +define kerl_otp_target +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(1)),) +$(KERL_INSTALL_DIR)/$(1): $(KERL) + MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $(1) $(1) + $(KERL) install $(1) $(KERL_INSTALL_DIR)/$(1) +endif +endef + +define kerl_hipe_target +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$1-native),) +$(KERL_INSTALL_DIR)/$1-native: $(KERL) + KERL_CONFIGURE_OPTIONS=--enable-native-libs \ + MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $1 $1-native + $(KERL) install $1-native $(KERL_INSTALL_DIR)/$1-native +endif +endef + +$(KERL): + $(verbose) mkdir -p $(ERLANG_MK_TMP) + $(gen_verbose) git clone --depth 1 $(KERL_GIT) $(ERLANG_MK_TMP)/kerl + $(verbose) cd $(ERLANG_MK_TMP)/kerl && git checkout $(KERL_COMMIT) + $(verbose) chmod +x $(KERL) + +distclean:: distclean-kerl + +distclean-kerl: + $(gen_verbose) rm -rf $(KERL) + +# Allow users to select which version of Erlang/OTP to use for a project. + +ERLANG_OTP ?= +ERLANG_HIPE ?= + +# Use kerl to enforce a specific Erlang/OTP version for a project. +ifneq ($(strip $(ERLANG_OTP)),) +export PATH := $(KERL_INSTALL_DIR)/$(ERLANG_OTP)/bin:$(PATH) +SHELL := env PATH=$(PATH) $(SHELL) +$(eval $(call kerl_otp_target,$(ERLANG_OTP))) + +# Build Erlang/OTP only if it doesn't already exist. +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(ERLANG_OTP))$(BUILD_ERLANG_OTP),) +$(info Building Erlang/OTP $(ERLANG_OTP)... Please wait...) +$(shell $(MAKE) $(KERL_INSTALL_DIR)/$(ERLANG_OTP) ERLANG_OTP=$(ERLANG_OTP) BUILD_ERLANG_OTP=1 >&2) +endif + +else +# Same for a HiPE enabled VM. +ifneq ($(strip $(ERLANG_HIPE)),) +export PATH := $(KERL_INSTALL_DIR)/$(ERLANG_HIPE)-native/bin:$(PATH) +SHELL := env PATH=$(PATH) $(SHELL) +$(eval $(call kerl_hipe_target,$(ERLANG_HIPE))) + +# Build Erlang/OTP only if it doesn't already exist. +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(ERLANG_HIPE))$(BUILD_ERLANG_OTP),) +$(info Building HiPE-enabled Erlang/OTP $(ERLANG_OTP)... Please wait...) +$(shell $(MAKE) $(KERL_INSTALL_DIR)/$(ERLANG_HIPE) ERLANG_HIPE=$(ERLANG_HIPE) BUILD_ERLANG_OTP=1 >&2) +endif + +endif +endif + # Copyright (c) 2015-2016, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. @@ -5966,10 +6057,10 @@ else $(call render_template,bs_erl_nif,src/$n.erl) endif -# Copyright (c) 2015-2016, Loïc Hoguin +# Copyright (c) 2015-2017, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. -.PHONY: ci ci-prepare ci-setup distclean-kerl +.PHONY: ci ci-prepare ci-setup CI_OTP ?= CI_HIPE ?= @@ -5987,24 +6078,9 @@ ifeq ($(strip $(CI_OTP) $(CI_HIPE) $(CI_ERLLVM)),) ci:: else -ifeq ($(strip $(KERL)),) -KERL := $(ERLANG_MK_TMP)/kerl/kerl -endif - -export KERL - -KERL_GIT ?= https://github.com/kerl/kerl -KERL_COMMIT ?= master - -KERL_MAKEFLAGS ?= - -OTP_GIT ?= https://github.com/erlang/otp - -CI_INSTALL_DIR ?= $(HOME)/erlang - ci:: $(addprefix ci-,$(CI_OTP) $(addsuffix -native,$(CI_HIPE)) $(addsuffix -erllvm,$(CI_ERLLVM))) -ci-prepare: $(addprefix $(CI_INSTALL_DIR)/,$(CI_OTP) $(addsuffix -native,$(CI_HIPE))) +ci-prepare: $(addprefix $(KERL_INSTALL_DIR)/,$(CI_OTP) $(addsuffix -native,$(CI_HIPE))) ci-setup:: @@ -6014,10 +6090,10 @@ ci_verbose_0 = @echo " CI " $(1); ci_verbose = $(ci_verbose_$(V)) define ci_target -ci-$1: $(CI_INSTALL_DIR)/$2 +ci-$1: $(KERL_INSTALL_DIR)/$2 $(verbose) $(MAKE) --no-print-directory clean $(ci_verbose) \ - PATH="$(CI_INSTALL_DIR)/$2/bin:$(PATH)" \ + PATH="$(KERL_INSTALL_DIR)/$2/bin:$(PATH)" \ CI_OTP_RELEASE="$1" \ CT_OPTS="-label $1" \ CI_VM="$3" \ @@ -6029,32 +6105,8 @@ $(foreach otp,$(CI_OTP),$(eval $(call ci_target,$(otp),$(otp),otp))) $(foreach otp,$(CI_HIPE),$(eval $(call ci_target,$(otp)-native,$(otp)-native,native))) $(foreach otp,$(CI_ERLLVM),$(eval $(call ci_target,$(otp)-erllvm,$(otp)-native,erllvm))) -define ci_otp_target -ifeq ($(wildcard $(CI_INSTALL_DIR)/$(1)),) -$(CI_INSTALL_DIR)/$(1): $(KERL) - MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $(1) $(1) - $(KERL) install $(1) $(CI_INSTALL_DIR)/$(1) -endif -endef - -$(foreach otp,$(CI_OTP),$(eval $(call ci_otp_target,$(otp)))) - -define ci_hipe_target -ifeq ($(wildcard $(CI_INSTALL_DIR)/$1-native),) -$(CI_INSTALL_DIR)/$1-native: $(KERL) - KERL_CONFIGURE_OPTIONS=--enable-native-libs \ - MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $1 $1-native - $(KERL) install $1-native $(CI_INSTALL_DIR)/$1-native -endif -endef - -$(foreach otp,$(sort $(CI_HIPE) $(CI_ERLLLVM)),$(eval $(call ci_hipe_target,$(otp)))) - -$(KERL): - $(verbose) mkdir -p $(ERLANG_MK_TMP) - $(gen_verbose) git clone --depth 1 $(KERL_GIT) $(ERLANG_MK_TMP)/kerl - $(verbose) cd $(ERLANG_MK_TMP)/kerl && git checkout $(KERL_COMMIT) - $(verbose) chmod +x $(KERL) +$(foreach otp,$(CI_OTP),$(eval $(call kerl_otp_target,$(otp)))) +$(foreach otp,$(sort $(CI_HIPE) $(CI_ERLLLVM)),$(eval $(call kerl_hipe_target,$(otp)))) help:: $(verbose) printf "%s\n" "" \ @@ -6064,10 +6116,6 @@ help:: "The CI_OTP variable must be defined with the Erlang versions" \ "that must be tested. For example: CI_OTP = OTP-17.3.4 OTP-17.5.3" -distclean:: distclean-kerl - -distclean-kerl: - $(gen_verbose) rm -rf $(KERL) endif # Copyright (c) 2013-2016, Loïc Hoguin @@ -6433,6 +6481,60 @@ apps-eunit: endif endif +# Copyright (c) 2015-2017, Loïc Hoguin +# This file is part of erlang.mk and subject to the terms of the ISC License. + +ifeq ($(filter proper,$(DEPS) $(TEST_DEPS)),proper) +.PHONY: proper + +# Targets. + +tests:: proper + +define proper_check.erl + code:add_pathsa(["$(call core_native_path,$(CURDIR)/ebin)", "$(call core_native_path,$(DEPS_DIR)/*/ebin)"]), + Module = fun(M) -> + [true] =:= lists:usort([ + case atom_to_list(F) of + "prop_" ++ _ -> + io:format("Testing ~p:~p/0~n", [M, F]), + proper:quickcheck(M:F()); + _ -> + true + end + || {F, 0} <- M:module_info(exports)]) + end, + try + case $(1) of + all -> [true] =:= lists:usort([Module(M) || M <- [$(call comma_list,$(3))]]); + module -> Module($(2)); + function -> proper:quickcheck($(2)) + end + of + true -> halt(0); + _ -> halt(1) + catch error:undef -> + io:format("Undefined property or module?~n~p~n", [erlang:get_stacktrace()]), + halt(0) + end. +endef + +ifdef t +ifeq (,$(findstring :,$(t))) +proper: test-build + $(verbose) $(call erlang,$(call proper_check.erl,module,$(t))) +else +proper: test-build + $(verbose) echo Testing $(t)/0 + $(verbose) $(call erlang,$(call proper_check.erl,function,$(t)())) +endif +else +proper: test-build + $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename $(wildcard ebin/*.beam)))))) + $(gen_verbose) $(call erlang,$(call proper_check.erl,all,undefined,$(MODULES))) +endif +endif + # Copyright (c) 2013-2016, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. @@ -6443,7 +6545,7 @@ endif RELX ?= $(ERLANG_MK_TMP)/relx RELX_CONFIG ?= $(CURDIR)/relx.config -RELX_URL ?= https://github.com/erlware/relx/releases/download/v3.19.0/relx +RELX_URL ?= https://github.com/erlware/relx/releases/download/v3.23.0/relx RELX_OPTS ?= RELX_OUTPUT_DIR ?= _rel RELX_REL_EXT ?= @@ -6489,7 +6591,7 @@ distclean-relx-rel: # Run target. ifeq ($(wildcard $(RELX_CONFIG)),) -run: +run:: else define get_relx_release.erl @@ -6513,7 +6615,7 @@ ifeq ($(PLATFORM),msys2) RELX_REL_EXT := .cmd endif -run: all +run:: all $(verbose) $(RELX_OUTPUT_DIR)/$(RELX_REL_NAME)/bin/$(RELX_REL_NAME)$(RELX_REL_EXT) console help:: @@ -6579,7 +6681,10 @@ ifeq ($(filter triq,$(DEPS) $(TEST_DEPS)),triq) tests:: triq define triq_check.erl - code:add_pathsa(["$(call core_native_path,$(CURDIR)/ebin)", "$(call core_native_path,$(DEPS_DIR)/*/ebin)"]), + code:add_pathsa([ + "$(call core_native_path,$(CURDIR)/ebin)", + "$(call core_native_path,$(DEPS_DIR)/*/ebin)", + "$(call core_native_path,$(TEST_DIR))"]), try case $(1) of all -> [true] =:= lists:usort([triq:check(M) || M <- [$(call comma_list,$(3))]]); @@ -6590,7 +6695,7 @@ define triq_check.erl true -> halt(0); _ -> halt(1) catch error:undef -> - io:format("Undefined property or module~n"), + io:format("Undefined property or module?~n~p~n", [erlang:get_stacktrace()]), halt(0) end. endef @@ -6606,7 +6711,8 @@ triq: test-build endif else triq: test-build - $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename $(wildcard ebin/*.beam)))))) + $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename \ + $(wildcard ebin/*.beam) $(call core_find,$(TEST_DIR)/,*.beam)))))) $(gen_verbose) $(call erlang,$(call triq_check.erl,all,undefined,$(MODULES))) endif endif diff --git a/rabbitmq-server/deps/rabbitmq_auth_mechanism_ssl/rabbitmq-components.mk b/rabbitmq-server/deps/rabbitmq_auth_mechanism_ssl/rabbitmq-components.mk index 1e5d000..5292fa9 100644 --- a/rabbitmq-server/deps/rabbitmq_auth_mechanism_ssl/rabbitmq-components.mk +++ b/rabbitmq-server/deps/rabbitmq_auth_mechanism_ssl/rabbitmq-components.mk @@ -38,6 +38,8 @@ endif # base of the topic branch. dep_amqp_client = git_rmq rabbitmq-erlang-client $(current_rmq_ref) $(base_rmq_ref) master +dep_amqp10_client = git_rmq rabbitmq-amqp1.0-client $(current_rmq_ref) $(base_rmq_ref) master +dep_amqp10_common = git_rmq rabbitmq-amqp1.0-common $(current_rmq_ref) $(base_rmq_ref) master dep_rabbit = git_rmq rabbitmq-server $(current_rmq_ref) $(base_rmq_ref) master dep_rabbit_common = git_rmq rabbitmq-common $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_amqp1_0 = git_rmq rabbitmq-amqp1.0 $(current_rmq_ref) $(base_rmq_ref) master @@ -63,7 +65,7 @@ dep_rabbitmq_java_client = git_rmq rabbitmq-java-client $(current_r dep_rabbitmq_jms_client = git_rmq rabbitmq-jms-client $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_jms_cts = git_rmq rabbitmq-jms-cts $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_jms_topic_exchange = git_rmq rabbitmq-jms-topic-exchange $(current_rmq_ref) $(base_rmq_ref) master -dep_rabbitmq_lvc = git_rmq rabbitmq-lvc-plugin $(current_rmq_ref) $(base_rmq_ref) master +dep_rabbitmq_lvc_exchange = git_rmq rabbitmq-lvc-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management = git_rmq rabbitmq-management $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management_agent = git_rmq rabbitmq-management-agent $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management_exchange = git_rmq rabbitmq-management-exchange $(current_rmq_ref) $(base_rmq_ref) master @@ -78,6 +80,7 @@ dep_rabbitmq_peer_discovery_common = git_rmq rabbitmq-peer-discovery-common $ dep_rabbitmq_peer_discovery_consul = git_rmq rabbitmq-peer-discovery-consul $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_peer_discovery_etcd = git_rmq rabbitmq-peer-discovery-etcd $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_peer_discovery_k8s = git_rmq rabbitmq-peer-discovery-k8s $(current_rmq_ref) $(base_rmq_ref) master +dep_rabbitmq_random_exchange = git_rmq rabbitmq-random-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_recent_history_exchange = git_rmq rabbitmq-recent-history-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_routing_node_stamp = git_rmq rabbitmq-routing-node-stamp $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_rtopic_exchange = git_rmq rabbitmq-rtopic-exchange $(current_rmq_ref) $(base_rmq_ref) master @@ -107,16 +110,18 @@ dep_rabbitmq_public_umbrella = git_rmq rabbitmq-public-umbrella $(curre # all projects use the same versions. It avoids conflicts and makes it # possible to work with rabbitmq-public-umbrella. -dep_cowboy_commit = 1.0.4 -dep_mochiweb = git git://github.com/basho/mochiweb.git v2.9.0p2 +dep_cowboy = hex 1.0.4 +dep_ranch = hex 1.3.2 +dep_recon = hex 2.3.2 + # Last commit of PropEr supporting Erlang R16B03. dep_proper_commit = 735d972758d8bd85b12483626fe1b66450d6a6fe -dep_ranch_commit = 1.3.2 # Last commit of sockjs support Erlang R16B03 and 17.x. dep_sockjs = git https://github.com/rabbitmq/sockjs-erlang.git 5af2b588c812c318b19bc105b577a759c71c3e0a -dep_webmachine_commit = 1.10.8p2 RABBITMQ_COMPONENTS = amqp_client \ + amqp10_common \ + amqp10_client \ rabbit \ rabbit_common \ rabbitmq_amqp1_0 \ @@ -142,7 +147,7 @@ RABBITMQ_COMPONENTS = amqp_client \ rabbitmq_jms_client \ rabbitmq_jms_cts \ rabbitmq_jms_topic_exchange \ - rabbitmq_lvc \ + rabbitmq_lvc_exchange \ rabbitmq_management \ rabbitmq_management_agent \ rabbitmq_management_exchange \ @@ -157,6 +162,7 @@ RABBITMQ_COMPONENTS = amqp_client \ rabbitmq_peer_discovery_consul \ rabbitmq_peer_discovery_etcd \ rabbitmq_peer_discovery_k8s \ + rabbitmq_random_exchange \ rabbitmq_recent_history_exchange \ rabbitmq_routing_node_stamp \ rabbitmq_rtopic_exchange \ @@ -184,7 +190,7 @@ NO_AUTOPATCH += $(RABBITMQ_COMPONENTS) ifeq ($(origin current_rmq_ref),undefined) ifneq ($(wildcard .git),) current_rmq_ref := $(shell (\ - ref=$$(git branch --list | awk '/^\* \(.*detached / {ref=$$0; sub(/.*detached [^ ]+ /, "", ref); sub(/\)$$/, "", ref); print ref; exit;} /^\* / {ref=$$0; sub(/^\* /, "", ref); print ref; exit}');\ + ref=$$(LANG=C git branch --list | awk '/^\* \(.*detached / {ref=$$0; sub(/.*detached [^ ]+ /, "", ref); sub(/\)$$/, "", ref); print ref; exit;} /^\* / {ref=$$0; sub(/^\* /, "", ref); print ref; exit}');\ if test "$$(git rev-parse --short HEAD)" != "$$ref"; then echo "$$ref"; fi)) else current_rmq_ref := master @@ -194,11 +200,17 @@ export current_rmq_ref ifeq ($(origin base_rmq_ref),undefined) ifneq ($(wildcard .git),) +possible_base_rmq_ref := v3.6.x +ifeq ($(possible_base_rmq_ref),$(current_rmq_ref)) +base_rmq_ref := $(current_rmq_ref) +else base_rmq_ref := $(shell \ - (git rev-parse --verify -q stable >/dev/null && \ - git merge-base --is-ancestor $$(git merge-base master HEAD) stable && \ - echo stable) || \ + (git rev-parse --verify -q master >/dev/null && \ + git rev-parse --verify -q $(possible_base_rmq_ref) >/dev/null && \ + git merge-base --is-ancestor $$(git merge-base master HEAD) $(possible_base_rmq_ref) && \ + echo $(possible_base_rmq_ref)) || \ echo master) +endif else base_rmq_ref := master endif @@ -313,11 +325,16 @@ endif UPSTREAM_RMQ_COMPONENTS_MK = $(DEPS_DIR)/rabbit_common/mk/rabbitmq-components.mk +ifeq ($(PROJECT),rabbit_common) +check-rabbitmq-components.mk: + @: +else check-rabbitmq-components.mk: $(verbose) cmp -s rabbitmq-components.mk \ $(UPSTREAM_RMQ_COMPONENTS_MK) || \ (echo "error: rabbitmq-components.mk must be updated!" 1>&2; \ false) +endif ifeq ($(PROJECT),rabbit_common) rabbitmq-components-mk: diff --git a/rabbitmq-server/deps/rabbitmq_consistent_hash_exchange/erlang.mk b/rabbitmq-server/deps/rabbitmq_consistent_hash_exchange/erlang.mk index 89ba561..1a45ad1 100644 --- a/rabbitmq-server/deps/rabbitmq_consistent_hash_exchange/erlang.mk +++ b/rabbitmq-server/deps/rabbitmq_consistent_hash_exchange/erlang.mk @@ -17,7 +17,7 @@ ERLANG_MK_FILENAME := $(realpath $(lastword $(MAKEFILE_LIST))) export ERLANG_MK_FILENAME -ERLANG_MK_VERSION = 2.0.0-pre.2-256-g2cce185 +ERLANG_MK_VERSION = 2.0.0-pre.2-278-gd9a9158 ERLANG_MK_WITHOUT = # Make 3.81 and 3.82 are deprecated. @@ -2023,6 +2023,14 @@ pkg_ibrowse_fetch = git pkg_ibrowse_repo = https://github.com/cmullaparthi/ibrowse pkg_ibrowse_commit = master +PACKAGES += idna +pkg_idna_name = idna +pkg_idna_description = Erlang IDNA lib +pkg_idna_homepage = https://github.com/benoitc/erlang-idna +pkg_idna_fetch = git +pkg_idna_repo = https://github.com/benoitc/erlang-idna +pkg_idna_commit = master + PACKAGES += ierlang pkg_ierlang_name = ierlang pkg_ierlang_description = An Erlang language kernel for IPython. @@ -2298,9 +2306,9 @@ pkg_kvs_commit = master PACKAGES += lager pkg_lager_name = lager pkg_lager_description = A logging framework for Erlang/OTP. -pkg_lager_homepage = https://github.com/basho/lager +pkg_lager_homepage = https://github.com/erlang-lager/lager pkg_lager_fetch = git -pkg_lager_repo = https://github.com/basho/lager +pkg_lager_repo = https://github.com/erlang-lager/lager pkg_lager_commit = master PACKAGES += lager_amqp_backend @@ -2314,9 +2322,9 @@ pkg_lager_amqp_backend_commit = master PACKAGES += lager_syslog pkg_lager_syslog_name = lager_syslog pkg_lager_syslog_description = Syslog backend for lager -pkg_lager_syslog_homepage = https://github.com/basho/lager_syslog +pkg_lager_syslog_homepage = https://github.com/erlang-lager/lager_syslog pkg_lager_syslog_fetch = git -pkg_lager_syslog_repo = https://github.com/basho/lager_syslog +pkg_lager_syslog_repo = https://github.com/erlang-lager/lager_syslog pkg_lager_syslog_commit = master PACKAGES += lambdapad @@ -3786,9 +3794,9 @@ pkg_trie_commit = master PACKAGES += triq pkg_triq_name = triq pkg_triq_description = Trifork QuickCheck -pkg_triq_homepage = https://github.com/krestenkrab/triq +pkg_triq_homepage = https://github.com/triqng/triq pkg_triq_fetch = git -pkg_triq_repo = https://github.com/krestenkrab/triq +pkg_triq_repo = https://github.com/triqng/triq.git pkg_triq_commit = master PACKAGES += tunctl @@ -4280,7 +4288,7 @@ endef # if given. Do it for all 3 possible Makefile file names. ifeq ($(NO_AUTOPATCH_ERLANG_MK),) define dep_autopatch_erlang_mk - $t for f in Makefile makefile GNUmakefile; do \ + for f in Makefile makefile GNUmakefile; do \ if [ -f $(DEPS_DIR)/$1/$$f ]; then \ sed -i.bak s/'include *erlang.mk'/'include $$(if $$(ERLANG_MK_FILENAME),$$(ERLANG_MK_FILENAME),erlang.mk)'/ $(DEPS_DIR)/$1/$$f; \ fi \ @@ -4357,6 +4365,8 @@ define dep_autopatch_rebar.erl lists:foreach(fun ({d, D}) -> Write("ERLC_OPTS += -D" ++ atom_to_list(D) ++ "=1\n"); + ({d, DKey, DVal}) -> + Write("ERLC_OPTS += -D" ++ atom_to_list(DKey) ++ "=" ++ atom_to_list(DVal) ++ "\n"); ({i, I}) -> Write(["ERLC_OPTS += -I ", I, "\n"]); ({platform_define, Regex, D}) -> @@ -4579,7 +4589,7 @@ define dep_autopatch_appsrc_script.erl AppSrc = "$(call core_native_path,$(DEPS_DIR)/$1/src/$1.app.src)", AppSrcScript = AppSrc ++ ".script", Bindings = erl_eval:new_bindings(), - {ok, Conf} = file:script(AppSrcScript, Bindings), + {ok, [Conf]} = file:script(AppSrcScript, Bindings), ok = file:write_file(AppSrc, io_lib:format("~p.~n", [Conf])), halt() endef @@ -4731,6 +4741,87 @@ ERLANG_MK_RECURSIVE_REL_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-rel-deps-list.log ERLANG_MK_RECURSIVE_TEST_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-test-deps-list.log ERLANG_MK_RECURSIVE_SHELL_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-shell-deps-list.log +# Copyright (c) 2015-2017, Loïc Hoguin +# This file is part of erlang.mk and subject to the terms of the ISC License. + +.PHONY: distclean-kerl + +KERL_INSTALL_DIR ?= $(HOME)/erlang + +ifeq ($(strip $(KERL)),) +KERL := $(ERLANG_MK_TMP)/kerl/kerl +endif + +export KERL + +KERL_GIT ?= https://github.com/kerl/kerl +KERL_COMMIT ?= master + +KERL_MAKEFLAGS ?= + +OTP_GIT ?= https://github.com/erlang/otp + +define kerl_otp_target +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(1)),) +$(KERL_INSTALL_DIR)/$(1): $(KERL) + MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $(1) $(1) + $(KERL) install $(1) $(KERL_INSTALL_DIR)/$(1) +endif +endef + +define kerl_hipe_target +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$1-native),) +$(KERL_INSTALL_DIR)/$1-native: $(KERL) + KERL_CONFIGURE_OPTIONS=--enable-native-libs \ + MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $1 $1-native + $(KERL) install $1-native $(KERL_INSTALL_DIR)/$1-native +endif +endef + +$(KERL): + $(verbose) mkdir -p $(ERLANG_MK_TMP) + $(gen_verbose) git clone --depth 1 $(KERL_GIT) $(ERLANG_MK_TMP)/kerl + $(verbose) cd $(ERLANG_MK_TMP)/kerl && git checkout $(KERL_COMMIT) + $(verbose) chmod +x $(KERL) + +distclean:: distclean-kerl + +distclean-kerl: + $(gen_verbose) rm -rf $(KERL) + +# Allow users to select which version of Erlang/OTP to use for a project. + +ERLANG_OTP ?= +ERLANG_HIPE ?= + +# Use kerl to enforce a specific Erlang/OTP version for a project. +ifneq ($(strip $(ERLANG_OTP)),) +export PATH := $(KERL_INSTALL_DIR)/$(ERLANG_OTP)/bin:$(PATH) +SHELL := env PATH=$(PATH) $(SHELL) +$(eval $(call kerl_otp_target,$(ERLANG_OTP))) + +# Build Erlang/OTP only if it doesn't already exist. +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(ERLANG_OTP))$(BUILD_ERLANG_OTP),) +$(info Building Erlang/OTP $(ERLANG_OTP)... Please wait...) +$(shell $(MAKE) $(KERL_INSTALL_DIR)/$(ERLANG_OTP) ERLANG_OTP=$(ERLANG_OTP) BUILD_ERLANG_OTP=1 >&2) +endif + +else +# Same for a HiPE enabled VM. +ifneq ($(strip $(ERLANG_HIPE)),) +export PATH := $(KERL_INSTALL_DIR)/$(ERLANG_HIPE)-native/bin:$(PATH) +SHELL := env PATH=$(PATH) $(SHELL) +$(eval $(call kerl_hipe_target,$(ERLANG_HIPE))) + +# Build Erlang/OTP only if it doesn't already exist. +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(ERLANG_HIPE))$(BUILD_ERLANG_OTP),) +$(info Building HiPE-enabled Erlang/OTP $(ERLANG_OTP)... Please wait...) +$(shell $(MAKE) $(KERL_INSTALL_DIR)/$(ERLANG_HIPE) ERLANG_HIPE=$(ERLANG_HIPE) BUILD_ERLANG_OTP=1 >&2) +endif + +endif +endif + # Copyright (c) 2015-2016, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. @@ -5966,10 +6057,10 @@ else $(call render_template,bs_erl_nif,src/$n.erl) endif -# Copyright (c) 2015-2016, Loïc Hoguin +# Copyright (c) 2015-2017, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. -.PHONY: ci ci-prepare ci-setup distclean-kerl +.PHONY: ci ci-prepare ci-setup CI_OTP ?= CI_HIPE ?= @@ -5987,24 +6078,9 @@ ifeq ($(strip $(CI_OTP) $(CI_HIPE) $(CI_ERLLVM)),) ci:: else -ifeq ($(strip $(KERL)),) -KERL := $(ERLANG_MK_TMP)/kerl/kerl -endif - -export KERL - -KERL_GIT ?= https://github.com/kerl/kerl -KERL_COMMIT ?= master - -KERL_MAKEFLAGS ?= - -OTP_GIT ?= https://github.com/erlang/otp - -CI_INSTALL_DIR ?= $(HOME)/erlang - ci:: $(addprefix ci-,$(CI_OTP) $(addsuffix -native,$(CI_HIPE)) $(addsuffix -erllvm,$(CI_ERLLVM))) -ci-prepare: $(addprefix $(CI_INSTALL_DIR)/,$(CI_OTP) $(addsuffix -native,$(CI_HIPE))) +ci-prepare: $(addprefix $(KERL_INSTALL_DIR)/,$(CI_OTP) $(addsuffix -native,$(CI_HIPE))) ci-setup:: @@ -6014,10 +6090,10 @@ ci_verbose_0 = @echo " CI " $(1); ci_verbose = $(ci_verbose_$(V)) define ci_target -ci-$1: $(CI_INSTALL_DIR)/$2 +ci-$1: $(KERL_INSTALL_DIR)/$2 $(verbose) $(MAKE) --no-print-directory clean $(ci_verbose) \ - PATH="$(CI_INSTALL_DIR)/$2/bin:$(PATH)" \ + PATH="$(KERL_INSTALL_DIR)/$2/bin:$(PATH)" \ CI_OTP_RELEASE="$1" \ CT_OPTS="-label $1" \ CI_VM="$3" \ @@ -6029,32 +6105,8 @@ $(foreach otp,$(CI_OTP),$(eval $(call ci_target,$(otp),$(otp),otp))) $(foreach otp,$(CI_HIPE),$(eval $(call ci_target,$(otp)-native,$(otp)-native,native))) $(foreach otp,$(CI_ERLLVM),$(eval $(call ci_target,$(otp)-erllvm,$(otp)-native,erllvm))) -define ci_otp_target -ifeq ($(wildcard $(CI_INSTALL_DIR)/$(1)),) -$(CI_INSTALL_DIR)/$(1): $(KERL) - MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $(1) $(1) - $(KERL) install $(1) $(CI_INSTALL_DIR)/$(1) -endif -endef - -$(foreach otp,$(CI_OTP),$(eval $(call ci_otp_target,$(otp)))) - -define ci_hipe_target -ifeq ($(wildcard $(CI_INSTALL_DIR)/$1-native),) -$(CI_INSTALL_DIR)/$1-native: $(KERL) - KERL_CONFIGURE_OPTIONS=--enable-native-libs \ - MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $1 $1-native - $(KERL) install $1-native $(CI_INSTALL_DIR)/$1-native -endif -endef - -$(foreach otp,$(sort $(CI_HIPE) $(CI_ERLLLVM)),$(eval $(call ci_hipe_target,$(otp)))) - -$(KERL): - $(verbose) mkdir -p $(ERLANG_MK_TMP) - $(gen_verbose) git clone --depth 1 $(KERL_GIT) $(ERLANG_MK_TMP)/kerl - $(verbose) cd $(ERLANG_MK_TMP)/kerl && git checkout $(KERL_COMMIT) - $(verbose) chmod +x $(KERL) +$(foreach otp,$(CI_OTP),$(eval $(call kerl_otp_target,$(otp)))) +$(foreach otp,$(sort $(CI_HIPE) $(CI_ERLLLVM)),$(eval $(call kerl_hipe_target,$(otp)))) help:: $(verbose) printf "%s\n" "" \ @@ -6064,10 +6116,6 @@ help:: "The CI_OTP variable must be defined with the Erlang versions" \ "that must be tested. For example: CI_OTP = OTP-17.3.4 OTP-17.5.3" -distclean:: distclean-kerl - -distclean-kerl: - $(gen_verbose) rm -rf $(KERL) endif # Copyright (c) 2013-2016, Loïc Hoguin @@ -6433,6 +6481,60 @@ apps-eunit: endif endif +# Copyright (c) 2015-2017, Loïc Hoguin +# This file is part of erlang.mk and subject to the terms of the ISC License. + +ifeq ($(filter proper,$(DEPS) $(TEST_DEPS)),proper) +.PHONY: proper + +# Targets. + +tests:: proper + +define proper_check.erl + code:add_pathsa(["$(call core_native_path,$(CURDIR)/ebin)", "$(call core_native_path,$(DEPS_DIR)/*/ebin)"]), + Module = fun(M) -> + [true] =:= lists:usort([ + case atom_to_list(F) of + "prop_" ++ _ -> + io:format("Testing ~p:~p/0~n", [M, F]), + proper:quickcheck(M:F()); + _ -> + true + end + || {F, 0} <- M:module_info(exports)]) + end, + try + case $(1) of + all -> [true] =:= lists:usort([Module(M) || M <- [$(call comma_list,$(3))]]); + module -> Module($(2)); + function -> proper:quickcheck($(2)) + end + of + true -> halt(0); + _ -> halt(1) + catch error:undef -> + io:format("Undefined property or module?~n~p~n", [erlang:get_stacktrace()]), + halt(0) + end. +endef + +ifdef t +ifeq (,$(findstring :,$(t))) +proper: test-build + $(verbose) $(call erlang,$(call proper_check.erl,module,$(t))) +else +proper: test-build + $(verbose) echo Testing $(t)/0 + $(verbose) $(call erlang,$(call proper_check.erl,function,$(t)())) +endif +else +proper: test-build + $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename $(wildcard ebin/*.beam)))))) + $(gen_verbose) $(call erlang,$(call proper_check.erl,all,undefined,$(MODULES))) +endif +endif + # Copyright (c) 2013-2016, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. @@ -6443,7 +6545,7 @@ endif RELX ?= $(ERLANG_MK_TMP)/relx RELX_CONFIG ?= $(CURDIR)/relx.config -RELX_URL ?= https://github.com/erlware/relx/releases/download/v3.19.0/relx +RELX_URL ?= https://github.com/erlware/relx/releases/download/v3.23.0/relx RELX_OPTS ?= RELX_OUTPUT_DIR ?= _rel RELX_REL_EXT ?= @@ -6489,7 +6591,7 @@ distclean-relx-rel: # Run target. ifeq ($(wildcard $(RELX_CONFIG)),) -run: +run:: else define get_relx_release.erl @@ -6513,7 +6615,7 @@ ifeq ($(PLATFORM),msys2) RELX_REL_EXT := .cmd endif -run: all +run:: all $(verbose) $(RELX_OUTPUT_DIR)/$(RELX_REL_NAME)/bin/$(RELX_REL_NAME)$(RELX_REL_EXT) console help:: @@ -6579,7 +6681,10 @@ ifeq ($(filter triq,$(DEPS) $(TEST_DEPS)),triq) tests:: triq define triq_check.erl - code:add_pathsa(["$(call core_native_path,$(CURDIR)/ebin)", "$(call core_native_path,$(DEPS_DIR)/*/ebin)"]), + code:add_pathsa([ + "$(call core_native_path,$(CURDIR)/ebin)", + "$(call core_native_path,$(DEPS_DIR)/*/ebin)", + "$(call core_native_path,$(TEST_DIR))"]), try case $(1) of all -> [true] =:= lists:usort([triq:check(M) || M <- [$(call comma_list,$(3))]]); @@ -6590,7 +6695,7 @@ define triq_check.erl true -> halt(0); _ -> halt(1) catch error:undef -> - io:format("Undefined property or module~n"), + io:format("Undefined property or module?~n~p~n", [erlang:get_stacktrace()]), halt(0) end. endef @@ -6606,7 +6711,8 @@ triq: test-build endif else triq: test-build - $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename $(wildcard ebin/*.beam)))))) + $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename \ + $(wildcard ebin/*.beam) $(call core_find,$(TEST_DIR)/,*.beam)))))) $(gen_verbose) $(call erlang,$(call triq_check.erl,all,undefined,$(MODULES))) endif endif diff --git a/rabbitmq-server/deps/rabbitmq_consistent_hash_exchange/rabbitmq-components.mk b/rabbitmq-server/deps/rabbitmq_consistent_hash_exchange/rabbitmq-components.mk index 1e5d000..5292fa9 100644 --- a/rabbitmq-server/deps/rabbitmq_consistent_hash_exchange/rabbitmq-components.mk +++ b/rabbitmq-server/deps/rabbitmq_consistent_hash_exchange/rabbitmq-components.mk @@ -38,6 +38,8 @@ endif # base of the topic branch. dep_amqp_client = git_rmq rabbitmq-erlang-client $(current_rmq_ref) $(base_rmq_ref) master +dep_amqp10_client = git_rmq rabbitmq-amqp1.0-client $(current_rmq_ref) $(base_rmq_ref) master +dep_amqp10_common = git_rmq rabbitmq-amqp1.0-common $(current_rmq_ref) $(base_rmq_ref) master dep_rabbit = git_rmq rabbitmq-server $(current_rmq_ref) $(base_rmq_ref) master dep_rabbit_common = git_rmq rabbitmq-common $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_amqp1_0 = git_rmq rabbitmq-amqp1.0 $(current_rmq_ref) $(base_rmq_ref) master @@ -63,7 +65,7 @@ dep_rabbitmq_java_client = git_rmq rabbitmq-java-client $(current_r dep_rabbitmq_jms_client = git_rmq rabbitmq-jms-client $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_jms_cts = git_rmq rabbitmq-jms-cts $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_jms_topic_exchange = git_rmq rabbitmq-jms-topic-exchange $(current_rmq_ref) $(base_rmq_ref) master -dep_rabbitmq_lvc = git_rmq rabbitmq-lvc-plugin $(current_rmq_ref) $(base_rmq_ref) master +dep_rabbitmq_lvc_exchange = git_rmq rabbitmq-lvc-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management = git_rmq rabbitmq-management $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management_agent = git_rmq rabbitmq-management-agent $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management_exchange = git_rmq rabbitmq-management-exchange $(current_rmq_ref) $(base_rmq_ref) master @@ -78,6 +80,7 @@ dep_rabbitmq_peer_discovery_common = git_rmq rabbitmq-peer-discovery-common $ dep_rabbitmq_peer_discovery_consul = git_rmq rabbitmq-peer-discovery-consul $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_peer_discovery_etcd = git_rmq rabbitmq-peer-discovery-etcd $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_peer_discovery_k8s = git_rmq rabbitmq-peer-discovery-k8s $(current_rmq_ref) $(base_rmq_ref) master +dep_rabbitmq_random_exchange = git_rmq rabbitmq-random-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_recent_history_exchange = git_rmq rabbitmq-recent-history-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_routing_node_stamp = git_rmq rabbitmq-routing-node-stamp $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_rtopic_exchange = git_rmq rabbitmq-rtopic-exchange $(current_rmq_ref) $(base_rmq_ref) master @@ -107,16 +110,18 @@ dep_rabbitmq_public_umbrella = git_rmq rabbitmq-public-umbrella $(curre # all projects use the same versions. It avoids conflicts and makes it # possible to work with rabbitmq-public-umbrella. -dep_cowboy_commit = 1.0.4 -dep_mochiweb = git git://github.com/basho/mochiweb.git v2.9.0p2 +dep_cowboy = hex 1.0.4 +dep_ranch = hex 1.3.2 +dep_recon = hex 2.3.2 + # Last commit of PropEr supporting Erlang R16B03. dep_proper_commit = 735d972758d8bd85b12483626fe1b66450d6a6fe -dep_ranch_commit = 1.3.2 # Last commit of sockjs support Erlang R16B03 and 17.x. dep_sockjs = git https://github.com/rabbitmq/sockjs-erlang.git 5af2b588c812c318b19bc105b577a759c71c3e0a -dep_webmachine_commit = 1.10.8p2 RABBITMQ_COMPONENTS = amqp_client \ + amqp10_common \ + amqp10_client \ rabbit \ rabbit_common \ rabbitmq_amqp1_0 \ @@ -142,7 +147,7 @@ RABBITMQ_COMPONENTS = amqp_client \ rabbitmq_jms_client \ rabbitmq_jms_cts \ rabbitmq_jms_topic_exchange \ - rabbitmq_lvc \ + rabbitmq_lvc_exchange \ rabbitmq_management \ rabbitmq_management_agent \ rabbitmq_management_exchange \ @@ -157,6 +162,7 @@ RABBITMQ_COMPONENTS = amqp_client \ rabbitmq_peer_discovery_consul \ rabbitmq_peer_discovery_etcd \ rabbitmq_peer_discovery_k8s \ + rabbitmq_random_exchange \ rabbitmq_recent_history_exchange \ rabbitmq_routing_node_stamp \ rabbitmq_rtopic_exchange \ @@ -184,7 +190,7 @@ NO_AUTOPATCH += $(RABBITMQ_COMPONENTS) ifeq ($(origin current_rmq_ref),undefined) ifneq ($(wildcard .git),) current_rmq_ref := $(shell (\ - ref=$$(git branch --list | awk '/^\* \(.*detached / {ref=$$0; sub(/.*detached [^ ]+ /, "", ref); sub(/\)$$/, "", ref); print ref; exit;} /^\* / {ref=$$0; sub(/^\* /, "", ref); print ref; exit}');\ + ref=$$(LANG=C git branch --list | awk '/^\* \(.*detached / {ref=$$0; sub(/.*detached [^ ]+ /, "", ref); sub(/\)$$/, "", ref); print ref; exit;} /^\* / {ref=$$0; sub(/^\* /, "", ref); print ref; exit}');\ if test "$$(git rev-parse --short HEAD)" != "$$ref"; then echo "$$ref"; fi)) else current_rmq_ref := master @@ -194,11 +200,17 @@ export current_rmq_ref ifeq ($(origin base_rmq_ref),undefined) ifneq ($(wildcard .git),) +possible_base_rmq_ref := v3.6.x +ifeq ($(possible_base_rmq_ref),$(current_rmq_ref)) +base_rmq_ref := $(current_rmq_ref) +else base_rmq_ref := $(shell \ - (git rev-parse --verify -q stable >/dev/null && \ - git merge-base --is-ancestor $$(git merge-base master HEAD) stable && \ - echo stable) || \ + (git rev-parse --verify -q master >/dev/null && \ + git rev-parse --verify -q $(possible_base_rmq_ref) >/dev/null && \ + git merge-base --is-ancestor $$(git merge-base master HEAD) $(possible_base_rmq_ref) && \ + echo $(possible_base_rmq_ref)) || \ echo master) +endif else base_rmq_ref := master endif @@ -313,11 +325,16 @@ endif UPSTREAM_RMQ_COMPONENTS_MK = $(DEPS_DIR)/rabbit_common/mk/rabbitmq-components.mk +ifeq ($(PROJECT),rabbit_common) +check-rabbitmq-components.mk: + @: +else check-rabbitmq-components.mk: $(verbose) cmp -s rabbitmq-components.mk \ $(UPSTREAM_RMQ_COMPONENTS_MK) || \ (echo "error: rabbitmq-components.mk must be updated!" 1>&2; \ false) +endif ifeq ($(PROJECT),rabbit_common) rabbitmq-components-mk: diff --git a/rabbitmq-server/deps/rabbitmq_event_exchange/erlang.mk b/rabbitmq-server/deps/rabbitmq_event_exchange/erlang.mk index 89ba561..1a45ad1 100644 --- a/rabbitmq-server/deps/rabbitmq_event_exchange/erlang.mk +++ b/rabbitmq-server/deps/rabbitmq_event_exchange/erlang.mk @@ -17,7 +17,7 @@ ERLANG_MK_FILENAME := $(realpath $(lastword $(MAKEFILE_LIST))) export ERLANG_MK_FILENAME -ERLANG_MK_VERSION = 2.0.0-pre.2-256-g2cce185 +ERLANG_MK_VERSION = 2.0.0-pre.2-278-gd9a9158 ERLANG_MK_WITHOUT = # Make 3.81 and 3.82 are deprecated. @@ -2023,6 +2023,14 @@ pkg_ibrowse_fetch = git pkg_ibrowse_repo = https://github.com/cmullaparthi/ibrowse pkg_ibrowse_commit = master +PACKAGES += idna +pkg_idna_name = idna +pkg_idna_description = Erlang IDNA lib +pkg_idna_homepage = https://github.com/benoitc/erlang-idna +pkg_idna_fetch = git +pkg_idna_repo = https://github.com/benoitc/erlang-idna +pkg_idna_commit = master + PACKAGES += ierlang pkg_ierlang_name = ierlang pkg_ierlang_description = An Erlang language kernel for IPython. @@ -2298,9 +2306,9 @@ pkg_kvs_commit = master PACKAGES += lager pkg_lager_name = lager pkg_lager_description = A logging framework for Erlang/OTP. -pkg_lager_homepage = https://github.com/basho/lager +pkg_lager_homepage = https://github.com/erlang-lager/lager pkg_lager_fetch = git -pkg_lager_repo = https://github.com/basho/lager +pkg_lager_repo = https://github.com/erlang-lager/lager pkg_lager_commit = master PACKAGES += lager_amqp_backend @@ -2314,9 +2322,9 @@ pkg_lager_amqp_backend_commit = master PACKAGES += lager_syslog pkg_lager_syslog_name = lager_syslog pkg_lager_syslog_description = Syslog backend for lager -pkg_lager_syslog_homepage = https://github.com/basho/lager_syslog +pkg_lager_syslog_homepage = https://github.com/erlang-lager/lager_syslog pkg_lager_syslog_fetch = git -pkg_lager_syslog_repo = https://github.com/basho/lager_syslog +pkg_lager_syslog_repo = https://github.com/erlang-lager/lager_syslog pkg_lager_syslog_commit = master PACKAGES += lambdapad @@ -3786,9 +3794,9 @@ pkg_trie_commit = master PACKAGES += triq pkg_triq_name = triq pkg_triq_description = Trifork QuickCheck -pkg_triq_homepage = https://github.com/krestenkrab/triq +pkg_triq_homepage = https://github.com/triqng/triq pkg_triq_fetch = git -pkg_triq_repo = https://github.com/krestenkrab/triq +pkg_triq_repo = https://github.com/triqng/triq.git pkg_triq_commit = master PACKAGES += tunctl @@ -4280,7 +4288,7 @@ endef # if given. Do it for all 3 possible Makefile file names. ifeq ($(NO_AUTOPATCH_ERLANG_MK),) define dep_autopatch_erlang_mk - $t for f in Makefile makefile GNUmakefile; do \ + for f in Makefile makefile GNUmakefile; do \ if [ -f $(DEPS_DIR)/$1/$$f ]; then \ sed -i.bak s/'include *erlang.mk'/'include $$(if $$(ERLANG_MK_FILENAME),$$(ERLANG_MK_FILENAME),erlang.mk)'/ $(DEPS_DIR)/$1/$$f; \ fi \ @@ -4357,6 +4365,8 @@ define dep_autopatch_rebar.erl lists:foreach(fun ({d, D}) -> Write("ERLC_OPTS += -D" ++ atom_to_list(D) ++ "=1\n"); + ({d, DKey, DVal}) -> + Write("ERLC_OPTS += -D" ++ atom_to_list(DKey) ++ "=" ++ atom_to_list(DVal) ++ "\n"); ({i, I}) -> Write(["ERLC_OPTS += -I ", I, "\n"]); ({platform_define, Regex, D}) -> @@ -4579,7 +4589,7 @@ define dep_autopatch_appsrc_script.erl AppSrc = "$(call core_native_path,$(DEPS_DIR)/$1/src/$1.app.src)", AppSrcScript = AppSrc ++ ".script", Bindings = erl_eval:new_bindings(), - {ok, Conf} = file:script(AppSrcScript, Bindings), + {ok, [Conf]} = file:script(AppSrcScript, Bindings), ok = file:write_file(AppSrc, io_lib:format("~p.~n", [Conf])), halt() endef @@ -4731,6 +4741,87 @@ ERLANG_MK_RECURSIVE_REL_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-rel-deps-list.log ERLANG_MK_RECURSIVE_TEST_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-test-deps-list.log ERLANG_MK_RECURSIVE_SHELL_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-shell-deps-list.log +# Copyright (c) 2015-2017, Loïc Hoguin +# This file is part of erlang.mk and subject to the terms of the ISC License. + +.PHONY: distclean-kerl + +KERL_INSTALL_DIR ?= $(HOME)/erlang + +ifeq ($(strip $(KERL)),) +KERL := $(ERLANG_MK_TMP)/kerl/kerl +endif + +export KERL + +KERL_GIT ?= https://github.com/kerl/kerl +KERL_COMMIT ?= master + +KERL_MAKEFLAGS ?= + +OTP_GIT ?= https://github.com/erlang/otp + +define kerl_otp_target +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(1)),) +$(KERL_INSTALL_DIR)/$(1): $(KERL) + MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $(1) $(1) + $(KERL) install $(1) $(KERL_INSTALL_DIR)/$(1) +endif +endef + +define kerl_hipe_target +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$1-native),) +$(KERL_INSTALL_DIR)/$1-native: $(KERL) + KERL_CONFIGURE_OPTIONS=--enable-native-libs \ + MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $1 $1-native + $(KERL) install $1-native $(KERL_INSTALL_DIR)/$1-native +endif +endef + +$(KERL): + $(verbose) mkdir -p $(ERLANG_MK_TMP) + $(gen_verbose) git clone --depth 1 $(KERL_GIT) $(ERLANG_MK_TMP)/kerl + $(verbose) cd $(ERLANG_MK_TMP)/kerl && git checkout $(KERL_COMMIT) + $(verbose) chmod +x $(KERL) + +distclean:: distclean-kerl + +distclean-kerl: + $(gen_verbose) rm -rf $(KERL) + +# Allow users to select which version of Erlang/OTP to use for a project. + +ERLANG_OTP ?= +ERLANG_HIPE ?= + +# Use kerl to enforce a specific Erlang/OTP version for a project. +ifneq ($(strip $(ERLANG_OTP)),) +export PATH := $(KERL_INSTALL_DIR)/$(ERLANG_OTP)/bin:$(PATH) +SHELL := env PATH=$(PATH) $(SHELL) +$(eval $(call kerl_otp_target,$(ERLANG_OTP))) + +# Build Erlang/OTP only if it doesn't already exist. +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(ERLANG_OTP))$(BUILD_ERLANG_OTP),) +$(info Building Erlang/OTP $(ERLANG_OTP)... Please wait...) +$(shell $(MAKE) $(KERL_INSTALL_DIR)/$(ERLANG_OTP) ERLANG_OTP=$(ERLANG_OTP) BUILD_ERLANG_OTP=1 >&2) +endif + +else +# Same for a HiPE enabled VM. +ifneq ($(strip $(ERLANG_HIPE)),) +export PATH := $(KERL_INSTALL_DIR)/$(ERLANG_HIPE)-native/bin:$(PATH) +SHELL := env PATH=$(PATH) $(SHELL) +$(eval $(call kerl_hipe_target,$(ERLANG_HIPE))) + +# Build Erlang/OTP only if it doesn't already exist. +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(ERLANG_HIPE))$(BUILD_ERLANG_OTP),) +$(info Building HiPE-enabled Erlang/OTP $(ERLANG_OTP)... Please wait...) +$(shell $(MAKE) $(KERL_INSTALL_DIR)/$(ERLANG_HIPE) ERLANG_HIPE=$(ERLANG_HIPE) BUILD_ERLANG_OTP=1 >&2) +endif + +endif +endif + # Copyright (c) 2015-2016, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. @@ -5966,10 +6057,10 @@ else $(call render_template,bs_erl_nif,src/$n.erl) endif -# Copyright (c) 2015-2016, Loïc Hoguin +# Copyright (c) 2015-2017, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. -.PHONY: ci ci-prepare ci-setup distclean-kerl +.PHONY: ci ci-prepare ci-setup CI_OTP ?= CI_HIPE ?= @@ -5987,24 +6078,9 @@ ifeq ($(strip $(CI_OTP) $(CI_HIPE) $(CI_ERLLVM)),) ci:: else -ifeq ($(strip $(KERL)),) -KERL := $(ERLANG_MK_TMP)/kerl/kerl -endif - -export KERL - -KERL_GIT ?= https://github.com/kerl/kerl -KERL_COMMIT ?= master - -KERL_MAKEFLAGS ?= - -OTP_GIT ?= https://github.com/erlang/otp - -CI_INSTALL_DIR ?= $(HOME)/erlang - ci:: $(addprefix ci-,$(CI_OTP) $(addsuffix -native,$(CI_HIPE)) $(addsuffix -erllvm,$(CI_ERLLVM))) -ci-prepare: $(addprefix $(CI_INSTALL_DIR)/,$(CI_OTP) $(addsuffix -native,$(CI_HIPE))) +ci-prepare: $(addprefix $(KERL_INSTALL_DIR)/,$(CI_OTP) $(addsuffix -native,$(CI_HIPE))) ci-setup:: @@ -6014,10 +6090,10 @@ ci_verbose_0 = @echo " CI " $(1); ci_verbose = $(ci_verbose_$(V)) define ci_target -ci-$1: $(CI_INSTALL_DIR)/$2 +ci-$1: $(KERL_INSTALL_DIR)/$2 $(verbose) $(MAKE) --no-print-directory clean $(ci_verbose) \ - PATH="$(CI_INSTALL_DIR)/$2/bin:$(PATH)" \ + PATH="$(KERL_INSTALL_DIR)/$2/bin:$(PATH)" \ CI_OTP_RELEASE="$1" \ CT_OPTS="-label $1" \ CI_VM="$3" \ @@ -6029,32 +6105,8 @@ $(foreach otp,$(CI_OTP),$(eval $(call ci_target,$(otp),$(otp),otp))) $(foreach otp,$(CI_HIPE),$(eval $(call ci_target,$(otp)-native,$(otp)-native,native))) $(foreach otp,$(CI_ERLLVM),$(eval $(call ci_target,$(otp)-erllvm,$(otp)-native,erllvm))) -define ci_otp_target -ifeq ($(wildcard $(CI_INSTALL_DIR)/$(1)),) -$(CI_INSTALL_DIR)/$(1): $(KERL) - MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $(1) $(1) - $(KERL) install $(1) $(CI_INSTALL_DIR)/$(1) -endif -endef - -$(foreach otp,$(CI_OTP),$(eval $(call ci_otp_target,$(otp)))) - -define ci_hipe_target -ifeq ($(wildcard $(CI_INSTALL_DIR)/$1-native),) -$(CI_INSTALL_DIR)/$1-native: $(KERL) - KERL_CONFIGURE_OPTIONS=--enable-native-libs \ - MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $1 $1-native - $(KERL) install $1-native $(CI_INSTALL_DIR)/$1-native -endif -endef - -$(foreach otp,$(sort $(CI_HIPE) $(CI_ERLLLVM)),$(eval $(call ci_hipe_target,$(otp)))) - -$(KERL): - $(verbose) mkdir -p $(ERLANG_MK_TMP) - $(gen_verbose) git clone --depth 1 $(KERL_GIT) $(ERLANG_MK_TMP)/kerl - $(verbose) cd $(ERLANG_MK_TMP)/kerl && git checkout $(KERL_COMMIT) - $(verbose) chmod +x $(KERL) +$(foreach otp,$(CI_OTP),$(eval $(call kerl_otp_target,$(otp)))) +$(foreach otp,$(sort $(CI_HIPE) $(CI_ERLLLVM)),$(eval $(call kerl_hipe_target,$(otp)))) help:: $(verbose) printf "%s\n" "" \ @@ -6064,10 +6116,6 @@ help:: "The CI_OTP variable must be defined with the Erlang versions" \ "that must be tested. For example: CI_OTP = OTP-17.3.4 OTP-17.5.3" -distclean:: distclean-kerl - -distclean-kerl: - $(gen_verbose) rm -rf $(KERL) endif # Copyright (c) 2013-2016, Loïc Hoguin @@ -6433,6 +6481,60 @@ apps-eunit: endif endif +# Copyright (c) 2015-2017, Loïc Hoguin +# This file is part of erlang.mk and subject to the terms of the ISC License. + +ifeq ($(filter proper,$(DEPS) $(TEST_DEPS)),proper) +.PHONY: proper + +# Targets. + +tests:: proper + +define proper_check.erl + code:add_pathsa(["$(call core_native_path,$(CURDIR)/ebin)", "$(call core_native_path,$(DEPS_DIR)/*/ebin)"]), + Module = fun(M) -> + [true] =:= lists:usort([ + case atom_to_list(F) of + "prop_" ++ _ -> + io:format("Testing ~p:~p/0~n", [M, F]), + proper:quickcheck(M:F()); + _ -> + true + end + || {F, 0} <- M:module_info(exports)]) + end, + try + case $(1) of + all -> [true] =:= lists:usort([Module(M) || M <- [$(call comma_list,$(3))]]); + module -> Module($(2)); + function -> proper:quickcheck($(2)) + end + of + true -> halt(0); + _ -> halt(1) + catch error:undef -> + io:format("Undefined property or module?~n~p~n", [erlang:get_stacktrace()]), + halt(0) + end. +endef + +ifdef t +ifeq (,$(findstring :,$(t))) +proper: test-build + $(verbose) $(call erlang,$(call proper_check.erl,module,$(t))) +else +proper: test-build + $(verbose) echo Testing $(t)/0 + $(verbose) $(call erlang,$(call proper_check.erl,function,$(t)())) +endif +else +proper: test-build + $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename $(wildcard ebin/*.beam)))))) + $(gen_verbose) $(call erlang,$(call proper_check.erl,all,undefined,$(MODULES))) +endif +endif + # Copyright (c) 2013-2016, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. @@ -6443,7 +6545,7 @@ endif RELX ?= $(ERLANG_MK_TMP)/relx RELX_CONFIG ?= $(CURDIR)/relx.config -RELX_URL ?= https://github.com/erlware/relx/releases/download/v3.19.0/relx +RELX_URL ?= https://github.com/erlware/relx/releases/download/v3.23.0/relx RELX_OPTS ?= RELX_OUTPUT_DIR ?= _rel RELX_REL_EXT ?= @@ -6489,7 +6591,7 @@ distclean-relx-rel: # Run target. ifeq ($(wildcard $(RELX_CONFIG)),) -run: +run:: else define get_relx_release.erl @@ -6513,7 +6615,7 @@ ifeq ($(PLATFORM),msys2) RELX_REL_EXT := .cmd endif -run: all +run:: all $(verbose) $(RELX_OUTPUT_DIR)/$(RELX_REL_NAME)/bin/$(RELX_REL_NAME)$(RELX_REL_EXT) console help:: @@ -6579,7 +6681,10 @@ ifeq ($(filter triq,$(DEPS) $(TEST_DEPS)),triq) tests:: triq define triq_check.erl - code:add_pathsa(["$(call core_native_path,$(CURDIR)/ebin)", "$(call core_native_path,$(DEPS_DIR)/*/ebin)"]), + code:add_pathsa([ + "$(call core_native_path,$(CURDIR)/ebin)", + "$(call core_native_path,$(DEPS_DIR)/*/ebin)", + "$(call core_native_path,$(TEST_DIR))"]), try case $(1) of all -> [true] =:= lists:usort([triq:check(M) || M <- [$(call comma_list,$(3))]]); @@ -6590,7 +6695,7 @@ define triq_check.erl true -> halt(0); _ -> halt(1) catch error:undef -> - io:format("Undefined property or module~n"), + io:format("Undefined property or module?~n~p~n", [erlang:get_stacktrace()]), halt(0) end. endef @@ -6606,7 +6711,8 @@ triq: test-build endif else triq: test-build - $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename $(wildcard ebin/*.beam)))))) + $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename \ + $(wildcard ebin/*.beam) $(call core_find,$(TEST_DIR)/,*.beam)))))) $(gen_verbose) $(call erlang,$(call triq_check.erl,all,undefined,$(MODULES))) endif endif diff --git a/rabbitmq-server/deps/rabbitmq_event_exchange/rabbitmq-components.mk b/rabbitmq-server/deps/rabbitmq_event_exchange/rabbitmq-components.mk index 1e5d000..5292fa9 100644 --- a/rabbitmq-server/deps/rabbitmq_event_exchange/rabbitmq-components.mk +++ b/rabbitmq-server/deps/rabbitmq_event_exchange/rabbitmq-components.mk @@ -38,6 +38,8 @@ endif # base of the topic branch. dep_amqp_client = git_rmq rabbitmq-erlang-client $(current_rmq_ref) $(base_rmq_ref) master +dep_amqp10_client = git_rmq rabbitmq-amqp1.0-client $(current_rmq_ref) $(base_rmq_ref) master +dep_amqp10_common = git_rmq rabbitmq-amqp1.0-common $(current_rmq_ref) $(base_rmq_ref) master dep_rabbit = git_rmq rabbitmq-server $(current_rmq_ref) $(base_rmq_ref) master dep_rabbit_common = git_rmq rabbitmq-common $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_amqp1_0 = git_rmq rabbitmq-amqp1.0 $(current_rmq_ref) $(base_rmq_ref) master @@ -63,7 +65,7 @@ dep_rabbitmq_java_client = git_rmq rabbitmq-java-client $(current_r dep_rabbitmq_jms_client = git_rmq rabbitmq-jms-client $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_jms_cts = git_rmq rabbitmq-jms-cts $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_jms_topic_exchange = git_rmq rabbitmq-jms-topic-exchange $(current_rmq_ref) $(base_rmq_ref) master -dep_rabbitmq_lvc = git_rmq rabbitmq-lvc-plugin $(current_rmq_ref) $(base_rmq_ref) master +dep_rabbitmq_lvc_exchange = git_rmq rabbitmq-lvc-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management = git_rmq rabbitmq-management $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management_agent = git_rmq rabbitmq-management-agent $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management_exchange = git_rmq rabbitmq-management-exchange $(current_rmq_ref) $(base_rmq_ref) master @@ -78,6 +80,7 @@ dep_rabbitmq_peer_discovery_common = git_rmq rabbitmq-peer-discovery-common $ dep_rabbitmq_peer_discovery_consul = git_rmq rabbitmq-peer-discovery-consul $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_peer_discovery_etcd = git_rmq rabbitmq-peer-discovery-etcd $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_peer_discovery_k8s = git_rmq rabbitmq-peer-discovery-k8s $(current_rmq_ref) $(base_rmq_ref) master +dep_rabbitmq_random_exchange = git_rmq rabbitmq-random-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_recent_history_exchange = git_rmq rabbitmq-recent-history-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_routing_node_stamp = git_rmq rabbitmq-routing-node-stamp $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_rtopic_exchange = git_rmq rabbitmq-rtopic-exchange $(current_rmq_ref) $(base_rmq_ref) master @@ -107,16 +110,18 @@ dep_rabbitmq_public_umbrella = git_rmq rabbitmq-public-umbrella $(curre # all projects use the same versions. It avoids conflicts and makes it # possible to work with rabbitmq-public-umbrella. -dep_cowboy_commit = 1.0.4 -dep_mochiweb = git git://github.com/basho/mochiweb.git v2.9.0p2 +dep_cowboy = hex 1.0.4 +dep_ranch = hex 1.3.2 +dep_recon = hex 2.3.2 + # Last commit of PropEr supporting Erlang R16B03. dep_proper_commit = 735d972758d8bd85b12483626fe1b66450d6a6fe -dep_ranch_commit = 1.3.2 # Last commit of sockjs support Erlang R16B03 and 17.x. dep_sockjs = git https://github.com/rabbitmq/sockjs-erlang.git 5af2b588c812c318b19bc105b577a759c71c3e0a -dep_webmachine_commit = 1.10.8p2 RABBITMQ_COMPONENTS = amqp_client \ + amqp10_common \ + amqp10_client \ rabbit \ rabbit_common \ rabbitmq_amqp1_0 \ @@ -142,7 +147,7 @@ RABBITMQ_COMPONENTS = amqp_client \ rabbitmq_jms_client \ rabbitmq_jms_cts \ rabbitmq_jms_topic_exchange \ - rabbitmq_lvc \ + rabbitmq_lvc_exchange \ rabbitmq_management \ rabbitmq_management_agent \ rabbitmq_management_exchange \ @@ -157,6 +162,7 @@ RABBITMQ_COMPONENTS = amqp_client \ rabbitmq_peer_discovery_consul \ rabbitmq_peer_discovery_etcd \ rabbitmq_peer_discovery_k8s \ + rabbitmq_random_exchange \ rabbitmq_recent_history_exchange \ rabbitmq_routing_node_stamp \ rabbitmq_rtopic_exchange \ @@ -184,7 +190,7 @@ NO_AUTOPATCH += $(RABBITMQ_COMPONENTS) ifeq ($(origin current_rmq_ref),undefined) ifneq ($(wildcard .git),) current_rmq_ref := $(shell (\ - ref=$$(git branch --list | awk '/^\* \(.*detached / {ref=$$0; sub(/.*detached [^ ]+ /, "", ref); sub(/\)$$/, "", ref); print ref; exit;} /^\* / {ref=$$0; sub(/^\* /, "", ref); print ref; exit}');\ + ref=$$(LANG=C git branch --list | awk '/^\* \(.*detached / {ref=$$0; sub(/.*detached [^ ]+ /, "", ref); sub(/\)$$/, "", ref); print ref; exit;} /^\* / {ref=$$0; sub(/^\* /, "", ref); print ref; exit}');\ if test "$$(git rev-parse --short HEAD)" != "$$ref"; then echo "$$ref"; fi)) else current_rmq_ref := master @@ -194,11 +200,17 @@ export current_rmq_ref ifeq ($(origin base_rmq_ref),undefined) ifneq ($(wildcard .git),) +possible_base_rmq_ref := v3.6.x +ifeq ($(possible_base_rmq_ref),$(current_rmq_ref)) +base_rmq_ref := $(current_rmq_ref) +else base_rmq_ref := $(shell \ - (git rev-parse --verify -q stable >/dev/null && \ - git merge-base --is-ancestor $$(git merge-base master HEAD) stable && \ - echo stable) || \ + (git rev-parse --verify -q master >/dev/null && \ + git rev-parse --verify -q $(possible_base_rmq_ref) >/dev/null && \ + git merge-base --is-ancestor $$(git merge-base master HEAD) $(possible_base_rmq_ref) && \ + echo $(possible_base_rmq_ref)) || \ echo master) +endif else base_rmq_ref := master endif @@ -313,11 +325,16 @@ endif UPSTREAM_RMQ_COMPONENTS_MK = $(DEPS_DIR)/rabbit_common/mk/rabbitmq-components.mk +ifeq ($(PROJECT),rabbit_common) +check-rabbitmq-components.mk: + @: +else check-rabbitmq-components.mk: $(verbose) cmp -s rabbitmq-components.mk \ $(UPSTREAM_RMQ_COMPONENTS_MK) || \ (echo "error: rabbitmq-components.mk must be updated!" 1>&2; \ false) +endif ifeq ($(PROJECT),rabbit_common) rabbitmq-components-mk: diff --git a/rabbitmq-server/deps/rabbitmq_federation/erlang.mk b/rabbitmq-server/deps/rabbitmq_federation/erlang.mk index 89ba561..1a45ad1 100644 --- a/rabbitmq-server/deps/rabbitmq_federation/erlang.mk +++ b/rabbitmq-server/deps/rabbitmq_federation/erlang.mk @@ -17,7 +17,7 @@ ERLANG_MK_FILENAME := $(realpath $(lastword $(MAKEFILE_LIST))) export ERLANG_MK_FILENAME -ERLANG_MK_VERSION = 2.0.0-pre.2-256-g2cce185 +ERLANG_MK_VERSION = 2.0.0-pre.2-278-gd9a9158 ERLANG_MK_WITHOUT = # Make 3.81 and 3.82 are deprecated. @@ -2023,6 +2023,14 @@ pkg_ibrowse_fetch = git pkg_ibrowse_repo = https://github.com/cmullaparthi/ibrowse pkg_ibrowse_commit = master +PACKAGES += idna +pkg_idna_name = idna +pkg_idna_description = Erlang IDNA lib +pkg_idna_homepage = https://github.com/benoitc/erlang-idna +pkg_idna_fetch = git +pkg_idna_repo = https://github.com/benoitc/erlang-idna +pkg_idna_commit = master + PACKAGES += ierlang pkg_ierlang_name = ierlang pkg_ierlang_description = An Erlang language kernel for IPython. @@ -2298,9 +2306,9 @@ pkg_kvs_commit = master PACKAGES += lager pkg_lager_name = lager pkg_lager_description = A logging framework for Erlang/OTP. -pkg_lager_homepage = https://github.com/basho/lager +pkg_lager_homepage = https://github.com/erlang-lager/lager pkg_lager_fetch = git -pkg_lager_repo = https://github.com/basho/lager +pkg_lager_repo = https://github.com/erlang-lager/lager pkg_lager_commit = master PACKAGES += lager_amqp_backend @@ -2314,9 +2322,9 @@ pkg_lager_amqp_backend_commit = master PACKAGES += lager_syslog pkg_lager_syslog_name = lager_syslog pkg_lager_syslog_description = Syslog backend for lager -pkg_lager_syslog_homepage = https://github.com/basho/lager_syslog +pkg_lager_syslog_homepage = https://github.com/erlang-lager/lager_syslog pkg_lager_syslog_fetch = git -pkg_lager_syslog_repo = https://github.com/basho/lager_syslog +pkg_lager_syslog_repo = https://github.com/erlang-lager/lager_syslog pkg_lager_syslog_commit = master PACKAGES += lambdapad @@ -3786,9 +3794,9 @@ pkg_trie_commit = master PACKAGES += triq pkg_triq_name = triq pkg_triq_description = Trifork QuickCheck -pkg_triq_homepage = https://github.com/krestenkrab/triq +pkg_triq_homepage = https://github.com/triqng/triq pkg_triq_fetch = git -pkg_triq_repo = https://github.com/krestenkrab/triq +pkg_triq_repo = https://github.com/triqng/triq.git pkg_triq_commit = master PACKAGES += tunctl @@ -4280,7 +4288,7 @@ endef # if given. Do it for all 3 possible Makefile file names. ifeq ($(NO_AUTOPATCH_ERLANG_MK),) define dep_autopatch_erlang_mk - $t for f in Makefile makefile GNUmakefile; do \ + for f in Makefile makefile GNUmakefile; do \ if [ -f $(DEPS_DIR)/$1/$$f ]; then \ sed -i.bak s/'include *erlang.mk'/'include $$(if $$(ERLANG_MK_FILENAME),$$(ERLANG_MK_FILENAME),erlang.mk)'/ $(DEPS_DIR)/$1/$$f; \ fi \ @@ -4357,6 +4365,8 @@ define dep_autopatch_rebar.erl lists:foreach(fun ({d, D}) -> Write("ERLC_OPTS += -D" ++ atom_to_list(D) ++ "=1\n"); + ({d, DKey, DVal}) -> + Write("ERLC_OPTS += -D" ++ atom_to_list(DKey) ++ "=" ++ atom_to_list(DVal) ++ "\n"); ({i, I}) -> Write(["ERLC_OPTS += -I ", I, "\n"]); ({platform_define, Regex, D}) -> @@ -4579,7 +4589,7 @@ define dep_autopatch_appsrc_script.erl AppSrc = "$(call core_native_path,$(DEPS_DIR)/$1/src/$1.app.src)", AppSrcScript = AppSrc ++ ".script", Bindings = erl_eval:new_bindings(), - {ok, Conf} = file:script(AppSrcScript, Bindings), + {ok, [Conf]} = file:script(AppSrcScript, Bindings), ok = file:write_file(AppSrc, io_lib:format("~p.~n", [Conf])), halt() endef @@ -4731,6 +4741,87 @@ ERLANG_MK_RECURSIVE_REL_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-rel-deps-list.log ERLANG_MK_RECURSIVE_TEST_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-test-deps-list.log ERLANG_MK_RECURSIVE_SHELL_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-shell-deps-list.log +# Copyright (c) 2015-2017, Loïc Hoguin +# This file is part of erlang.mk and subject to the terms of the ISC License. + +.PHONY: distclean-kerl + +KERL_INSTALL_DIR ?= $(HOME)/erlang + +ifeq ($(strip $(KERL)),) +KERL := $(ERLANG_MK_TMP)/kerl/kerl +endif + +export KERL + +KERL_GIT ?= https://github.com/kerl/kerl +KERL_COMMIT ?= master + +KERL_MAKEFLAGS ?= + +OTP_GIT ?= https://github.com/erlang/otp + +define kerl_otp_target +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(1)),) +$(KERL_INSTALL_DIR)/$(1): $(KERL) + MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $(1) $(1) + $(KERL) install $(1) $(KERL_INSTALL_DIR)/$(1) +endif +endef + +define kerl_hipe_target +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$1-native),) +$(KERL_INSTALL_DIR)/$1-native: $(KERL) + KERL_CONFIGURE_OPTIONS=--enable-native-libs \ + MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $1 $1-native + $(KERL) install $1-native $(KERL_INSTALL_DIR)/$1-native +endif +endef + +$(KERL): + $(verbose) mkdir -p $(ERLANG_MK_TMP) + $(gen_verbose) git clone --depth 1 $(KERL_GIT) $(ERLANG_MK_TMP)/kerl + $(verbose) cd $(ERLANG_MK_TMP)/kerl && git checkout $(KERL_COMMIT) + $(verbose) chmod +x $(KERL) + +distclean:: distclean-kerl + +distclean-kerl: + $(gen_verbose) rm -rf $(KERL) + +# Allow users to select which version of Erlang/OTP to use for a project. + +ERLANG_OTP ?= +ERLANG_HIPE ?= + +# Use kerl to enforce a specific Erlang/OTP version for a project. +ifneq ($(strip $(ERLANG_OTP)),) +export PATH := $(KERL_INSTALL_DIR)/$(ERLANG_OTP)/bin:$(PATH) +SHELL := env PATH=$(PATH) $(SHELL) +$(eval $(call kerl_otp_target,$(ERLANG_OTP))) + +# Build Erlang/OTP only if it doesn't already exist. +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(ERLANG_OTP))$(BUILD_ERLANG_OTP),) +$(info Building Erlang/OTP $(ERLANG_OTP)... Please wait...) +$(shell $(MAKE) $(KERL_INSTALL_DIR)/$(ERLANG_OTP) ERLANG_OTP=$(ERLANG_OTP) BUILD_ERLANG_OTP=1 >&2) +endif + +else +# Same for a HiPE enabled VM. +ifneq ($(strip $(ERLANG_HIPE)),) +export PATH := $(KERL_INSTALL_DIR)/$(ERLANG_HIPE)-native/bin:$(PATH) +SHELL := env PATH=$(PATH) $(SHELL) +$(eval $(call kerl_hipe_target,$(ERLANG_HIPE))) + +# Build Erlang/OTP only if it doesn't already exist. +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(ERLANG_HIPE))$(BUILD_ERLANG_OTP),) +$(info Building HiPE-enabled Erlang/OTP $(ERLANG_OTP)... Please wait...) +$(shell $(MAKE) $(KERL_INSTALL_DIR)/$(ERLANG_HIPE) ERLANG_HIPE=$(ERLANG_HIPE) BUILD_ERLANG_OTP=1 >&2) +endif + +endif +endif + # Copyright (c) 2015-2016, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. @@ -5966,10 +6057,10 @@ else $(call render_template,bs_erl_nif,src/$n.erl) endif -# Copyright (c) 2015-2016, Loïc Hoguin +# Copyright (c) 2015-2017, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. -.PHONY: ci ci-prepare ci-setup distclean-kerl +.PHONY: ci ci-prepare ci-setup CI_OTP ?= CI_HIPE ?= @@ -5987,24 +6078,9 @@ ifeq ($(strip $(CI_OTP) $(CI_HIPE) $(CI_ERLLVM)),) ci:: else -ifeq ($(strip $(KERL)),) -KERL := $(ERLANG_MK_TMP)/kerl/kerl -endif - -export KERL - -KERL_GIT ?= https://github.com/kerl/kerl -KERL_COMMIT ?= master - -KERL_MAKEFLAGS ?= - -OTP_GIT ?= https://github.com/erlang/otp - -CI_INSTALL_DIR ?= $(HOME)/erlang - ci:: $(addprefix ci-,$(CI_OTP) $(addsuffix -native,$(CI_HIPE)) $(addsuffix -erllvm,$(CI_ERLLVM))) -ci-prepare: $(addprefix $(CI_INSTALL_DIR)/,$(CI_OTP) $(addsuffix -native,$(CI_HIPE))) +ci-prepare: $(addprefix $(KERL_INSTALL_DIR)/,$(CI_OTP) $(addsuffix -native,$(CI_HIPE))) ci-setup:: @@ -6014,10 +6090,10 @@ ci_verbose_0 = @echo " CI " $(1); ci_verbose = $(ci_verbose_$(V)) define ci_target -ci-$1: $(CI_INSTALL_DIR)/$2 +ci-$1: $(KERL_INSTALL_DIR)/$2 $(verbose) $(MAKE) --no-print-directory clean $(ci_verbose) \ - PATH="$(CI_INSTALL_DIR)/$2/bin:$(PATH)" \ + PATH="$(KERL_INSTALL_DIR)/$2/bin:$(PATH)" \ CI_OTP_RELEASE="$1" \ CT_OPTS="-label $1" \ CI_VM="$3" \ @@ -6029,32 +6105,8 @@ $(foreach otp,$(CI_OTP),$(eval $(call ci_target,$(otp),$(otp),otp))) $(foreach otp,$(CI_HIPE),$(eval $(call ci_target,$(otp)-native,$(otp)-native,native))) $(foreach otp,$(CI_ERLLVM),$(eval $(call ci_target,$(otp)-erllvm,$(otp)-native,erllvm))) -define ci_otp_target -ifeq ($(wildcard $(CI_INSTALL_DIR)/$(1)),) -$(CI_INSTALL_DIR)/$(1): $(KERL) - MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $(1) $(1) - $(KERL) install $(1) $(CI_INSTALL_DIR)/$(1) -endif -endef - -$(foreach otp,$(CI_OTP),$(eval $(call ci_otp_target,$(otp)))) - -define ci_hipe_target -ifeq ($(wildcard $(CI_INSTALL_DIR)/$1-native),) -$(CI_INSTALL_DIR)/$1-native: $(KERL) - KERL_CONFIGURE_OPTIONS=--enable-native-libs \ - MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $1 $1-native - $(KERL) install $1-native $(CI_INSTALL_DIR)/$1-native -endif -endef - -$(foreach otp,$(sort $(CI_HIPE) $(CI_ERLLLVM)),$(eval $(call ci_hipe_target,$(otp)))) - -$(KERL): - $(verbose) mkdir -p $(ERLANG_MK_TMP) - $(gen_verbose) git clone --depth 1 $(KERL_GIT) $(ERLANG_MK_TMP)/kerl - $(verbose) cd $(ERLANG_MK_TMP)/kerl && git checkout $(KERL_COMMIT) - $(verbose) chmod +x $(KERL) +$(foreach otp,$(CI_OTP),$(eval $(call kerl_otp_target,$(otp)))) +$(foreach otp,$(sort $(CI_HIPE) $(CI_ERLLLVM)),$(eval $(call kerl_hipe_target,$(otp)))) help:: $(verbose) printf "%s\n" "" \ @@ -6064,10 +6116,6 @@ help:: "The CI_OTP variable must be defined with the Erlang versions" \ "that must be tested. For example: CI_OTP = OTP-17.3.4 OTP-17.5.3" -distclean:: distclean-kerl - -distclean-kerl: - $(gen_verbose) rm -rf $(KERL) endif # Copyright (c) 2013-2016, Loïc Hoguin @@ -6433,6 +6481,60 @@ apps-eunit: endif endif +# Copyright (c) 2015-2017, Loïc Hoguin +# This file is part of erlang.mk and subject to the terms of the ISC License. + +ifeq ($(filter proper,$(DEPS) $(TEST_DEPS)),proper) +.PHONY: proper + +# Targets. + +tests:: proper + +define proper_check.erl + code:add_pathsa(["$(call core_native_path,$(CURDIR)/ebin)", "$(call core_native_path,$(DEPS_DIR)/*/ebin)"]), + Module = fun(M) -> + [true] =:= lists:usort([ + case atom_to_list(F) of + "prop_" ++ _ -> + io:format("Testing ~p:~p/0~n", [M, F]), + proper:quickcheck(M:F()); + _ -> + true + end + || {F, 0} <- M:module_info(exports)]) + end, + try + case $(1) of + all -> [true] =:= lists:usort([Module(M) || M <- [$(call comma_list,$(3))]]); + module -> Module($(2)); + function -> proper:quickcheck($(2)) + end + of + true -> halt(0); + _ -> halt(1) + catch error:undef -> + io:format("Undefined property or module?~n~p~n", [erlang:get_stacktrace()]), + halt(0) + end. +endef + +ifdef t +ifeq (,$(findstring :,$(t))) +proper: test-build + $(verbose) $(call erlang,$(call proper_check.erl,module,$(t))) +else +proper: test-build + $(verbose) echo Testing $(t)/0 + $(verbose) $(call erlang,$(call proper_check.erl,function,$(t)())) +endif +else +proper: test-build + $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename $(wildcard ebin/*.beam)))))) + $(gen_verbose) $(call erlang,$(call proper_check.erl,all,undefined,$(MODULES))) +endif +endif + # Copyright (c) 2013-2016, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. @@ -6443,7 +6545,7 @@ endif RELX ?= $(ERLANG_MK_TMP)/relx RELX_CONFIG ?= $(CURDIR)/relx.config -RELX_URL ?= https://github.com/erlware/relx/releases/download/v3.19.0/relx +RELX_URL ?= https://github.com/erlware/relx/releases/download/v3.23.0/relx RELX_OPTS ?= RELX_OUTPUT_DIR ?= _rel RELX_REL_EXT ?= @@ -6489,7 +6591,7 @@ distclean-relx-rel: # Run target. ifeq ($(wildcard $(RELX_CONFIG)),) -run: +run:: else define get_relx_release.erl @@ -6513,7 +6615,7 @@ ifeq ($(PLATFORM),msys2) RELX_REL_EXT := .cmd endif -run: all +run:: all $(verbose) $(RELX_OUTPUT_DIR)/$(RELX_REL_NAME)/bin/$(RELX_REL_NAME)$(RELX_REL_EXT) console help:: @@ -6579,7 +6681,10 @@ ifeq ($(filter triq,$(DEPS) $(TEST_DEPS)),triq) tests:: triq define triq_check.erl - code:add_pathsa(["$(call core_native_path,$(CURDIR)/ebin)", "$(call core_native_path,$(DEPS_DIR)/*/ebin)"]), + code:add_pathsa([ + "$(call core_native_path,$(CURDIR)/ebin)", + "$(call core_native_path,$(DEPS_DIR)/*/ebin)", + "$(call core_native_path,$(TEST_DIR))"]), try case $(1) of all -> [true] =:= lists:usort([triq:check(M) || M <- [$(call comma_list,$(3))]]); @@ -6590,7 +6695,7 @@ define triq_check.erl true -> halt(0); _ -> halt(1) catch error:undef -> - io:format("Undefined property or module~n"), + io:format("Undefined property or module?~n~p~n", [erlang:get_stacktrace()]), halt(0) end. endef @@ -6606,7 +6711,8 @@ triq: test-build endif else triq: test-build - $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename $(wildcard ebin/*.beam)))))) + $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename \ + $(wildcard ebin/*.beam) $(call core_find,$(TEST_DIR)/,*.beam)))))) $(gen_verbose) $(call erlang,$(call triq_check.erl,all,undefined,$(MODULES))) endif endif diff --git a/rabbitmq-server/deps/rabbitmq_federation/rabbitmq-components.mk b/rabbitmq-server/deps/rabbitmq_federation/rabbitmq-components.mk index 1e5d000..5292fa9 100644 --- a/rabbitmq-server/deps/rabbitmq_federation/rabbitmq-components.mk +++ b/rabbitmq-server/deps/rabbitmq_federation/rabbitmq-components.mk @@ -38,6 +38,8 @@ endif # base of the topic branch. dep_amqp_client = git_rmq rabbitmq-erlang-client $(current_rmq_ref) $(base_rmq_ref) master +dep_amqp10_client = git_rmq rabbitmq-amqp1.0-client $(current_rmq_ref) $(base_rmq_ref) master +dep_amqp10_common = git_rmq rabbitmq-amqp1.0-common $(current_rmq_ref) $(base_rmq_ref) master dep_rabbit = git_rmq rabbitmq-server $(current_rmq_ref) $(base_rmq_ref) master dep_rabbit_common = git_rmq rabbitmq-common $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_amqp1_0 = git_rmq rabbitmq-amqp1.0 $(current_rmq_ref) $(base_rmq_ref) master @@ -63,7 +65,7 @@ dep_rabbitmq_java_client = git_rmq rabbitmq-java-client $(current_r dep_rabbitmq_jms_client = git_rmq rabbitmq-jms-client $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_jms_cts = git_rmq rabbitmq-jms-cts $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_jms_topic_exchange = git_rmq rabbitmq-jms-topic-exchange $(current_rmq_ref) $(base_rmq_ref) master -dep_rabbitmq_lvc = git_rmq rabbitmq-lvc-plugin $(current_rmq_ref) $(base_rmq_ref) master +dep_rabbitmq_lvc_exchange = git_rmq rabbitmq-lvc-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management = git_rmq rabbitmq-management $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management_agent = git_rmq rabbitmq-management-agent $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management_exchange = git_rmq rabbitmq-management-exchange $(current_rmq_ref) $(base_rmq_ref) master @@ -78,6 +80,7 @@ dep_rabbitmq_peer_discovery_common = git_rmq rabbitmq-peer-discovery-common $ dep_rabbitmq_peer_discovery_consul = git_rmq rabbitmq-peer-discovery-consul $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_peer_discovery_etcd = git_rmq rabbitmq-peer-discovery-etcd $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_peer_discovery_k8s = git_rmq rabbitmq-peer-discovery-k8s $(current_rmq_ref) $(base_rmq_ref) master +dep_rabbitmq_random_exchange = git_rmq rabbitmq-random-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_recent_history_exchange = git_rmq rabbitmq-recent-history-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_routing_node_stamp = git_rmq rabbitmq-routing-node-stamp $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_rtopic_exchange = git_rmq rabbitmq-rtopic-exchange $(current_rmq_ref) $(base_rmq_ref) master @@ -107,16 +110,18 @@ dep_rabbitmq_public_umbrella = git_rmq rabbitmq-public-umbrella $(curre # all projects use the same versions. It avoids conflicts and makes it # possible to work with rabbitmq-public-umbrella. -dep_cowboy_commit = 1.0.4 -dep_mochiweb = git git://github.com/basho/mochiweb.git v2.9.0p2 +dep_cowboy = hex 1.0.4 +dep_ranch = hex 1.3.2 +dep_recon = hex 2.3.2 + # Last commit of PropEr supporting Erlang R16B03. dep_proper_commit = 735d972758d8bd85b12483626fe1b66450d6a6fe -dep_ranch_commit = 1.3.2 # Last commit of sockjs support Erlang R16B03 and 17.x. dep_sockjs = git https://github.com/rabbitmq/sockjs-erlang.git 5af2b588c812c318b19bc105b577a759c71c3e0a -dep_webmachine_commit = 1.10.8p2 RABBITMQ_COMPONENTS = amqp_client \ + amqp10_common \ + amqp10_client \ rabbit \ rabbit_common \ rabbitmq_amqp1_0 \ @@ -142,7 +147,7 @@ RABBITMQ_COMPONENTS = amqp_client \ rabbitmq_jms_client \ rabbitmq_jms_cts \ rabbitmq_jms_topic_exchange \ - rabbitmq_lvc \ + rabbitmq_lvc_exchange \ rabbitmq_management \ rabbitmq_management_agent \ rabbitmq_management_exchange \ @@ -157,6 +162,7 @@ RABBITMQ_COMPONENTS = amqp_client \ rabbitmq_peer_discovery_consul \ rabbitmq_peer_discovery_etcd \ rabbitmq_peer_discovery_k8s \ + rabbitmq_random_exchange \ rabbitmq_recent_history_exchange \ rabbitmq_routing_node_stamp \ rabbitmq_rtopic_exchange \ @@ -184,7 +190,7 @@ NO_AUTOPATCH += $(RABBITMQ_COMPONENTS) ifeq ($(origin current_rmq_ref),undefined) ifneq ($(wildcard .git),) current_rmq_ref := $(shell (\ - ref=$$(git branch --list | awk '/^\* \(.*detached / {ref=$$0; sub(/.*detached [^ ]+ /, "", ref); sub(/\)$$/, "", ref); print ref; exit;} /^\* / {ref=$$0; sub(/^\* /, "", ref); print ref; exit}');\ + ref=$$(LANG=C git branch --list | awk '/^\* \(.*detached / {ref=$$0; sub(/.*detached [^ ]+ /, "", ref); sub(/\)$$/, "", ref); print ref; exit;} /^\* / {ref=$$0; sub(/^\* /, "", ref); print ref; exit}');\ if test "$$(git rev-parse --short HEAD)" != "$$ref"; then echo "$$ref"; fi)) else current_rmq_ref := master @@ -194,11 +200,17 @@ export current_rmq_ref ifeq ($(origin base_rmq_ref),undefined) ifneq ($(wildcard .git),) +possible_base_rmq_ref := v3.6.x +ifeq ($(possible_base_rmq_ref),$(current_rmq_ref)) +base_rmq_ref := $(current_rmq_ref) +else base_rmq_ref := $(shell \ - (git rev-parse --verify -q stable >/dev/null && \ - git merge-base --is-ancestor $$(git merge-base master HEAD) stable && \ - echo stable) || \ + (git rev-parse --verify -q master >/dev/null && \ + git rev-parse --verify -q $(possible_base_rmq_ref) >/dev/null && \ + git merge-base --is-ancestor $$(git merge-base master HEAD) $(possible_base_rmq_ref) && \ + echo $(possible_base_rmq_ref)) || \ echo master) +endif else base_rmq_ref := master endif @@ -313,11 +325,16 @@ endif UPSTREAM_RMQ_COMPONENTS_MK = $(DEPS_DIR)/rabbit_common/mk/rabbitmq-components.mk +ifeq ($(PROJECT),rabbit_common) +check-rabbitmq-components.mk: + @: +else check-rabbitmq-components.mk: $(verbose) cmp -s rabbitmq-components.mk \ $(UPSTREAM_RMQ_COMPONENTS_MK) || \ (echo "error: rabbitmq-components.mk must be updated!" 1>&2; \ false) +endif ifeq ($(PROJECT),rabbit_common) rabbitmq-components-mk: diff --git a/rabbitmq-server/deps/rabbitmq_federation/src/rabbit_federation_exchange_link.erl b/rabbitmq-server/deps/rabbitmq_federation/src/rabbit_federation_exchange_link.erl index 7737ebf..b4de2ec 100644 --- a/rabbitmq-server/deps/rabbitmq_federation/src/rabbit_federation_exchange_link.erl +++ b/rabbitmq-server/deps/rabbitmq_federation/src/rabbit_federation_exchange_link.erl @@ -198,8 +198,14 @@ terminate(Reason, #state{downstream_connection = DConn, upstream = Upstream, upstream_params = UParams, downstream_exchange = XName, - internal_exchange_timer = TRef}) -> + internal_exchange_timer = TRef, + internal_exchange = IntExchange, + queue = Queue}) -> timer:cancel(TRef), + %% Cleanup of internal queue and exchange + delete_upstream_queue(Conn, Queue), + delete_upstream_exchange(Conn, IntExchange), + rabbit_federation_link_util:ensure_connection_closed(DConn), rabbit_federation_link_util:ensure_connection_closed(Conn), rabbit_federation_link_util:log_terminate(Reason, Upstream, UParams, XName), @@ -591,6 +597,10 @@ delete_upstream_exchange(Conn, XNameBin) -> rabbit_federation_link_util:disposable_channel_call( Conn, #'exchange.delete'{exchange = XNameBin}). +delete_upstream_queue(Conn, Queue) -> + rabbit_federation_link_util:disposable_channel_call( + Conn, #'queue.delete'{queue = Queue}). + update_headers(#upstream_params{table = Table}, UName, Redelivered, Headers) -> rabbit_basic:prepend_table_header( ?ROUTING_HEADER, Table ++ [{<<"redelivered">>, bool, Redelivered}] ++ diff --git a/rabbitmq-server/deps/rabbitmq_federation_management/erlang.mk b/rabbitmq-server/deps/rabbitmq_federation_management/erlang.mk index 89ba561..1a45ad1 100644 --- a/rabbitmq-server/deps/rabbitmq_federation_management/erlang.mk +++ b/rabbitmq-server/deps/rabbitmq_federation_management/erlang.mk @@ -17,7 +17,7 @@ ERLANG_MK_FILENAME := $(realpath $(lastword $(MAKEFILE_LIST))) export ERLANG_MK_FILENAME -ERLANG_MK_VERSION = 2.0.0-pre.2-256-g2cce185 +ERLANG_MK_VERSION = 2.0.0-pre.2-278-gd9a9158 ERLANG_MK_WITHOUT = # Make 3.81 and 3.82 are deprecated. @@ -2023,6 +2023,14 @@ pkg_ibrowse_fetch = git pkg_ibrowse_repo = https://github.com/cmullaparthi/ibrowse pkg_ibrowse_commit = master +PACKAGES += idna +pkg_idna_name = idna +pkg_idna_description = Erlang IDNA lib +pkg_idna_homepage = https://github.com/benoitc/erlang-idna +pkg_idna_fetch = git +pkg_idna_repo = https://github.com/benoitc/erlang-idna +pkg_idna_commit = master + PACKAGES += ierlang pkg_ierlang_name = ierlang pkg_ierlang_description = An Erlang language kernel for IPython. @@ -2298,9 +2306,9 @@ pkg_kvs_commit = master PACKAGES += lager pkg_lager_name = lager pkg_lager_description = A logging framework for Erlang/OTP. -pkg_lager_homepage = https://github.com/basho/lager +pkg_lager_homepage = https://github.com/erlang-lager/lager pkg_lager_fetch = git -pkg_lager_repo = https://github.com/basho/lager +pkg_lager_repo = https://github.com/erlang-lager/lager pkg_lager_commit = master PACKAGES += lager_amqp_backend @@ -2314,9 +2322,9 @@ pkg_lager_amqp_backend_commit = master PACKAGES += lager_syslog pkg_lager_syslog_name = lager_syslog pkg_lager_syslog_description = Syslog backend for lager -pkg_lager_syslog_homepage = https://github.com/basho/lager_syslog +pkg_lager_syslog_homepage = https://github.com/erlang-lager/lager_syslog pkg_lager_syslog_fetch = git -pkg_lager_syslog_repo = https://github.com/basho/lager_syslog +pkg_lager_syslog_repo = https://github.com/erlang-lager/lager_syslog pkg_lager_syslog_commit = master PACKAGES += lambdapad @@ -3786,9 +3794,9 @@ pkg_trie_commit = master PACKAGES += triq pkg_triq_name = triq pkg_triq_description = Trifork QuickCheck -pkg_triq_homepage = https://github.com/krestenkrab/triq +pkg_triq_homepage = https://github.com/triqng/triq pkg_triq_fetch = git -pkg_triq_repo = https://github.com/krestenkrab/triq +pkg_triq_repo = https://github.com/triqng/triq.git pkg_triq_commit = master PACKAGES += tunctl @@ -4280,7 +4288,7 @@ endef # if given. Do it for all 3 possible Makefile file names. ifeq ($(NO_AUTOPATCH_ERLANG_MK),) define dep_autopatch_erlang_mk - $t for f in Makefile makefile GNUmakefile; do \ + for f in Makefile makefile GNUmakefile; do \ if [ -f $(DEPS_DIR)/$1/$$f ]; then \ sed -i.bak s/'include *erlang.mk'/'include $$(if $$(ERLANG_MK_FILENAME),$$(ERLANG_MK_FILENAME),erlang.mk)'/ $(DEPS_DIR)/$1/$$f; \ fi \ @@ -4357,6 +4365,8 @@ define dep_autopatch_rebar.erl lists:foreach(fun ({d, D}) -> Write("ERLC_OPTS += -D" ++ atom_to_list(D) ++ "=1\n"); + ({d, DKey, DVal}) -> + Write("ERLC_OPTS += -D" ++ atom_to_list(DKey) ++ "=" ++ atom_to_list(DVal) ++ "\n"); ({i, I}) -> Write(["ERLC_OPTS += -I ", I, "\n"]); ({platform_define, Regex, D}) -> @@ -4579,7 +4589,7 @@ define dep_autopatch_appsrc_script.erl AppSrc = "$(call core_native_path,$(DEPS_DIR)/$1/src/$1.app.src)", AppSrcScript = AppSrc ++ ".script", Bindings = erl_eval:new_bindings(), - {ok, Conf} = file:script(AppSrcScript, Bindings), + {ok, [Conf]} = file:script(AppSrcScript, Bindings), ok = file:write_file(AppSrc, io_lib:format("~p.~n", [Conf])), halt() endef @@ -4731,6 +4741,87 @@ ERLANG_MK_RECURSIVE_REL_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-rel-deps-list.log ERLANG_MK_RECURSIVE_TEST_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-test-deps-list.log ERLANG_MK_RECURSIVE_SHELL_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-shell-deps-list.log +# Copyright (c) 2015-2017, Loïc Hoguin +# This file is part of erlang.mk and subject to the terms of the ISC License. + +.PHONY: distclean-kerl + +KERL_INSTALL_DIR ?= $(HOME)/erlang + +ifeq ($(strip $(KERL)),) +KERL := $(ERLANG_MK_TMP)/kerl/kerl +endif + +export KERL + +KERL_GIT ?= https://github.com/kerl/kerl +KERL_COMMIT ?= master + +KERL_MAKEFLAGS ?= + +OTP_GIT ?= https://github.com/erlang/otp + +define kerl_otp_target +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(1)),) +$(KERL_INSTALL_DIR)/$(1): $(KERL) + MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $(1) $(1) + $(KERL) install $(1) $(KERL_INSTALL_DIR)/$(1) +endif +endef + +define kerl_hipe_target +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$1-native),) +$(KERL_INSTALL_DIR)/$1-native: $(KERL) + KERL_CONFIGURE_OPTIONS=--enable-native-libs \ + MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $1 $1-native + $(KERL) install $1-native $(KERL_INSTALL_DIR)/$1-native +endif +endef + +$(KERL): + $(verbose) mkdir -p $(ERLANG_MK_TMP) + $(gen_verbose) git clone --depth 1 $(KERL_GIT) $(ERLANG_MK_TMP)/kerl + $(verbose) cd $(ERLANG_MK_TMP)/kerl && git checkout $(KERL_COMMIT) + $(verbose) chmod +x $(KERL) + +distclean:: distclean-kerl + +distclean-kerl: + $(gen_verbose) rm -rf $(KERL) + +# Allow users to select which version of Erlang/OTP to use for a project. + +ERLANG_OTP ?= +ERLANG_HIPE ?= + +# Use kerl to enforce a specific Erlang/OTP version for a project. +ifneq ($(strip $(ERLANG_OTP)),) +export PATH := $(KERL_INSTALL_DIR)/$(ERLANG_OTP)/bin:$(PATH) +SHELL := env PATH=$(PATH) $(SHELL) +$(eval $(call kerl_otp_target,$(ERLANG_OTP))) + +# Build Erlang/OTP only if it doesn't already exist. +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(ERLANG_OTP))$(BUILD_ERLANG_OTP),) +$(info Building Erlang/OTP $(ERLANG_OTP)... Please wait...) +$(shell $(MAKE) $(KERL_INSTALL_DIR)/$(ERLANG_OTP) ERLANG_OTP=$(ERLANG_OTP) BUILD_ERLANG_OTP=1 >&2) +endif + +else +# Same for a HiPE enabled VM. +ifneq ($(strip $(ERLANG_HIPE)),) +export PATH := $(KERL_INSTALL_DIR)/$(ERLANG_HIPE)-native/bin:$(PATH) +SHELL := env PATH=$(PATH) $(SHELL) +$(eval $(call kerl_hipe_target,$(ERLANG_HIPE))) + +# Build Erlang/OTP only if it doesn't already exist. +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(ERLANG_HIPE))$(BUILD_ERLANG_OTP),) +$(info Building HiPE-enabled Erlang/OTP $(ERLANG_OTP)... Please wait...) +$(shell $(MAKE) $(KERL_INSTALL_DIR)/$(ERLANG_HIPE) ERLANG_HIPE=$(ERLANG_HIPE) BUILD_ERLANG_OTP=1 >&2) +endif + +endif +endif + # Copyright (c) 2015-2016, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. @@ -5966,10 +6057,10 @@ else $(call render_template,bs_erl_nif,src/$n.erl) endif -# Copyright (c) 2015-2016, Loïc Hoguin +# Copyright (c) 2015-2017, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. -.PHONY: ci ci-prepare ci-setup distclean-kerl +.PHONY: ci ci-prepare ci-setup CI_OTP ?= CI_HIPE ?= @@ -5987,24 +6078,9 @@ ifeq ($(strip $(CI_OTP) $(CI_HIPE) $(CI_ERLLVM)),) ci:: else -ifeq ($(strip $(KERL)),) -KERL := $(ERLANG_MK_TMP)/kerl/kerl -endif - -export KERL - -KERL_GIT ?= https://github.com/kerl/kerl -KERL_COMMIT ?= master - -KERL_MAKEFLAGS ?= - -OTP_GIT ?= https://github.com/erlang/otp - -CI_INSTALL_DIR ?= $(HOME)/erlang - ci:: $(addprefix ci-,$(CI_OTP) $(addsuffix -native,$(CI_HIPE)) $(addsuffix -erllvm,$(CI_ERLLVM))) -ci-prepare: $(addprefix $(CI_INSTALL_DIR)/,$(CI_OTP) $(addsuffix -native,$(CI_HIPE))) +ci-prepare: $(addprefix $(KERL_INSTALL_DIR)/,$(CI_OTP) $(addsuffix -native,$(CI_HIPE))) ci-setup:: @@ -6014,10 +6090,10 @@ ci_verbose_0 = @echo " CI " $(1); ci_verbose = $(ci_verbose_$(V)) define ci_target -ci-$1: $(CI_INSTALL_DIR)/$2 +ci-$1: $(KERL_INSTALL_DIR)/$2 $(verbose) $(MAKE) --no-print-directory clean $(ci_verbose) \ - PATH="$(CI_INSTALL_DIR)/$2/bin:$(PATH)" \ + PATH="$(KERL_INSTALL_DIR)/$2/bin:$(PATH)" \ CI_OTP_RELEASE="$1" \ CT_OPTS="-label $1" \ CI_VM="$3" \ @@ -6029,32 +6105,8 @@ $(foreach otp,$(CI_OTP),$(eval $(call ci_target,$(otp),$(otp),otp))) $(foreach otp,$(CI_HIPE),$(eval $(call ci_target,$(otp)-native,$(otp)-native,native))) $(foreach otp,$(CI_ERLLVM),$(eval $(call ci_target,$(otp)-erllvm,$(otp)-native,erllvm))) -define ci_otp_target -ifeq ($(wildcard $(CI_INSTALL_DIR)/$(1)),) -$(CI_INSTALL_DIR)/$(1): $(KERL) - MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $(1) $(1) - $(KERL) install $(1) $(CI_INSTALL_DIR)/$(1) -endif -endef - -$(foreach otp,$(CI_OTP),$(eval $(call ci_otp_target,$(otp)))) - -define ci_hipe_target -ifeq ($(wildcard $(CI_INSTALL_DIR)/$1-native),) -$(CI_INSTALL_DIR)/$1-native: $(KERL) - KERL_CONFIGURE_OPTIONS=--enable-native-libs \ - MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $1 $1-native - $(KERL) install $1-native $(CI_INSTALL_DIR)/$1-native -endif -endef - -$(foreach otp,$(sort $(CI_HIPE) $(CI_ERLLLVM)),$(eval $(call ci_hipe_target,$(otp)))) - -$(KERL): - $(verbose) mkdir -p $(ERLANG_MK_TMP) - $(gen_verbose) git clone --depth 1 $(KERL_GIT) $(ERLANG_MK_TMP)/kerl - $(verbose) cd $(ERLANG_MK_TMP)/kerl && git checkout $(KERL_COMMIT) - $(verbose) chmod +x $(KERL) +$(foreach otp,$(CI_OTP),$(eval $(call kerl_otp_target,$(otp)))) +$(foreach otp,$(sort $(CI_HIPE) $(CI_ERLLLVM)),$(eval $(call kerl_hipe_target,$(otp)))) help:: $(verbose) printf "%s\n" "" \ @@ -6064,10 +6116,6 @@ help:: "The CI_OTP variable must be defined with the Erlang versions" \ "that must be tested. For example: CI_OTP = OTP-17.3.4 OTP-17.5.3" -distclean:: distclean-kerl - -distclean-kerl: - $(gen_verbose) rm -rf $(KERL) endif # Copyright (c) 2013-2016, Loïc Hoguin @@ -6433,6 +6481,60 @@ apps-eunit: endif endif +# Copyright (c) 2015-2017, Loïc Hoguin +# This file is part of erlang.mk and subject to the terms of the ISC License. + +ifeq ($(filter proper,$(DEPS) $(TEST_DEPS)),proper) +.PHONY: proper + +# Targets. + +tests:: proper + +define proper_check.erl + code:add_pathsa(["$(call core_native_path,$(CURDIR)/ebin)", "$(call core_native_path,$(DEPS_DIR)/*/ebin)"]), + Module = fun(M) -> + [true] =:= lists:usort([ + case atom_to_list(F) of + "prop_" ++ _ -> + io:format("Testing ~p:~p/0~n", [M, F]), + proper:quickcheck(M:F()); + _ -> + true + end + || {F, 0} <- M:module_info(exports)]) + end, + try + case $(1) of + all -> [true] =:= lists:usort([Module(M) || M <- [$(call comma_list,$(3))]]); + module -> Module($(2)); + function -> proper:quickcheck($(2)) + end + of + true -> halt(0); + _ -> halt(1) + catch error:undef -> + io:format("Undefined property or module?~n~p~n", [erlang:get_stacktrace()]), + halt(0) + end. +endef + +ifdef t +ifeq (,$(findstring :,$(t))) +proper: test-build + $(verbose) $(call erlang,$(call proper_check.erl,module,$(t))) +else +proper: test-build + $(verbose) echo Testing $(t)/0 + $(verbose) $(call erlang,$(call proper_check.erl,function,$(t)())) +endif +else +proper: test-build + $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename $(wildcard ebin/*.beam)))))) + $(gen_verbose) $(call erlang,$(call proper_check.erl,all,undefined,$(MODULES))) +endif +endif + # Copyright (c) 2013-2016, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. @@ -6443,7 +6545,7 @@ endif RELX ?= $(ERLANG_MK_TMP)/relx RELX_CONFIG ?= $(CURDIR)/relx.config -RELX_URL ?= https://github.com/erlware/relx/releases/download/v3.19.0/relx +RELX_URL ?= https://github.com/erlware/relx/releases/download/v3.23.0/relx RELX_OPTS ?= RELX_OUTPUT_DIR ?= _rel RELX_REL_EXT ?= @@ -6489,7 +6591,7 @@ distclean-relx-rel: # Run target. ifeq ($(wildcard $(RELX_CONFIG)),) -run: +run:: else define get_relx_release.erl @@ -6513,7 +6615,7 @@ ifeq ($(PLATFORM),msys2) RELX_REL_EXT := .cmd endif -run: all +run:: all $(verbose) $(RELX_OUTPUT_DIR)/$(RELX_REL_NAME)/bin/$(RELX_REL_NAME)$(RELX_REL_EXT) console help:: @@ -6579,7 +6681,10 @@ ifeq ($(filter triq,$(DEPS) $(TEST_DEPS)),triq) tests:: triq define triq_check.erl - code:add_pathsa(["$(call core_native_path,$(CURDIR)/ebin)", "$(call core_native_path,$(DEPS_DIR)/*/ebin)"]), + code:add_pathsa([ + "$(call core_native_path,$(CURDIR)/ebin)", + "$(call core_native_path,$(DEPS_DIR)/*/ebin)", + "$(call core_native_path,$(TEST_DIR))"]), try case $(1) of all -> [true] =:= lists:usort([triq:check(M) || M <- [$(call comma_list,$(3))]]); @@ -6590,7 +6695,7 @@ define triq_check.erl true -> halt(0); _ -> halt(1) catch error:undef -> - io:format("Undefined property or module~n"), + io:format("Undefined property or module?~n~p~n", [erlang:get_stacktrace()]), halt(0) end. endef @@ -6606,7 +6711,8 @@ triq: test-build endif else triq: test-build - $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename $(wildcard ebin/*.beam)))))) + $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename \ + $(wildcard ebin/*.beam) $(call core_find,$(TEST_DIR)/,*.beam)))))) $(gen_verbose) $(call erlang,$(call triq_check.erl,all,undefined,$(MODULES))) endif endif diff --git a/rabbitmq-server/deps/rabbitmq_federation_management/priv/www/js/tmpl/federation-upstream.ejs b/rabbitmq-server/deps/rabbitmq_federation_management/priv/www/js/tmpl/federation-upstream.ejs index da1331b..b1b67da 100644 --- a/rabbitmq-server/deps/rabbitmq_federation_management/priv/www/js/tmpl/federation-upstream.ejs +++ b/rabbitmq-server/deps/rabbitmq_federation_management/priv/www/js/tmpl/federation-upstream.ejs @@ -10,7 +10,7 @@ URI - <%= fmt_string(upstream.value.uri) %> + <%= fmt_string(fmt_uri_with_credentials(upstream.value.uri)) %> Prefetch Count diff --git a/rabbitmq-server/deps/rabbitmq_federation_management/priv/www/js/tmpl/federation-upstreams.ejs b/rabbitmq-server/deps/rabbitmq_federation_management/priv/www/js/tmpl/federation-upstreams.ejs index dc23417..8c67af5 100644 --- a/rabbitmq-server/deps/rabbitmq_federation_management/priv/www/js/tmpl/federation-upstreams.ejs +++ b/rabbitmq-server/deps/rabbitmq_federation_management/priv/www/js/tmpl/federation-upstreams.ejs @@ -35,7 +35,7 @@ <%= fmt_string(upstream.vhost) %> <% } %> <%= link_fed_conn(upstream.vhost, upstream.name) %> - <%= fmt_shortened_uri(upstream.value.uri) %> + <%= fmt_shortened_uri(fmt_uri_with_credentials(upstream.value.uri)) %> <%= upstream.value['prefetch-count'] %> <%= fmt_time(upstream.value['reconnect-delay'], 's') %> <%= fmt_string(upstream.value['ack-mode']) %> diff --git a/rabbitmq-server/deps/rabbitmq_federation_management/priv/www/js/tmpl/federation.ejs b/rabbitmq-server/deps/rabbitmq_federation_management/priv/www/js/tmpl/federation.ejs index b496daa..9fb637d 100644 --- a/rabbitmq-server/deps/rabbitmq_federation_management/priv/www/js/tmpl/federation.ejs +++ b/rabbitmq-server/deps/rabbitmq_federation_management/priv/www/js/tmpl/federation.ejs @@ -38,7 +38,7 @@ <%= fmt_string(link.upstream_queue) %> <% } %> - <%= fmt_string(link.uri) %> + <%= fmt_string(fmt_uri_with_credentials(link.uri)) %> <% if (vhosts_interesting) { %> <%= fmt_string(link.vhost) %> <% } %> diff --git a/rabbitmq-server/deps/rabbitmq_federation_management/rabbitmq-components.mk b/rabbitmq-server/deps/rabbitmq_federation_management/rabbitmq-components.mk index 1e5d000..5292fa9 100644 --- a/rabbitmq-server/deps/rabbitmq_federation_management/rabbitmq-components.mk +++ b/rabbitmq-server/deps/rabbitmq_federation_management/rabbitmq-components.mk @@ -38,6 +38,8 @@ endif # base of the topic branch. dep_amqp_client = git_rmq rabbitmq-erlang-client $(current_rmq_ref) $(base_rmq_ref) master +dep_amqp10_client = git_rmq rabbitmq-amqp1.0-client $(current_rmq_ref) $(base_rmq_ref) master +dep_amqp10_common = git_rmq rabbitmq-amqp1.0-common $(current_rmq_ref) $(base_rmq_ref) master dep_rabbit = git_rmq rabbitmq-server $(current_rmq_ref) $(base_rmq_ref) master dep_rabbit_common = git_rmq rabbitmq-common $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_amqp1_0 = git_rmq rabbitmq-amqp1.0 $(current_rmq_ref) $(base_rmq_ref) master @@ -63,7 +65,7 @@ dep_rabbitmq_java_client = git_rmq rabbitmq-java-client $(current_r dep_rabbitmq_jms_client = git_rmq rabbitmq-jms-client $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_jms_cts = git_rmq rabbitmq-jms-cts $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_jms_topic_exchange = git_rmq rabbitmq-jms-topic-exchange $(current_rmq_ref) $(base_rmq_ref) master -dep_rabbitmq_lvc = git_rmq rabbitmq-lvc-plugin $(current_rmq_ref) $(base_rmq_ref) master +dep_rabbitmq_lvc_exchange = git_rmq rabbitmq-lvc-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management = git_rmq rabbitmq-management $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management_agent = git_rmq rabbitmq-management-agent $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management_exchange = git_rmq rabbitmq-management-exchange $(current_rmq_ref) $(base_rmq_ref) master @@ -78,6 +80,7 @@ dep_rabbitmq_peer_discovery_common = git_rmq rabbitmq-peer-discovery-common $ dep_rabbitmq_peer_discovery_consul = git_rmq rabbitmq-peer-discovery-consul $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_peer_discovery_etcd = git_rmq rabbitmq-peer-discovery-etcd $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_peer_discovery_k8s = git_rmq rabbitmq-peer-discovery-k8s $(current_rmq_ref) $(base_rmq_ref) master +dep_rabbitmq_random_exchange = git_rmq rabbitmq-random-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_recent_history_exchange = git_rmq rabbitmq-recent-history-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_routing_node_stamp = git_rmq rabbitmq-routing-node-stamp $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_rtopic_exchange = git_rmq rabbitmq-rtopic-exchange $(current_rmq_ref) $(base_rmq_ref) master @@ -107,16 +110,18 @@ dep_rabbitmq_public_umbrella = git_rmq rabbitmq-public-umbrella $(curre # all projects use the same versions. It avoids conflicts and makes it # possible to work with rabbitmq-public-umbrella. -dep_cowboy_commit = 1.0.4 -dep_mochiweb = git git://github.com/basho/mochiweb.git v2.9.0p2 +dep_cowboy = hex 1.0.4 +dep_ranch = hex 1.3.2 +dep_recon = hex 2.3.2 + # Last commit of PropEr supporting Erlang R16B03. dep_proper_commit = 735d972758d8bd85b12483626fe1b66450d6a6fe -dep_ranch_commit = 1.3.2 # Last commit of sockjs support Erlang R16B03 and 17.x. dep_sockjs = git https://github.com/rabbitmq/sockjs-erlang.git 5af2b588c812c318b19bc105b577a759c71c3e0a -dep_webmachine_commit = 1.10.8p2 RABBITMQ_COMPONENTS = amqp_client \ + amqp10_common \ + amqp10_client \ rabbit \ rabbit_common \ rabbitmq_amqp1_0 \ @@ -142,7 +147,7 @@ RABBITMQ_COMPONENTS = amqp_client \ rabbitmq_jms_client \ rabbitmq_jms_cts \ rabbitmq_jms_topic_exchange \ - rabbitmq_lvc \ + rabbitmq_lvc_exchange \ rabbitmq_management \ rabbitmq_management_agent \ rabbitmq_management_exchange \ @@ -157,6 +162,7 @@ RABBITMQ_COMPONENTS = amqp_client \ rabbitmq_peer_discovery_consul \ rabbitmq_peer_discovery_etcd \ rabbitmq_peer_discovery_k8s \ + rabbitmq_random_exchange \ rabbitmq_recent_history_exchange \ rabbitmq_routing_node_stamp \ rabbitmq_rtopic_exchange \ @@ -184,7 +190,7 @@ NO_AUTOPATCH += $(RABBITMQ_COMPONENTS) ifeq ($(origin current_rmq_ref),undefined) ifneq ($(wildcard .git),) current_rmq_ref := $(shell (\ - ref=$$(git branch --list | awk '/^\* \(.*detached / {ref=$$0; sub(/.*detached [^ ]+ /, "", ref); sub(/\)$$/, "", ref); print ref; exit;} /^\* / {ref=$$0; sub(/^\* /, "", ref); print ref; exit}');\ + ref=$$(LANG=C git branch --list | awk '/^\* \(.*detached / {ref=$$0; sub(/.*detached [^ ]+ /, "", ref); sub(/\)$$/, "", ref); print ref; exit;} /^\* / {ref=$$0; sub(/^\* /, "", ref); print ref; exit}');\ if test "$$(git rev-parse --short HEAD)" != "$$ref"; then echo "$$ref"; fi)) else current_rmq_ref := master @@ -194,11 +200,17 @@ export current_rmq_ref ifeq ($(origin base_rmq_ref),undefined) ifneq ($(wildcard .git),) +possible_base_rmq_ref := v3.6.x +ifeq ($(possible_base_rmq_ref),$(current_rmq_ref)) +base_rmq_ref := $(current_rmq_ref) +else base_rmq_ref := $(shell \ - (git rev-parse --verify -q stable >/dev/null && \ - git merge-base --is-ancestor $$(git merge-base master HEAD) stable && \ - echo stable) || \ + (git rev-parse --verify -q master >/dev/null && \ + git rev-parse --verify -q $(possible_base_rmq_ref) >/dev/null && \ + git merge-base --is-ancestor $$(git merge-base master HEAD) $(possible_base_rmq_ref) && \ + echo $(possible_base_rmq_ref)) || \ echo master) +endif else base_rmq_ref := master endif @@ -313,11 +325,16 @@ endif UPSTREAM_RMQ_COMPONENTS_MK = $(DEPS_DIR)/rabbit_common/mk/rabbitmq-components.mk +ifeq ($(PROJECT),rabbit_common) +check-rabbitmq-components.mk: + @: +else check-rabbitmq-components.mk: $(verbose) cmp -s rabbitmq-components.mk \ $(UPSTREAM_RMQ_COMPONENTS_MK) || \ (echo "error: rabbitmq-components.mk must be updated!" 1>&2; \ false) +endif ifeq ($(PROJECT),rabbit_common) rabbitmq-components-mk: diff --git a/rabbitmq-server/deps/rabbitmq_jms_topic_exchange/erlang.mk b/rabbitmq-server/deps/rabbitmq_jms_topic_exchange/erlang.mk index 89ba561..1a45ad1 100644 --- a/rabbitmq-server/deps/rabbitmq_jms_topic_exchange/erlang.mk +++ b/rabbitmq-server/deps/rabbitmq_jms_topic_exchange/erlang.mk @@ -17,7 +17,7 @@ ERLANG_MK_FILENAME := $(realpath $(lastword $(MAKEFILE_LIST))) export ERLANG_MK_FILENAME -ERLANG_MK_VERSION = 2.0.0-pre.2-256-g2cce185 +ERLANG_MK_VERSION = 2.0.0-pre.2-278-gd9a9158 ERLANG_MK_WITHOUT = # Make 3.81 and 3.82 are deprecated. @@ -2023,6 +2023,14 @@ pkg_ibrowse_fetch = git pkg_ibrowse_repo = https://github.com/cmullaparthi/ibrowse pkg_ibrowse_commit = master +PACKAGES += idna +pkg_idna_name = idna +pkg_idna_description = Erlang IDNA lib +pkg_idna_homepage = https://github.com/benoitc/erlang-idna +pkg_idna_fetch = git +pkg_idna_repo = https://github.com/benoitc/erlang-idna +pkg_idna_commit = master + PACKAGES += ierlang pkg_ierlang_name = ierlang pkg_ierlang_description = An Erlang language kernel for IPython. @@ -2298,9 +2306,9 @@ pkg_kvs_commit = master PACKAGES += lager pkg_lager_name = lager pkg_lager_description = A logging framework for Erlang/OTP. -pkg_lager_homepage = https://github.com/basho/lager +pkg_lager_homepage = https://github.com/erlang-lager/lager pkg_lager_fetch = git -pkg_lager_repo = https://github.com/basho/lager +pkg_lager_repo = https://github.com/erlang-lager/lager pkg_lager_commit = master PACKAGES += lager_amqp_backend @@ -2314,9 +2322,9 @@ pkg_lager_amqp_backend_commit = master PACKAGES += lager_syslog pkg_lager_syslog_name = lager_syslog pkg_lager_syslog_description = Syslog backend for lager -pkg_lager_syslog_homepage = https://github.com/basho/lager_syslog +pkg_lager_syslog_homepage = https://github.com/erlang-lager/lager_syslog pkg_lager_syslog_fetch = git -pkg_lager_syslog_repo = https://github.com/basho/lager_syslog +pkg_lager_syslog_repo = https://github.com/erlang-lager/lager_syslog pkg_lager_syslog_commit = master PACKAGES += lambdapad @@ -3786,9 +3794,9 @@ pkg_trie_commit = master PACKAGES += triq pkg_triq_name = triq pkg_triq_description = Trifork QuickCheck -pkg_triq_homepage = https://github.com/krestenkrab/triq +pkg_triq_homepage = https://github.com/triqng/triq pkg_triq_fetch = git -pkg_triq_repo = https://github.com/krestenkrab/triq +pkg_triq_repo = https://github.com/triqng/triq.git pkg_triq_commit = master PACKAGES += tunctl @@ -4280,7 +4288,7 @@ endef # if given. Do it for all 3 possible Makefile file names. ifeq ($(NO_AUTOPATCH_ERLANG_MK),) define dep_autopatch_erlang_mk - $t for f in Makefile makefile GNUmakefile; do \ + for f in Makefile makefile GNUmakefile; do \ if [ -f $(DEPS_DIR)/$1/$$f ]; then \ sed -i.bak s/'include *erlang.mk'/'include $$(if $$(ERLANG_MK_FILENAME),$$(ERLANG_MK_FILENAME),erlang.mk)'/ $(DEPS_DIR)/$1/$$f; \ fi \ @@ -4357,6 +4365,8 @@ define dep_autopatch_rebar.erl lists:foreach(fun ({d, D}) -> Write("ERLC_OPTS += -D" ++ atom_to_list(D) ++ "=1\n"); + ({d, DKey, DVal}) -> + Write("ERLC_OPTS += -D" ++ atom_to_list(DKey) ++ "=" ++ atom_to_list(DVal) ++ "\n"); ({i, I}) -> Write(["ERLC_OPTS += -I ", I, "\n"]); ({platform_define, Regex, D}) -> @@ -4579,7 +4589,7 @@ define dep_autopatch_appsrc_script.erl AppSrc = "$(call core_native_path,$(DEPS_DIR)/$1/src/$1.app.src)", AppSrcScript = AppSrc ++ ".script", Bindings = erl_eval:new_bindings(), - {ok, Conf} = file:script(AppSrcScript, Bindings), + {ok, [Conf]} = file:script(AppSrcScript, Bindings), ok = file:write_file(AppSrc, io_lib:format("~p.~n", [Conf])), halt() endef @@ -4731,6 +4741,87 @@ ERLANG_MK_RECURSIVE_REL_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-rel-deps-list.log ERLANG_MK_RECURSIVE_TEST_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-test-deps-list.log ERLANG_MK_RECURSIVE_SHELL_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-shell-deps-list.log +# Copyright (c) 2015-2017, Loïc Hoguin +# This file is part of erlang.mk and subject to the terms of the ISC License. + +.PHONY: distclean-kerl + +KERL_INSTALL_DIR ?= $(HOME)/erlang + +ifeq ($(strip $(KERL)),) +KERL := $(ERLANG_MK_TMP)/kerl/kerl +endif + +export KERL + +KERL_GIT ?= https://github.com/kerl/kerl +KERL_COMMIT ?= master + +KERL_MAKEFLAGS ?= + +OTP_GIT ?= https://github.com/erlang/otp + +define kerl_otp_target +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(1)),) +$(KERL_INSTALL_DIR)/$(1): $(KERL) + MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $(1) $(1) + $(KERL) install $(1) $(KERL_INSTALL_DIR)/$(1) +endif +endef + +define kerl_hipe_target +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$1-native),) +$(KERL_INSTALL_DIR)/$1-native: $(KERL) + KERL_CONFIGURE_OPTIONS=--enable-native-libs \ + MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $1 $1-native + $(KERL) install $1-native $(KERL_INSTALL_DIR)/$1-native +endif +endef + +$(KERL): + $(verbose) mkdir -p $(ERLANG_MK_TMP) + $(gen_verbose) git clone --depth 1 $(KERL_GIT) $(ERLANG_MK_TMP)/kerl + $(verbose) cd $(ERLANG_MK_TMP)/kerl && git checkout $(KERL_COMMIT) + $(verbose) chmod +x $(KERL) + +distclean:: distclean-kerl + +distclean-kerl: + $(gen_verbose) rm -rf $(KERL) + +# Allow users to select which version of Erlang/OTP to use for a project. + +ERLANG_OTP ?= +ERLANG_HIPE ?= + +# Use kerl to enforce a specific Erlang/OTP version for a project. +ifneq ($(strip $(ERLANG_OTP)),) +export PATH := $(KERL_INSTALL_DIR)/$(ERLANG_OTP)/bin:$(PATH) +SHELL := env PATH=$(PATH) $(SHELL) +$(eval $(call kerl_otp_target,$(ERLANG_OTP))) + +# Build Erlang/OTP only if it doesn't already exist. +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(ERLANG_OTP))$(BUILD_ERLANG_OTP),) +$(info Building Erlang/OTP $(ERLANG_OTP)... Please wait...) +$(shell $(MAKE) $(KERL_INSTALL_DIR)/$(ERLANG_OTP) ERLANG_OTP=$(ERLANG_OTP) BUILD_ERLANG_OTP=1 >&2) +endif + +else +# Same for a HiPE enabled VM. +ifneq ($(strip $(ERLANG_HIPE)),) +export PATH := $(KERL_INSTALL_DIR)/$(ERLANG_HIPE)-native/bin:$(PATH) +SHELL := env PATH=$(PATH) $(SHELL) +$(eval $(call kerl_hipe_target,$(ERLANG_HIPE))) + +# Build Erlang/OTP only if it doesn't already exist. +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(ERLANG_HIPE))$(BUILD_ERLANG_OTP),) +$(info Building HiPE-enabled Erlang/OTP $(ERLANG_OTP)... Please wait...) +$(shell $(MAKE) $(KERL_INSTALL_DIR)/$(ERLANG_HIPE) ERLANG_HIPE=$(ERLANG_HIPE) BUILD_ERLANG_OTP=1 >&2) +endif + +endif +endif + # Copyright (c) 2015-2016, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. @@ -5966,10 +6057,10 @@ else $(call render_template,bs_erl_nif,src/$n.erl) endif -# Copyright (c) 2015-2016, Loïc Hoguin +# Copyright (c) 2015-2017, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. -.PHONY: ci ci-prepare ci-setup distclean-kerl +.PHONY: ci ci-prepare ci-setup CI_OTP ?= CI_HIPE ?= @@ -5987,24 +6078,9 @@ ifeq ($(strip $(CI_OTP) $(CI_HIPE) $(CI_ERLLVM)),) ci:: else -ifeq ($(strip $(KERL)),) -KERL := $(ERLANG_MK_TMP)/kerl/kerl -endif - -export KERL - -KERL_GIT ?= https://github.com/kerl/kerl -KERL_COMMIT ?= master - -KERL_MAKEFLAGS ?= - -OTP_GIT ?= https://github.com/erlang/otp - -CI_INSTALL_DIR ?= $(HOME)/erlang - ci:: $(addprefix ci-,$(CI_OTP) $(addsuffix -native,$(CI_HIPE)) $(addsuffix -erllvm,$(CI_ERLLVM))) -ci-prepare: $(addprefix $(CI_INSTALL_DIR)/,$(CI_OTP) $(addsuffix -native,$(CI_HIPE))) +ci-prepare: $(addprefix $(KERL_INSTALL_DIR)/,$(CI_OTP) $(addsuffix -native,$(CI_HIPE))) ci-setup:: @@ -6014,10 +6090,10 @@ ci_verbose_0 = @echo " CI " $(1); ci_verbose = $(ci_verbose_$(V)) define ci_target -ci-$1: $(CI_INSTALL_DIR)/$2 +ci-$1: $(KERL_INSTALL_DIR)/$2 $(verbose) $(MAKE) --no-print-directory clean $(ci_verbose) \ - PATH="$(CI_INSTALL_DIR)/$2/bin:$(PATH)" \ + PATH="$(KERL_INSTALL_DIR)/$2/bin:$(PATH)" \ CI_OTP_RELEASE="$1" \ CT_OPTS="-label $1" \ CI_VM="$3" \ @@ -6029,32 +6105,8 @@ $(foreach otp,$(CI_OTP),$(eval $(call ci_target,$(otp),$(otp),otp))) $(foreach otp,$(CI_HIPE),$(eval $(call ci_target,$(otp)-native,$(otp)-native,native))) $(foreach otp,$(CI_ERLLVM),$(eval $(call ci_target,$(otp)-erllvm,$(otp)-native,erllvm))) -define ci_otp_target -ifeq ($(wildcard $(CI_INSTALL_DIR)/$(1)),) -$(CI_INSTALL_DIR)/$(1): $(KERL) - MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $(1) $(1) - $(KERL) install $(1) $(CI_INSTALL_DIR)/$(1) -endif -endef - -$(foreach otp,$(CI_OTP),$(eval $(call ci_otp_target,$(otp)))) - -define ci_hipe_target -ifeq ($(wildcard $(CI_INSTALL_DIR)/$1-native),) -$(CI_INSTALL_DIR)/$1-native: $(KERL) - KERL_CONFIGURE_OPTIONS=--enable-native-libs \ - MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $1 $1-native - $(KERL) install $1-native $(CI_INSTALL_DIR)/$1-native -endif -endef - -$(foreach otp,$(sort $(CI_HIPE) $(CI_ERLLLVM)),$(eval $(call ci_hipe_target,$(otp)))) - -$(KERL): - $(verbose) mkdir -p $(ERLANG_MK_TMP) - $(gen_verbose) git clone --depth 1 $(KERL_GIT) $(ERLANG_MK_TMP)/kerl - $(verbose) cd $(ERLANG_MK_TMP)/kerl && git checkout $(KERL_COMMIT) - $(verbose) chmod +x $(KERL) +$(foreach otp,$(CI_OTP),$(eval $(call kerl_otp_target,$(otp)))) +$(foreach otp,$(sort $(CI_HIPE) $(CI_ERLLLVM)),$(eval $(call kerl_hipe_target,$(otp)))) help:: $(verbose) printf "%s\n" "" \ @@ -6064,10 +6116,6 @@ help:: "The CI_OTP variable must be defined with the Erlang versions" \ "that must be tested. For example: CI_OTP = OTP-17.3.4 OTP-17.5.3" -distclean:: distclean-kerl - -distclean-kerl: - $(gen_verbose) rm -rf $(KERL) endif # Copyright (c) 2013-2016, Loïc Hoguin @@ -6433,6 +6481,60 @@ apps-eunit: endif endif +# Copyright (c) 2015-2017, Loïc Hoguin +# This file is part of erlang.mk and subject to the terms of the ISC License. + +ifeq ($(filter proper,$(DEPS) $(TEST_DEPS)),proper) +.PHONY: proper + +# Targets. + +tests:: proper + +define proper_check.erl + code:add_pathsa(["$(call core_native_path,$(CURDIR)/ebin)", "$(call core_native_path,$(DEPS_DIR)/*/ebin)"]), + Module = fun(M) -> + [true] =:= lists:usort([ + case atom_to_list(F) of + "prop_" ++ _ -> + io:format("Testing ~p:~p/0~n", [M, F]), + proper:quickcheck(M:F()); + _ -> + true + end + || {F, 0} <- M:module_info(exports)]) + end, + try + case $(1) of + all -> [true] =:= lists:usort([Module(M) || M <- [$(call comma_list,$(3))]]); + module -> Module($(2)); + function -> proper:quickcheck($(2)) + end + of + true -> halt(0); + _ -> halt(1) + catch error:undef -> + io:format("Undefined property or module?~n~p~n", [erlang:get_stacktrace()]), + halt(0) + end. +endef + +ifdef t +ifeq (,$(findstring :,$(t))) +proper: test-build + $(verbose) $(call erlang,$(call proper_check.erl,module,$(t))) +else +proper: test-build + $(verbose) echo Testing $(t)/0 + $(verbose) $(call erlang,$(call proper_check.erl,function,$(t)())) +endif +else +proper: test-build + $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename $(wildcard ebin/*.beam)))))) + $(gen_verbose) $(call erlang,$(call proper_check.erl,all,undefined,$(MODULES))) +endif +endif + # Copyright (c) 2013-2016, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. @@ -6443,7 +6545,7 @@ endif RELX ?= $(ERLANG_MK_TMP)/relx RELX_CONFIG ?= $(CURDIR)/relx.config -RELX_URL ?= https://github.com/erlware/relx/releases/download/v3.19.0/relx +RELX_URL ?= https://github.com/erlware/relx/releases/download/v3.23.0/relx RELX_OPTS ?= RELX_OUTPUT_DIR ?= _rel RELX_REL_EXT ?= @@ -6489,7 +6591,7 @@ distclean-relx-rel: # Run target. ifeq ($(wildcard $(RELX_CONFIG)),) -run: +run:: else define get_relx_release.erl @@ -6513,7 +6615,7 @@ ifeq ($(PLATFORM),msys2) RELX_REL_EXT := .cmd endif -run: all +run:: all $(verbose) $(RELX_OUTPUT_DIR)/$(RELX_REL_NAME)/bin/$(RELX_REL_NAME)$(RELX_REL_EXT) console help:: @@ -6579,7 +6681,10 @@ ifeq ($(filter triq,$(DEPS) $(TEST_DEPS)),triq) tests:: triq define triq_check.erl - code:add_pathsa(["$(call core_native_path,$(CURDIR)/ebin)", "$(call core_native_path,$(DEPS_DIR)/*/ebin)"]), + code:add_pathsa([ + "$(call core_native_path,$(CURDIR)/ebin)", + "$(call core_native_path,$(DEPS_DIR)/*/ebin)", + "$(call core_native_path,$(TEST_DIR))"]), try case $(1) of all -> [true] =:= lists:usort([triq:check(M) || M <- [$(call comma_list,$(3))]]); @@ -6590,7 +6695,7 @@ define triq_check.erl true -> halt(0); _ -> halt(1) catch error:undef -> - io:format("Undefined property or module~n"), + io:format("Undefined property or module?~n~p~n", [erlang:get_stacktrace()]), halt(0) end. endef @@ -6606,7 +6711,8 @@ triq: test-build endif else triq: test-build - $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename $(wildcard ebin/*.beam)))))) + $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename \ + $(wildcard ebin/*.beam) $(call core_find,$(TEST_DIR)/,*.beam)))))) $(gen_verbose) $(call erlang,$(call triq_check.erl,all,undefined,$(MODULES))) endif endif diff --git a/rabbitmq-server/deps/rabbitmq_jms_topic_exchange/rabbitmq-components.mk b/rabbitmq-server/deps/rabbitmq_jms_topic_exchange/rabbitmq-components.mk index 1e5d000..5292fa9 100644 --- a/rabbitmq-server/deps/rabbitmq_jms_topic_exchange/rabbitmq-components.mk +++ b/rabbitmq-server/deps/rabbitmq_jms_topic_exchange/rabbitmq-components.mk @@ -38,6 +38,8 @@ endif # base of the topic branch. dep_amqp_client = git_rmq rabbitmq-erlang-client $(current_rmq_ref) $(base_rmq_ref) master +dep_amqp10_client = git_rmq rabbitmq-amqp1.0-client $(current_rmq_ref) $(base_rmq_ref) master +dep_amqp10_common = git_rmq rabbitmq-amqp1.0-common $(current_rmq_ref) $(base_rmq_ref) master dep_rabbit = git_rmq rabbitmq-server $(current_rmq_ref) $(base_rmq_ref) master dep_rabbit_common = git_rmq rabbitmq-common $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_amqp1_0 = git_rmq rabbitmq-amqp1.0 $(current_rmq_ref) $(base_rmq_ref) master @@ -63,7 +65,7 @@ dep_rabbitmq_java_client = git_rmq rabbitmq-java-client $(current_r dep_rabbitmq_jms_client = git_rmq rabbitmq-jms-client $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_jms_cts = git_rmq rabbitmq-jms-cts $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_jms_topic_exchange = git_rmq rabbitmq-jms-topic-exchange $(current_rmq_ref) $(base_rmq_ref) master -dep_rabbitmq_lvc = git_rmq rabbitmq-lvc-plugin $(current_rmq_ref) $(base_rmq_ref) master +dep_rabbitmq_lvc_exchange = git_rmq rabbitmq-lvc-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management = git_rmq rabbitmq-management $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management_agent = git_rmq rabbitmq-management-agent $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_management_exchange = git_rmq rabbitmq-management-exchange $(current_rmq_ref) $(base_rmq_ref) master @@ -78,6 +80,7 @@ dep_rabbitmq_peer_discovery_common = git_rmq rabbitmq-peer-discovery-common $ dep_rabbitmq_peer_discovery_consul = git_rmq rabbitmq-peer-discovery-consul $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_peer_discovery_etcd = git_rmq rabbitmq-peer-discovery-etcd $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_peer_discovery_k8s = git_rmq rabbitmq-peer-discovery-k8s $(current_rmq_ref) $(base_rmq_ref) master +dep_rabbitmq_random_exchange = git_rmq rabbitmq-random-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_recent_history_exchange = git_rmq rabbitmq-recent-history-exchange $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_routing_node_stamp = git_rmq rabbitmq-routing-node-stamp $(current_rmq_ref) $(base_rmq_ref) master dep_rabbitmq_rtopic_exchange = git_rmq rabbitmq-rtopic-exchange $(current_rmq_ref) $(base_rmq_ref) master @@ -107,16 +110,18 @@ dep_rabbitmq_public_umbrella = git_rmq rabbitmq-public-umbrella $(curre # all projects use the same versions. It avoids conflicts and makes it # possible to work with rabbitmq-public-umbrella. -dep_cowboy_commit = 1.0.4 -dep_mochiweb = git git://github.com/basho/mochiweb.git v2.9.0p2 +dep_cowboy = hex 1.0.4 +dep_ranch = hex 1.3.2 +dep_recon = hex 2.3.2 + # Last commit of PropEr supporting Erlang R16B03. dep_proper_commit = 735d972758d8bd85b12483626fe1b66450d6a6fe -dep_ranch_commit = 1.3.2 # Last commit of sockjs support Erlang R16B03 and 17.x. dep_sockjs = git https://github.com/rabbitmq/sockjs-erlang.git 5af2b588c812c318b19bc105b577a759c71c3e0a -dep_webmachine_commit = 1.10.8p2 RABBITMQ_COMPONENTS = amqp_client \ + amqp10_common \ + amqp10_client \ rabbit \ rabbit_common \ rabbitmq_amqp1_0 \ @@ -142,7 +147,7 @@ RABBITMQ_COMPONENTS = amqp_client \ rabbitmq_jms_client \ rabbitmq_jms_cts \ rabbitmq_jms_topic_exchange \ - rabbitmq_lvc \ + rabbitmq_lvc_exchange \ rabbitmq_management \ rabbitmq_management_agent \ rabbitmq_management_exchange \ @@ -157,6 +162,7 @@ RABBITMQ_COMPONENTS = amqp_client \ rabbitmq_peer_discovery_consul \ rabbitmq_peer_discovery_etcd \ rabbitmq_peer_discovery_k8s \ + rabbitmq_random_exchange \ rabbitmq_recent_history_exchange \ rabbitmq_routing_node_stamp \ rabbitmq_rtopic_exchange \ @@ -184,7 +190,7 @@ NO_AUTOPATCH += $(RABBITMQ_COMPONENTS) ifeq ($(origin current_rmq_ref),undefined) ifneq ($(wildcard .git),) current_rmq_ref := $(shell (\ - ref=$$(git branch --list | awk '/^\* \(.*detached / {ref=$$0; sub(/.*detached [^ ]+ /, "", ref); sub(/\)$$/, "", ref); print ref; exit;} /^\* / {ref=$$0; sub(/^\* /, "", ref); print ref; exit}');\ + ref=$$(LANG=C git branch --list | awk '/^\* \(.*detached / {ref=$$0; sub(/.*detached [^ ]+ /, "", ref); sub(/\)$$/, "", ref); print ref; exit;} /^\* / {ref=$$0; sub(/^\* /, "", ref); print ref; exit}');\ if test "$$(git rev-parse --short HEAD)" != "$$ref"; then echo "$$ref"; fi)) else current_rmq_ref := master @@ -194,11 +200,17 @@ export current_rmq_ref ifeq ($(origin base_rmq_ref),undefined) ifneq ($(wildcard .git),) +possible_base_rmq_ref := v3.6.x +ifeq ($(possible_base_rmq_ref),$(current_rmq_ref)) +base_rmq_ref := $(current_rmq_ref) +else base_rmq_ref := $(shell \ - (git rev-parse --verify -q stable >/dev/null && \ - git merge-base --is-ancestor $$(git merge-base master HEAD) stable && \ - echo stable) || \ + (git rev-parse --verify -q master >/dev/null && \ + git rev-parse --verify -q $(possible_base_rmq_ref) >/dev/null && \ + git merge-base --is-ancestor $$(git merge-base master HEAD) $(possible_base_rmq_ref) && \ + echo $(possible_base_rmq_ref)) || \ echo master) +endif else base_rmq_ref := master endif @@ -313,11 +325,16 @@ endif UPSTREAM_RMQ_COMPONENTS_MK = $(DEPS_DIR)/rabbit_common/mk/rabbitmq-components.mk +ifeq ($(PROJECT),rabbit_common) +check-rabbitmq-components.mk: + @: +else check-rabbitmq-components.mk: $(verbose) cmp -s rabbitmq-components.mk \ $(UPSTREAM_RMQ_COMPONENTS_MK) || \ (echo "error: rabbitmq-components.mk must be updated!" 1>&2; \ false) +endif ifeq ($(PROJECT),rabbit_common) rabbitmq-components-mk: diff --git a/rabbitmq-server/deps/rabbitmq_management/CONTRIBUTING.md b/rabbitmq-server/deps/rabbitmq_management/CONTRIBUTING.md index 45bbcbe..a06d107 100644 --- a/rabbitmq-server/deps/rabbitmq_management/CONTRIBUTING.md +++ b/rabbitmq-server/deps/rabbitmq_management/CONTRIBUTING.md @@ -1,38 +1,99 @@ +Thank you for using RabbitMQ and for taking the time to contribute to the project. +This document has two main parts: + + * when and how to file GitHub issues for RabbitMQ projects + * how to submit pull requests + +They intend to save you and RabbitMQ maintainers some time, so please +take a moment to read through them. + ## Overview +### GitHub issues + +The RabbitMQ team uses GitHub issues for _specific actionable items_ that +engineers can work on. This assumes the following: + +* GitHub issues are not used for questions, investigations, root cause + analysis, discussions of potential issues, etc (as defined by this team) +* Enough information is provided by the reporter for maintainers to work with + +The team receives many questions through various venues every single +day. Frequently, these questions do not include the necessary details +the team needs to begin useful work. GitHub issues can very quickly +turn into a something impossible to navigate and make sense +of. Because of this, questions, investigations, root cause analysis, +and discussions of potential features are all considered to be +[mailing list][rmq-users] material. If you are unsure where to begin, +the [RabbitMQ users mailing list][rmq-users] is the right place. + +Getting all the details necessary to reproduce an issue, make a +conclusion or even form a hypothesis about what's happening can take a +fair amount of time. Please help others help you by providing a way to +reproduce the behavior you're observing, or at least sharing as much +relevant information as possible on the [RabbitMQ users mailing +list][rmq-users]. + +Please provide versions of the software used: + + * RabbitMQ server + * Erlang + * Operating system version (and distribution, if applicable) + * All client libraries used + * RabbitMQ plugins (if applicable) + +The following information greatly helps in investigating and reproducing issues: + + * RabbitMQ server logs + * A code example or terminal transcript that can be used to reproduce + * Full exception stack traces (a single line message is not enough!) + * `rabbitmqctl report` and `rabbitmqctl environment` output + * Other relevant details about the environment and workload, e.g. a traffic capture + * Feel free to edit out hostnames and other potentially sensitive information. + +To make collecting much of this and other environment information, use +the [`rabbitmq-collect-env`][rmq-collect-env] script. It will produce an archive with +server logs, operating system logs, output of certain diagnostics commands and so on. +Please note that **no effort is made to scrub any information that may be sensitive**. + +### Pull Requests + RabbitMQ projects use pull requests to discuss, collaborate on and accept code contributions. Pull requests is the primary place of discussing code changes. -## How to Contribute - -The process is fairly standard: +Here's the recommended workflow: - * Fork the repository or repositories you plan on contributing to - * Clone [RabbitMQ umbrella repository](https://github.com/rabbitmq/rabbitmq-public-umbrella) - * `cd umbrella`, `make co` + * [Fork the repository][github-fork] or repositories you plan on contributing to. If multiple + repositories are involved in addressing the same issue, please use the same branch name + in each repository * Create a branch with a descriptive name in the relevant repositories - * Make your changes, run tests, commit with a [descriptive message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html), push to your fork + * Make your changes, run tests (usually with `make tests`), commit with a + [descriptive message][git-commit-msgs], push to your fork * Submit pull requests with an explanation what has been changed and **why** - * Submit a filled out and signed [Contributor Agreement](https://github.com/rabbitmq/ca#how-to-submit) if needed (see below) + * Submit a filled out and signed [Contributor Agreement][ca-agreement] if needed (see below) * Be patient. We will get to your pull request eventually -If what you are going to work on is a substantial change, please first ask the core team -of their opinion on [RabbitMQ mailing list](https://groups.google.com/forum/#!forum/rabbitmq-users). - +If what you are going to work on is a substantial change, please first +ask the core team for their opinion on the [RabbitMQ users mailing list][rmq-users]. ## Code of Conduct See [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md). - ## Contributor Agreement -If you want to contribute a non-trivial change, please submit a signed copy of our -[Contributor Agreement](https://github.com/rabbitmq/ca#how-to-submit) around the time -you submit your pull request. This will make it much easier (in some cases, possible) -for the RabbitMQ team at Pivotal to merge your contribution. - +If you want to contribute a non-trivial change, please submit a signed +copy of our [Contributor Agreement][ca-agreement] around the time you +submit your pull request. This will make it much easier (in some +cases, possible) for the RabbitMQ team at Pivotal to merge your +contribution. ## Where to Ask Questions -If something isn't clear, feel free to ask on our [mailing list](https://groups.google.com/forum/#!forum/rabbitmq-users). +If something isn't clear, feel free to ask on our [mailing list][rmq-users]. + +[rmq-collect-env]: https://github.com/rabbitmq/support-tools/blob/master/scripts/rabbitmq-collect-env +[git-commit-msgs]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html +[rmq-users]: https://groups.google.com/forum/#!forum/rabbitmq-users +[ca-agreement]: https://cla.pivotal.io/sign/rabbitmq +[github-fork]: https://help.github.com/articles/fork-a-repo/ diff --git a/rabbitmq-server/deps/rabbitmq_management/Caddyfile b/rabbitmq-server/deps/rabbitmq_management/Caddyfile new file mode 100644 index 0000000..04a803d --- /dev/null +++ b/rabbitmq-server/deps/rabbitmq_management/Caddyfile @@ -0,0 +1,5 @@ +:2015 +log stdout +errors stderr +root priv/www +proxy /api localhost:15672 diff --git a/rabbitmq-server/deps/rabbitmq_management/LICENSE b/rabbitmq-server/deps/rabbitmq_management/LICENSE index b086024..13ad772 100644 --- a/rabbitmq-server/deps/rabbitmq_management/LICENSE +++ b/rabbitmq-server/deps/rabbitmq_management/LICENSE @@ -2,10 +2,15 @@ This package, the RabbitMQ Management Plugin is licensed under the MPL. For the MPL, please see LICENSE-MPL-RabbitMQ. This package makes use of the following third party libraries: -jQuery - http://jquery.com/ - MIT license, see LICENSE-MIT-jQuery164 -EJS - http://embeddedjs.com/ - MIT license, see LICENSE-MIT-EJS10 -Sammy - http://code.quirkey.com/sammy/ - MIT license, see LICENSE-MIT-Sammy060 -Cowboy - http://ninenines.eu/ - ISC license -base64.js - http://code.google.com/p/stringencoders/ - BSD license, see LICENSE-BSD-base64js -If you have any questions regarding licensing, please contact us at -info@rabbitmq.com. + +| Name | Website | License type | License file | +| -------------- | ------------------------------------------------------ | ------------- | ------------------------ | +| ExplorerCanvas | https://github.com/arv/explorercanvas | APACHE 2 | LICENSE-APACHE2-excanvas | +| base64.js | http://code.google.com/p/stringencoders/ | BSD | LICENSE-BSD-base64js | +| Cowboy | http://ninenines.eu/ | ISC | LICENSE-ISC-cowboy | +| EJS | https://code.google.com/archive/p/embeddedjavascript/ | MIT | LICENSE-MIT-EJS | +| Flot | https://github.com/flot/flot | MIT | LICENSE-MIT-Flot | +| Sammy | http://code.quirkey.com/sammy/ | MIT | LICENSE-MIT-Sammy | +| jQuery | http://jquery.com/ | MIT | LICENSE-MIT-jQuery | + +If you have any questions regarding licensing, please contact us at info@rabbitmq.com. diff --git a/rabbitmq-server/deps/rabbitmq_management/LICENSE-APACHE2-excanvas b/rabbitmq-server/deps/rabbitmq_management/LICENSE-APACHE2-excanvas new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/rabbitmq-server/deps/rabbitmq_management/LICENSE-APACHE2-excanvas @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/rabbitmq-server/deps/rabbitmq_management/LICENSE-ISC-cowboy b/rabbitmq-server/deps/rabbitmq_management/LICENSE-ISC-cowboy new file mode 100644 index 0000000..9d28158 --- /dev/null +++ b/rabbitmq-server/deps/rabbitmq_management/LICENSE-ISC-cowboy @@ -0,0 +1,13 @@ +Copyright (c) 2011-2017, Loïc Hoguin + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/rabbitmq-server/deps/rabbitmq_management/LICENSE-MIT-EJS b/rabbitmq-server/deps/rabbitmq_management/LICENSE-MIT-EJS new file mode 100644 index 0000000..5990a35 --- /dev/null +++ b/rabbitmq-server/deps/rabbitmq_management/LICENSE-MIT-EJS @@ -0,0 +1,21 @@ +EJS - Embedded JavaScript + +Copyright (c) 2007 Edward Benson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/rabbitmq-server/deps/rabbitmq_management/LICENSE-MIT-Flot b/rabbitmq-server/deps/rabbitmq_management/LICENSE-MIT-Flot index 67f4625..719da06 100644 --- a/rabbitmq-server/deps/rabbitmq_management/LICENSE-MIT-Flot +++ b/rabbitmq-server/deps/rabbitmq_management/LICENSE-MIT-Flot @@ -1,4 +1,4 @@ -Copyright (c) 2007-2013 IOLA and Ole Laursen +Copyright (c) 2007-2014 IOLA and Ole Laursen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation diff --git a/rabbitmq-server/deps/rabbitmq_management/LICENSE-MIT-Sammy b/rabbitmq-server/deps/rabbitmq_management/LICENSE-MIT-Sammy new file mode 100644 index 0000000..ad77bb8 --- /dev/null +++ b/rabbitmq-server/deps/rabbitmq_management/LICENSE-MIT-Sammy @@ -0,0 +1,22 @@ +Copyright (c) 2008 Aaron Quint, Quirkey NYC, LLC + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/rabbitmq-server/deps/rabbitmq_management/LICENSE-MIT-jQuery b/rabbitmq-server/deps/rabbitmq_management/LICENSE-MIT-jQuery new file mode 100644 index 0000000..5327046 --- /dev/null +++ b/rabbitmq-server/deps/rabbitmq_management/LICENSE-MIT-jQuery @@ -0,0 +1,20 @@ +Copyright (c) 2011 John Resig, http://jquery.com/ + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/rabbitmq-server/deps/rabbitmq_management/erlang.mk b/rabbitmq-server/deps/rabbitmq_management/erlang.mk index 89ba561..1a45ad1 100644 --- a/rabbitmq-server/deps/rabbitmq_management/erlang.mk +++ b/rabbitmq-server/deps/rabbitmq_management/erlang.mk @@ -17,7 +17,7 @@ ERLANG_MK_FILENAME := $(realpath $(lastword $(MAKEFILE_LIST))) export ERLANG_MK_FILENAME -ERLANG_MK_VERSION = 2.0.0-pre.2-256-g2cce185 +ERLANG_MK_VERSION = 2.0.0-pre.2-278-gd9a9158 ERLANG_MK_WITHOUT = # Make 3.81 and 3.82 are deprecated. @@ -2023,6 +2023,14 @@ pkg_ibrowse_fetch = git pkg_ibrowse_repo = https://github.com/cmullaparthi/ibrowse pkg_ibrowse_commit = master +PACKAGES += idna +pkg_idna_name = idna +pkg_idna_description = Erlang IDNA lib +pkg_idna_homepage = https://github.com/benoitc/erlang-idna +pkg_idna_fetch = git +pkg_idna_repo = https://github.com/benoitc/erlang-idna +pkg_idna_commit = master + PACKAGES += ierlang pkg_ierlang_name = ierlang pkg_ierlang_description = An Erlang language kernel for IPython. @@ -2298,9 +2306,9 @@ pkg_kvs_commit = master PACKAGES += lager pkg_lager_name = lager pkg_lager_description = A logging framework for Erlang/OTP. -pkg_lager_homepage = https://github.com/basho/lager +pkg_lager_homepage = https://github.com/erlang-lager/lager pkg_lager_fetch = git -pkg_lager_repo = https://github.com/basho/lager +pkg_lager_repo = https://github.com/erlang-lager/lager pkg_lager_commit = master PACKAGES += lager_amqp_backend @@ -2314,9 +2322,9 @@ pkg_lager_amqp_backend_commit = master PACKAGES += lager_syslog pkg_lager_syslog_name = lager_syslog pkg_lager_syslog_description = Syslog backend for lager -pkg_lager_syslog_homepage = https://github.com/basho/lager_syslog +pkg_lager_syslog_homepage = https://github.com/erlang-lager/lager_syslog pkg_lager_syslog_fetch = git -pkg_lager_syslog_repo = https://github.com/basho/lager_syslog +pkg_lager_syslog_repo = https://github.com/erlang-lager/lager_syslog pkg_lager_syslog_commit = master PACKAGES += lambdapad @@ -3786,9 +3794,9 @@ pkg_trie_commit = master PACKAGES += triq pkg_triq_name = triq pkg_triq_description = Trifork QuickCheck -pkg_triq_homepage = https://github.com/krestenkrab/triq +pkg_triq_homepage = https://github.com/triqng/triq pkg_triq_fetch = git -pkg_triq_repo = https://github.com/krestenkrab/triq +pkg_triq_repo = https://github.com/triqng/triq.git pkg_triq_commit = master PACKAGES += tunctl @@ -4280,7 +4288,7 @@ endef # if given. Do it for all 3 possible Makefile file names. ifeq ($(NO_AUTOPATCH_ERLANG_MK),) define dep_autopatch_erlang_mk - $t for f in Makefile makefile GNUmakefile; do \ + for f in Makefile makefile GNUmakefile; do \ if [ -f $(DEPS_DIR)/$1/$$f ]; then \ sed -i.bak s/'include *erlang.mk'/'include $$(if $$(ERLANG_MK_FILENAME),$$(ERLANG_MK_FILENAME),erlang.mk)'/ $(DEPS_DIR)/$1/$$f; \ fi \ @@ -4357,6 +4365,8 @@ define dep_autopatch_rebar.erl lists:foreach(fun ({d, D}) -> Write("ERLC_OPTS += -D" ++ atom_to_list(D) ++ "=1\n"); + ({d, DKey, DVal}) -> + Write("ERLC_OPTS += -D" ++ atom_to_list(DKey) ++ "=" ++ atom_to_list(DVal) ++ "\n"); ({i, I}) -> Write(["ERLC_OPTS += -I ", I, "\n"]); ({platform_define, Regex, D}) -> @@ -4579,7 +4589,7 @@ define dep_autopatch_appsrc_script.erl AppSrc = "$(call core_native_path,$(DEPS_DIR)/$1/src/$1.app.src)", AppSrcScript = AppSrc ++ ".script", Bindings = erl_eval:new_bindings(), - {ok, Conf} = file:script(AppSrcScript, Bindings), + {ok, [Conf]} = file:script(AppSrcScript, Bindings), ok = file:write_file(AppSrc, io_lib:format("~p.~n", [Conf])), halt() endef @@ -4731,6 +4741,87 @@ ERLANG_MK_RECURSIVE_REL_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-rel-deps-list.log ERLANG_MK_RECURSIVE_TEST_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-test-deps-list.log ERLANG_MK_RECURSIVE_SHELL_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-shell-deps-list.log +# Copyright (c) 2015-2017, Loïc Hoguin +# This file is part of erlang.mk and subject to the terms of the ISC License. + +.PHONY: distclean-kerl + +KERL_INSTALL_DIR ?= $(HOME)/erlang + +ifeq ($(strip $(KERL)),) +KERL := $(ERLANG_MK_TMP)/kerl/kerl +endif + +export KERL + +KERL_GIT ?= https://github.com/kerl/kerl +KERL_COMMIT ?= master + +KERL_MAKEFLAGS ?= + +OTP_GIT ?= https://github.com/erlang/otp + +define kerl_otp_target +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(1)),) +$(KERL_INSTALL_DIR)/$(1): $(KERL) + MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $(1) $(1) + $(KERL) install $(1) $(KERL_INSTALL_DIR)/$(1) +endif +endef + +define kerl_hipe_target +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$1-native),) +$(KERL_INSTALL_DIR)/$1-native: $(KERL) + KERL_CONFIGURE_OPTIONS=--enable-native-libs \ + MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $1 $1-native + $(KERL) install $1-native $(KERL_INSTALL_DIR)/$1-native +endif +endef + +$(KERL): + $(verbose) mkdir -p $(ERLANG_MK_TMP) + $(gen_verbose) git clone --depth 1 $(KERL_GIT) $(ERLANG_MK_TMP)/kerl + $(verbose) cd $(ERLANG_MK_TMP)/kerl && git checkout $(KERL_COMMIT) + $(verbose) chmod +x $(KERL) + +distclean:: distclean-kerl + +distclean-kerl: + $(gen_verbose) rm -rf $(KERL) + +# Allow users to select which version of Erlang/OTP to use for a project. + +ERLANG_OTP ?= +ERLANG_HIPE ?= + +# Use kerl to enforce a specific Erlang/OTP version for a project. +ifneq ($(strip $(ERLANG_OTP)),) +export PATH := $(KERL_INSTALL_DIR)/$(ERLANG_OTP)/bin:$(PATH) +SHELL := env PATH=$(PATH) $(SHELL) +$(eval $(call kerl_otp_target,$(ERLANG_OTP))) + +# Build Erlang/OTP only if it doesn't already exist. +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(ERLANG_OTP))$(BUILD_ERLANG_OTP),) +$(info Building Erlang/OTP $(ERLANG_OTP)... Please wait...) +$(shell $(MAKE) $(KERL_INSTALL_DIR)/$(ERLANG_OTP) ERLANG_OTP=$(ERLANG_OTP) BUILD_ERLANG_OTP=1 >&2) +endif + +else +# Same for a HiPE enabled VM. +ifneq ($(strip $(ERLANG_HIPE)),) +export PATH := $(KERL_INSTALL_DIR)/$(ERLANG_HIPE)-native/bin:$(PATH) +SHELL := env PATH=$(PATH) $(SHELL) +$(eval $(call kerl_hipe_target,$(ERLANG_HIPE))) + +# Build Erlang/OTP only if it doesn't already exist. +ifeq ($(wildcard $(KERL_INSTALL_DIR)/$(ERLANG_HIPE))$(BUILD_ERLANG_OTP),) +$(info Building HiPE-enabled Erlang/OTP $(ERLANG_OTP)... Please wait...) +$(shell $(MAKE) $(KERL_INSTALL_DIR)/$(ERLANG_HIPE) ERLANG_HIPE=$(ERLANG_HIPE) BUILD_ERLANG_OTP=1 >&2) +endif + +endif +endif + # Copyright (c) 2015-2016, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. @@ -5966,10 +6057,10 @@ else $(call render_template,bs_erl_nif,src/$n.erl) endif -# Copyright (c) 2015-2016, Loïc Hoguin +# Copyright (c) 2015-2017, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. -.PHONY: ci ci-prepare ci-setup distclean-kerl +.PHONY: ci ci-prepare ci-setup CI_OTP ?= CI_HIPE ?= @@ -5987,24 +6078,9 @@ ifeq ($(strip $(CI_OTP) $(CI_HIPE) $(CI_ERLLVM)),) ci:: else -ifeq ($(strip $(KERL)),) -KERL := $(ERLANG_MK_TMP)/kerl/kerl -endif - -export KERL - -KERL_GIT ?= https://github.com/kerl/kerl -KERL_COMMIT ?= master - -KERL_MAKEFLAGS ?= - -OTP_GIT ?= https://github.com/erlang/otp - -CI_INSTALL_DIR ?= $(HOME)/erlang - ci:: $(addprefix ci-,$(CI_OTP) $(addsuffix -native,$(CI_HIPE)) $(addsuffix -erllvm,$(CI_ERLLVM))) -ci-prepare: $(addprefix $(CI_INSTALL_DIR)/,$(CI_OTP) $(addsuffix -native,$(CI_HIPE))) +ci-prepare: $(addprefix $(KERL_INSTALL_DIR)/,$(CI_OTP) $(addsuffix -native,$(CI_HIPE))) ci-setup:: @@ -6014,10 +6090,10 @@ ci_verbose_0 = @echo " CI " $(1); ci_verbose = $(ci_verbose_$(V)) define ci_target -ci-$1: $(CI_INSTALL_DIR)/$2 +ci-$1: $(KERL_INSTALL_DIR)/$2 $(verbose) $(MAKE) --no-print-directory clean $(ci_verbose) \ - PATH="$(CI_INSTALL_DIR)/$2/bin:$(PATH)" \ + PATH="$(KERL_INSTALL_DIR)/$2/bin:$(PATH)" \ CI_OTP_RELEASE="$1" \ CT_OPTS="-label $1" \ CI_VM="$3" \ @@ -6029,32 +6105,8 @@ $(foreach otp,$(CI_OTP),$(eval $(call ci_target,$(otp),$(otp),otp))) $(foreach otp,$(CI_HIPE),$(eval $(call ci_target,$(otp)-native,$(otp)-native,native))) $(foreach otp,$(CI_ERLLVM),$(eval $(call ci_target,$(otp)-erllvm,$(otp)-native,erllvm))) -define ci_otp_target -ifeq ($(wildcard $(CI_INSTALL_DIR)/$(1)),) -$(CI_INSTALL_DIR)/$(1): $(KERL) - MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $(1) $(1) - $(KERL) install $(1) $(CI_INSTALL_DIR)/$(1) -endif -endef - -$(foreach otp,$(CI_OTP),$(eval $(call ci_otp_target,$(otp)))) - -define ci_hipe_target -ifeq ($(wildcard $(CI_INSTALL_DIR)/$1-native),) -$(CI_INSTALL_DIR)/$1-native: $(KERL) - KERL_CONFIGURE_OPTIONS=--enable-native-libs \ - MAKEFLAGS="$(KERL_MAKEFLAGS)" $(KERL) build git $(OTP_GIT) $1 $1-native - $(KERL) install $1-native $(CI_INSTALL_DIR)/$1-native -endif -endef - -$(foreach otp,$(sort $(CI_HIPE) $(CI_ERLLLVM)),$(eval $(call ci_hipe_target,$(otp)))) - -$(KERL): - $(verbose) mkdir -p $(ERLANG_MK_TMP) - $(gen_verbose) git clone --depth 1 $(KERL_GIT) $(ERLANG_MK_TMP)/kerl - $(verbose) cd $(ERLANG_MK_TMP)/kerl && git checkout $(KERL_COMMIT) - $(verbose) chmod +x $(KERL) +$(foreach otp,$(CI_OTP),$(eval $(call kerl_otp_target,$(otp)))) +$(foreach otp,$(sort $(CI_HIPE) $(CI_ERLLLVM)),$(eval $(call kerl_hipe_target,$(otp)))) help:: $(verbose) printf "%s\n" "" \ @@ -6064,10 +6116,6 @@ help:: "The CI_OTP variable must be defined with the Erlang versions" \ "that must be tested. For example: CI_OTP = OTP-17.3.4 OTP-17.5.3" -distclean:: distclean-kerl - -distclean-kerl: - $(gen_verbose) rm -rf $(KERL) endif # Copyright (c) 2013-2016, Loïc Hoguin @@ -6433,6 +6481,60 @@ apps-eunit: endif endif +# Copyright (c) 2015-2017, Loïc Hoguin +# This file is part of erlang.mk and subject to the terms of the ISC License. + +ifeq ($(filter proper,$(DEPS) $(TEST_DEPS)),proper) +.PHONY: proper + +# Targets. + +tests:: proper + +define proper_check.erl + code:add_pathsa(["$(call core_native_path,$(CURDIR)/ebin)", "$(call core_native_path,$(DEPS_DIR)/*/ebin)"]), + Module = fun(M) -> + [true] =:= lists:usort([ + case atom_to_list(F) of + "prop_" ++ _ -> + io:format("Testing ~p:~p/0~n", [M, F]), + proper:quickcheck(M:F()); + _ -> + true + end + || {F, 0} <- M:module_info(exports)]) + end, + try + case $(1) of + all -> [true] =:= lists:usort([Module(M) || M <- [$(call comma_list,$(3))]]); + module -> Module($(2)); + function -> proper:quickcheck($(2)) + end + of + true -> halt(0); + _ -> halt(1) + catch error:undef -> + io:format("Undefined property or module?~n~p~n", [erlang:get_stacktrace()]), + halt(0) + end. +endef + +ifdef t +ifeq (,$(findstring :,$(t))) +proper: test-build + $(verbose) $(call erlang,$(call proper_check.erl,module,$(t))) +else +proper: test-build + $(verbose) echo Testing $(t)/0 + $(verbose) $(call erlang,$(call proper_check.erl,function,$(t)())) +endif +else +proper: test-build + $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename $(wildcard ebin/*.beam)))))) + $(gen_verbose) $(call erlang,$(call proper_check.erl,all,undefined,$(MODULES))) +endif +endif + # Copyright (c) 2013-2016, Loïc Hoguin # This file is part of erlang.mk and subject to the terms of the ISC License. @@ -6443,7 +6545,7 @@ endif RELX ?= $(ERLANG_MK_TMP)/relx RELX_CONFIG ?= $(CURDIR)/relx.config -RELX_URL ?= https://github.com/erlware/relx/releases/download/v3.19.0/relx +RELX_URL ?= https://github.com/erlware/relx/releases/download/v3.23.0/relx RELX_OPTS ?= RELX_OUTPUT_DIR ?= _rel RELX_REL_EXT ?= @@ -6489,7 +6591,7 @@ distclean-relx-rel: # Run target. ifeq ($(wildcard $(RELX_CONFIG)),) -run: +run:: else define get_relx_release.erl @@ -6513,7 +6615,7 @@ ifeq ($(PLATFORM),msys2) RELX_REL_EXT := .cmd endif -run: all +run:: all $(verbose) $(RELX_OUTPUT_DIR)/$(RELX_REL_NAME)/bin/$(RELX_REL_NAME)$(RELX_REL_EXT) console help:: @@ -6579,7 +6681,10 @@ ifeq ($(filter triq,$(DEPS) $(TEST_DEPS)),triq) tests:: triq define triq_check.erl - code:add_pathsa(["$(call core_native_path,$(CURDIR)/ebin)", "$(call core_native_path,$(DEPS_DIR)/*/ebin)"]), + code:add_pathsa([ + "$(call core_native_path,$(CURDIR)/ebin)", + "$(call core_native_path,$(DEPS_DIR)/*/ebin)", + "$(call core_native_path,$(TEST_DIR))"]), try case $(1) of all -> [true] =:= lists:usort([triq:check(M) || M <- [$(call comma_list,$(3))]]); @@ -6590,7 +6695,7 @@ define triq_check.erl true -> halt(0); _ -> halt(1) catch error:undef -> - io:format("Undefined property or module~n"), + io:format("Undefined property or module?~n~p~n", [erlang:get_stacktrace()]), halt(0) end. endef @@ -6606,7 +6711,8 @@ triq: test-build endif else triq: test-build - $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename $(wildcard ebin/*.beam)))))) + $(eval MODULES := $(patsubst %,'%',$(sort $(notdir $(basename \ + $(wildcard ebin/*.beam) $(call core_find,$(TEST_DIR)/,*.beam)))))) $(gen_verbose) $(call erlang,$(call triq_check.erl,all,undefined,$(MODULES))) endif endif diff --git a/rabbitmq-server/deps/rabbitmq_management/license_info b/rabbitmq-server/deps/rabbitmq_management/license_info deleted file mode 100644 index eabe119..0000000 --- a/rabbitmq-server/deps/rabbitmq_management/license_info +++ /dev/null @@ -1,17 +0,0 @@ -jQuery is "Copyright (c) 2010 John Resig" and is covered by the MIT -license. It was downloaded from http://jquery.com/ - -EJS is "Copyright (c) 2007 Edward Benson" and is covered by the MIT -license. It was downloaded from http://embeddedjs.com/ - -Sammy is "Copyright (c) 2008 Aaron Quint, Quirkey NYC, LLC" and is -covered by the MIT license. It was downloaded from -http://code.quirkey.com/sammy/ - -ExplorerCanvas is "Copyright 2006 Google Inc" and is covered by the -Apache License version 2.0. It was downloaded from -http://code.google.com/p/explorercanvas/ - -Flot is "Copyright (c) 2007-2013 IOLA and Ole Laursen" and is covered -by the MIT license. It was downloaded from -http://www.flotcharts.org/ diff --git a/rabbitmq-server/deps/rabbitmq_management/priv/www/cli/index.html b/rabbitmq-server/deps/rabbitmq_management/priv/www/cli/index.html index 35823f0..89cd527 100644 --- a/rabbitmq-server/deps/rabbitmq_management/priv/www/cli/index.html +++ b/rabbitmq-server/deps/rabbitmq_management/priv/www/cli/index.html @@ -11,22 +11,32 @@

rabbitmqadmin

- Download it from here (Right click, - Save as), make executable, and drop it in your path. Note that + rabbitmqadmin is an HTTP API-based management tool. It uses the same API as RabbitMQ management UI + and provides access to the subset of the functionality in the UI from the command line. + It is not meant to be a replacement for rabbitmqctl + as there are operations that HTTP API intentionally does not expose. +

+ +

+ To use it, download it from this node (right click, + Save As), make sure it is executable, and drop it in your PATH. Note that many browsers will rename the - file rabbitmqadmin.txt. You will need Python - 2.6 or later. To use rabbitmqadmin with HTTPS, - Python 2.6.7 is the minimum supported version. + file rabbitmqadmin.txt. rabbitmqadmin requires Python + 2.6 or later (both 2.x and 3.x series are supported). + To use rabbitmqadmin with HTTPS, Python 2.7.9 is the minimum supported version.

See the rabbitmqadmin page on the website for more information on its use, or invoke rabbitmqadmin --help for usage - instructions. Windows users will need to ensure Python is on - their path, and invoke rabbitmqadmin as python.exe - rabbitmqadmin. + instructions.

+

+ Windows users will need to ensure Python is on + their PATH, and invoke rabbitmqadmin as python.exe + rabbitmqadmin. +

diff --git a/rabbitmq-server/deps/rabbitmq_management/priv/www/css/main.css b/rabbitmq-server/deps/rabbitmq_management/priv/www/css/main.css index b00cb09..39cd3ae 100644 --- a/rabbitmq-server/deps/rabbitmq_management/priv/www/css/main.css +++ b/rabbitmq-server/deps/rabbitmq_management/priv/www/css/main.css @@ -1,37 +1,50 @@ -body { font: 12px Verdana,sans-serif; color: #484848; padding: 8px 35px; } +body { font: 12px Verdana, sans-serif; color: #484848; padding: 0; margin: 0; } +input, button, a.button { font: 12px Verdana, sans-serif; } + +a { font-weight: bold; color: #444; text-decoration: none; } +a:hover { color: #F60; } + +#outer { padding: 0 0 1em 0; width: 95%; margin: auto; } #login table { margin: auto; } #login p { text-align: center; } -#logo { margin-bottom: 20px; } -#logo img { border: none; } -#login-version { float: right; color: #444; } -#login-version form { float: left; display: block; margin-left: 10px; } -#login-version form input { padding: 5px; border: 1px solid #ddd !important; color: #666 !important; background: none; } -#login-details { float: left; } -#login-details p { padding: 0 0 0.2em 0; margin: 0; text-align: right; } -#login-details b { color: black; font-weight: normal; } -#menu ul { float: left; padding: 0; margin: 0; } -#menu li { float: left; list-style-type: none; padding: 0 2em 0 0; } -#menu li a { display: block; padding: 0.5em; } -#menu { border-bottom: 1px solid #FF8C00; overflow: auto; width: 100%; } -#menu a { color: #444; font-weight: bold; text-decoration: none; } -#main a { color: black; font-weight: bold; text-decoration: none; } -#main a:hover { color: #222; } -#menu a.selected { background-color: #F60; color:white; -moz-border-radius: 8px 8px 0 0; border-radius: 8px 8px 0 0; } -#menu a:hover { color: black; } -#menu a.selected:hover { color: white; } -#login-details a { color: black; } +#logo { padding: 0 0 2em 0; } +#logo img { margin: 1em 0 -0.3em 1em; border: none; } + +#versions abbr { background: #f0f0f0; margin: 0 0 0 1em; } + +.status-ok { } +.status-error { color: #F00; } +.status-timeout { color: #99EBFF; } + +#debug { position: fixed; bottom: 0; z-index: 9; width: 100%; text-align: center; padding: 0; margin: 0; } +#debug p { background: #F60; color: white; margin: 0; padding: 1em; font-size: 2em; } + +#header { background: white; position: fixed; z-index: 1; width: 95%; margin: auto; padding: 1em 0 0 0; border-bottom: 1px solid #666; } + +#topnav { float: right; padding: 0; margin: 0; list-style-type: none; } +#topnav form { display: inline; } +#topnav input[type=submit] { padding: 3px 7px; display: inline; } +#topnav li { text-align: right; padding: 2px 0; } + +#menu ul { padding: 0; margin: 0; overflow: auto; } +#menu li { float: left; list-style-type: none; padding: 0 0.1em 0 0; } +#menu li a { display: block; padding: 0.7em 1.3em; margin-right: 5px; } +#menu a:hover { background-color: #F60; color: white; -moz-border-radius: 8px 8px 0 0; border-radius: 8px 8px 0 0; } +#menu a.selected { background-color: #666; color: white; -moz-border-radius: 8px 8px 0 0; border-radius: 8px 8px 0 0; } #vhost-form { float: right; padding: 0; margin: 0; } +#main { padding-top: 10em; } #main.with-rhs { margin-right: 210px; } -#rhs { float: right; width: 200px; padding-top: 10px; } -#rhs ul { padding: 0; margin: 0; } -#rhs li { list-style-type: none; padding: 0; } -#rhs a { display: block; padding: 0.5em; color: #444; font-weight: bold; text-decoration: none; } -#rhs a.selected { background-color: #F60; color:white; -moz-border-radius: 8px 0 0 8px; border-radius: 8px 0 0 8px; } - -h1 { font-size: 2em; font-weight: normal; padding: 0; } +#rhs { float: right; width: 200px; background-color: white; position: relative; padding-top: 10em; } +#rhs ul { padding: 0; margin: 10px 0 0 0; } +#rhs li { list-style-type: none; padding: 0; margin-bottom: 5px; } +#rhs a { display: block; padding: 0.7em; font-weight: bold; text-decoration: none; } +#rhs a:hover { background-color: #F60; color: white; -moz-border-radius: 8px 0 0 8px; border-radius: 8px 0 0 8px; } +#rhs a.selected { background-color: #666; color: white; -moz-border-radius: 8px 0 0 8px; border-radius: 8px 0 0 8px; } + +h1 { font-size: 2em; font-weight: normal; padding: 0; margin-bottom: 0; } b, dt { color: black; font-weight: normal; } dd { margin-bottom: 5px; } div.box, div.section, div.section-hidden { overflow: auto; width: 100%; } @@ -42,9 +55,14 @@ div.box, div.section, div.section-hidden { overflow: auto; width: 100%; } .shortinput { width: 50px; text-align: right; } -.help:after { content: '(?)'; } -.help, .popup-options-link { color: #888; cursor: pointer; } -.help:hover, .popup-options-link:hover { color: #444; } +.help:after { content: '?'; } +.help, +.popup-options-link { background-color: #E4E4E4; padding: 2px 4px; cursor: pointer; } +table th .help, +table th .popup-options-link { border: none; } +.help:hover, +.popup-options-link:hover, +.popup-owner { background-color: #F60; color: white; } .rate-visibility-option { cursor: pointer; padding: 4px; background: #fafafa; border: 1px solid #f0f0f0; border-radius: 3px; display:block; } .rate-visibility-option:hover { background: #ddf; @@ -59,8 +77,8 @@ table.legend { float: left; } table.legend th { padding: 4px 10px 4px 0; width: 80px; } table.legend td { padding: 4px 0 4px 10px; width: 130px; } -.tag-link, .argument-link { color: #444; cursor: pointer; } -.tag-link:hover, .argument-link:hover { color: #888; } +.tag-link, .argument-link { color: #444; cursor: pointer; font-weight: bold; } +.tag-link:hover, .argument-link:hover { color: #F60; } .filter { overflow: auto; width: 100%; margin-bottom: 10px; } .filter table { float: left; } @@ -68,23 +86,24 @@ table.legend td { padding: 4px 0 4px 10px; width: 130px; } .filter input#filter-regex-mode { vertical-align: middle; } .filter p#filter-truncate { float: right; padding: 4px; margin: 0; } .filter p.filter-warning { border-radius: 5px; background: #ff8; } -.filter-active { background: #99ebff; border-radius: 5px; } -.filter-highlight { background: #99ebff; } +.filter-active { background: #99EBFF; border-radius: 5px; } +.filter-highlight { background: #99EBFF; } input#truncate { width: 50px; text-align: right; } table { border-collapse: collapse; } table th { font-weight: normal; color: black; } -table th, table td { font: 12px Verdana,sans-serif; padding: 5px 4px; } +table th, table td { font: 12px Verdana, sans-serif; padding: 5px 4px; } table.list th, table.list td { vertical-align: top; min-width: 5em; width: auto; } table.list { border-width: 1px; margin-bottom: 1em; } table.list th, table.list td { border: 1px solid #ccc; } -table.list th { text-align: center; } +table.list th { text-align: left; } table.list th.plus-minus { border: none; min-width: 2em; } -table.list td a { display: block; width: 100%; } -table.list th a.sort { display: block; width: 100%; cursor: pointer; } -table.list th a.sort .arrow { color: #888; } +table.list td a { display: block; color: black; text-decoration: none; font-weight: bold; } +table.list td a:hover { color: #F60; } +table.list th a.sort { display: block; width: 100%; cursor: pointer; color: black; font-weight: bold; } +table.list th a.sort .arrow { color: #F60; } table.list td p { margin: 0; padding: 1px 0 0 0; } table.list td p.warning { margin: 0; padding: 5px; } @@ -108,6 +127,7 @@ div.memory_conn { background: #dada66; } div.memory_proc { background: #6abf59; } div.memory_table { background: #6679da; } div.memory_system { background: #999; } +div.memory_unused { background: #955; } div.memory-bar div.memory_queue { border-right: solid 1px #eb50a6; } div.memory-bar div.memory_binary { border-right: solid 1px #eb50a6; } @@ -115,13 +135,14 @@ div.memory-bar div.memory_conn { border-right: solid 1px #ebeb8d; } div.memory-bar div.memory_proc { border-right: solid 1px #79da66; } div.memory-bar div.memory_table { border-right: solid 1px #8d9ceb; } div.memory-bar div.memory_system { border-right: solid 1px #bbb; } +div.memory-bar div.memory_unused { border-right: solid 1px #bbb; } sub { display: block; font-size: 0.8em; color: #888; } small { font-size: 0.8em; color: #888; } #main sub a { color: #888; } #main sub a:hover { color: #444; } table.argument-links { color: #888; } -table.argument-links td { font-size: 0.64em; vertical-align: top; } +table.argument-links td { vertical-align: top; } .unknown { color: #888; } table.facts { float: left; } @@ -137,8 +158,23 @@ table.facts-l { margin-right: 50px; } table.mini th { border: none; padding: 0 2px 2px 2px; text-align: right; } table.mini td { border: none; padding: 0 2px 2px 2px; } -tr.alt1>td { background: #eee; } -tr.alt2>td { background: #fff; } +tr.alt1>td { + background: #eee; + background: -moz-linear-gradient(center top, #f0f0f0 0%,#e0e0e0 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f0f0f0),color-stop(1, #e0e0e0)); +} +tr.alt2>td { + background: #fff; + background: -moz-linear-gradient(center top, #F8F8F8 0%,#ffffff 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #F8F8F8),color-stop(1, #ffffff)); +} + +td span, +td abbr { + display: inline-block; + padding: 3px 5px; + margin: 0 0 3px 0; +} div.status-bar, div.status-red, div.status-yellow, div.status-green, div.status-grey { text-align: center; } div.status-bar-main, div.status-red, div.status-yellow, div.status-green, div.status-grey { border-radius: 3px; -moz-border-radius: 3px; padding: 3px; } @@ -162,47 +198,80 @@ div.status-key-green { background: #98f898; } .r { text-align: right !important; } .t { vertical-align: top !important; } -p.status-ok { color: #888; text-align: right; } -p.status-error { background: #ff7a7a; color: white; margin-top: 50px !important; } -p.status-error th { background: white; } -p.warning, div.form-popup-warn { background: #ff8; } -div.form-popup-info { background: #8f8; } -div.form-popup-help { text-align: left !important; background: #f8f8f8; border: 1px solid #ccc; } -div.form-popup-warn, div.form-popup-info, div.form-popup-help { margin: 20px; padding: 15px; border-radius: 10px; -moz-border-radius: 10px; text-align: center; max-width: 600px; z-index: 1; display: none; position: fixed; min-width: 500px; } -div.form-popup-warn span, div.form-popup-info span, div.form-popup-help span, div.form-popup-options span { color: black; font-weight: bold; cursor: pointer; } - +div.form-popup-warn, +div.form-popup-info, +div.form-popup-help, div.form-popup-options { - z-index: 1; position: absolute; right: 35px; padding: 15px; background: white; border-left: 1px solid #ccc; border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; border-radius: 10px 0 0 10px; -moz-border-radius: 10px 0 0 10px; + -moz-border-radius: 5px 0 0 5px; + background: #EEE; + border-radius: 5px 0 0 5px; + border: 1px solid #ccc; + right: 0; + margin: 10px 0 10px 0; + padding: 15px; + position: fixed; + top: 0; +} +div.form-popup-warn, +div.form-popup-info, +div.form-popup-help { + -moz-border-radius: 5px; + border-radius: 5px; + left: 50%; + margin-left: -250px; + text-align: left; + top: 25%; + width: 500px; + z-index: 2; +} +p.warning, div.form-popup-warn { background: #FF9; } + +div.form-popup-options { z-index: 3; } + +div.form-popup-warn span, +div.form-popup-info span, +div.form-popup-help span, +div.form-popup-options span { + color: white; + background-color: #666; + cursor: pointer; + padding: 4px 8px; + border-radius: 5px; + -moz-border-radius: 5px; +} +div.form-popup-warn span:hover, +div.form-popup-info span:hover, +div.form-popup-help span:hover, +div.form-popup-options span:hover { + background-color: #F60; + cursor: pointer; } -.popup-owner { background: #eee; padding: 5px; border-radius: 3px; -moz-border-radius: 3px; } - -p.status-error, p.warning { margin: 20px; padding: 15px; border-radius: 10px; -moz-border-radius: 10px; text-align: center; } +p.warning { padding: 15px; border-radius: 5px; -moz-border-radius: 5px; text-align: center; } -.highlight { min-width: 120px; font-size: 120%; text-align:center; padding:10px; background-color: #ddd; margin: 0 20px 0 0; color: #888; border-radius: 10px; -moz-border-radius: 10px; } +.highlight { min-width: 120px; font-size: 120%; text-align:center; padding:10px; background-color: #ddd; margin: 0 20px 0 0; color: #888; border-radius: 5px; -moz-border-radius: 5px; } .highlight strong { font-size: 2em; display: block; color: #444; font-weight: normal; } -.highlight, .micro-highlight { float: left; } +.highlight { float: left; } .chart { margin: 0 20px 20px 0; float: left; } .chart-small { width: 400px; height: 100px; } .chart-medium { width: 600px; height: 200px; } .chart-large { width: 800px; height: 300px; } -.micro-highlight { min-width: 120px; font-size: 100%; text-align:center; padding:10px; background-color: #ddd; margin: 0 20px 0 0; color: #888; border-radius: 10px; -moz-border-radius: 10px; } -.micro-highlight a { font-weight: normal !important; color: #888 !important; } -.micro-highlight strong { font-size: 120%; color: #444; font-weight: normal; } +ul#global-counts { overflow: hidden; list-style-type: none; margin: 0; padding: 0; } +ul#global-counts li { float: left; margin: 0 1em 0 0; } div.section, div.section-hidden { margin: 0 0 1em 0; } div.section-invisible div.hider { display: none; } div.section div.hider, div.section-hidden div.hider { padding: 0.5em 0; } div.section h2, div.section-hidden h2 { font-size: 1em; padding: 5px 5px 5px 25px; cursor: pointer; margin: 0; } div.section h2:hover, div.section-hidden h2:hover { color: black; } -div.section-invisible h2 { background: white; border-bottom: 1px solid #ddd; background-image: url(../img/collapse.png); background-repeat:no-repeat; background-position:4px 4px; } -div.section-visible h2 { background: #f8f8f8; border-bottom: 1px solid #ddd; background-image: url(../img/expand.png); background-repeat:no-repeat; background-position:4px 4px; } +div.section-invisible h2 { background: white; background-image: url(../img/collapse.png); background-repeat:no-repeat; background-position:4px 4px; } +div.section-visible h2 { background: #F8F8F8; background-image: url(../img/expand.png); background-repeat:no-repeat; background-position:4px 4px; } form { margin: 0; } form.inline-form { float: left; } -form.inline-form-right { float: right; } +form.inline-form-right { float: right; padding-left: 5px; } input, select { padding: 0.2em; } input[type=text], input[type=password] { font: 1.1em Andale Mono, Lucidatypewriter, Courier New, Courier, monospace; border: 1px solid #ccc; } textarea { width: 600px; height: 200px; border: 1px solid #ccc; } @@ -213,89 +282,70 @@ table.form { margin-bottom: 0.5em; } table.form th { text-align: right; vertical-align: top; } table.form input[type=text], table.form input[type=password] { width: 200px; } table.form input[type=text].wide, table.form input[type=password].wide { width: 300px; } -table.form select { width: 200px; } +table.form select { width: auto; } table.form select.narrow { width: 110px; } table.form .multifield { margin: 0; padding: 0; } table.form .multifield td { margin: 0; padding: 0; vertical-align: top; } table.form .multifield td.equals { padding: 3px; } table.form .multifield td input { float: left; } -table.form .multifield td select { width: 70px; display: block; float: left; margin-left: 5px; } +table.form .multifield td select { width: auto; display: block; float: left; margin-left: 5px; } table.form label { margin-top: 5px; display: block; } table.form table.subform { margin-bottom: 5px; } table.form table.subform th { text-align: left; } table.form table.subform th, table.form table.subform td { padding: 0; } -.multifield-sub { border: 1px solid #ddd; background: #f8f8f8; padding: 10px; border-radius: 10px; -moz-border-radius: 10px; float: left; margin-bottom: 10px; } +.multifield-sub { border: 1px solid #ddd; background: #F8F8F8; padding: 10px; border-radius: 5px; -moz-border-radius: 5px; float: left; margin-bottom: 10px; } -label.radio, label.checkbox { padding: 5px; border: 1px solid #eee; cursor: pointer; border-radius: 5px; -moz-border-radius: 5px; } +label.radio, label.checkbox { padding: 5px; cursor: pointer; border-radius: 5px; -moz-border-radius: 5px; border: 1px solid #ccc; } table.two-col-layout { width: 100%; } table.two-col-layout > tbody > tr > td { width: 50%; vertical-align: top; } -input[type=submit], button { padding: 8px; border-radius: 5px; -moz-border-radius: 5px; color: black !important; text-decoration: none; cursor: pointer; font-weight: normal; } -table.list input[type=submit], table.list button { padding: 4px; } +input[type=submit], button, a.button { padding: 8px; border-radius: 5px; -moz-border-radius: 5px; text-decoration: none !important; cursor: pointer; display: block; font-weight: normal !important; } +table.list input[type=submit], table.list button, table.list a.button { padding: 3px 7px; margin: 0 0 3px 0; } -input[type=submit], button { - background: #ddf; - background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #ddf),color-stop(1, #bbf)); - border: 1px solid #88d; +input[type=submit], button, a.button { + background: #666; + color: #FFF !important; + border: 0; } - -input[type=submit]:hover, button:hover { - background: #bbf; - background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #bbf),color-stop(1, #99d)); - border: 1px solid #66b; +input[type=submit]:hover, button:hover, a.button:hover { + background: #F60; + text-decoration: none !important; } -input[type=submit][disabled], button[disabled] { background: #aac; } -input[type=submit][disabled]:hover, button[disabled]:hover { background: #aac; } +input[type=submit][disabled], button[disabled], a.button.disabled { pointer-events: none; background: #aaa; } +input[type=submit][disabled]:hover, button[disabled]:hover, a.button.disabled { background: #aaa; } h3 { padding: 0 0 2px 0; margin: 1em 0 1em 0; font-size: 1em; border-bottom: 1px solid #E4E4E4; font-weight: normal; } -acronym { background: #add; color: #222; padding: 2px 4px; border-radius: 2px; -moz-border-radius: 2px; border: none; cursor: default; } +abbr { background: #99EBFF; padding: 3px 5px; border-radius: 5px; -moz-border-radius: 5px; border: none; cursor: default; text-decoration: none; } -acronym.policy { background: none; border: 2px solid #add; padding: 0 2px; } -table.list td acronym a { display: inline; width: auto; } +table.list td abbr a { display: inline; width: auto; } -acronym.warning { background: #daa; } +abbr.warning { background: #red; } -.status-red acronym, .status-yellow acronym, .status-green acronym, .status-grey acronym, small acronym, acronym.normal { background: none; color: inherit; padding: 0; border-bottom: 1px dotted; cursor: default; } +.status-red abbr, .status-yellow abbr, .status-green abbr, .status-grey abbr, small abbr, abbr.normal { background: none; color: inherit; padding: 0; border-bottom: 1px dotted; cursor: default; } -acronym.type { background: none; color: inherit; padding: 0; border-bottom: 1px dotted #ddd; cursor: default; } +abbr.type { background: none; color: inherit; padding: 0; border-bottom: 1px dotted #ddd; cursor: default; } div.bindings-wrapper { display: inline-block; } div.bindings-wrapper table { margin: auto; } div.bindings-wrapper p { margin: 10px; text-align: center; } -div.bindings-wrapper span.exchange { border: 1px solid #bbb; padding: 10px; border-radius: 10px; -moz-border-radius: 10px; } +div.bindings-wrapper span.exchange { border: 1px solid #bbb; padding: 10px; border-radius: 5px; -moz-border-radius: 5px; } div.bindings-wrapper span.queue { border: 1px solid #666; padding: 10px; } div.bindings-wrapper td span.exchange, div.bindings-wrapper td span.queue { background: white; display: block; } div.bindings-wrapper span.exchange a, div.bindings-wrapper span.queue a { font-weight: normal !important; } div.bindings-wrapper p.arrow { font-size: 200%; } -#footer { overflow: auto; width: 100%; } -#footer-nav { padding-top: 5px; } -#footer-nav ul { float: left; list-style-type: none; padding: 0; margin: 0;} -#footer-nav ul li { float: left; border-right: 1px solid #ccc; padding: 2px 5px 2px 0;} -#footer-nav ul li + li { border-right: none; padding: 2px 5px;} -#footer-nav ul li a { color: #888; text-decoration: none; } -#footer-nav ul li a:hover { color: #444; } +#footer { overflow: auto; width: 100%; border-top: 1px solid #666; } +#footer ul { list-style-type: none; padding: 0; margin: 0; } +#footer ul li { float: left; } +#footer ul li a { display: block; padding: 0.7em 1em; } -#update-form { float: right; margin: 0; padding: 0; } - -#status { clear: both; } #scratch { display: none; } -tr.alt1>td { - background: -moz-linear-gradient(center top, #f0f0f0 0%,#e0e0e0 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f0f0f0),color-stop(1, #e0e0e0)); -} - -tr.alt2>td { - background: -moz-linear-gradient(center top, #f8f8f8 0%,#ffffff 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f8f8f8),color-stop(1, #ffffff)); -} - .highlight, .mini-highlight, .micro-highlight { background: -moz-linear-gradient(center top, #f0f0f0 0%,#e0e0e0 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #f0f0f0),color-stop(1, #e0e0e0)); diff --git a/rabbitmq-server/deps/rabbitmq_management/priv/www/favicon.ico b/rabbitmq-server/deps/rabbitmq_management/priv/www/favicon.ico index 2b2cfa6..4c17e66 100644 Binary files a/rabbitmq-server/deps/rabbitmq_management/priv/www/favicon.ico and b/rabbitmq-server/deps/rabbitmq_management/priv/www/favicon.ico differ diff --git a/rabbitmq-server/deps/rabbitmq_management/priv/www/index.html b/rabbitmq-server/deps/rabbitmq_management/priv/www/index.html index 7ca790e..7dbaf0d 100644 --- a/rabbitmq-server/deps/rabbitmq_management/priv/www/index.html +++ b/rabbitmq-server/deps/rabbitmq_management/priv/www/index.html @@ -3,17 +3,16 @@ RabbitMQ Management - - - - - - + + + + + + - diff --git a/rabbitmq-server/deps/rabbitmq_management/priv/www/js/charts.js b/rabbitmq-server/deps/rabbitmq_management/priv/www/js/charts.js index 54c482d..e8e4a9a 100644 --- a/rabbitmq-server/deps/rabbitmq_management/priv/www/js/charts.js +++ b/rabbitmq-server/deps/rabbitmq_management/priv/www/js/charts.js @@ -70,8 +70,8 @@ function chart_h3(id, heading, heading_help) { var range = get_pref('chart-range'); return '

' + heading + ' (' + prefix_title(mode, range) + - ')' + (heading_help == undefined ? '' : + 'type="rate" for="' + id + '">' + prefix_title(mode, range) + + '' + (heading_help == undefined ? '' : ' ') + '

'; } @@ -79,7 +79,7 @@ function chart_h3(id, heading, heading_help) { function prefix_title(mode, range) { var desc = CHART_PERIODS[range]; if (mode == 'chart') { - return 'chart: ' + desc.toLowerCase(); + return desc.toLowerCase(); } else if (mode == 'curr') { return 'current value'; diff --git a/rabbitmq-server/deps/rabbitmq_management/priv/www/js/ejs.js b/rabbitmq-server/deps/rabbitmq_management/priv/www/js/ejs-1.0.js similarity index 95% rename from rabbitmq-server/deps/rabbitmq_management/priv/www/js/ejs.js rename to rabbitmq-server/deps/rabbitmq_management/priv/www/js/ejs-1.0.js index 49d9525..259d87f 100644 --- a/rabbitmq-server/deps/rabbitmq_management/priv/www/js/ejs.js +++ b/rabbitmq-server/deps/rabbitmq_management/priv/www/js/ejs-1.0.js @@ -1,5 +1,5 @@ (function(){ - + var rsplit = function(string, regex) { var result = regex.exec(string),retArr = new Array(), first_idx, last_idx, first_bit; @@ -11,10 +11,10 @@ var rsplit = function(string, regex) { first_bit = string.substring(0,first_idx); retArr.push(string.substring(0,first_idx)); string = string.slice(first_idx); - } + } retArr.push(result[0]); string = string.slice(result[0].length); - result = regex.exec(string); + result = regex.exec(string); } if (! string == '') { @@ -76,7 +76,7 @@ EJS = function( options ){ template.compile(options, this.name); - + EJS.update(this.name, this); this.template = template; }; @@ -145,7 +145,7 @@ EJS.endExt = function(path, match){ /* @Static*/ EJS.Scanner = function(source, left, right) { - + extend(this, {left_delimiter: left +'%', right_delimiter: '%'+right, @@ -155,7 +155,7 @@ EJS.Scanner = function(source, left, right) { left_comment: left+'%#'}) this.SplitRegexp = left=='[' ? /(\[%%)|(%%\])|(\[%=)|(\[%#)|(\[%)|(%\]\n)|(%\])|(\n)/ : new RegExp('('+this.double_left+')|(%%'+this.double_right+')|('+this.left_equal+')|('+this.left_comment+')|('+this.left_delimiter+')|('+this.right_delimiter+'\n)|('+this.right_delimiter+')|(\n)') ; - + this.source = source; this.stag = null; this.lines = 0; @@ -166,7 +166,7 @@ EJS.Scanner.to_text = function(input){ return ''; if(input instanceof Date) return input.toDateString(); - if(input.toString) + if(input.toString) return input.toString(); return ''; }; @@ -177,9 +177,9 @@ EJS.Scanner.prototype = { regex = this.SplitRegexp; if (! this.source == '') { - var source_split = rsplit(this.source, /\n/); - for(var i=0; i - * + * */ EJS.config = function(options){ EJS.cache = options.cache != null ? options.cache : EJS.cache; EJS.type = options.type != null ? options.type : EJS.type; EJS.ext = options.ext != null ? options.ext : EJS.ext; - + var templates_directory = EJS.templates_directory || {}; //nice and private container EJS.templates_directory = templates_directory; EJS.get = function(path, cache){ if(cache == false) return null; if(templates_directory[path]) return templates_directory[path]; - return null; + return null; }; - - EJS.update = function(path, template) { + + EJS.update = function(path, template) { if(path == null) return; templates_directory[path] = template ; }; - + EJS.INVALID_PATH = -1; }; EJS.config( {cache: true, type: '<', ext: '.ejs' } ); @@ -425,7 +425,7 @@ EJS.config( {cache: true, type: '<', ext: '.ejs' } ); /** * @constructor - * By adding functions to EJS.Helpers.prototype, those functions will be available in the + * By adding functions to EJS.Helpers.prototype, those functions will be available in the * views. * @init Creates a view helper. This function is called internally. You should never call it. * @param {Object} data The data passed to the view. Helpers have access to it through this._data @@ -452,7 +452,7 @@ EJS.Helpers.prototype = { * For a given value, tries to create a human representation. * @param {Object} input the value being converted. * @param {Object} null_text what text should be present if input == null or undefined, defaults to '' - * @return {String} + * @return {String} */ to_text: function(input, null_text) { if(input == null || input === undefined) return null_text || ''; @@ -471,21 +471,21 @@ EJS.Helpers.prototype = { catch(e) { continue;} } } - + EJS.request = function(path){ var request = new EJS.newRequest() request.open("GET", path, false); - + try{request.send(null);} catch(e){return null;} - + if ( request.status == 404 || request.status == 2 ||(request.status == 0 && request.responseText == '') ) return null; - + return request.responseText } EJS.ajax_request = function(params){ params.method = ( params.method ? params.method : 'GET') - + var request = new EJS.newRequest(); request.onreadystatechange = function(){ if(request.readyState == 4){ diff --git a/rabbitmq-server/deps/rabbitmq_management/priv/www/js/ejs.min.js b/rabbitmq-server/deps/rabbitmq_management/priv/www/js/ejs-1.0.min.js similarity index 99% rename from rabbitmq-server/deps/rabbitmq_management/priv/www/js/ejs.min.js rename to rabbitmq-server/deps/rabbitmq_management/priv/www/js/ejs-1.0.min.js index 01a4181..ccce922 100644 --- a/rabbitmq-server/deps/rabbitmq_management/priv/www/js/ejs.min.js +++ b/rabbitmq-server/deps/rabbitmq_management/priv/www/js/ejs-1.0.min.js @@ -1 +1 @@ -(function(){var rsplit=function(string,regex){var result=regex.exec(string),retArr=new Array(),first_idx,last_idx,first_bit;while(result!=null){first_idx=result.index;last_idx=regex.lastIndex;if((first_idx)!=0){first_bit=string.substring(0,first_idx);retArr.push(string.substring(0,first_idx));string=string.slice(first_idx)}retArr.push(result[0]);string=string.slice(result[0].length);result=regex.exec(string)}if(!string==""){retArr.push(string)}return retArr},chop=function(string){return string.substr(0,string.length-1)},extend=function(d,s){for(var n in s){if(s.hasOwnProperty(n)){d[n]=s[n]}}};EJS=function(options){options=typeof options=="string"?{view:options}:options;this.set_options(options);if(options.precompiled){this.template={};this.template.process=options.precompiled;EJS.update(this.name,this);return }if(options.element){if(typeof options.element=="string"){var name=options.element;options.element=document.getElementById(options.element);if(options.element==null){throw name+"does not exist!"}}if(options.element.value){this.text=options.element.value}else{this.text=options.element.innerHTML}this.name=options.element.id;this.type="["}else{if(options.url){options.url=EJS.endExt(options.url,this.extMatch);this.name=this.name?this.name:options.url;var url=options.url;var template=EJS.get(this.name,this.cache);if(template){return template}if(template==EJS.INVALID_PATH){return null}try{this.text=EJS.request(url+(this.cache?"":"?"+Math.random()))}catch(e){}if(this.text==null){throw ({type:"EJS",message:"There is no template at "+url})}}}var template=new EJS.Compiler(this.text,this.type);template.compile(options,this.name);EJS.update(this.name,this);this.template=template};EJS.prototype={render:function(object,extra_helpers){object=object||{};this._extra_helpers=extra_helpers;var v=new EJS.Helpers(object,extra_helpers||{});return this.template.process.call(object,object,v)},update:function(element,options){if(typeof element=="string"){element=document.getElementById(element)}if(options==null){_template=this;return function(object){EJS.prototype.update.call(_template,element,object)}}if(typeof options=="string"){params={};params.url=options;_template=this;params.onComplete=function(request){var object=eval(request.responseText);EJS.prototype.update.call(_template,element,object)};EJS.ajax_request(params)}else{element.innerHTML=this.render(options)}},out:function(){return this.template.out},set_options:function(options){this.type=options.type||EJS.type;this.cache=options.cache!=null?options.cache:EJS.cache;this.text=options.text||null;this.name=options.name||null;this.ext=options.ext||EJS.ext;this.extMatch=new RegExp(this.ext.replace(/\./,"."))}};EJS.endExt=function(path,match){if(!path){return null}match.lastIndex=0;return path+(match.test(path)?"":this.ext)};EJS.Scanner=function(source,left,right){extend(this,{left_delimiter:left+"%",right_delimiter:"%"+right,double_left:left+"%%",double_right:"%%"+right,left_equal:left+"%=",left_comment:left+"%#"});this.SplitRegexp=left=="["?/(\[%%)|(%%\])|(\[%=)|(\[%#)|(\[%)|(%\]\n)|(%\])|(\n)/:new RegExp("("+this.double_left+")|(%%"+this.double_right+")|("+this.left_equal+")|("+this.left_comment+")|("+this.left_delimiter+")|("+this.right_delimiter+"\n)|("+this.right_delimiter+")|(\n)");this.source=source;this.stag=null;this.lines=0};EJS.Scanner.to_text=function(input){if(input==null||input===undefined){return""}if(input instanceof Date){return input.toDateString()}if(input.toString){return input.toString()}return""};EJS.Scanner.prototype={scan:function(block){scanline=this.scanline;regex=this.SplitRegexp;if(!this.source==""){var source_split=rsplit(this.source,/\n/);for(var i=0;i0){for(var i=0;i0){buff.push(put_cmd+'"'+clean(content)+'")')}content="";break;case scanner.double_left:content=content+scanner.left_delimiter;break;default:content=content+token;break}}else{switch(token){case scanner.right_delimiter:switch(scanner.stag){case scanner.left_delimiter:if(content[content.length-1]=="\n"){content=chop(content);buff.push(content);buff.cr()}else{buff.push(content)}break;case scanner.left_equal:buff.push(insert_cmd+"(EJS.Scanner.to_text("+content+")))");break}scanner.stag=null;content="";break;case scanner.double_right:content=content+scanner.right_delimiter;break;default:content=content+token;break}}});if(content.length>0){buff.push(put_cmd+'"'+clean(content)+'")')}buff.close();this.out=buff.script+";";var to_be_evaled="/*"+name+"*/this.process = function(_CONTEXT,_VIEW) { try { with(_VIEW) { with (_CONTEXT) {"+this.out+" return ___ViewO.join('');}}}catch(e){e.lineNumber=null;throw e;}};";try{eval(to_be_evaled)}catch(e){if(typeof JSLINT!="undefined"){JSLINT(this.out);for(var i=0;i").replace(/''/g,"'")}return""}};EJS.newRequest=function(){var factories=[function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Microsoft.XMLHTTP")}];for(var i=0;i")};EJS.Helpers.prototype.start_tag_for=function(A,B){return this.tag(A,B)};EJS.Helpers.prototype.submit_tag=function(A,B){B=B||{};B.type=B.type||"submit";B.value=A||"Submit";return this.single_tag_for("input",B)};EJS.Helpers.prototype.tag=function(C,E,D){if(!D){var D=">"}var B=" ";for(var A in E){if(E[A]!=null){var F=E[A].toString()}else{var F=""}if(A=="Class"){A="class"}if(F.indexOf("'")!=-1){B+=A+'="'+F+'" '}else{B+=A+"='"+F+"' "}}return"<"+C+B+D};EJS.Helpers.prototype.tag_end=function(A){return""};EJS.Helpers.prototype.text_area_tag=function(A,C,B){B=B||{};B.id=B.id||A;B.name=B.name||A;C=C||"";if(B.size){B.cols=B.size.split("x")[0];B.rows=B.size.split("x")[1];delete B.size}B.cols=B.cols||50;B.rows=B.rows||4;return this.start_tag_for("textarea",B)+C+this.tag_end("textarea")};EJS.Helpers.prototype.text_tag=EJS.Helpers.prototype.text_area_tag;EJS.Helpers.prototype.text_field_tag=function(A,C,B){return this.input_field_tag(A,C,"text",B)};EJS.Helpers.prototype.url_for=function(A){return'window.location="'+A+'";'};EJS.Helpers.prototype.img_tag=function(B,C,A){A=A||{};A.src=B;A.alt=C;return this.single_tag_for("img",A)} +(function(){var rsplit=function(string,regex){var result=regex.exec(string),retArr=new Array(),first_idx,last_idx,first_bit;while(result!=null){first_idx=result.index;last_idx=regex.lastIndex;if((first_idx)!=0){first_bit=string.substring(0,first_idx);retArr.push(string.substring(0,first_idx));string=string.slice(first_idx)}retArr.push(result[0]);string=string.slice(result[0].length);result=regex.exec(string)}if(!string==""){retArr.push(string)}return retArr},chop=function(string){return string.substr(0,string.length-1)},extend=function(d,s){for(var n in s){if(s.hasOwnProperty(n)){d[n]=s[n]}}};EJS=function(options){options=typeof options=="string"?{view:options}:options;this.set_options(options);if(options.precompiled){this.template={};this.template.process=options.precompiled;EJS.update(this.name,this);return }if(options.element){if(typeof options.element=="string"){var name=options.element;options.element=document.getElementById(options.element);if(options.element==null){throw name+"does not exist!"}}if(options.element.value){this.text=options.element.value}else{this.text=options.element.innerHTML}this.name=options.element.id;this.type="["}else{if(options.url){options.url=EJS.endExt(options.url,this.extMatch);this.name=this.name?this.name:options.url;var url=options.url;var template=EJS.get(this.name,this.cache);if(template){return template}if(template==EJS.INVALID_PATH){return null}try{this.text=EJS.request(url+(this.cache?"":"?"+Math.random()))}catch(e){}if(this.text==null){throw ({type:"EJS",message:"There is no template at "+url})}}}var template=new EJS.Compiler(this.text,this.type);template.compile(options,this.name);EJS.update(this.name,this);this.template=template};EJS.prototype={render:function(object,extra_helpers){object=object||{};this._extra_helpers=extra_helpers;var v=new EJS.Helpers(object,extra_helpers||{});return this.template.process.call(object,object,v)},update:function(element,options){if(typeof element=="string"){element=document.getElementById(element)}if(options==null){_template=this;return function(object){EJS.prototype.update.call(_template,element,object)}}if(typeof options=="string"){params={};params.url=options;_template=this;params.onComplete=function(request){var object=eval(request.responseText);EJS.prototype.update.call(_template,element,object)};EJS.ajax_request(params)}else{element.innerHTML=this.render(options)}},out:function(){return this.template.out},set_options:function(options){this.type=options.type||EJS.type;this.cache=options.cache!=null?options.cache:EJS.cache;this.text=options.text||null;this.name=options.name||null;this.ext=options.ext||EJS.ext;this.extMatch=new RegExp(this.ext.replace(/\./,"."))}};EJS.endExt=function(path,match){if(!path){return null}match.lastIndex=0;return path+(match.test(path)?"":this.ext)};EJS.Scanner=function(source,left,right){extend(this,{left_delimiter:left+"%",right_delimiter:"%"+right,double_left:left+"%%",double_right:"%%"+right,left_equal:left+"%=",left_comment:left+"%#"});this.SplitRegexp=left=="["?/(\[%%)|(%%\])|(\[%=)|(\[%#)|(\[%)|(%\]\n)|(%\])|(\n)/:new RegExp("("+this.double_left+")|(%%"+this.double_right+")|("+this.left_equal+")|("+this.left_comment+")|("+this.left_delimiter+")|("+this.right_delimiter+"\n)|("+this.right_delimiter+")|(\n)");this.source=source;this.stag=null;this.lines=0};EJS.Scanner.to_text=function(input){if(input==null||input===undefined){return""}if(input instanceof Date){return input.toDateString()}if(input.toString){return input.toString()}return""};EJS.Scanner.prototype={scan:function(block){scanline=this.scanline;regex=this.SplitRegexp;if(!this.source==""){var source_split=rsplit(this.source,/\n/);for(var i=0;i0){for(var i=0;i0){buff.push(put_cmd+'"'+clean(content)+'")')}content="";break;case scanner.double_left:content=content+scanner.left_delimiter;break;default:content=content+token;break}}else{switch(token){case scanner.right_delimiter:switch(scanner.stag){case scanner.left_delimiter:if(content[content.length-1]=="\n"){content=chop(content);buff.push(content);buff.cr()}else{buff.push(content)}break;case scanner.left_equal:buff.push(insert_cmd+"(EJS.Scanner.to_text("+content+")))");break}scanner.stag=null;content="";break;case scanner.double_right:content=content+scanner.right_delimiter;break;default:content=content+token;break}}});if(content.length>0){buff.push(put_cmd+'"'+clean(content)+'")')}buff.close();this.out=buff.script+";";var to_be_evaled="/*"+name+"*/this.process = function(_CONTEXT,_VIEW) { try { with(_VIEW) { with (_CONTEXT) {"+this.out+" return ___ViewO.join('');}}}catch(e){e.lineNumber=null;throw e;}};";try{eval(to_be_evaled)}catch(e){if(typeof JSLINT!="undefined"){JSLINT(this.out);for(var i=0;i").replace(/''/g,"'")}return""}};EJS.newRequest=function(){var factories=[function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Microsoft.XMLHTTP")}];for(var i=0;i")};EJS.Helpers.prototype.start_tag_for=function(A,B){return this.tag(A,B)};EJS.Helpers.prototype.submit_tag=function(A,B){B=B||{};B.type=B.type||"submit";B.value=A||"Submit";return this.single_tag_for("input",B)};EJS.Helpers.prototype.tag=function(C,E,D){if(!D){var D=">"}var B=" ";for(var A in E){if(E[A]!=null){var F=E[A].toString()}else{var F=""}if(A=="Class"){A="class"}if(F.indexOf("'")!=-1){B+=A+'="'+F+'" '}else{B+=A+"='"+F+"' "}}return"<"+C+B+D};EJS.Helpers.prototype.tag_end=function(A){return""};EJS.Helpers.prototype.text_area_tag=function(A,C,B){B=B||{};B.id=B.id||A;B.name=B.name||A;C=C||"";if(B.size){B.cols=B.size.split("x")[0];B.rows=B.size.split("x")[1];delete B.size}B.cols=B.cols||50;B.rows=B.rows||4;return this.start_tag_for("textarea",B)+C+this.tag_end("textarea")};EJS.Helpers.prototype.text_tag=EJS.Helpers.prototype.text_area_tag;EJS.Helpers.prototype.text_field_tag=function(A,C,B){return this.input_field_tag(A,C,"text",B)};EJS.Helpers.prototype.url_for=function(A){return'window.location="'+A+'";'};EJS.Helpers.prototype.img_tag=function(B,C,A){A=A||{};A.src=B;A.alt=C;return this.single_tag_for("img",A)} \ No newline at end of file diff --git a/rabbitmq-server/deps/rabbitmq_management/priv/www/js/formatters.js b/rabbitmq-server/deps/rabbitmq_management/priv/www/js/formatters.js index 391575e..e027acd 100644 --- a/rabbitmq-server/deps/rabbitmq_management/priv/www/js/formatters.js +++ b/rabbitmq-server/deps/rabbitmq_management/priv/www/js/formatters.js @@ -7,8 +7,12 @@ PROCESS_THRESHOLDS=[[0.75, 'red'], [0.5, 'yellow']]; function fmt_string(str, unknown) { - if (unknown == undefined) unknown = UNKNOWN_REPR; - if (str == undefined) return unknown; + if (unknown == undefined) { + unknown = UNKNOWN_REPR; + } + if (str == undefined) { + return unknown; + } return fmt_escape_html("" + str); } @@ -79,9 +83,9 @@ function fmt_features(obj) { function fmt_policy_short(obj) { if (obj.policy != undefined && obj.policy != '') { - return '' + - fmt_escape_html(obj.policy) + ' '; + link_policy(obj.vhost, obj.policy) + ' '; } else { return ''; } @@ -93,14 +97,14 @@ function fmt_features_short(obj) { for (var k in ALL_ARGS) { if (features[k] != undefined) { - res += '' + ALL_ARGS[k].short + ' '; + res += '' + ALL_ARGS[k].short + ' '; } } if (features.arguments) { - res += 'Args '; + res += 'Args '; } return res; } @@ -152,15 +156,15 @@ function fmt_mirrors(queue) { }); var res = ''; if (synced.length > 0) { - res += ' +' + - synced.length + ''; + res += ' +' + + synced.length + ''; } if (synced.length == 0 && unsynced.length > 0) { - res += ' +0'; + res += ' +0'; } if (unsynced.length > 0) { - res += ' +' + unsynced.length + ''; + res += ' +' + unsynced.length + ''; } return res; } @@ -175,10 +179,10 @@ function fmt_sync_state(queue) { function fmt_channel_mode(ch) { if (ch.transactional) { - return 'T'; + return 'T'; } else if (ch.confirm) { - return 'C'; + return 'C'; } else { return ''; @@ -313,9 +317,9 @@ function fmt_exchange_type(type) { return fmt_escape_html(type); } } - return '
' + fmt_escape_html(type) + - '
'; + ''; } function fmt_exchange_url(name) { @@ -358,10 +362,10 @@ function fmt_amqp_value(val) { } else { var t = typeof(val); if (t == 'string') { - return '' + - fmt_escape_html(val) + ''; + return '' + + fmt_escape_html(val) + ''; } else { - return '' + val + ''; + return '' + val + ''; } } } @@ -414,8 +418,8 @@ function fmt_plugins_small(node) { plugins.push(application.name); } } - return '' + - plugins.length + ''; + return '' + + plugins.length + ''; } function get_plugins_list(node) { @@ -491,10 +495,7 @@ function fmt_maybe_wrap(txt, encoding) { } function fmt_node(node_host) { - var both = node_host.split('@'); - var node = both.slice(0, 1); - var host = both.slice(1); - return node == 'rabbit' ? host : (node + '@' + host); + return fmt_string(node_host); } function fmt_object_state(obj) { @@ -539,8 +540,8 @@ function fmt_object_state(obj) { function fmt_state(colour, text, explanation) { var key; if (explanation) { - key = '' + - text + ''; + key = '' + + text + ''; } else { key = text; @@ -562,8 +563,18 @@ function fmt_shortened_uri(uri) { return uri; } else { - return '' + - uri.substr(0, uri.indexOf('?')) + '?...'; + return '' + + uri.substr(0, uri.indexOf('?')) + '?...'; + } +} + +function fmt_uri_with_credentials(uri) { + if (typeof uri == 'string') { + // mask password + var mask = /^([a-zA-Z0-9+-.]+):\/\/(.*):(.*)@/; + return uri.replace(mask, "$1://$2:[redacted]@"); + } else { + return UNKNOWN_REPR; } } @@ -585,8 +596,8 @@ function fmt_client_name(properties) { function fmt_trunc(str, max_length) { return str.length > max_length ? - ('' + - fmt_escape_html(str.substring(0, max_length)) + '...') : + ('' + + fmt_escape_html(str.substring(0, max_length)) + '...') : fmt_escape_html(str); } @@ -633,7 +644,7 @@ function link_user(name) { } function link_node(name) { - return _link_to(name, '#/nodes/' + esc(name)) + return _link_to(fmt_node(name), '#/nodes/' + esc(name)) } function link_policy(vhost, name) { @@ -701,7 +712,7 @@ function filter_ui_pg(items, truncate, appendselect) { fmt_escape_html(current_filter) + '"/>' + ' (?)' + + '/> ' + ''; function items_desc(l) { @@ -775,7 +786,7 @@ function pagiante_ui(pages, context){ res += ' (?)' ; + res += fmt_regex_request(context, "") + '> ' ; res +=' ' ; res += '

'; diff --git a/rabbitmq-server/deps/rabbitmq_management/priv/www/js/global.js b/rabbitmq-server/deps/rabbitmq_management/priv/www/js/global.js index f96f9c3..fa85506 100644 --- a/rabbitmq-server/deps/rabbitmq_management/priv/www/js/global.js +++ b/rabbitmq-server/deps/rabbitmq_management/priv/www/js/global.js @@ -41,9 +41,10 @@ var NAVIGATION = {'Overview': ['#/', "management"], 'Exchanges': ['#/exchanges', "management"], 'Queues': ['#/queues', "management"], 'Admin': - [{'Users': ['#/users', "administrator"], - 'Virtual Hosts': ['#/vhosts', "administrator"], - 'Policies': ['#/policies', "management"]}, + [{'Users': ['#/users', "administrator"], + 'Virtual Hosts': ['#/vhosts', "administrator"], + 'Policies': ['#/policies', "management"], + 'Cluster': ['#/cluster-name', "administrator"]}, "management"] }; @@ -127,9 +128,359 @@ var COLUMNS = ['erlang_processes', 'Erlang processes', true], ['memory', 'Memory', true], ['disk_space', 'Disk space', true]], - 'General': [['uptime', 'Uptime', false], - ['rates_mode', 'Rates mode', true], - ['info', 'Info', true]]}}; + 'General': [['uptime', 'Uptime', true], + ['info', 'Info', true], + ['reset_stats', 'Reset stats', true]]}}; + +// All help ? popups +var HELP = { + 'exchange-auto-delete': + 'If yes, the exchange will delete itself after at least one queue or exchange has been bound to this one, and then all queues or exchanges have been unbound.', + + 'exchange-internal': + 'If yes, clients cannot publish to this exchange directly. It can only be used with exchange to exchange bindings.', + + 'exchange-alternate': + 'If messages to this exchange cannot otherwise be routed, send them to the alternate exchange named here.
(Sets the "alternate-exchange" argument.)', + + 'queue-message-ttl': + 'How long a message published to a queue can live before it is discarded (milliseconds).
(Sets the "x-message-ttl" argument.)', + + 'queue-expires': + 'How long a queue can be unused for before it is automatically deleted (milliseconds).
(Sets the "x-expires" argument.)', + + 'queue-max-length': + 'How many (ready) messages a queue can contain before it starts to drop them from its head.
(Sets the "x-max-length" argument.)', + + 'queue-max-length-bytes': + 'Total body size for ready messages a queue can contain before it starts to drop them from its head.
(Sets the "x-max-length-bytes" argument.)', + + 'queue-auto-delete': + 'If yes, the queue will delete itself after at least one consumer has connected, and then all consumers have disconnected.', + + 'queue-dead-letter-exchange': + 'Optional name of an exchange to which messages will be republished if they are rejected or expire.
(Sets the "x-dead-letter-exchange" argument.)', + + 'queue-dead-letter-routing-key': + 'Optional replacement routing key to use when a message is dead-lettered. If this is not set, the message\'s original routing key will be used.
(Sets the "x-dead-letter-routing-key" argument.)', + + 'queue-max-priority': + 'Maximum number of priority levels for the queue to support; if not set, the queue will not support message priorities.
(Sets the "x-max-priority" argument.)', + + 'queue-lazy': + 'Set the queue into lazy mode, keeping as many messages as possible on disk to reduce RAM usage; if not set, the queue will keep an in-memory cache to deliver messages as fast as possible.
(Sets the "x-queue-mode" argument.)', + + 'queue-master-locator': + 'Set the queue into master location mode, determining the rule by which the queue master is located when declared on a cluster of nodes.
(Sets the "x-queue-master-locator" argument.)', + + 'queue-messages': + '

Message counts.

Note that "in memory" and "persistent" are not mutually exclusive; persistent messages can be in memory as well as on disc, and transient messages can be paged out if memory is tight. Non-durable queues will consider all messages to be transient.

', + + 'queue-message-body-bytes': + '

The sum total of the sizes of the message bodies in this queue. This only counts message bodies; it does not include message properties (including headers) or metadata used by the queue.

Note that "in memory" and "persistent" are not mutually exclusive; persistent messages can be in memory as well as on disc, and transient messages can be paged out if memory is tight. Non-durable queues will consider all messages to be transient.

If a message is routed to multiple queues on publication, its body will be stored only once (in memory and on disk) and shared between queues. The value shown here does not take account of this effect.

', + + 'queue-process-memory': + 'Total memory used by this queue process. This does not include in-memory message bodies (which may be shared between queues and will appear in the global "binaries" memory) but does include everything else.', + + 'queue-consumer-utilisation': + 'Fraction of the time that the queue is able to immediately deliver messages to consumers. If this number is less than 100% you may be able to deliver messages faster if: \ +
    \ +
  • There were more consumers or
  • \ +
  • The consumers were faster or
  • \ +
  • The consumers had a higher prefetch count
  • \ +
', + + 'internal-users-only': + 'Only users within the internal RabbitMQ database are shown here. Other users (e.g. those authenticated over LDAP) will not appear.', + + 'export-definitions': + 'The definitions consist of users, virtual hosts, permissions, parameters, exchanges, queues and bindings. They do not include the contents of queues or the cluster name. Exclusive queues will not be exported.', + + 'export-definitions-vhost': + 'The definitions exported for a single virtual host consist of exchanges, queues, bindings and policies.', + + 'import-definitions': + 'The definitions that are imported will be merged with the current definitions. If an error occurs during import, any changes made will not be rolled back.', + + 'import-definitions-vhost': + 'For a single virtual host, only exchanges, queues, bindings and policies are imported.', + + 'exchange-rates-incoming': + 'The incoming rate is the rate at which messages are published directly to this exchange.', + + 'exchange-rates-outgoing': + 'The outgoing rate is the rate at which messages enter queues, having been published directly to this exchange.', + + 'channel-mode': + 'Channel guarantee mode. Can be one of the following, or neither:
\ +
\ +
Cconfirm
\ +
Channel will send streaming publish confirmations.
\ +
Ttransactional
\ +
Channel is transactional.
\ +
', + + 'channel-prefetch': + 'Channel prefetch counts. \ +

\ + Each channel can have two prefetch counts: A per-consumer count, which \ + will limit each new consumer created on the channel, and a global \ + count, which is shared between all consumers on the channel.\ +

\ +

\ + This column shows one, the other, or both limits if they are set. \ +

', + + 'file-descriptors': + '

File descriptor count and limit, as reported by the operating \ + system. The count includes network sockets and file handles.

\ +

To optimize disk access RabbitMQ uses as many free descriptors as are \ + available, so the count may safely approach the limit. \ + However, if most of the file descriptors are used by sockets then \ + persister performance will be negatively impacted.

\ +

To change the limit on Unix / Linux, use "ulimit -n". To change \ + the limit on Windows, set the ERL_MAX_PORTS environment variable

\ +

To report used file handles on Windows, handle.exe from \ + sysinternals must be installed in your path. You can download it \ + here.

', + + 'socket-descriptors': + 'The network sockets count and limit managed by RabbitMQ.
\ + When the limit is exhausted RabbitMQ will stop accepting new \ + network connections.', + + 'memory-alarm': + '

The memory \ + alarm for this node has gone off. It will block \ + incoming network traffic until the memory usage drops below \ + the watermark.

\ +

Note that the pale line in this case indicates the high watermark \ + in relation to how much memory is used in total.

', + + 'disk-free-alarm': + 'The disk \ + free space alarm for this node has gone off. It will block \ + incoming network traffic until the amount of free space exceeds \ + the limit.', + + 'message-get-requeue': + '

Clicking "Get Message(s)" will consume messages from the queue. \ + If requeue is set the message will be put back into the queue in place, \ + but "redelivered" will be set on the message.

\ +

If requeue is not set messages will be removed from the queue.

\ +

Furthermore, message payloads will be truncated to 50000 bytes.

', + + 'message-publish-headers': + 'Headers can have any name. Only long string headers can be set here.', + + 'message-publish-properties': + '

You can set other message properties here (delivery mode and headers \ + are pulled out as the most common cases).

\ +

Invalid properties will be ignored. Valid properties are:

\ +
    \ +
  • content_type
  • \ +
  • content_encoding
  • \ +
  • priority
  • \ +
  • correlation_id
  • \ +
  • reply_to
  • \ +
  • expiration
  • \ +
  • message_id
  • \ +
  • timestamp
  • \ +
  • type
  • \ +
  • user_id
  • \ +
  • app_id
  • \ +
  • cluster_id
  • \ +
', + + 'string-base64': + '

AMQP message payloads can contain any binary content. They can \ + therefore be difficult to display in a browser. The options here \ + have the following meanings:

\ +
\ +
Auto string / base64
\ +
If the message payload can be interpreted as a string in UTF-8 \ + encoding, do so. Otherwise return the payload encoded as \ + base64.
\ +
base64
\ +
Return the payload encoded as base64 unconditionally.
\ +
', + + 'user-tags': + 'Comma-separated list of tags to apply to the user. Currently \ + supported \ + by the management plugin: \ +
\ +
management
\ +
\ + User can access the management plugin \ +
\ +
policymaker
\ +
\ + User can access the management plugin and manage policies and \ + parameters for the vhosts they have access to. \ +
\ +
monitoring
\ +
\ + User can access the management plugin and see all connections and \ + channels as well as node-related information. \ +
\ +
administrator
\ +
\ + User can do everything monitoring can do, manage users, \ + vhosts and permissions, close other user\'s connections, and manage \ + policies and parameters for all vhosts. \ +
\ +
\ +

\ + Note that you can set any tag here; the links for the above four \ + tags are just for convenience. \ +

', + + 'queued-messages': + '
\ +
Ready
\ +
Number of messages that are available to be delivered now.
\ +
Unacknowledged
\ +
Number of messages for which the server is waiting for acknowledgement.
\ +
Total
\ +
The total of these two numbers.
\ +
', + + 'message-rates': + 'Only rates for which some activity is taking place will be shown.\ +
\ +
Publish
\ +
Rate at which messages are entering the server.
\ +
Publisher confirm
\ +
Rate at which the server is confirming publishes.
\ +
Deliver (manual ack)
\ +
Rate at which messages are delivered to consumers that use manual acknowledgements.
\ +
Deliver (auto ack)
\ +
Rate at which messages are delivered to consumers that use automatic acknowledgements.
\ +
Consumer ack
\ +
Rate at which messages are being acknowledged by consumers.
\ +
Redelivered
\ +
Rate at which messages with the \'redelivered\' flag set are being delivered. Note that these messages will also be counted in one of the delivery rates above.
\ +
Get (manual ack)
\ +
Rate at which messages requiring acknowledgement are being delivered in response to basic.get.
\ +
Get (auto ack)
\ +
Rate at which messages not requiring acknowledgement are being delivered in response to basic.get.
\ +
Return
\ +
Rate at which basic.return is sent to publishers for unroutable messages published with the \'mandatory\' flag set.
\ +
Disk read
\ +
Rate at which queues read messages from disk.
\ +
Disk write
\ +
Rate at which queues write messages to disk.
\ +
\ +

\ + Note that the last two items are originate in queues rather than \ + channels; they may therefore be slightly out of sync with other \ + statistics.\ +

', + + 'disk-monitoring-no-watermark' : 'There is no disk space low watermark set. RabbitMQ will not take any action to avoid running out of disk space.', + + 'resource-counts' : 'Shows total number of objects for all virtual hosts the current user has access to.', + + 'memory-use' : '

Note that the memory details shown here are only updated on request - they could be too expensive to calculate every few seconds on a busy server.

Read more on memory use.

', + + 'binary-use' : '

Binary accounting is not exact; binaries are shared between processes (and thus the same binary might be counted in more than one section), and the VM does not allow us to track binaries that are not associated with processes (so some binary use might not appear at all).

', + + 'policy-ha-mode' : 'One of all (mirror to all nodes in the cluster), exactly (mirror to a set number of nodes) or nodes (mirror to an explicit list of nodes). If you choose one of the latter two, you must also set ha-params.', + + 'policy-ha-params' : 'Absent if ha-mode is all, a number\ + if ha-mode is exactly, or a list\ + of strings if ha-mode is nodes.', + + 'policy-ha-sync-mode' : 'One of manual or automatic.', + + 'policy-federation-upstream-set' : + 'A string; only if the federation plugin is enabled. Chooses the name of a set of upstreams to use with federation, or "all" to use all upstreams. Incompatible with federation-upstream.', + + 'policy-federation-upstream' : + 'A string; only if the federation plugin is enabled. Chooses a specific upstream set to use for federation. Incompatible with federation-upstream-set.', + + 'handle-exe' : 'In order to monitor the number of file descriptors in use on Windows, RabbitMQ needs the handle.exe command line tool from Microsoft. Download it and place it in the path (e.g. in C:\Windows).', + + 'filter-regex' : + 'Whether to enable regular expression matching. Both string literals \ + and regular expressions are matched in a case-insensitive manner.

\ + (Regular expression reference)', + + 'plugins' : + 'Note that only plugins which are both explicitly enabled and running are shown here.', + + 'io-operations': + 'Rate of I/O operations. Only operations performed by the message \ + persister are shown here (e.g. metadata changes in Mnesia or writes \ + to the log files are not shown).\ +
\ +
Read
\ +
Rate at which data is read from the disk.
\ +
Write
\ +
Rate at which data is written to the disk.
\ +
Seek
\ +
Rate at which the broker switches position while reading or \ + writing to disk.
\ +
Sync
\ +
Rate at which the broker invokes fsync() to ensure \ + data is flushed to disk.
\ +
Reopen
\ +
Rate at which the broker recycles file handles in order to support \ + more queues than it has file handles. If this operation is occurring \ + frequently you may get a performance boost from increasing the number \ + of file handles available.
\ +
', + + 'mnesia-transactions': + 'Rate at which Mnesia transactions are initiated on this node (this node \ + will also take part in Mnesia transactions initiated on other nodes).\ +
\ +
RAM only
\ +
Rate at which RAM-only transactions take place (e.g. creation / \ + deletion of transient queues).
\ +
Disk
\ +
Rate at which disk (and RAM) transactions take place (.e.g \ + creation / deletion of durable queues).
\ +
', + + 'persister-operations-msg': + 'Rate at which per-message persister operations take place on this node. See \ + here \ + for more information on the persister. \ +
\ +
QI Journal
\ +
Rate at which message information (publishes, deliveries and \ + acknowledgements) is written to queue index journals.
\ +
Store Read
\ +
Rate at which messages are read from the message store.
\ +
Store Write
\ +
Rate at which messages are written to the message store.
\ +
', + + 'persister-operations-bulk': + 'Rate at which whole-file persister operations take place on this node. See \ + here \ + for more information on the persister. \ +
\ +
QI Read
\ +
Rate at which queue index segment files are read.
\ +
QI Write
\ +
Rate at which queue index segment files are written.
\ +
', + + 'gc-operations': + 'Rate at which garbage collection operations take place on this node.', + + 'gc-bytes': + 'Rate at which memory is reclaimed by the garbage collector on this node.', + + 'context-switches-operations': + 'Rate at which runtime context switching takes place on this node.', + + 'process-reductions': + 'Rate at which reductions take place on this process.' +}; /////////////////////////////////////////////////////////////////////////// // // @@ -170,15 +521,22 @@ function setup_global_vars() { user_administrator = jQuery.inArray("administrator", user_tags) != -1; is_user_policymaker = jQuery.inArray("policymaker", user_tags) != -1; user_monitor = jQuery.inArray("monitoring", user_tags) != -1; - replace_content('login-details', - '

User: ' + fmt_escape_html(user.name) + '

' + - '

Cluster: ' + fmt_escape_html(overview.cluster_name) + ' ' + - (user_administrator ? - '(change)' : '') + '

' + - '

RabbitMQ ' + fmt_escape_html(overview.rabbitmq_version) + - ', Erlang ' + - fmt_escape_html(overview.erlang_version) + '

'); + exchange_types = overview.exchange_types.map(function(xt) { return xt.name; }); + + cluster_name = fmt_escape_html(overview.cluster_name); + $('#logout').before( + '
  • Cluster ' + (user_administrator ? '' + cluster_name + '' : cluster_name) + '
  • ' + ); + + user_name = fmt_escape_html(user.name); + $('#header #logout').prepend( + 'User ' + (user_administrator ? '' + user_name + '' : user_name) + ); + + $('#versions').html( + '' + fmt_escape_html(overview.rabbitmq_version) + '' + + 'Erlang ' + fmt_escape_html(overview.erlang_version) + '' + ); nodes_interesting = false; rabbit_versions_interesting = false; if (user_monitor) { diff --git a/rabbitmq-server/deps/rabbitmq_management/priv/www/js/help.js b/rabbitmq-server/deps/rabbitmq_management/priv/www/js/help.js deleted file mode 100644 index eab13f0..0000000 --- a/rabbitmq-server/deps/rabbitmq_management/priv/www/js/help.js +++ /dev/null @@ -1,354 +0,0 @@ -HELP = { - 'exchange-auto-delete': - 'If yes, the exchange will delete itself after at least one queue or exchange has been bound to this one, and then all queues or exchanges have been unbound.', - - 'exchange-internal': - 'If yes, clients cannot publish to this exchange directly. It can only be used with exchange to exchange bindings.', - - 'exchange-alternate': - 'If messages to this exchange cannot otherwise be routed, send them to the alternate exchange named here.
    (Sets the "alternate-exchange" argument.)', - - 'queue-message-ttl': - 'How long a message published to a queue can live before it is discarded (milliseconds).
    (Sets the "x-message-ttl" argument.)', - - 'queue-expires': - 'How long a queue can be unused for before it is automatically deleted (milliseconds).
    (Sets the "x-expires" argument.)', - - 'queue-max-length': - 'How many (ready) messages a queue can contain before it starts to drop them from its head.
    (Sets the "x-max-length" argument.)', - - 'queue-max-length-bytes': - 'Total body size for ready messages a queue can contain before it starts to drop them from its head.
    (Sets the "x-max-length-bytes" argument.)', - - 'queue-auto-delete': - 'If yes, the queue will delete itself after at least one consumer has connected, and then all consumers have disconnected.', - - 'queue-dead-letter-exchange': - 'Optional name of an exchange to which messages will be republished if they are rejected or expire.
    (Sets the "x-dead-letter-exchange" argument.)', - - 'queue-dead-letter-routing-key': - 'Optional replacement routing key to use when a message is dead-lettered. If this is not set, the message\'s original routing key will be used.
    (Sets the "x-dead-letter-routing-key" argument.)', - - 'queue-max-priority': - 'Maximum number of priority levels for the queue to support; if not set, the queue will not support message priorities.
    (Sets the "x-max-priority" argument.)', - - 'queue-lazy': - 'Set the queue into lazy mode, keeping as many messages as possible on disk to reduce RAM usage; if not set, the queue will keep an in-memory cache to deliver messages as fast as possible.
    (Sets the "x-queue-mode" argument.)', - - 'queue-master-locator': - 'Set the queue into master location mode, determining the rule by which the queue master is located when declared on a cluster of nodes.
    (Sets the "x-queue-master-locator" argument.)', - - 'queue-messages': - '

    Message counts.

    Note that "in memory" and "persistent" are not mutually exclusive; persistent messages can be in memory as well as on disc, and transient messages can be paged out if memory is tight. Non-durable queues will consider all messages to be transient.

    ', - - 'queue-message-body-bytes': - '

    The sum total of the sizes of the message bodies in this queue. This only counts message bodies; it does not include message properties (including headers) or metadata used by the queue.

    Note that "in memory" and "persistent" are not mutually exclusive; persistent messages can be in memory as well as on disc, and transient messages can be paged out if memory is tight. Non-durable queues will consider all messages to be transient.

    If a message is routed to multiple queues on publication, its body will be stored only once (in memory and on disk) and shared between queues. The value shown here does not take account of this effect.

    ', - - 'queue-process-memory': - 'Total memory used by this queue process. This does not include in-memory message bodies (which may be shared between queues and will appear in the global "binaries" memory) but does include everything else.', - - 'queue-consumer-utilisation': - 'Fraction of the time that the queue is able to immediately deliver messages to consumers. If this number is less than 100% you may be able to deliver messages faster if: \ -
      \ -
    • There were more consumers or
    • \ -
    • The consumers were faster or
    • \ -
    • The consumers had a higher prefetch count
    • \ -
    ', - - 'internal-users-only': - 'Only users within the internal RabbitMQ database are shown here. Other users (e.g. those authenticated over LDAP) will not appear.', - - 'export-definitions': - 'The definitions consist of users, virtual hosts, permissions, parameters, exchanges, queues and bindings. They do not include the contents of queues or the cluster name. Exclusive queues will not be exported.', - - 'export-definitions-vhost': - 'The definitions exported for a single virtual host consist of exchanges, queues, bindings and policies.', - - 'import-definitions': - 'The definitions that are imported will be merged with the current definitions. If an error occurs during import, any changes made will not be rolled back.', - - 'import-definitions-vhost': - 'For a single virtual host, only exchanges, queues, bindings and policies are imported.', - - 'exchange-rates-incoming': - 'The incoming rate is the rate at which messages are published directly to this exchange.', - - 'exchange-rates-outgoing': - 'The outgoing rate is the rate at which messages enter queues, having been published directly to this exchange.', - - 'channel-mode': - 'Channel guarantee mode. Can be one of the following, or neither:
    \ -
    \ -
    Cconfirm
    \ -
    Channel will send streaming publish confirmations.
    \ -
    Ttransactional
    \ -
    Channel is transactional.
    \ -
    ', - - 'channel-prefetch': - 'Channel prefetch counts. \ -

    \ - Each channel can have two prefetch counts: A per-consumer count, which \ - will limit each new consumer created on the channel, and a global \ - count, which is shared between all consumers on the channel.\ -

    \ -

    \ - This column shows one, the other, or both limits if they are set. \ -

    ', - - 'file-descriptors': - '

    File descriptor count and limit, as reported by the operating \ - system. The count includes network sockets and file handles.

    \ -

    To optimize disk access RabbitMQ uses as many free descriptors as are \ - available, so the count may safely approach the limit. \ - However, if most of the file descriptors are used by sockets then \ - persister performance will be negatively impacted.

    \ -

    To change the limit on Unix / Linux, use "ulimit -n". To change \ - the limit on Windows, set the ERL_MAX_PORTS environment variable

    \ -

    To report used file handles on Windows, handle.exe from \ - sysinternals must be installed in your path. You can download it \ - here.

    ', - - 'socket-descriptors': - 'The network sockets count and limit managed by RabbitMQ.
    \ - When the limit is exhausted RabbitMQ will stop accepting new \ - network connections.', - - 'memory-alarm': - '

    The memory \ - alarm for this node has gone off. It will block \ - incoming network traffic until the memory usage drops below \ - the watermark.

    \ -

    Note that the pale line in this case indicates the high watermark \ - in relation to how much memory is used in total.

    ', - - 'disk-free-alarm': - 'The disk \ - free space alarm for this node has gone off. It will block \ - incoming network traffic until the amount of free space exceeds \ - the limit.', - - 'message-get-requeue': - '

    Clicking "Get Message(s)" will consume messages from the queue. \ - If requeue is set the message will be put back into the queue in place, \ - but "redelivered" will be set on the message.

    \ -

    If requeue is not set messages will be removed from the queue.

    \ -

    Furthermore, message payloads will be truncated to 50000 bytes.

    ', - - 'message-publish-headers': - 'Headers can have any name. Only long string headers can be set here.', - - 'message-publish-properties': - '

    You can set other message properties here (delivery mode and headers \ - are pulled out as the most common cases).

    \ -

    Invalid properties will be ignored. Valid properties are:

    \ -
      \ -
    • content_type
    • \ -
    • content_encoding
    • \ -
    • priority
    • \ -
    • correlation_id
    • \ -
    • reply_to
    • \ -
    • expiration
    • \ -
    • message_id
    • \ -
    • timestamp
    • \ -
    • type
    • \ -
    • user_id
    • \ -
    • app_id
    • \ -
    • cluster_id
    • \ -
    ', - - 'string-base64': - '

    AMQP message payloads can contain any binary content. They can \ - therefore be difficult to display in a browser. The options here \ - have the following meanings:

    \ -
    \ -
    Auto string / base64
    \ -
    If the message payload can be interpreted as a string in UTF-8 \ - encoding, do so. Otherwise return the payload encoded as \ - base64.
    \ -
    base64
    \ -
    Return the payload encoded as base64 unconditionally.
    \ -
    ', - - 'user-tags': - 'Comma-separated list of tags to apply to the user. Currently \ - supported \ - by the management plugin: \ -
    \ -
    management
    \ -
    \ - User can access the management plugin \ -
    \ -
    policymaker
    \ -
    \ - User can access the management plugin and manage policies and \ - parameters for the vhosts they have access to. \ -
    \ -
    monitoring
    \ -
    \ - User can access the management plugin and see all connections and \ - channels as well as node-related information. \ -
    \ -
    administrator
    \ -
    \ - User can do everything monitoring can do, manage users, \ - vhosts and permissions, close other user\'s connections, and manage \ - policies and parameters for all vhosts. \ -
    \ -
    \ -

    \ - Note that you can set any tag here; the links for the above four \ - tags are just for convenience. \ -

    ', - - 'queued-messages': - '
    \ -
    Ready
    \ -
    Number of messages that are available to be delivered now.
    \ -
    Unacknowledged
    \ -
    Number of messages for which the server is waiting for acknowledgement.
    \ -
    Total
    \ -
    The total of these two numbers.
    \ -
    ', - - 'message-rates': - 'Only rates for which some activity is taking place will be shown.\ -
    \ -
    Publish
    \ -
    Rate at which messages are entering the server.
    \ -
    Publisher confirm
    \ -
    Rate at which the server is confirming publishes.
    \ -
    Deliver (manual ack)
    \ -
    Rate at which messages are delivered to consumers that use manual acknowledgements.
    \ -
    Deliver (auto ack)
    \ -
    Rate at which messages are delivered to consumers that use automatic acknowledgements.
    \ -
    Consumer ack
    \ -
    Rate at which messages are being acknowledged by consumers.
    \ -
    Redelivered
    \ -
    Rate at which messages with the \'redelivered\' flag set are being delivered. Note that these messages will also be counted in one of the delivery rates above.
    \ -
    Get (manual ack)
    \ -
    Rate at which messages requiring acknowledgement are being delivered in response to basic.get.
    \ -
    Get (auto ack)
    \ -
    Rate at which messages not requiring acknowledgement are being delivered in response to basic.get.
    \ -
    Return
    \ -
    Rate at which basic.return is sent to publishers for unroutable messages published with the \'mandatory\' flag set.
    \ -
    Disk read
    \ -
    Rate at which queues read messages from disk.
    \ -
    Disk write
    \ -
    Rate at which queues write messages to disk.
    \ -
    \ -

    \ - Note that the last two items are originate in queues rather than \ - channels; they may therefore be slightly out of sync with other \ - statistics.\ -

    ', - - 'disk-monitoring-no-watermark' : 'There is no disk space low watermark set. RabbitMQ will not take any action to avoid running out of disk space.', - - 'resource-counts' : 'Shows total number of objects for all virtual hosts the current user has access to.', - - 'memory-use' : '

    Note that the memory details shown here are only updated on request - they could be too expensive to calculate every few seconds on a busy server.

    Read more on memory use.

    ', - - 'binary-use' : '

    Binary accounting is not exact; binaries are shared between processes (and thus the same binary might be counted in more than one section), and the VM does not allow us to track binaries that are not associated with processes (so some binary use might not appear at all).

    ', - - 'policy-ha-mode' : 'One of all (mirror to all nodes in the cluster), exactly (mirror to a set number of nodes) or nodes (mirror to an explicit list of nodes). If you choose one of the latter two, you must also set ha-params.', - - 'policy-ha-params' : 'Absent if ha-mode is all, a number\ - if ha-mode is exactly, or a list\ - of strings if ha-mode is nodes.', - - 'policy-ha-sync-mode' : 'One of manual or automatic.', - - 'policy-federation-upstream-set' : - 'A string; only if the federation plugin is enabled. Chooses the name of a set of upstreams to use with federation, or "all" to use all upstreams. Incompatible with federation-upstream.', - - 'policy-federation-upstream' : - 'A string; only if the federation plugin is enabled. Chooses a specific upstream set to use for federation. Incompatible with federation-upstream-set.', - - 'handle-exe' : 'In order to monitor the number of file descriptors in use on Windows, RabbitMQ needs the handle.exe command line tool from Microsoft. Download it and place it in the path (e.g. in C:\Windows).', - - 'filter-regex' : - 'Whether to enable regular expression matching. Both string literals \ - and regular expressions are matched in a case-insensitive manner.

    \ - (Regular expression reference)', - - 'plugins' : - 'Note that only plugins which are both explicitly enabled and running are shown here.', - - 'io-operations': - 'Rate of I/O operations. Only operations performed by the message \ - persister are shown here (e.g. metadata changes in Mnesia or writes \ - to the log files are not shown).\ -
    \ -
    Read
    \ -
    Rate at which data is read from the disk.
    \ -
    Write
    \ -
    Rate at which data is written to the disk.
    \ -
    Seek
    \ -
    Rate at which the broker switches position while reading or \ - writing to disk.
    \ -
    Sync
    \ -
    Rate at which the broker invokes fsync() to ensure \ - data is flushed to disk.
    \ -
    Reopen
    \ -
    Rate at which the broker recycles file handles in order to support \ - more queues than it has file handles. If this operation is occurring \ - frequently you may get a performance boost from increasing the number \ - of file handles available.
    \ -
    ', - - 'mnesia-transactions': - 'Rate at which Mnesia transactions are initiated on this node (this node \ - will also take part in Mnesia transactions initiated on other nodes).\ -
    \ -
    RAM only
    \ -
    Rate at which RAM-only transactions take place (e.g. creation / \ - deletion of transient queues).
    \ -
    Disk
    \ -
    Rate at which disk (and RAM) transactions take place (.e.g \ - creation / deletion of durable queues).
    \ -
    ', - - 'persister-operations-msg': - 'Rate at which per-message persister operations take place on this node. See \ - here \ - for more information on the persister. \ -
    \ -
    QI Journal
    \ -
    Rate at which message information (publishes, deliveries and \ - acknowledgements) is written to queue index journals.
    \ -
    Store Read
    \ -
    Rate at which messages are read from the message store.
    \ -
    Store Write
    \ -
    Rate at which messages are written to the message store.
    \ -
    ', - - 'persister-operations-bulk': - 'Rate at which whole-file persister operations take place on this node. See \ - here \ - for more information on the persister. \ -
    \ -
    QI Read
    \ -
    Rate at which queue index segment files are read.
    \ -
    QI Write
    \ -
    Rate at which queue index segment files are written.
    \ -
    ', - - 'gc-operations': - 'Rate at which garbage collection operations take place on this node.', - - 'gc-bytes': - 'Rate at which memory is reclaimed by the garbage collector on this node.', - - 'context-switches-operations': - 'Rate at which runtime context switching takes place on this node.', - - 'process-reductions': - 'Rate at which reductions take place on this process.', - - 'foo': 'foo' // No comma. -}; - -function help(id) { - show_popup('help', HELP[id]); -} diff --git a/rabbitmq-server/deps/rabbitmq_management/priv/www/js/jquery-1.12.4.js b/rabbitmq-server/deps/rabbitmq_management/priv/www/js/jquery-1.12.4.js new file mode 100644 index 0000000..7fc60fc --- /dev/null +++ b/rabbitmq-server/deps/rabbitmq_management/priv/www/js/jquery-1.12.4.js @@ -0,0 +1,11008 @@ +/*! + * jQuery JavaScript Library v1.12.4 + * http://jquery.com/ + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-05-20T17:17Z + */ + +(function( global, factory ) { + + if ( typeof module === "object" && typeof module.exports === "object" ) { + // For CommonJS and CommonJS-like environments where a proper `window` + // is present, execute the factory and get jQuery. + // For environments that do not have a `window` with a `document` + // (such as Node.js), expose a factory as module.exports. + // This accentuates the need for the creation of a real `window`. + // e.g. var jQuery = require("jquery")(window); + // See ticket #14549 for more info. + module.exports = global.document ? + factory( global, true ) : + function( w ) { + if ( !w.document ) { + throw new Error( "jQuery requires a window with a document" ); + } + return factory( w ); + }; + } else { + factory( global ); + } + +// Pass this if window is not defined yet +}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { + +// Support: Firefox 18+ +// Can't be in strict mode, several libs including ASP.NET trace +// the stack via arguments.caller.callee and Firefox dies if +// you try to trace through "use strict" call chains. (#13335) +//"use strict"; +var deletedIds = []; + +var document = window.document; + +var slice = deletedIds.slice; + +var concat = deletedIds.concat; + +var push = deletedIds.push; + +var indexOf = deletedIds.indexOf; + +var class2type = {}; + +var toString = class2type.toString; + +var hasOwn = class2type.hasOwnProperty; + +var support = {}; + + + +var + version = "1.12.4", + + // Define a local copy of jQuery + jQuery = function( selector, context ) { + + // The jQuery object is actually just the init constructor 'enhanced' + // Need init if jQuery is called (just allow error to be thrown if not included) + return new jQuery.fn.init( selector, context ); + }, + + // Support: Android<4.1, IE<9 + // Make sure we trim BOM and NBSP + rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, + + // Matches dashed string for camelizing + rmsPrefix = /^-ms-/, + rdashAlpha = /-([\da-z])/gi, + + // Used by jQuery.camelCase as callback to replace() + fcamelCase = function( all, letter ) { + return letter.toUpperCase(); + }; + +jQuery.fn = jQuery.prototype = { + + // The current version of jQuery being used + jquery: version, + + constructor: jQuery, + + // Start with an empty selector + selector: "", + + // The default length of a jQuery object is 0 + length: 0, + + toArray: function() { + return slice.call( this ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num != null ? + + // Return just the one element from the set + ( num < 0 ? this[ num + this.length ] : this[ num ] ) : + + // Return all the elements in a clean array + slice.call( this ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems ) { + + // Build a new jQuery matched element set + var ret = jQuery.merge( this.constructor(), elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + ret.context = this.context; + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + each: function( callback ) { + return jQuery.each( this, callback ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map( this, function( elem, i ) { + return callback.call( elem, i, elem ); + } ) ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ) ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + eq: function( i ) { + var len = this.length, + j = +i + ( i < 0 ? len : 0 ); + return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); + }, + + end: function() { + return this.prevObject || this.constructor(); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: deletedIds.sort, + splice: deletedIds.splice +}; + +jQuery.extend = jQuery.fn.extend = function() { + var src, copyIsArray, copy, name, options, clone, + target = arguments[ 0 ] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + + // skip the boolean and the target + target = arguments[ i ] || {}; + i++; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction( target ) ) { + target = {}; + } + + // extend jQuery itself if only one argument is passed + if ( i === length ) { + target = this; + i--; + } + + for ( ; i < length; i++ ) { + + // Only deal with non-null/undefined values + if ( ( options = arguments[ i ] ) != null ) { + + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject( copy ) || + ( copyIsArray = jQuery.isArray( copy ) ) ) ) { + + if ( copyIsArray ) { + copyIsArray = false; + clone = src && jQuery.isArray( src ) ? src : []; + + } else { + clone = src && jQuery.isPlainObject( src ) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend( { + + // Unique for each copy of jQuery on the page + expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), + + // Assume jQuery is ready without the ready module + isReady: true, + + error: function( msg ) { + throw new Error( msg ); + }, + + noop: function() {}, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return jQuery.type( obj ) === "function"; + }, + + isArray: Array.isArray || function( obj ) { + return jQuery.type( obj ) === "array"; + }, + + isWindow: function( obj ) { + /* jshint eqeqeq: false */ + return obj != null && obj == obj.window; + }, + + isNumeric: function( obj ) { + + // parseFloat NaNs numeric-cast false positives (null|true|false|"") + // ...but misinterprets leading-number strings, particularly hex literals ("0x...") + // subtraction forces infinities to NaN + // adding 1 corrects loss of precision from parseFloat (#15100) + var realStringObj = obj && obj.toString(); + return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0; + }, + + isEmptyObject: function( obj ) { + var name; + for ( name in obj ) { + return false; + } + return true; + }, + + isPlainObject: function( obj ) { + var key; + + // Must be an Object. + // Because of IE, we also have to check the presence of the constructor property. + // Make sure that DOM nodes and window objects don't pass through, as well + if ( !obj || jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { + return false; + } + + try { + + // Not own constructor property must be Object + if ( obj.constructor && + !hasOwn.call( obj, "constructor" ) && + !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) { + return false; + } + } catch ( e ) { + + // IE8,9 Will throw exceptions on certain host objects #9897 + return false; + } + + // Support: IE<9 + // Handle iteration over inherited properties before own properties. + if ( !support.ownFirst ) { + for ( key in obj ) { + return hasOwn.call( obj, key ); + } + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + for ( key in obj ) {} + + return key === undefined || hasOwn.call( obj, key ); + }, + + type: function( obj ) { + if ( obj == null ) { + return obj + ""; + } + return typeof obj === "object" || typeof obj === "function" ? + class2type[ toString.call( obj ) ] || "object" : + typeof obj; + }, + + // Workarounds based on findings by Jim Driscoll + // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context + globalEval: function( data ) { + if ( data && jQuery.trim( data ) ) { + + // We use execScript on Internet Explorer + // We use an anonymous function so that context is window + // rather than jQuery in Firefox + ( window.execScript || function( data ) { + window[ "eval" ].call( window, data ); // jscs:ignore requireDotNotation + } )( data ); + } + }, + + // Convert dashed to camelCase; used by the css and data modules + // Microsoft forgot to hump their vendor prefix (#9572) + camelCase: function( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + }, + + each: function( obj, callback ) { + var length, i = 0; + + if ( isArrayLike( obj ) ) { + length = obj.length; + for ( ; i < length; i++ ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } else { + for ( i in obj ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } + + return obj; + }, + + // Support: Android<4.1, IE<9 + trim: function( text ) { + return text == null ? + "" : + ( text + "" ).replace( rtrim, "" ); + }, + + // results is for internal usage only + makeArray: function( arr, results ) { + var ret = results || []; + + if ( arr != null ) { + if ( isArrayLike( Object( arr ) ) ) { + jQuery.merge( ret, + typeof arr === "string" ? + [ arr ] : arr + ); + } else { + push.call( ret, arr ); + } + } + + return ret; + }, + + inArray: function( elem, arr, i ) { + var len; + + if ( arr ) { + if ( indexOf ) { + return indexOf.call( arr, elem, i ); + } + + len = arr.length; + i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; + + for ( ; i < len; i++ ) { + + // Skip accessing in sparse arrays + if ( i in arr && arr[ i ] === elem ) { + return i; + } + } + } + + return -1; + }, + + merge: function( first, second ) { + var len = +second.length, + j = 0, + i = first.length; + + while ( j < len ) { + first[ i++ ] = second[ j++ ]; + } + + // Support: IE<9 + // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists) + if ( len !== len ) { + while ( second[ j ] !== undefined ) { + first[ i++ ] = second[ j++ ]; + } + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, invert ) { + var callbackInverse, + matches = [], + i = 0, + length = elems.length, + callbackExpect = !invert; + + // Go through the array, only saving the items + // that pass the validator function + for ( ; i < length; i++ ) { + callbackInverse = !callback( elems[ i ], i ); + if ( callbackInverse !== callbackExpect ) { + matches.push( elems[ i ] ); + } + } + + return matches; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var length, value, + i = 0, + ret = []; + + // Go through the array, translating each of the items to their new values + if ( isArrayLike( elems ) ) { + length = elems.length; + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + + // Go through every key on the object, + } else { + for ( i in elems ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + } + + // Flatten any nested arrays + return concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // Bind a function to a context, optionally partially applying any + // arguments. + proxy: function( fn, context ) { + var args, proxy, tmp; + + if ( typeof context === "string" ) { + tmp = fn[ context ]; + context = fn; + fn = tmp; + } + + // Quick check to determine if target is callable, in the spec + // this throws a TypeError, but we will just return undefined. + if ( !jQuery.isFunction( fn ) ) { + return undefined; + } + + // Simulated bind + args = slice.call( arguments, 2 ); + proxy = function() { + return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); + }; + + // Set the guid of unique handler to the same of original handler, so it can be removed + proxy.guid = fn.guid = fn.guid || jQuery.guid++; + + return proxy; + }, + + now: function() { + return +( new Date() ); + }, + + // jQuery.support is not used in Core but other projects attach their + // properties to it so it needs to exist. + support: support +} ); + +// JSHint would error on this code due to the Symbol not being defined in ES5. +// Defining this global in .jshintrc would create a danger of using the global +// unguarded in another place, it seems safer to just disable JSHint for these +// three lines. +/* jshint ignore: start */ +if ( typeof Symbol === "function" ) { + jQuery.fn[ Symbol.iterator ] = deletedIds[ Symbol.iterator ]; +} +/* jshint ignore: end */ + +// Populate the class2type map +jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), +function( i, name ) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +} ); + +function isArrayLike( obj ) { + + // Support: iOS 8.2 (not reproducible in simulator) + // `in` check used to prevent JIT error (gh-2145) + // hasOwn isn't used here due to false negatives + // regarding Nodelist length in IE + var length = !!obj && "length" in obj && obj.length, + type = jQuery.type( obj ); + + if ( type === "function" || jQuery.isWindow( obj ) ) { + return false; + } + + return type === "array" || length === 0 || + typeof length === "number" && length > 0 && ( length - 1 ) in obj; +} +var Sizzle = +/*! + * Sizzle CSS Selector Engine v2.2.1 + * http://sizzlejs.com/ + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2015-10-17 + */ +(function( window ) { + +var i, + support, + Expr, + getText, + isXML, + tokenize, + compile, + select, + outermostContext, + sortInput, + hasDuplicate, + + // Local document vars + setDocument, + document, + docElem, + documentIsHTML, + rbuggyQSA, + rbuggyMatches, + matches, + contains, + + // Instance-specific data + expando = "sizzle" + 1 * new Date(), + preferredDoc = window.document, + dirruns = 0, + done = 0, + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + } + return 0; + }, + + // General-purpose constants + MAX_NEGATIVE = 1 << 31, + + // Instance methods + hasOwn = ({}).hasOwnProperty, + arr = [], + pop = arr.pop, + push_native = arr.push, + push = arr.push, + slice = arr.slice, + // Use a stripped-down indexOf as it's faster than native + // http://jsperf.com/thor-indexof-vs-for/5 + indexOf = function( list, elem ) { + var i = 0, + len = list.length; + for ( ; i < len; i++ ) { + if ( list[i] === elem ) { + return i; + } + } + return -1; + }, + + booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", + + // Regular expressions + + // http://www.w3.org/TR/css3-selectors/#whitespace + whitespace = "[\\x20\\t\\r\\n\\f]", + + // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier + identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", + + // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors + attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + + // Operator (capture 2) + "*([*^$|!~]?=)" + whitespace + + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + + "*\\]", + + pseudos = ":(" + identifier + ")(?:\\((" + + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: + // 1. quoted (capture 3; capture 4 or capture 5) + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + + // 2. simple (capture 6) + "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + + // 3. anything else (capture 2) + ".*" + + ")\\)|)", + + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rwhitespace = new RegExp( whitespace + "+", "g" ), + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), + + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), + rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), + + rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), + + rpseudo = new RegExp( pseudos ), + ridentifier = new RegExp( "^" + identifier + "$" ), + + matchExpr = { + "ID": new RegExp( "^#(" + identifier + ")" ), + "CLASS": new RegExp( "^\\.(" + identifier + ")" ), + "TAG": new RegExp( "^(" + identifier + "|[*])" ), + "ATTR": new RegExp( "^" + attributes ), + "PSEUDO": new RegExp( "^" + pseudos ), + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), + // For use in libraries implementing .is() + // We use this for POS matching in `select` + "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) + }, + + rinputs = /^(?:input|select|textarea|button)$/i, + rheader = /^h\d$/i, + + rnative = /^[^{]+\{\s*\[native \w/, + + // Easily-parseable/retrievable ID or TAG or CLASS selectors + rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, + + rsibling = /[+~]/, + rescape = /'|\\/g, + + // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters + runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), + funescape = function( _, escaped, escapedWhitespace ) { + var high = "0x" + escaped - 0x10000; + // NaN means non-codepoint + // Support: Firefox<24 + // Workaround erroneous numeric interpretation of +"0x" + return high !== high || escapedWhitespace ? + escaped : + high < 0 ? + // BMP codepoint + String.fromCharCode( high + 0x10000 ) : + // Supplemental Plane codepoint (surrogate pair) + String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); + }, + + // Used for iframes + // See setDocument() + // Removing the function wrapper causes a "Permission Denied" + // error in IE + unloadHandler = function() { + setDocument(); + }; + +// Optimize for push.apply( _, NodeList ) +try { + push.apply( + (arr = slice.call( preferredDoc.childNodes )), + preferredDoc.childNodes + ); + // Support: Android<4.0 + // Detect silently failing push.apply + arr[ preferredDoc.childNodes.length ].nodeType; +} catch ( e ) { + push = { apply: arr.length ? + + // Leverage slice if possible + function( target, els ) { + push_native.apply( target, slice.call(els) ); + } : + + // Support: IE<9 + // Otherwise append directly + function( target, els ) { + var j = target.length, + i = 0; + // Can't trust NodeList.length + while ( (target[j++] = els[i++]) ) {} + target.length = j - 1; + } + }; +} + +function Sizzle( selector, context, results, seed ) { + var m, i, elem, nid, nidselect, match, groups, newSelector, + newContext = context && context.ownerDocument, + + // nodeType defaults to 9, since context defaults to document + nodeType = context ? context.nodeType : 9; + + results = results || []; + + // Return early from calls with invalid selector or context + if ( typeof selector !== "string" || !selector || + nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { + + return results; + } + + // Try to shortcut find operations (as opposed to filters) in HTML documents + if ( !seed ) { + + if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { + setDocument( context ); + } + context = context || document; + + if ( documentIsHTML ) { + + // If the selector is sufficiently simple, try using a "get*By*" DOM method + // (excepting DocumentFragment context, where the methods don't exist) + if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { + + // ID selector + if ( (m = match[1]) ) { + + // Document context + if ( nodeType === 9 ) { + if ( (elem = context.getElementById( m )) ) { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { + return results; + } + + // Element context + } else { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( newContext && (elem = newContext.getElementById( m )) && + contains( context, elem ) && + elem.id === m ) { + + results.push( elem ); + return results; + } + } + + // Type selector + } else if ( match[2] ) { + push.apply( results, context.getElementsByTagName( selector ) ); + return results; + + // Class selector + } else if ( (m = match[3]) && support.getElementsByClassName && + context.getElementsByClassName ) { + + push.apply( results, context.getElementsByClassName( m ) ); + return results; + } + } + + // Take advantage of querySelectorAll + if ( support.qsa && + !compilerCache[ selector + " " ] && + (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { + + if ( nodeType !== 1 ) { + newContext = context; + newSelector = selector; + + // qSA looks outside Element context, which is not what we want + // Thanks to Andrew Dupont for this workaround technique + // Support: IE <=8 + // Exclude object elements + } else if ( context.nodeName.toLowerCase() !== "object" ) { + + // Capture the context ID, setting it first if necessary + if ( (nid = context.getAttribute( "id" )) ) { + nid = nid.replace( rescape, "\\$&" ); + } else { + context.setAttribute( "id", (nid = expando) ); + } + + // Prefix every selector in the list + groups = tokenize( selector ); + i = groups.length; + nidselect = ridentifier.test( nid ) ? "#" + nid : "[id='" + nid + "']"; + while ( i-- ) { + groups[i] = nidselect + " " + toSelector( groups[i] ); + } + newSelector = groups.join( "," ); + + // Expand context for sibling selectors + newContext = rsibling.test( selector ) && testContext( context.parentNode ) || + context; + } + + if ( newSelector ) { + try { + push.apply( results, + newContext.querySelectorAll( newSelector ) + ); + return results; + } catch ( qsaError ) { + } finally { + if ( nid === expando ) { + context.removeAttribute( "id" ); + } + } + } + } + } + } + + // All others + return select( selector.replace( rtrim, "$1" ), context, results, seed ); +} + +/** + * Create key-value caches of limited size + * @returns {function(string, object)} Returns the Object data after storing it on itself with + * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) + * deleting the oldest entry + */ +function createCache() { + var keys = []; + + function cache( key, value ) { + // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) + if ( keys.push( key + " " ) > Expr.cacheLength ) { + // Only keep the most recent entries + delete cache[ keys.shift() ]; + } + return (cache[ key + " " ] = value); + } + return cache; +} + +/** + * Mark a function for special use by Sizzle + * @param {Function} fn The function to mark + */ +function markFunction( fn ) { + fn[ expando ] = true; + return fn; +} + +/** + * Support testing using an element + * @param {Function} fn Passed the created div and expects a boolean result + */ +function assert( fn ) { + var div = document.createElement("div"); + + try { + return !!fn( div ); + } catch (e) { + return false; + } finally { + // Remove from its parent by default + if ( div.parentNode ) { + div.parentNode.removeChild( div ); + } + // release memory in IE + div = null; + } +} + +/** + * Adds the same handler for all of the specified attrs + * @param {String} attrs Pipe-separated list of attributes + * @param {Function} handler The method that will be applied + */ +function addHandle( attrs, handler ) { + var arr = attrs.split("|"), + i = arr.length; + + while ( i-- ) { + Expr.attrHandle[ arr[i] ] = handler; + } +} + +/** + * Checks document order of two siblings + * @param {Element} a + * @param {Element} b + * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b + */ +function siblingCheck( a, b ) { + var cur = b && a, + diff = cur && a.nodeType === 1 && b.nodeType === 1 && + ( ~b.sourceIndex || MAX_NEGATIVE ) - + ( ~a.sourceIndex || MAX_NEGATIVE ); + + // Use IE sourceIndex if available on both nodes + if ( diff ) { + return diff; + } + + // Check if b follows a + if ( cur ) { + while ( (cur = cur.nextSibling) ) { + if ( cur === b ) { + return -1; + } + } + } + + return a ? 1 : -1; +} + +/** + * Returns a function to use in pseudos for input types + * @param {String} type + */ +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for buttons + * @param {String} type + */ +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for positionals + * @param {Function} fn + */ +function createPositionalPseudo( fn ) { + return markFunction(function( argument ) { + argument = +argument; + return markFunction(function( seed, matches ) { + var j, + matchIndexes = fn( [], seed.length, argument ), + i = matchIndexes.length; + + // Match elements found at the specified indexes + while ( i-- ) { + if ( seed[ (j = matchIndexes[i]) ] ) { + seed[j] = !(matches[j] = seed[j]); + } + } + }); + }); +} + +/** + * Checks a node for validity as a Sizzle context + * @param {Element|Object=} context + * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value + */ +function testContext( context ) { + return context && typeof context.getElementsByTagName !== "undefined" && context; +} + +// Expose support vars for convenience +support = Sizzle.support = {}; + +/** + * Detects XML nodes + * @param {Element|Object} elem An element or a document + * @returns {Boolean} True iff elem is a non-HTML XML node + */ +isXML = Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = elem && (elem.ownerDocument || elem).documentElement; + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +/** + * Sets document-related variables once based on the current document + * @param {Element|Object} [doc] An element or document object to use to set the document + * @returns {Object} Returns the current document + */ +setDocument = Sizzle.setDocument = function( node ) { + var hasCompare, parent, + doc = node ? node.ownerDocument || node : preferredDoc; + + // Return early if doc is invalid or already selected + if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { + return document; + } + + // Update global variables + document = doc; + docElem = document.documentElement; + documentIsHTML = !isXML( document ); + + // Support: IE 9-11, Edge + // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) + if ( (parent = document.defaultView) && parent.top !== parent ) { + // Support: IE 11 + if ( parent.addEventListener ) { + parent.addEventListener( "unload", unloadHandler, false ); + + // Support: IE 9 - 10 only + } else if ( parent.attachEvent ) { + parent.attachEvent( "onunload", unloadHandler ); + } + } + + /* Attributes + ---------------------------------------------------------------------- */ + + // Support: IE<8 + // Verify that getAttribute really returns attributes and not properties + // (excepting IE8 booleans) + support.attributes = assert(function( div ) { + div.className = "i"; + return !div.getAttribute("className"); + }); + + /* getElement(s)By* + ---------------------------------------------------------------------- */ + + // Check if getElementsByTagName("*") returns only elements + support.getElementsByTagName = assert(function( div ) { + div.appendChild( document.createComment("") ); + return !div.getElementsByTagName("*").length; + }); + + // Support: IE<9 + support.getElementsByClassName = rnative.test( document.getElementsByClassName ); + + // Support: IE<10 + // Check if getElementById returns elements by name + // The broken getElementById methods don't pick up programatically-set names, + // so use a roundabout getElementsByName test + support.getById = assert(function( div ) { + docElem.appendChild( div ).id = expando; + return !document.getElementsByName || !document.getElementsByName( expando ).length; + }); + + // ID find and filter + if ( support.getById ) { + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var m = context.getElementById( id ); + return m ? [ m ] : []; + } + }; + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + return elem.getAttribute("id") === attrId; + }; + }; + } else { + // Support: IE6/7 + // getElementById is not reliable as a find shortcut + delete Expr.find["ID"]; + + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + var node = typeof elem.getAttributeNode !== "undefined" && + elem.getAttributeNode("id"); + return node && node.value === attrId; + }; + }; + } + + // Tag + Expr.find["TAG"] = support.getElementsByTagName ? + function( tag, context ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { + return context.getElementsByTagName( tag ); + + // DocumentFragment nodes don't have gEBTN + } else if ( support.qsa ) { + return context.querySelectorAll( tag ); + } + } : + + function( tag, context ) { + var elem, + tmp = [], + i = 0, + // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too + results = context.getElementsByTagName( tag ); + + // Filter out possible comments + if ( tag === "*" ) { + while ( (elem = results[i++]) ) { + if ( elem.nodeType === 1 ) { + tmp.push( elem ); + } + } + + return tmp; + } + return results; + }; + + // Class + Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { + if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { + return context.getElementsByClassName( className ); + } + }; + + /* QSA/matchesSelector + ---------------------------------------------------------------------- */ + + // QSA and matchesSelector support + + // matchesSelector(:active) reports false when true (IE9/Opera 11.5) + rbuggyMatches = []; + + // qSa(:focus) reports false when true (Chrome 21) + // We allow this because of a bug in IE8/9 that throws an error + // whenever `document.activeElement` is accessed on an iframe + // So, we allow :focus to pass through QSA all the time to avoid the IE error + // See http://bugs.jquery.com/ticket/13378 + rbuggyQSA = []; + + if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert(function( div ) { + // Select is set to empty string on purpose + // This is to test IE's treatment of not explicitly + // setting a boolean content attribute, + // since its presence should be enough + // http://bugs.jquery.com/ticket/12359 + docElem.appendChild( div ).innerHTML = "" + + ""; + + // Support: IE8, Opera 11-12.16 + // Nothing should be selected when empty strings follow ^= or $= or *= + // The test attribute must be unknown in Opera but "safe" for WinRT + // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section + if ( div.querySelectorAll("[msallowcapture^='']").length ) { + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); + } + + // Support: IE8 + // Boolean attributes and "value" are not treated correctly + if ( !div.querySelectorAll("[selected]").length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); + } + + // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ + if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) { + rbuggyQSA.push("~="); + } + + // Webkit/Opera - :checked should return selected option elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // IE8 throws error here and will not see later tests + if ( !div.querySelectorAll(":checked").length ) { + rbuggyQSA.push(":checked"); + } + + // Support: Safari 8+, iOS 8+ + // https://bugs.webkit.org/show_bug.cgi?id=136851 + // In-page `selector#id sibing-combinator selector` fails + if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) { + rbuggyQSA.push(".#.+[+~]"); + } + }); + + assert(function( div ) { + // Support: Windows 8 Native Apps + // The type and name attributes are restricted during .innerHTML assignment + var input = document.createElement("input"); + input.setAttribute( "type", "hidden" ); + div.appendChild( input ).setAttribute( "name", "D" ); + + // Support: IE8 + // Enforce case-sensitivity of name attribute + if ( div.querySelectorAll("[name=d]").length ) { + rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); + } + + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) + // IE8 throws error here and will not see later tests + if ( !div.querySelectorAll(":enabled").length ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Opera 10-11 does not throw on post-comma invalid pseudos + div.querySelectorAll("*,:x"); + rbuggyQSA.push(",.*:"); + }); + } + + if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || + docElem.webkitMatchesSelector || + docElem.mozMatchesSelector || + docElem.oMatchesSelector || + docElem.msMatchesSelector) )) ) { + + assert(function( div ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9) + support.disconnectedMatch = matches.call( div, "div" ); + + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( div, "[s!='']:x" ); + rbuggyMatches.push( "!=", pseudos ); + }); + } + + rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); + rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); + + /* Contains + ---------------------------------------------------------------------- */ + hasCompare = rnative.test( docElem.compareDocumentPosition ); + + // Element contains another + // Purposefully self-exclusive + // As in, an element does not contain itself + contains = hasCompare || rnative.test( docElem.contains ) ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && ( + adown.contains ? + adown.contains( bup ) : + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 + )); + } : + function( a, b ) { + if ( b ) { + while ( (b = b.parentNode) ) { + if ( b === a ) { + return true; + } + } + } + return false; + }; + + /* Sorting + ---------------------------------------------------------------------- */ + + // Document order sorting + sortOrder = hasCompare ? + function( a, b ) { + + // Flag for duplicate removal + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + // Sort on method existence if only one input has compareDocumentPosition + var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; + if ( compare ) { + return compare; + } + + // Calculate position if both inputs belong to the same document + compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? + a.compareDocumentPosition( b ) : + + // Otherwise we know they are disconnected + 1; + + // Disconnected nodes + if ( compare & 1 || + (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { + + // Choose the first element that is related to our preferred document + if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { + return -1; + } + if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { + return 1; + } + + // Maintain original order + return sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + } + + return compare & 4 ? -1 : 1; + } : + function( a, b ) { + // Exit early if the nodes are identical + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + var cur, + i = 0, + aup = a.parentNode, + bup = b.parentNode, + ap = [ a ], + bp = [ b ]; + + // Parentless nodes are either documents or disconnected + if ( !aup || !bup ) { + return a === document ? -1 : + b === document ? 1 : + aup ? -1 : + bup ? 1 : + sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + + // If the nodes are siblings, we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + } + + // Otherwise we need full lists of their ancestors for comparison + cur = a; + while ( (cur = cur.parentNode) ) { + ap.unshift( cur ); + } + cur = b; + while ( (cur = cur.parentNode) ) { + bp.unshift( cur ); + } + + // Walk down the tree looking for a discrepancy + while ( ap[i] === bp[i] ) { + i++; + } + + return i ? + // Do a sibling check if the nodes have a common ancestor + siblingCheck( ap[i], bp[i] ) : + + // Otherwise nodes in our document sort first + ap[i] === preferredDoc ? -1 : + bp[i] === preferredDoc ? 1 : + 0; + }; + + return document; +}; + +Sizzle.matches = function( expr, elements ) { + return Sizzle( expr, null, null, elements ); +}; + +Sizzle.matchesSelector = function( elem, expr ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + // Make sure that attribute selectors are quoted + expr = expr.replace( rattributeQuotes, "='$1']" ); + + if ( support.matchesSelector && documentIsHTML && + !compilerCache[ expr + " " ] && + ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && + ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { + + try { + var ret = matches.call( elem, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || support.disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { + return ret; + } + } catch (e) {} + } + + return Sizzle( expr, document, null, [ elem ] ).length > 0; +}; + +Sizzle.contains = function( context, elem ) { + // Set document vars if needed + if ( ( context.ownerDocument || context ) !== document ) { + setDocument( context ); + } + return contains( context, elem ); +}; + +Sizzle.attr = function( elem, name ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + var fn = Expr.attrHandle[ name.toLowerCase() ], + // Don't get fooled by Object.prototype properties (jQuery #13807) + val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? + fn( elem, name, !documentIsHTML ) : + undefined; + + return val !== undefined ? + val : + support.attributes || !documentIsHTML ? + elem.getAttribute( name ) : + (val = elem.getAttributeNode(name)) && val.specified ? + val.value : + null; +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +/** + * Document sorting and removing duplicates + * @param {ArrayLike} results + */ +Sizzle.uniqueSort = function( results ) { + var elem, + duplicates = [], + j = 0, + i = 0; + + // Unless we *know* we can detect duplicates, assume their presence + hasDuplicate = !support.detectDuplicates; + sortInput = !support.sortStable && results.slice( 0 ); + results.sort( sortOrder ); + + if ( hasDuplicate ) { + while ( (elem = results[i++]) ) { + if ( elem === results[ i ] ) { + j = duplicates.push( i ); + } + } + while ( j-- ) { + results.splice( duplicates[ j ], 1 ); + } + } + + // Clear input after sorting to release objects + // See https://github.com/jquery/sizzle/pull/225 + sortInput = null; + + return results; +}; + +/** + * Utility function for retrieving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +getText = Sizzle.getText = function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( !nodeType ) { + // If no nodeType, this is expected to be an array + while ( (node = elem[i++]) ) { + // Do not traverse comment nodes + ret += getText( node ); + } + } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + // Use textContent for elements + // innerText usage removed for consistency of new lines (jQuery #11153) + if ( typeof elem.textContent === "string" ) { + return elem.textContent; + } else { + // Traverse its children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + // Do not include comment or processing instruction nodes + + return ret; +}; + +Expr = Sizzle.selectors = { + + // Can be adjusted by the user + cacheLength: 50, + + createPseudo: markFunction, + + match: matchExpr, + + attrHandle: {}, + + find: {}, + + relative: { + ">": { dir: "parentNode", first: true }, + " ": { dir: "parentNode" }, + "+": { dir: "previousSibling", first: true }, + "~": { dir: "previousSibling" } + }, + + preFilter: { + "ATTR": function( match ) { + match[1] = match[1].replace( runescape, funescape ); + + // Move the given value to match[3] whether quoted or unquoted + match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); + + if ( match[2] === "~=" ) { + match[3] = " " + match[3] + " "; + } + + return match.slice( 0, 4 ); + }, + + "CHILD": function( match ) { + /* matches from matchExpr["CHILD"] + 1 type (only|nth|...) + 2 what (child|of-type) + 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) + 4 xn-component of xn+y argument ([+-]?\d*n|) + 5 sign of xn-component + 6 x of xn-component + 7 sign of y-component + 8 y of y-component + */ + match[1] = match[1].toLowerCase(); + + if ( match[1].slice( 0, 3 ) === "nth" ) { + // nth-* requires argument + if ( !match[3] ) { + Sizzle.error( match[0] ); + } + + // numeric x and y parameters for Expr.filter.CHILD + // remember that false/true cast respectively to 0/1 + match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); + match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); + + // other types prohibit arguments + } else if ( match[3] ) { + Sizzle.error( match[0] ); + } + + return match; + }, + + "PSEUDO": function( match ) { + var excess, + unquoted = !match[6] && match[2]; + + if ( matchExpr["CHILD"].test( match[0] ) ) { + return null; + } + + // Accept quoted arguments as-is + if ( match[3] ) { + match[2] = match[4] || match[5] || ""; + + // Strip excess characters from unquoted arguments + } else if ( unquoted && rpseudo.test( unquoted ) && + // Get excess from tokenize (recursively) + (excess = tokenize( unquoted, true )) && + // advance to the next closing parenthesis + (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { + + // excess is a negative index + match[0] = match[0].slice( 0, excess ); + match[2] = unquoted.slice( 0, excess ); + } + + // Return only captures needed by the pseudo filter method (type and argument) + return match.slice( 0, 3 ); + } + }, + + filter: { + + "TAG": function( nodeNameSelector ) { + var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); + return nodeNameSelector === "*" ? + function() { return true; } : + function( elem ) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + + "CLASS": function( className ) { + var pattern = classCache[ className + " " ]; + + return pattern || + (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && + classCache( className, function( elem ) { + return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); + }); + }, + + "ATTR": function( name, operator, check ) { + return function( elem ) { + var result = Sizzle.attr( elem, name ); + + if ( result == null ) { + return operator === "!="; + } + if ( !operator ) { + return true; + } + + result += ""; + + return operator === "=" ? result === check : + operator === "!=" ? result !== check : + operator === "^=" ? check && result.indexOf( check ) === 0 : + operator === "*=" ? check && result.indexOf( check ) > -1 : + operator === "$=" ? check && result.slice( -check.length ) === check : + operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : + operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : + false; + }; + }, + + "CHILD": function( type, what, argument, first, last ) { + var simple = type.slice( 0, 3 ) !== "nth", + forward = type.slice( -4 ) !== "last", + ofType = what === "of-type"; + + return first === 1 && last === 0 ? + + // Shortcut for :nth-*(n) + function( elem ) { + return !!elem.parentNode; + } : + + function( elem, context, xml ) { + var cache, uniqueCache, outerCache, node, nodeIndex, start, + dir = simple !== forward ? "nextSibling" : "previousSibling", + parent = elem.parentNode, + name = ofType && elem.nodeName.toLowerCase(), + useCache = !xml && !ofType, + diff = false; + + if ( parent ) { + + // :(first|last|only)-(child|of-type) + if ( simple ) { + while ( dir ) { + node = elem; + while ( (node = node[ dir ]) ) { + if ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) { + + return false; + } + } + // Reverse direction for :only-* (if we haven't yet done so) + start = dir = type === "only" && !start && "nextSibling"; + } + return true; + } + + start = [ forward ? parent.firstChild : parent.lastChild ]; + + // non-xml :nth-child(...) stores cache data on `parent` + if ( forward && useCache ) { + + // Seek `elem` from a previously-cached index + + // ...in a gzip-friendly way + node = parent; + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex && cache[ 2 ]; + node = nodeIndex && parent.childNodes[ nodeIndex ]; + + while ( (node = ++nodeIndex && node && node[ dir ] || + + // Fallback to seeking `elem` from the start + (diff = nodeIndex = 0) || start.pop()) ) { + + // When found, cache indexes on `parent` and break + if ( node.nodeType === 1 && ++diff && node === elem ) { + uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; + break; + } + } + + } else { + // Use previously-cached element index if available + if ( useCache ) { + // ...in a gzip-friendly way + node = elem; + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex; + } + + // xml :nth-child(...) + // or :nth-last-child(...) or :nth(-last)?-of-type(...) + if ( diff === false ) { + // Use the same loop as above to seek `elem` from the start + while ( (node = ++nodeIndex && node && node[ dir ] || + (diff = nodeIndex = 0) || start.pop()) ) { + + if ( ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) && + ++diff ) { + + // Cache the index of each encountered element + if ( useCache ) { + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + uniqueCache[ type ] = [ dirruns, diff ]; + } + + if ( node === elem ) { + break; + } + } + } + } + } + + // Incorporate the offset, then check against cycle size + diff -= last; + return diff === first || ( diff % first === 0 && diff / first >= 0 ); + } + }; + }, + + "PSEUDO": function( pseudo, argument ) { + // pseudo-class names are case-insensitive + // http://www.w3.org/TR/selectors/#pseudo-classes + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters + // Remember that setFilters inherits from pseudos + var args, + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || + Sizzle.error( "unsupported pseudo: " + pseudo ); + + // The user may use createPseudo to indicate that + // arguments are needed to create the filter function + // just as Sizzle does + if ( fn[ expando ] ) { + return fn( argument ); + } + + // But maintain support for old signatures + if ( fn.length > 1 ) { + args = [ pseudo, pseudo, "", argument ]; + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? + markFunction(function( seed, matches ) { + var idx, + matched = fn( seed, argument ), + i = matched.length; + while ( i-- ) { + idx = indexOf( seed, matched[i] ); + seed[ idx ] = !( matches[ idx ] = matched[i] ); + } + }) : + function( elem ) { + return fn( elem, 0, args ); + }; + } + + return fn; + } + }, + + pseudos: { + // Potentially complex pseudos + "not": markFunction(function( selector ) { + // Trim the selector passed to compile + // to avoid treating leading and trailing + // spaces as combinators + var input = [], + results = [], + matcher = compile( selector.replace( rtrim, "$1" ) ); + + return matcher[ expando ] ? + markFunction(function( seed, matches, context, xml ) { + var elem, + unmatched = matcher( seed, null, xml, [] ), + i = seed.length; + + // Match elements unmatched by `matcher` + while ( i-- ) { + if ( (elem = unmatched[i]) ) { + seed[i] = !(matches[i] = elem); + } + } + }) : + function( elem, context, xml ) { + input[0] = elem; + matcher( input, null, xml, results ); + // Don't keep the element (issue #299) + input[0] = null; + return !results.pop(); + }; + }), + + "has": markFunction(function( selector ) { + return function( elem ) { + return Sizzle( selector, elem ).length > 0; + }; + }), + + "contains": markFunction(function( text ) { + text = text.replace( runescape, funescape ); + return function( elem ) { + return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; + }; + }), + + // "Whether an element is represented by a :lang() selector + // is based solely on the element's language value + // being equal to the identifier C, + // or beginning with the identifier C immediately followed by "-". + // The matching of C against the element's language value is performed case-insensitively. + // The identifier C does not have to be a valid language name." + // http://www.w3.org/TR/selectors/#lang-pseudo + "lang": markFunction( function( lang ) { + // lang value must be a valid identifier + if ( !ridentifier.test(lang || "") ) { + Sizzle.error( "unsupported lang: " + lang ); + } + lang = lang.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + var elemLang; + do { + if ( (elemLang = documentIsHTML ? + elem.lang : + elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { + + elemLang = elemLang.toLowerCase(); + return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; + } + } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); + return false; + }; + }), + + // Miscellaneous + "target": function( elem ) { + var hash = window.location && window.location.hash; + return hash && hash.slice( 1 ) === elem.id; + }, + + "root": function( elem ) { + return elem === docElem; + }, + + "focus": function( elem ) { + return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); + }, + + // Boolean properties + "enabled": function( elem ) { + return elem.disabled === false; + }, + + "disabled": function( elem ) { + return elem.disabled === true; + }, + + "checked": function( elem ) { + // In CSS3, :checked should return both checked and selected elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + var nodeName = elem.nodeName.toLowerCase(); + return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); + }, + + "selected": function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + // Contents + "empty": function( elem ) { + // http://www.w3.org/TR/selectors/#empty-pseudo + // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), + // but not by others (comment: 8; processing instruction: 7; etc.) + // nodeType < 6 works because attributes (2) do not appear as children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + if ( elem.nodeType < 6 ) { + return false; + } + } + return true; + }, + + "parent": function( elem ) { + return !Expr.pseudos["empty"]( elem ); + }, + + // Element/input types + "header": function( elem ) { + return rheader.test( elem.nodeName ); + }, + + "input": function( elem ) { + return rinputs.test( elem.nodeName ); + }, + + "button": function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === "button" || name === "button"; + }, + + "text": function( elem ) { + var attr; + return elem.nodeName.toLowerCase() === "input" && + elem.type === "text" && + + // Support: IE<8 + // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" + ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); + }, + + // Position-in-collection + "first": createPositionalPseudo(function() { + return [ 0 ]; + }), + + "last": createPositionalPseudo(function( matchIndexes, length ) { + return [ length - 1 ]; + }), + + "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { + return [ argument < 0 ? argument + length : argument ]; + }), + + "even": createPositionalPseudo(function( matchIndexes, length ) { + var i = 0; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "odd": createPositionalPseudo(function( matchIndexes, length ) { + var i = 1; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; --i >= 0; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; ++i < length; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }) + } +}; + +Expr.pseudos["nth"] = Expr.pseudos["eq"]; + +// Add button/input type pseudos +for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { + Expr.pseudos[ i ] = createInputPseudo( i ); +} +for ( i in { submit: true, reset: true } ) { + Expr.pseudos[ i ] = createButtonPseudo( i ); +} + +// Easy API for creating new setFilters +function setFilters() {} +setFilters.prototype = Expr.filters = Expr.pseudos; +Expr.setFilters = new setFilters(); + +tokenize = Sizzle.tokenize = function( selector, parseOnly ) { + var matched, match, tokens, type, + soFar, groups, preFilters, + cached = tokenCache[ selector + " " ]; + + if ( cached ) { + return parseOnly ? 0 : cached.slice( 0 ); + } + + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + + while ( soFar ) { + + // Comma and first run + if ( !matched || (match = rcomma.exec( soFar )) ) { + if ( match ) { + // Don't consume trailing commas as valid + soFar = soFar.slice( match[0].length ) || soFar; + } + groups.push( (tokens = []) ); + } + + matched = false; + + // Combinators + if ( (match = rcombinators.exec( soFar )) ) { + matched = match.shift(); + tokens.push({ + value: matched, + // Cast descendant combinators to space + type: match[0].replace( rtrim, " " ) + }); + soFar = soFar.slice( matched.length ); + } + + // Filters + for ( type in Expr.filter ) { + if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || + (match = preFilters[ type ]( match ))) ) { + matched = match.shift(); + tokens.push({ + value: matched, + type: type, + matches: match + }); + soFar = soFar.slice( matched.length ); + } + } + + if ( !matched ) { + break; + } + } + + // Return the length of the invalid excess + // if we're just parsing + // Otherwise, throw an error or return tokens + return parseOnly ? + soFar.length : + soFar ? + Sizzle.error( selector ) : + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +}; + +function toSelector( tokens ) { + var i = 0, + len = tokens.length, + selector = ""; + for ( ; i < len; i++ ) { + selector += tokens[i].value; + } + return selector; +} + +function addCombinator( matcher, combinator, base ) { + var dir = combinator.dir, + checkNonElements = base && dir === "parentNode", + doneName = done++; + + return combinator.first ? + // Check against closest ancestor/preceding element + function( elem, context, xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + return matcher( elem, context, xml ); + } + } + } : + + // Check against all ancestor/preceding elements + function( elem, context, xml ) { + var oldCache, uniqueCache, outerCache, + newCache = [ dirruns, doneName ]; + + // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching + if ( xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + if ( matcher( elem, context, xml ) ) { + return true; + } + } + } + } else { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + outerCache = elem[ expando ] || (elem[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); + + if ( (oldCache = uniqueCache[ dir ]) && + oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { + + // Assign to newCache so results back-propagate to previous elements + return (newCache[ 2 ] = oldCache[ 2 ]); + } else { + // Reuse newcache so results back-propagate to previous elements + uniqueCache[ dir ] = newCache; + + // A match means we're done; a fail means we have to keep checking + if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { + return true; + } + } + } + } + } + }; +} + +function elementMatcher( matchers ) { + return matchers.length > 1 ? + function( elem, context, xml ) { + var i = matchers.length; + while ( i-- ) { + if ( !matchers[i]( elem, context, xml ) ) { + return false; + } + } + return true; + } : + matchers[0]; +} + +function multipleContexts( selector, contexts, results ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[i], results ); + } + return results; +} + +function condense( unmatched, map, filter, context, xml ) { + var elem, + newUnmatched = [], + i = 0, + len = unmatched.length, + mapped = map != null; + + for ( ; i < len; i++ ) { + if ( (elem = unmatched[i]) ) { + if ( !filter || filter( elem, context, xml ) ) { + newUnmatched.push( elem ); + if ( mapped ) { + map.push( i ); + } + } + } + } + + return newUnmatched; +} + +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { + if ( postFilter && !postFilter[ expando ] ) { + postFilter = setMatcher( postFilter ); + } + if ( postFinder && !postFinder[ expando ] ) { + postFinder = setMatcher( postFinder, postSelector ); + } + return markFunction(function( seed, results, context, xml ) { + var temp, i, elem, + preMap = [], + postMap = [], + preexisting = results.length, + + // Get initial elements from seed or context + elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), + + // Prefilter to get matcher input, preserving a map for seed-results synchronization + matcherIn = preFilter && ( seed || !selector ) ? + condense( elems, preMap, preFilter, context, xml ) : + elems, + + matcherOut = matcher ? + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, + postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results : + matcherIn; + + // Find primary matches + if ( matcher ) { + matcher( matcherIn, matcherOut, context, xml ); + } + + // Apply postFilter + if ( postFilter ) { + temp = condense( matcherOut, postMap ); + postFilter( temp, [], context, xml ); + + // Un-match failing elements by moving them back to matcherIn + i = temp.length; + while ( i-- ) { + if ( (elem = temp[i]) ) { + matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); + } + } + } + + if ( seed ) { + if ( postFinder || preFilter ) { + if ( postFinder ) { + // Get the final matcherOut by condensing this intermediate into postFinder contexts + temp = []; + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) ) { + // Restore matcherIn since elem is not yet a final match + temp.push( (matcherIn[i] = elem) ); + } + } + postFinder( null, (matcherOut = []), temp, xml ); + } + + // Move matched elements from seed to results to keep them synchronized + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) && + (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { + + seed[temp] = !(results[temp] = elem); + } + } + } + + // Add elements to results, through postFinder if defined + } else { + matcherOut = condense( + matcherOut === results ? + matcherOut.splice( preexisting, matcherOut.length ) : + matcherOut + ); + if ( postFinder ) { + postFinder( null, results, matcherOut, xml ); + } else { + push.apply( results, matcherOut ); + } + } + }); +} + +function matcherFromTokens( tokens ) { + var checkContext, matcher, j, + len = tokens.length, + leadingRelative = Expr.relative[ tokens[0].type ], + implicitRelative = leadingRelative || Expr.relative[" "], + i = leadingRelative ? 1 : 0, + + // The foundational matcher ensures that elements are reachable from top-level context(s) + matchContext = addCombinator( function( elem ) { + return elem === checkContext; + }, implicitRelative, true ), + matchAnyContext = addCombinator( function( elem ) { + return indexOf( checkContext, elem ) > -1; + }, implicitRelative, true ), + matchers = [ function( elem, context, xml ) { + var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + (checkContext = context).nodeType ? + matchContext( elem, context, xml ) : + matchAnyContext( elem, context, xml ) ); + // Avoid hanging onto element (issue #299) + checkContext = null; + return ret; + } ]; + + for ( ; i < len; i++ ) { + if ( (matcher = Expr.relative[ tokens[i].type ]) ) { + matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; + } else { + matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); + + // Return special upon seeing a positional matcher + if ( matcher[ expando ] ) { + // Find the next relative operator (if any) for proper handling + j = ++i; + for ( ; j < len; j++ ) { + if ( Expr.relative[ tokens[j].type ] ) { + break; + } + } + return setMatcher( + i > 1 && elementMatcher( matchers ), + i > 1 && toSelector( + // If the preceding token was a descendant combinator, insert an implicit any-element `*` + tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) + ).replace( rtrim, "$1" ), + matcher, + i < j && matcherFromTokens( tokens.slice( i, j ) ), + j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), + j < len && toSelector( tokens ) + ); + } + matchers.push( matcher ); + } + } + + return elementMatcher( matchers ); +} + +function matcherFromGroupMatchers( elementMatchers, setMatchers ) { + var bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function( seed, context, xml, results, outermost ) { + var elem, j, matcher, + matchedCount = 0, + i = "0", + unmatched = seed && [], + setMatched = [], + contextBackup = outermostContext, + // We must always have either seed elements or outermost context + elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), + // Use integer dirruns iff this is the outermost matcher + dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), + len = elems.length; + + if ( outermost ) { + outermostContext = context === document || context || outermost; + } + + // Add elements passing elementMatchers directly to results + // Support: IE<9, Safari + // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id + for ( ; i !== len && (elem = elems[i]) != null; i++ ) { + if ( byElement && elem ) { + j = 0; + if ( !context && elem.ownerDocument !== document ) { + setDocument( elem ); + xml = !documentIsHTML; + } + while ( (matcher = elementMatchers[j++]) ) { + if ( matcher( elem, context || document, xml) ) { + results.push( elem ); + break; + } + } + if ( outermost ) { + dirruns = dirrunsUnique; + } + } + + // Track unmatched elements for set filters + if ( bySet ) { + // They will have gone through all possible matchers + if ( (elem = !matcher && elem) ) { + matchedCount--; + } + + // Lengthen the array for every element, matched or not + if ( seed ) { + unmatched.push( elem ); + } + } + } + + // `i` is now the count of elements visited above, and adding it to `matchedCount` + // makes the latter nonnegative. + matchedCount += i; + + // Apply set filters to unmatched elements + // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` + // equals `i`), unless we didn't visit _any_ elements in the above loop because we have + // no element matchers and no seed. + // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that + // case, which will result in a "00" `matchedCount` that differs from `i` but is also + // numerically zero. + if ( bySet && i !== matchedCount ) { + j = 0; + while ( (matcher = setMatchers[j++]) ) { + matcher( unmatched, setMatched, context, xml ); + } + + if ( seed ) { + // Reintegrate element matches to eliminate the need for sorting + if ( matchedCount > 0 ) { + while ( i-- ) { + if ( !(unmatched[i] || setMatched[i]) ) { + setMatched[i] = pop.call( results ); + } + } + } + + // Discard index placeholder values to get only actual matches + setMatched = condense( setMatched ); + } + + // Add matches to results + push.apply( results, setMatched ); + + // Seedless set matches succeeding multiple successful matchers stipulate sorting + if ( outermost && !seed && setMatched.length > 0 && + ( matchedCount + setMatchers.length ) > 1 ) { + + Sizzle.uniqueSort( results ); + } + } + + // Override manipulation of globals by nested matchers + if ( outermost ) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + + return unmatched; + }; + + return bySet ? + markFunction( superMatcher ) : + superMatcher; +} + +compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[ selector + " " ]; + + if ( !cached ) { + // Generate a function of recursive functions that can be used to check each element + if ( !match ) { + match = tokenize( selector ); + } + i = match.length; + while ( i-- ) { + cached = matcherFromTokens( match[i] ); + if ( cached[ expando ] ) { + setMatchers.push( cached ); + } else { + elementMatchers.push( cached ); + } + } + + // Cache the compiled function + cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); + + // Save selector and tokenization + cached.selector = selector; + } + return cached; +}; + +/** + * A low-level selection function that works with Sizzle's compiled + * selector functions + * @param {String|Function} selector A selector or a pre-compiled + * selector function built with Sizzle.compile + * @param {Element} context + * @param {Array} [results] + * @param {Array} [seed] A set of elements to match against + */ +select = Sizzle.select = function( selector, context, results, seed ) { + var i, tokens, token, type, find, + compiled = typeof selector === "function" && selector, + match = !seed && tokenize( (selector = compiled.selector || selector) ); + + results = results || []; + + // Try to minimize operations if there is only one selector in the list and no seed + // (the latter of which guarantees us context) + if ( match.length === 1 ) { + + // Reduce context if the leading compound selector is an ID + tokens = match[0] = match[0].slice( 0 ); + if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && + support.getById && context.nodeType === 9 && documentIsHTML && + Expr.relative[ tokens[1].type ] ) { + + context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; + if ( !context ) { + return results; + + // Precompiled matchers will still verify ancestry, so step up a level + } else if ( compiled ) { + context = context.parentNode; + } + + selector = selector.slice( tokens.shift().value.length ); + } + + // Fetch a seed set for right-to-left matching + i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; + while ( i-- ) { + token = tokens[i]; + + // Abort if we hit a combinator + if ( Expr.relative[ (type = token.type) ] ) { + break; + } + if ( (find = Expr.find[ type ]) ) { + // Search, expanding context for leading sibling combinators + if ( (seed = find( + token.matches[0].replace( runescape, funescape ), + rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context + )) ) { + + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && toSelector( tokens ); + if ( !selector ) { + push.apply( results, seed ); + return results; + } + + break; + } + } + } + } + + // Compile and execute a filtering function if one is not provided + // Provide `match` to avoid retokenization if we modified the selector above + ( compiled || compile( selector, match ) )( + seed, + context, + !documentIsHTML, + results, + !context || rsibling.test( selector ) && testContext( context.parentNode ) || context + ); + return results; +}; + +// One-time assignments + +// Sort stability +support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; + +// Support: Chrome 14-35+ +// Always assume duplicates if they aren't passed to the comparison function +support.detectDuplicates = !!hasDuplicate; + +// Initialize against the default document +setDocument(); + +// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) +// Detached nodes confoundingly follow *each other* +support.sortDetached = assert(function( div1 ) { + // Should return 1, but returns 4 (following) + return div1.compareDocumentPosition( document.createElement("div") ) & 1; +}); + +// Support: IE<8 +// Prevent attribute/property "interpolation" +// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx +if ( !assert(function( div ) { + div.innerHTML = ""; + return div.firstChild.getAttribute("href") === "#" ; +}) ) { + addHandle( "type|href|height|width", function( elem, name, isXML ) { + if ( !isXML ) { + return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); + } + }); +} + +// Support: IE<9 +// Use defaultValue in place of getAttribute("value") +if ( !support.attributes || !assert(function( div ) { + div.innerHTML = ""; + div.firstChild.setAttribute( "value", "" ); + return div.firstChild.getAttribute( "value" ) === ""; +}) ) { + addHandle( "value", function( elem, name, isXML ) { + if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { + return elem.defaultValue; + } + }); +} + +// Support: IE<9 +// Use getAttributeNode to fetch booleans when getAttribute lies +if ( !assert(function( div ) { + return div.getAttribute("disabled") == null; +}) ) { + addHandle( booleans, function( elem, name, isXML ) { + var val; + if ( !isXML ) { + return elem[ name ] === true ? name.toLowerCase() : + (val = elem.getAttributeNode( name )) && val.specified ? + val.value : + null; + } + }); +} + +return Sizzle; + +})( window ); + + + +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; +jQuery.expr[ ":" ] = jQuery.expr.pseudos; +jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; + + + +var dir = function( elem, dir, until ) { + var matched = [], + truncate = until !== undefined; + + while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { + if ( elem.nodeType === 1 ) { + if ( truncate && jQuery( elem ).is( until ) ) { + break; + } + matched.push( elem ); + } + } + return matched; +}; + + +var siblings = function( n, elem ) { + var matched = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + matched.push( n ); + } + } + + return matched; +}; + + +var rneedsContext = jQuery.expr.match.needsContext; + +var rsingleTag = ( /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/ ); + + + +var risSimple = /^.[^:#\[\.,]*$/; + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, not ) { + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep( elements, function( elem, i ) { + /* jshint -W018 */ + return !!qualifier.call( elem, i, elem ) !== not; + } ); + + } + + if ( qualifier.nodeType ) { + return jQuery.grep( elements, function( elem ) { + return ( elem === qualifier ) !== not; + } ); + + } + + if ( typeof qualifier === "string" ) { + if ( risSimple.test( qualifier ) ) { + return jQuery.filter( qualifier, elements, not ); + } + + qualifier = jQuery.filter( qualifier, elements ); + } + + return jQuery.grep( elements, function( elem ) { + return ( jQuery.inArray( elem, qualifier ) > -1 ) !== not; + } ); +} + +jQuery.filter = function( expr, elems, not ) { + var elem = elems[ 0 ]; + + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return elems.length === 1 && elem.nodeType === 1 ? + jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : + jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { + return elem.nodeType === 1; + } ) ); +}; + +jQuery.fn.extend( { + find: function( selector ) { + var i, + ret = [], + self = this, + len = self.length; + + if ( typeof selector !== "string" ) { + return this.pushStack( jQuery( selector ).filter( function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + } ) ); + } + + for ( i = 0; i < len; i++ ) { + jQuery.find( selector, self[ i ], ret ); + } + + // Needed because $( selector, context ) becomes $( context ).find( selector ) + ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); + ret.selector = this.selector ? this.selector + " " + selector : selector; + return ret; + }, + filter: function( selector ) { + return this.pushStack( winnow( this, selector || [], false ) ); + }, + not: function( selector ) { + return this.pushStack( winnow( this, selector || [], true ) ); + }, + is: function( selector ) { + return !!winnow( + this, + + // If this is a positional/relative selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + typeof selector === "string" && rneedsContext.test( selector ) ? + jQuery( selector ) : + selector || [], + false + ).length; + } +} ); + + +// Initialize a jQuery object + + +// A central reference to the root jQuery(document) +var rootjQuery, + + // A simple way to check for HTML strings + // Prioritize #id over to avoid XSS via location.hash (#9521) + // Strict HTML recognition (#11290: must start with <) + rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, + + init = jQuery.fn.init = function( selector, context, root ) { + var match, elem; + + // HANDLE: $(""), $(null), $(undefined), $(false) + if ( !selector ) { + return this; + } + + // init accepts an alternate rootjQuery + // so migrate can support jQuery.sub (gh-2101) + root = root || rootjQuery; + + // Handle HTML strings + if ( typeof selector === "string" ) { + if ( selector.charAt( 0 ) === "<" && + selector.charAt( selector.length - 1 ) === ">" && + selector.length >= 3 ) { + + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = rquickExpr.exec( selector ); + } + + // Match html or make sure no context is specified for #id + if ( match && ( match[ 1 ] || !context ) ) { + + // HANDLE: $(html) -> $(array) + if ( match[ 1 ] ) { + context = context instanceof jQuery ? context[ 0 ] : context; + + // scripts is true for back-compat + // Intentionally let the error be thrown if parseHTML is not present + jQuery.merge( this, jQuery.parseHTML( + match[ 1 ], + context && context.nodeType ? context.ownerDocument || context : document, + true + ) ); + + // HANDLE: $(html, props) + if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { + for ( match in context ) { + + // Properties of context are called as methods if possible + if ( jQuery.isFunction( this[ match ] ) ) { + this[ match ]( context[ match ] ); + + // ...and otherwise set as attributes + } else { + this.attr( match, context[ match ] ); + } + } + } + + return this; + + // HANDLE: $(#id) + } else { + elem = document.getElementById( match[ 2 ] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id !== match[ 2 ] ) { + return rootjQuery.find( selector ); + } + + // Otherwise, we inject the element directly into the jQuery object + this.length = 1; + this[ 0 ] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return ( context || root ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(DOMElement) + } else if ( selector.nodeType ) { + this.context = this[ 0 ] = selector; + this.length = 1; + return this; + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return typeof root.ready !== "undefined" ? + root.ready( selector ) : + + // Execute immediately if ready is not present + selector( jQuery ); + } + + if ( selector.selector !== undefined ) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }; + +// Give the init function the jQuery prototype for later instantiation +init.prototype = jQuery.fn; + +// Initialize central reference +rootjQuery = jQuery( document ); + + +var rparentsprev = /^(?:parents|prev(?:Until|All))/, + + // methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend( { + has: function( target ) { + var i, + targets = jQuery( target, this ), + len = targets.length; + + return this.filter( function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( this, targets[ i ] ) ) { + return true; + } + } + } ); + }, + + closest: function( selectors, context ) { + var cur, + i = 0, + l = this.length, + matched = [], + pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? + jQuery( selectors, context || this.context ) : + 0; + + for ( ; i < l; i++ ) { + for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { + + // Always skip document fragments + if ( cur.nodeType < 11 && ( pos ? + pos.index( cur ) > -1 : + + // Don't pass non-elements to Sizzle + cur.nodeType === 1 && + jQuery.find.matchesSelector( cur, selectors ) ) ) { + + matched.push( cur ); + break; + } + } + } + + return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; + } + + // index in selector + if ( typeof elem === "string" ) { + return jQuery.inArray( this[ 0 ], jQuery( elem ) ); + } + + // Locate the position of the desired element + return jQuery.inArray( + + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[ 0 ] : elem, this ); + }, + + add: function( selector, context ) { + return this.pushStack( + jQuery.uniqueSort( + jQuery.merge( this.get(), jQuery( selector, context ) ) + ) + ); + }, + + addBack: function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter( selector ) + ); + } +} ); + +function sibling( cur, dir ) { + do { + cur = cur[ dir ]; + } while ( cur && cur.nodeType !== 1 ); + + return cur; +} + +jQuery.each( { + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return sibling( elem, "nextSibling" ); + }, + prev: function( elem ) { + return sibling( elem, "previousSibling" ); + }, + nextAll: function( elem ) { + return dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return siblings( ( elem.parentNode || {} ).firstChild, elem ); + }, + children: function( elem ) { + return siblings( elem.firstChild ); + }, + contents: function( elem ) { + return jQuery.nodeName( elem, "iframe" ) ? + elem.contentDocument || elem.contentWindow.document : + jQuery.merge( [], elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var ret = jQuery.map( this, fn, until ); + + if ( name.slice( -5 ) !== "Until" ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + ret = jQuery.filter( selector, ret ); + } + + if ( this.length > 1 ) { + + // Remove duplicates + if ( !guaranteedUnique[ name ] ) { + ret = jQuery.uniqueSort( ret ); + } + + // Reverse order for parents* and prev-derivatives + if ( rparentsprev.test( name ) ) { + ret = ret.reverse(); + } + } + + return this.pushStack( ret ); + }; +} ); +var rnotwhite = ( /\S+/g ); + + + +// Convert String-formatted options into Object-formatted ones +function createOptions( options ) { + var object = {}; + jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { + object[ flag ] = true; + } ); + return object; +} + +/* + * Create a callback list using the following parameters: + * + * options: an optional list of space-separated options that will change how + * the callback list behaves or a more traditional option object + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible options: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +jQuery.Callbacks = function( options ) { + + // Convert options from String-formatted to Object-formatted if needed + // (we check in cache first) + options = typeof options === "string" ? + createOptions( options ) : + jQuery.extend( {}, options ); + + var // Flag to know if list is currently firing + firing, + + // Last fire value for non-forgettable lists + memory, + + // Flag to know if list was already fired + fired, + + // Flag to prevent firing + locked, + + // Actual callback list + list = [], + + // Queue of execution data for repeatable lists + queue = [], + + // Index of currently firing callback (modified by add/remove as needed) + firingIndex = -1, + + // Fire callbacks + fire = function() { + + // Enforce single-firing + locked = options.once; + + // Execute callbacks for all pending executions, + // respecting firingIndex overrides and runtime changes + fired = firing = true; + for ( ; queue.length; firingIndex = -1 ) { + memory = queue.shift(); + while ( ++firingIndex < list.length ) { + + // Run callback and check for early termination + if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && + options.stopOnFalse ) { + + // Jump to end and forget the data so .add doesn't re-fire + firingIndex = list.length; + memory = false; + } + } + } + + // Forget the data if we're done with it + if ( !options.memory ) { + memory = false; + } + + firing = false; + + // Clean up if we're done firing for good + if ( locked ) { + + // Keep an empty list if we have data for future add calls + if ( memory ) { + list = []; + + // Otherwise, this object is spent + } else { + list = ""; + } + } + }, + + // Actual Callbacks object + self = { + + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + + // If we have memory from a past run, we should fire after adding + if ( memory && !firing ) { + firingIndex = list.length - 1; + queue.push( memory ); + } + + ( function add( args ) { + jQuery.each( args, function( _, arg ) { + if ( jQuery.isFunction( arg ) ) { + if ( !options.unique || !self.has( arg ) ) { + list.push( arg ); + } + } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) { + + // Inspect recursively + add( arg ); + } + } ); + } )( arguments ); + + if ( memory && !firing ) { + fire(); + } + } + return this; + }, + + // Remove a callback from the list + remove: function() { + jQuery.each( arguments, function( _, arg ) { + var index; + while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + + // Handle firing indexes + if ( index <= firingIndex ) { + firingIndex--; + } + } + } ); + return this; + }, + + // Check if a given callback is in the list. + // If no argument is given, return whether or not list has callbacks attached. + has: function( fn ) { + return fn ? + jQuery.inArray( fn, list ) > -1 : + list.length > 0; + }, + + // Remove all callbacks from the list + empty: function() { + if ( list ) { + list = []; + } + return this; + }, + + // Disable .fire and .add + // Abort any current/pending executions + // Clear all callbacks and values + disable: function() { + locked = queue = []; + list = memory = ""; + return this; + }, + disabled: function() { + return !list; + }, + + // Disable .fire + // Also disable .add unless we have memory (since it would have no effect) + // Abort any pending executions + lock: function() { + locked = true; + if ( !memory ) { + self.disable(); + } + return this; + }, + locked: function() { + return !!locked; + }, + + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + if ( !locked ) { + args = args || []; + args = [ context, args.slice ? args.slice() : args ]; + queue.push( args ); + if ( !firing ) { + fire(); + } + } + return this; + }, + + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + + // To know if the callbacks have already been called at least once + fired: function() { + return !!fired; + } + }; + + return self; +}; + + +jQuery.extend( { + + Deferred: function( func ) { + var tuples = [ + + // action, add listener, listener list, final state + [ "resolve", "done", jQuery.Callbacks( "once memory" ), "resolved" ], + [ "reject", "fail", jQuery.Callbacks( "once memory" ), "rejected" ], + [ "notify", "progress", jQuery.Callbacks( "memory" ) ] + ], + state = "pending", + promise = { + state: function() { + return state; + }, + always: function() { + deferred.done( arguments ).fail( arguments ); + return this; + }, + then: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; + return jQuery.Deferred( function( newDefer ) { + jQuery.each( tuples, function( i, tuple ) { + var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; + + // deferred[ done | fail | progress ] for forwarding actions to newDefer + deferred[ tuple[ 1 ] ]( function() { + var returned = fn && fn.apply( this, arguments ); + if ( returned && jQuery.isFunction( returned.promise ) ) { + returned.promise() + .progress( newDefer.notify ) + .done( newDefer.resolve ) + .fail( newDefer.reject ); + } else { + newDefer[ tuple[ 0 ] + "With" ]( + this === promise ? newDefer.promise() : this, + fn ? [ returned ] : arguments + ); + } + } ); + } ); + fns = null; + } ).promise(); + }, + + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + return obj != null ? jQuery.extend( obj, promise ) : promise; + } + }, + deferred = {}; + + // Keep pipe for back-compat + promise.pipe = promise.then; + + // Add list-specific methods + jQuery.each( tuples, function( i, tuple ) { + var list = tuple[ 2 ], + stateString = tuple[ 3 ]; + + // promise[ done | fail | progress ] = list.add + promise[ tuple[ 1 ] ] = list.add; + + // Handle state + if ( stateString ) { + list.add( function() { + + // state = [ resolved | rejected ] + state = stateString; + + // [ reject_list | resolve_list ].disable; progress_list.lock + }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); + } + + // deferred[ resolve | reject | notify ] + deferred[ tuple[ 0 ] ] = function() { + deferred[ tuple[ 0 ] + "With" ]( this === deferred ? promise : this, arguments ); + return this; + }; + deferred[ tuple[ 0 ] + "With" ] = list.fireWith; + } ); + + // Make the deferred a promise + promise.promise( deferred ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( subordinate /* , ..., subordinateN */ ) { + var i = 0, + resolveValues = slice.call( arguments ), + length = resolveValues.length, + + // the count of uncompleted subordinates + remaining = length !== 1 || + ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, + + // the master Deferred. + // If resolveValues consist of only a single Deferred, just use that. + deferred = remaining === 1 ? subordinate : jQuery.Deferred(), + + // Update function for both resolve and progress values + updateFunc = function( i, contexts, values ) { + return function( value ) { + contexts[ i ] = this; + values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; + if ( values === progressValues ) { + deferred.notifyWith( contexts, values ); + + } else if ( !( --remaining ) ) { + deferred.resolveWith( contexts, values ); + } + }; + }, + + progressValues, progressContexts, resolveContexts; + + // add listeners to Deferred subordinates; treat others as resolved + if ( length > 1 ) { + progressValues = new Array( length ); + progressContexts = new Array( length ); + resolveContexts = new Array( length ); + for ( ; i < length; i++ ) { + if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { + resolveValues[ i ].promise() + .progress( updateFunc( i, progressContexts, progressValues ) ) + .done( updateFunc( i, resolveContexts, resolveValues ) ) + .fail( deferred.reject ); + } else { + --remaining; + } + } + } + + // if we're not waiting on anything, resolve the master + if ( !remaining ) { + deferred.resolveWith( resolveContexts, resolveValues ); + } + + return deferred.promise(); + } +} ); + + +// The deferred used on DOM ready +var readyList; + +jQuery.fn.ready = function( fn ) { + + // Add the callback + jQuery.ready.promise().done( fn ); + + return this; +}; + +jQuery.extend( { + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Hold (or release) the ready event + holdReady: function( hold ) { + if ( hold ) { + jQuery.readyWait++; + } else { + jQuery.ready( true ); + } + }, + + // Handle when the DOM is ready + ready: function( wait ) { + + // Abort if there are pending holds or we're already ready + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { + return; + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + + // Trigger any bound ready events + if ( jQuery.fn.triggerHandler ) { + jQuery( document ).triggerHandler( "ready" ); + jQuery( document ).off( "ready" ); + } + } +} ); + +/** + * Clean-up method for dom ready events + */ +function detach() { + if ( document.addEventListener ) { + document.removeEventListener( "DOMContentLoaded", completed ); + window.removeEventListener( "load", completed ); + + } else { + document.detachEvent( "onreadystatechange", completed ); + window.detachEvent( "onload", completed ); + } +} + +/** + * The ready event handler and self cleanup method + */ +function completed() { + + // readyState === "complete" is good enough for us to call the dom ready in oldIE + if ( document.addEventListener || + window.event.type === "load" || + document.readyState === "complete" ) { + + detach(); + jQuery.ready(); + } +} + +jQuery.ready.promise = function( obj ) { + if ( !readyList ) { + + readyList = jQuery.Deferred(); + + // Catch cases where $(document).ready() is called + // after the browser event has already occurred. + // Support: IE6-10 + // Older IE sometimes signals "interactive" too soon + if ( document.readyState === "complete" || + ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { + + // Handle it asynchronously to allow scripts the opportunity to delay ready + window.setTimeout( jQuery.ready ); + + // Standards-based browsers support DOMContentLoaded + } else if ( document.addEventListener ) { + + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", completed ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", completed ); + + // If IE event model is used + } else { + + // Ensure firing before onload, maybe late but safe also for iframes + document.attachEvent( "onreadystatechange", completed ); + + // A fallback to window.onload, that will always work + window.attachEvent( "onload", completed ); + + // If IE and not a frame + // continually check to see if the document is ready + var top = false; + + try { + top = window.frameElement == null && document.documentElement; + } catch ( e ) {} + + if ( top && top.doScroll ) { + ( function doScrollCheck() { + if ( !jQuery.isReady ) { + + try { + + // Use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + top.doScroll( "left" ); + } catch ( e ) { + return window.setTimeout( doScrollCheck, 50 ); + } + + // detach all dom ready events + detach(); + + // and execute any waiting functions + jQuery.ready(); + } + } )(); + } + } + } + return readyList.promise( obj ); +}; + +// Kick off the DOM ready check even if the user does not +jQuery.ready.promise(); + + + + +// Support: IE<9 +// Iteration over object's inherited properties before its own +var i; +for ( i in jQuery( support ) ) { + break; +} +support.ownFirst = i === "0"; + +// Note: most support tests are defined in their respective modules. +// false until the test is run +support.inlineBlockNeedsLayout = false; + +// Execute ASAP in case we need to set body.style.zoom +jQuery( function() { + + // Minified: var a,b,c,d + var val, div, body, container; + + body = document.getElementsByTagName( "body" )[ 0 ]; + if ( !body || !body.style ) { + + // Return for frameset docs that don't have a body + return; + } + + // Setup + div = document.createElement( "div" ); + container = document.createElement( "div" ); + container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; + body.appendChild( container ).appendChild( div ); + + if ( typeof div.style.zoom !== "undefined" ) { + + // Support: IE<8 + // Check if natively block-level elements act like inline-block + // elements when setting their display to 'inline' and giving + // them layout + div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1"; + + support.inlineBlockNeedsLayout = val = div.offsetWidth === 3; + if ( val ) { + + // Prevent IE 6 from affecting layout for positioned elements #11048 + // Prevent IE from shrinking the body in IE 7 mode #12869 + // Support: IE<8 + body.style.zoom = 1; + } + } + + body.removeChild( container ); +} ); + + +( function() { + var div = document.createElement( "div" ); + + // Support: IE<9 + support.deleteExpando = true; + try { + delete div.test; + } catch ( e ) { + support.deleteExpando = false; + } + + // Null elements to avoid leaks in IE. + div = null; +} )(); +var acceptData = function( elem ) { + var noData = jQuery.noData[ ( elem.nodeName + " " ).toLowerCase() ], + nodeType = +elem.nodeType || 1; + + // Do not set data on non-element DOM nodes because it will not be cleared (#8335). + return nodeType !== 1 && nodeType !== 9 ? + false : + + // Nodes accept data unless otherwise specified; rejection can be conditional + !noData || noData !== true && elem.getAttribute( "classid" ) === noData; +}; + + + + +var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, + rmultiDash = /([A-Z])/g; + +function dataAttr( elem, key, data ) { + + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + + var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); + + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = data === "true" ? true : + data === "false" ? false : + data === "null" ? null : + + // Only convert to a number if it doesn't change the string + +data + "" === data ? +data : + rbrace.test( data ) ? jQuery.parseJSON( data ) : + data; + } catch ( e ) {} + + // Make sure we set the data so it isn't changed later + jQuery.data( elem, key, data ); + + } else { + data = undefined; + } + } + + return data; +} + +// checks a cache object for emptiness +function isEmptyDataObject( obj ) { + var name; + for ( name in obj ) { + + // if the public data object is empty, the private is still empty + if ( name === "data" && jQuery.isEmptyObject( obj[ name ] ) ) { + continue; + } + if ( name !== "toJSON" ) { + return false; + } + } + + return true; +} + +function internalData( elem, name, data, pvt /* Internal Use Only */ ) { + if ( !acceptData( elem ) ) { + return; + } + + var ret, thisCache, + internalKey = jQuery.expando, + + // We have to handle DOM nodes and JS objects differently because IE6-7 + // can't GC object references properly across the DOM-JS boundary + isNode = elem.nodeType, + + // Only DOM nodes need the global jQuery cache; JS object data is + // attached directly to the object so GC can occur automatically + cache = isNode ? jQuery.cache : elem, + + // Only defining an ID for JS objects if its cache already exists allows + // the code to shortcut on the same path as a DOM node with no cache + id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; + + // Avoid doing any more work than we need to when trying to get data on an + // object that has no data at all + if ( ( !id || !cache[ id ] || ( !pvt && !cache[ id ].data ) ) && + data === undefined && typeof name === "string" ) { + return; + } + + if ( !id ) { + + // Only DOM nodes need a new unique ID for each element since their data + // ends up in the global cache + if ( isNode ) { + id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++; + } else { + id = internalKey; + } + } + + if ( !cache[ id ] ) { + + // Avoid exposing jQuery metadata on plain JS objects when the object + // is serialized using JSON.stringify + cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; + } + + // An object can be passed to jQuery.data instead of a key/value pair; this gets + // shallow copied over onto the existing cache + if ( typeof name === "object" || typeof name === "function" ) { + if ( pvt ) { + cache[ id ] = jQuery.extend( cache[ id ], name ); + } else { + cache[ id ].data = jQuery.extend( cache[ id ].data, name ); + } + } + + thisCache = cache[ id ]; + + // jQuery data() is stored in a separate object inside the object's internal data + // cache in order to avoid key collisions between internal data and user-defined + // data. + if ( !pvt ) { + if ( !thisCache.data ) { + thisCache.data = {}; + } + + thisCache = thisCache.data; + } + + if ( data !== undefined ) { + thisCache[ jQuery.camelCase( name ) ] = data; + } + + // Check for both converted-to-camel and non-converted data property names + // If a data property was specified + if ( typeof name === "string" ) { + + // First Try to find as-is property data + ret = thisCache[ name ]; + + // Test for null|undefined property data + if ( ret == null ) { + + // Try to find the camelCased property + ret = thisCache[ jQuery.camelCase( name ) ]; + } + } else { + ret = thisCache; + } + + return ret; +} + +function internalRemoveData( elem, name, pvt ) { + if ( !acceptData( elem ) ) { + return; + } + + var thisCache, i, + isNode = elem.nodeType, + + // See jQuery.data for more information + cache = isNode ? jQuery.cache : elem, + id = isNode ? elem[ jQuery.expando ] : jQuery.expando; + + // If there is already no cache entry for this object, there is no + // purpose in continuing + if ( !cache[ id ] ) { + return; + } + + if ( name ) { + + thisCache = pvt ? cache[ id ] : cache[ id ].data; + + if ( thisCache ) { + + // Support array or space separated string names for data keys + if ( !jQuery.isArray( name ) ) { + + // try the string as a key before any manipulation + if ( name in thisCache ) { + name = [ name ]; + } else { + + // split the camel cased version by spaces unless a key with the spaces exists + name = jQuery.camelCase( name ); + if ( name in thisCache ) { + name = [ name ]; + } else { + name = name.split( " " ); + } + } + } else { + + // If "name" is an array of keys... + // When data is initially created, via ("key", "val") signature, + // keys will be converted to camelCase. + // Since there is no way to tell _how_ a key was added, remove + // both plain key and camelCase key. #12786 + // This will only penalize the array argument path. + name = name.concat( jQuery.map( name, jQuery.camelCase ) ); + } + + i = name.length; + while ( i-- ) { + delete thisCache[ name[ i ] ]; + } + + // If there is no data left in the cache, we want to continue + // and let the cache object itself get destroyed + if ( pvt ? !isEmptyDataObject( thisCache ) : !jQuery.isEmptyObject( thisCache ) ) { + return; + } + } + } + + // See jQuery.data for more information + if ( !pvt ) { + delete cache[ id ].data; + + // Don't destroy the parent cache unless the internal data object + // had been the only thing left in it + if ( !isEmptyDataObject( cache[ id ] ) ) { + return; + } + } + + // Destroy the cache + if ( isNode ) { + jQuery.cleanData( [ elem ], true ); + + // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) + /* jshint eqeqeq: false */ + } else if ( support.deleteExpando || cache != cache.window ) { + /* jshint eqeqeq: true */ + delete cache[ id ]; + + // When all else fails, undefined + } else { + cache[ id ] = undefined; + } +} + +jQuery.extend( { + cache: {}, + + // The following elements (space-suffixed to avoid Object.prototype collisions) + // throw uncatchable exceptions if you attempt to set expando properties + noData: { + "applet ": true, + "embed ": true, + + // ...but Flash objects (which have this classid) *can* handle expandos + "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" + }, + + hasData: function( elem ) { + elem = elem.nodeType ? jQuery.cache[ elem[ jQuery.expando ] ] : elem[ jQuery.expando ]; + return !!elem && !isEmptyDataObject( elem ); + }, + + data: function( elem, name, data ) { + return internalData( elem, name, data ); + }, + + removeData: function( elem, name ) { + return internalRemoveData( elem, name ); + }, + + // For internal use only. + _data: function( elem, name, data ) { + return internalData( elem, name, data, true ); + }, + + _removeData: function( elem, name ) { + return internalRemoveData( elem, name, true ); + } +} ); + +jQuery.fn.extend( { + data: function( key, value ) { + var i, name, data, + elem = this[ 0 ], + attrs = elem && elem.attributes; + + // Special expections of .data basically thwart jQuery.access, + // so implement the relevant behavior ourselves + + // Gets all values + if ( key === undefined ) { + if ( this.length ) { + data = jQuery.data( elem ); + + if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { + i = attrs.length; + while ( i-- ) { + + // Support: IE11+ + // The attrs elements can be null (#14894) + if ( attrs[ i ] ) { + name = attrs[ i ].name; + if ( name.indexOf( "data-" ) === 0 ) { + name = jQuery.camelCase( name.slice( 5 ) ); + dataAttr( elem, name, data[ name ] ); + } + } + } + jQuery._data( elem, "parsedAttrs", true ); + } + } + + return data; + } + + // Sets multiple values + if ( typeof key === "object" ) { + return this.each( function() { + jQuery.data( this, key ); + } ); + } + + return arguments.length > 1 ? + + // Sets one value + this.each( function() { + jQuery.data( this, key, value ); + } ) : + + // Gets one value + // Try to fetch any internally stored data first + elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined; + }, + + removeData: function( key ) { + return this.each( function() { + jQuery.removeData( this, key ); + } ); + } +} ); + + +jQuery.extend( { + queue: function( elem, type, data ) { + var queue; + + if ( elem ) { + type = ( type || "fx" ) + "queue"; + queue = jQuery._data( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !queue || jQuery.isArray( data ) ) { + queue = jQuery._data( elem, type, jQuery.makeArray( data ) ); + } else { + queue.push( data ); + } + } + return queue || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + startLength = queue.length, + fn = queue.shift(), + hooks = jQuery._queueHooks( elem, type ), + next = function() { + jQuery.dequeue( elem, type ); + }; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + startLength--; + } + + if ( fn ) { + + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + // clear up the last queue stop function + delete hooks.stop; + fn.call( elem, next, hooks ); + } + + if ( !startLength && hooks ) { + hooks.empty.fire(); + } + }, + + // not intended for public consumption - generates a queueHooks object, + // or returns the current one + _queueHooks: function( elem, type ) { + var key = type + "queueHooks"; + return jQuery._data( elem, key ) || jQuery._data( elem, key, { + empty: jQuery.Callbacks( "once memory" ).add( function() { + jQuery._removeData( elem, type + "queue" ); + jQuery._removeData( elem, key ); + } ) + } ); + } +} ); + +jQuery.fn.extend( { + queue: function( type, data ) { + var setter = 2; + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + setter--; + } + + if ( arguments.length < setter ) { + return jQuery.queue( this[ 0 ], type ); + } + + return data === undefined ? + this : + this.each( function() { + var queue = jQuery.queue( this, type, data ); + + // ensure a hooks for this queue + jQuery._queueHooks( this, type ); + + if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + } ); + }, + dequeue: function( type ) { + return this.each( function() { + jQuery.dequeue( this, type ); + } ); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, obj ) { + var tmp, + count = 1, + defer = jQuery.Deferred(), + elements = this, + i = this.length, + resolve = function() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + }; + + if ( typeof type !== "string" ) { + obj = type; + type = undefined; + } + type = type || "fx"; + + while ( i-- ) { + tmp = jQuery._data( elements[ i ], type + "queueHooks" ); + if ( tmp && tmp.empty ) { + count++; + tmp.empty.add( resolve ); + } + } + resolve(); + return defer.promise( obj ); + } +} ); + + +( function() { + var shrinkWrapBlocksVal; + + support.shrinkWrapBlocks = function() { + if ( shrinkWrapBlocksVal != null ) { + return shrinkWrapBlocksVal; + } + + // Will be changed later if needed. + shrinkWrapBlocksVal = false; + + // Minified: var b,c,d + var div, body, container; + + body = document.getElementsByTagName( "body" )[ 0 ]; + if ( !body || !body.style ) { + + // Test fired too early or in an unsupported environment, exit. + return; + } + + // Setup + div = document.createElement( "div" ); + container = document.createElement( "div" ); + container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; + body.appendChild( container ).appendChild( div ); + + // Support: IE6 + // Check if elements with layout shrink-wrap their children + if ( typeof div.style.zoom !== "undefined" ) { + + // Reset CSS: box-sizing; display; margin; border + div.style.cssText = + + // Support: Firefox<29, Android 2.3 + // Vendor-prefix box-sizing + "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + + "box-sizing:content-box;display:block;margin:0;border:0;" + + "padding:1px;width:1px;zoom:1"; + div.appendChild( document.createElement( "div" ) ).style.width = "5px"; + shrinkWrapBlocksVal = div.offsetWidth !== 3; + } + + body.removeChild( container ); + + return shrinkWrapBlocksVal; + }; + +} )(); +var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; + +var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); + + +var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; + +var isHidden = function( elem, el ) { + + // isHidden might be called from jQuery#filter function; + // in that case, element will be second argument + elem = el || elem; + return jQuery.css( elem, "display" ) === "none" || + !jQuery.contains( elem.ownerDocument, elem ); + }; + + + +function adjustCSS( elem, prop, valueParts, tween ) { + var adjusted, + scale = 1, + maxIterations = 20, + currentValue = tween ? + function() { return tween.cur(); } : + function() { return jQuery.css( elem, prop, "" ); }, + initial = currentValue(), + unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), + + // Starting value computation is required for potential unit mismatches + initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && + rcssNum.exec( jQuery.css( elem, prop ) ); + + if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { + + // Trust units reported by jQuery.css + unit = unit || initialInUnit[ 3 ]; + + // Make sure we update the tween properties later on + valueParts = valueParts || []; + + // Iteratively approximate from a nonzero starting point + initialInUnit = +initial || 1; + + do { + + // If previous iteration zeroed out, double until we get *something*. + // Use string for doubling so we don't accidentally see scale as unchanged below + scale = scale || ".5"; + + // Adjust and apply + initialInUnit = initialInUnit / scale; + jQuery.style( elem, prop, initialInUnit + unit ); + + // Update scale, tolerating zero or NaN from tween.cur() + // Break the loop if scale is unchanged or perfect, or if we've just had enough. + } while ( + scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations + ); + } + + if ( valueParts ) { + initialInUnit = +initialInUnit || +initial || 0; + + // Apply relative offset (+=/-=) if specified + adjusted = valueParts[ 1 ] ? + initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : + +valueParts[ 2 ]; + if ( tween ) { + tween.unit = unit; + tween.start = initialInUnit; + tween.end = adjusted; + } + } + return adjusted; +} + + +// Multifunctional method to get and set values of a collection +// The value/s can optionally be executed if it's a function +var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { + var i = 0, + length = elems.length, + bulk = key == null; + + // Sets many values + if ( jQuery.type( key ) === "object" ) { + chainable = true; + for ( i in key ) { + access( elems, fn, i, key[ i ], true, emptyGet, raw ); + } + + // Sets one value + } else if ( value !== undefined ) { + chainable = true; + + if ( !jQuery.isFunction( value ) ) { + raw = true; + } + + if ( bulk ) { + + // Bulk operations run against the entire set + if ( raw ) { + fn.call( elems, value ); + fn = null; + + // ...except when executing function values + } else { + bulk = fn; + fn = function( elem, key, value ) { + return bulk.call( jQuery( elem ), value ); + }; + } + } + + if ( fn ) { + for ( ; i < length; i++ ) { + fn( + elems[ i ], + key, + raw ? value : value.call( elems[ i ], i, fn( elems[ i ], key ) ) + ); + } + } + } + + return chainable ? + elems : + + // Gets + bulk ? + fn.call( elems ) : + length ? fn( elems[ 0 ], key ) : emptyGet; +}; +var rcheckableType = ( /^(?:checkbox|radio)$/i ); + +var rtagName = ( /<([\w:-]+)/ ); + +var rscriptType = ( /^$|\/(?:java|ecma)script/i ); + +var rleadingWhitespace = ( /^\s+/ ); + +var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|" + + "details|dialog|figcaption|figure|footer|header|hgroup|main|" + + "mark|meter|nav|output|picture|progress|section|summary|template|time|video"; + + + +function createSafeFragment( document ) { + var list = nodeNames.split( "|" ), + safeFrag = document.createDocumentFragment(); + + if ( safeFrag.createElement ) { + while ( list.length ) { + safeFrag.createElement( + list.pop() + ); + } + } + return safeFrag; +} + + +( function() { + var div = document.createElement( "div" ), + fragment = document.createDocumentFragment(), + input = document.createElement( "input" ); + + // Setup + div.innerHTML = "
    a"; + + // IE strips leading whitespace when .innerHTML is used + support.leadingWhitespace = div.firstChild.nodeType === 3; + + // Make sure that tbody elements aren't automatically inserted + // IE will insert them into empty tables + support.tbody = !div.getElementsByTagName( "tbody" ).length; + + // Make sure that link elements get serialized correctly by innerHTML + // This requires a wrapper element in IE + support.htmlSerialize = !!div.getElementsByTagName( "link" ).length; + + // Makes sure cloning an html5 element does not cause problems + // Where outerHTML is undefined, this still works + support.html5Clone = + document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav>"; + + // Check if a disconnected checkbox will retain its checked + // value of true after appended to the DOM (IE6/7) + input.type = "checkbox"; + input.checked = true; + fragment.appendChild( input ); + support.appendChecked = input.checked; + + // Make sure textarea (and checkbox) defaultValue is properly cloned + // Support: IE6-IE11+ + div.innerHTML = ""; + support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; + + // #11217 - WebKit loses check when the name is after the checked attribute + fragment.appendChild( div ); + + // Support: Windows Web Apps (WWA) + // `name` and `type` must use .setAttribute for WWA (#14901) + input = document.createElement( "input" ); + input.setAttribute( "type", "radio" ); + input.setAttribute( "checked", "checked" ); + input.setAttribute( "name", "t" ); + + div.appendChild( input ); + + // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 + // old WebKit doesn't clone checked state correctly in fragments + support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Support: IE<9 + // Cloned elements keep attachEvent handlers, we use addEventListener on IE9+ + support.noCloneEvent = !!div.addEventListener; + + // Support: IE<9 + // Since attributes and properties are the same in IE, + // cleanData must set properties to undefined rather than use removeAttribute + div[ jQuery.expando ] = 1; + support.attributes = !div.getAttribute( jQuery.expando ); +} )(); + + +// We have to close these tags to support XHTML (#13200) +var wrapMap = { + option: [ 1, "" ], + legend: [ 1, "
    ", "
    " ], + area: [ 1, "", "" ], + + // Support: IE8 + param: [ 1, "", "" ], + thead: [ 1, "", "
    " ], + tr: [ 2, "", "
    " ], + col: [ 2, "", "
    " ], + td: [ 3, "", "
    " ], + + // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, + // unless wrapped in a div with non-breaking characters in front of it. + _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X
    ", "
    " ] +}; + +// Support: IE8-IE9 +wrapMap.optgroup = wrapMap.option; + +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + + +function getAll( context, tag ) { + var elems, elem, + i = 0, + found = typeof context.getElementsByTagName !== "undefined" ? + context.getElementsByTagName( tag || "*" ) : + typeof context.querySelectorAll !== "undefined" ? + context.querySelectorAll( tag || "*" ) : + undefined; + + if ( !found ) { + for ( found = [], elems = context.childNodes || context; + ( elem = elems[ i ] ) != null; + i++ + ) { + if ( !tag || jQuery.nodeName( elem, tag ) ) { + found.push( elem ); + } else { + jQuery.merge( found, getAll( elem, tag ) ); + } + } + } + + return tag === undefined || tag && jQuery.nodeName( context, tag ) ? + jQuery.merge( [ context ], found ) : + found; +} + + +// Mark scripts as having already been evaluated +function setGlobalEval( elems, refElements ) { + var elem, + i = 0; + for ( ; ( elem = elems[ i ] ) != null; i++ ) { + jQuery._data( + elem, + "globalEval", + !refElements || jQuery._data( refElements[ i ], "globalEval" ) + ); + } +} + + +var rhtml = /<|&#?\w+;/, + rtbody = / from table fragments + if ( !support.tbody ) { + + // String was a , *may* have spurious + elem = tag === "table" && !rtbody.test( elem ) ? + tmp.firstChild : + + // String was a bare or + wrap[ 1 ] === "
    " && !rtbody.test( elem ) ? + tmp : + 0; + + j = elem && elem.childNodes.length; + while ( j-- ) { + if ( jQuery.nodeName( ( tbody = elem.childNodes[ j ] ), "tbody" ) && + !tbody.childNodes.length ) { + + elem.removeChild( tbody ); + } + } + } + + jQuery.merge( nodes, tmp.childNodes ); + + // Fix #12392 for WebKit and IE > 9 + tmp.textContent = ""; + + // Fix #12392 for oldIE + while ( tmp.firstChild ) { + tmp.removeChild( tmp.firstChild ); + } + + // Remember the top-level container for proper cleanup + tmp = safe.lastChild; + } + } + } + + // Fix #11356: Clear elements from fragment + if ( tmp ) { + safe.removeChild( tmp ); + } + + // Reset defaultChecked for any radios and checkboxes + // about to be appended to the DOM in IE 6/7 (#8060) + if ( !support.appendChecked ) { + jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); + } + + i = 0; + while ( ( elem = nodes[ i++ ] ) ) { + + // Skip elements already in the context collection (trac-4087) + if ( selection && jQuery.inArray( elem, selection ) > -1 ) { + if ( ignored ) { + ignored.push( elem ); + } + + continue; + } + + contains = jQuery.contains( elem.ownerDocument, elem ); + + // Append to fragment + tmp = getAll( safe.appendChild( elem ), "script" ); + + // Preserve script evaluation history + if ( contains ) { + setGlobalEval( tmp ); + } + + // Capture executables + if ( scripts ) { + j = 0; + while ( ( elem = tmp[ j++ ] ) ) { + if ( rscriptType.test( elem.type || "" ) ) { + scripts.push( elem ); + } + } + } + } + + tmp = null; + + return safe; +} + + +( function() { + var i, eventName, + div = document.createElement( "div" ); + + // Support: IE<9 (lack submit/change bubble), Firefox (lack focus(in | out) events) + for ( i in { submit: true, change: true, focusin: true } ) { + eventName = "on" + i; + + if ( !( support[ i ] = eventName in window ) ) { + + // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) + div.setAttribute( eventName, "t" ); + support[ i ] = div.attributes[ eventName ].expando === false; + } + } + + // Null elements to avoid leaks in IE. + div = null; +} )(); + + +var rformElems = /^(?:input|select|textarea)$/i, + rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, + rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, + rtypenamespace = /^([^.]*)(?:\.(.+)|)/; + +function returnTrue() { + return true; +} + +function returnFalse() { + return false; +} + +// Support: IE9 +// See #13393 for more info +function safeActiveElement() { + try { + return document.activeElement; + } catch ( err ) { } +} + +function on( elem, types, selector, data, fn, one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + on( elem, type, selector, data, types[ type ], one ); + } + return elem; + } + + if ( data == null && fn == null ) { + + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return elem; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return elem.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + } ); +} + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + global: {}, + + add: function( elem, types, handler, data, selector ) { + var tmp, events, t, handleObjIn, + special, eventHandle, handleObj, + handlers, type, namespaces, origType, + elemData = jQuery._data( elem ); + + // Don't attach events to noData or text/comment nodes (but allow plain objects) + if ( !elemData ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + if ( !( events = elemData.events ) ) { + events = elemData.events = {}; + } + if ( !( eventHandle = elemData.handle ) ) { + eventHandle = elemData.handle = function( e ) { + + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== "undefined" && + ( !e || jQuery.event.triggered !== e.type ) ? + jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : + undefined; + }; + + // Add elem as a property of the handle fn to prevent a memory leak + // with IE non-native events + eventHandle.elem = elem; + } + + // Handle multiple events separated by a space + types = ( types || "" ).match( rnotwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // There *must* be a type, no attaching namespace-only handlers + if ( !type ) { + continue; + } + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend( { + type: type, + origType: origType, + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + needsContext: selector && jQuery.expr.match.needsContext.test( selector ), + namespace: namespaces.join( "." ) + }, handleObjIn ); + + // Init the event handler queue if we're the first + if ( !( handlers = events[ type ] ) ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener/attachEvent if the special events handler returns false + if ( !special.setup || + special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + + // Bind the global event handler to the element + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle, false ); + + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + // Nullify elem to prevent memory leaks in IE + elem = null; + }, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + var j, handleObj, tmp, + origCount, t, events, + special, handlers, type, + namespaces, origType, + elemData = jQuery.hasData( elem ) && jQuery._data( elem ); + + if ( !elemData || !( events = elemData.events ) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = ( types || "" ).match( rnotwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector ? special.delegateType : special.bindType ) || type; + handlers = events[ type ] || []; + tmp = tmp[ 2 ] && + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); + + // Remove matching events + origCount = j = handlers.length; + while ( j-- ) { + handleObj = handlers[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !tmp || tmp.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || + selector === "**" && handleObj.selector ) ) { + handlers.splice( j, 1 ); + + if ( handleObj.selector ) { + handlers.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( origCount && !handlers.length ) { + if ( !special.teardown || + special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + delete elemData.handle; + + // removeData also checks for emptiness and clears the expando if empty + // so use it instead of delete + jQuery._removeData( elem, "events" ); + } + }, + + trigger: function( event, data, elem, onlyHandlers ) { + var handle, ontype, cur, + bubbleType, special, tmp, i, + eventPath = [ elem || document ], + type = hasOwn.call( event, "type" ) ? event.type : event, + namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; + + cur = tmp = elem = elem || document; + + // Don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // focus/blur morphs to focusin/out; ensure we're not firing them right now + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { + return; + } + + if ( type.indexOf( "." ) > -1 ) { + + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split( "." ); + type = namespaces.shift(); + namespaces.sort(); + } + ontype = type.indexOf( ":" ) < 0 && "on" + type; + + // Caller can pass in a jQuery.Event object, Object, or just an event type string + event = event[ jQuery.expando ] ? + event : + new jQuery.Event( type, typeof event === "object" && event ); + + // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) + event.isTrigger = onlyHandlers ? 2 : 3; + event.namespace = namespaces.join( "." ); + event.rnamespace = event.namespace ? + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : + null; + + // Clean up the event in case it is being reused + event.result = undefined; + if ( !event.target ) { + event.target = elem; + } + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data == null ? + [ event ] : + jQuery.makeArray( data, [ event ] ); + + // Allow special events to draw outside the lines + special = jQuery.event.special[ type ] || {}; + if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { + return; + } + + // Determine event propagation path in advance, per W3C events spec (#9951) + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) + if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { + + bubbleType = special.delegateType || type; + if ( !rfocusMorph.test( bubbleType + type ) ) { + cur = cur.parentNode; + } + for ( ; cur; cur = cur.parentNode ) { + eventPath.push( cur ); + tmp = cur; + } + + // Only add window if we got to document (e.g., not plain obj or detached DOM) + if ( tmp === ( elem.ownerDocument || document ) ) { + eventPath.push( tmp.defaultView || tmp.parentWindow || window ); + } + } + + // Fire handlers on the event path + i = 0; + while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { + + event.type = i > 1 ? + bubbleType : + special.bindType || type; + + // jQuery handler + handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && + jQuery._data( cur, "handle" ); + + if ( handle ) { + handle.apply( cur, data ); + } + + // Native handler + handle = ontype && cur[ ontype ]; + if ( handle && handle.apply && acceptData( cur ) ) { + event.result = handle.apply( cur, data ); + if ( event.result === false ) { + event.preventDefault(); + } + } + } + event.type = type; + + // If nobody prevented the default action, do it now + if ( !onlyHandlers && !event.isDefaultPrevented() ) { + + if ( + ( !special._default || + special._default.apply( eventPath.pop(), data ) === false + ) && acceptData( elem ) + ) { + + // Call a native DOM method on the target with the same name name as the event. + // Can't use an .isFunction() check here because IE6/7 fails that test. + // Don't do default actions on window, that's where global variables be (#6170) + if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { + + // Don't re-trigger an onFOO event when we call its FOO() method + tmp = elem[ ontype ]; + + if ( tmp ) { + elem[ ontype ] = null; + } + + // Prevent re-triggering of the same event, since we already bubbled it above + jQuery.event.triggered = type; + try { + elem[ type ](); + } catch ( e ) { + + // IE<9 dies on focus/blur to hidden element (#1486,#12518) + // only reproducible on winXP IE8 native, not IE9 in IE8 mode + } + jQuery.event.triggered = undefined; + + if ( tmp ) { + elem[ ontype ] = tmp; + } + } + } + } + + return event.result; + }, + + dispatch: function( event ) { + + // Make a writable jQuery.Event from the native event object + event = jQuery.event.fix( event ); + + var i, j, ret, matched, handleObj, + handlerQueue = [], + args = slice.call( arguments ), + handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], + special = jQuery.event.special[ event.type ] || {}; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[ 0 ] = event; + event.delegateTarget = this; + + // Call the preDispatch hook for the mapped type, and let it bail if desired + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { + return; + } + + // Determine handlers + handlerQueue = jQuery.event.handlers.call( this, event, handlers ); + + // Run delegates first; they may want to stop propagation beneath us + i = 0; + while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { + event.currentTarget = matched.elem; + + j = 0; + while ( ( handleObj = matched.handlers[ j++ ] ) && + !event.isImmediatePropagationStopped() ) { + + // Triggered event must either 1) have no namespace, or 2) have namespace(s) + // a subset or equal to those in the bound event (both can have no namespace). + if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) { + + event.handleObj = handleObj; + event.data = handleObj.data; + + ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || + handleObj.handler ).apply( matched.elem, args ); + + if ( ret !== undefined ) { + if ( ( event.result = ret ) === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + // Call the postDispatch hook for the mapped type + if ( special.postDispatch ) { + special.postDispatch.call( this, event ); + } + + return event.result; + }, + + handlers: function( event, handlers ) { + var i, matches, sel, handleObj, + handlerQueue = [], + delegateCount = handlers.delegateCount, + cur = event.target; + + // Support (at least): Chrome, IE9 + // Find delegate handlers + // Black-hole SVG instance trees (#13180) + // + // Support: Firefox<=42+ + // Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343) + if ( delegateCount && cur.nodeType && + ( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) { + + /* jshint eqeqeq: false */ + for ( ; cur != this; cur = cur.parentNode || this ) { + /* jshint eqeqeq: true */ + + // Don't check non-elements (#13208) + // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) + if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) { + matches = []; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + + // Don't conflict with Object.prototype properties (#13203) + sel = handleObj.selector + " "; + + if ( matches[ sel ] === undefined ) { + matches[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) > -1 : + jQuery.find( sel, this, null, [ cur ] ).length; + } + if ( matches[ sel ] ) { + matches.push( handleObj ); + } + } + if ( matches.length ) { + handlerQueue.push( { elem: cur, handlers: matches } ); + } + } + } + } + + // Add the remaining (directly-bound) handlers + if ( delegateCount < handlers.length ) { + handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } ); + } + + return handlerQueue; + }, + + fix: function( event ) { + if ( event[ jQuery.expando ] ) { + return event; + } + + // Create a writable copy of the event object and normalize some properties + var i, prop, copy, + type = event.type, + originalEvent = event, + fixHook = this.fixHooks[ type ]; + + if ( !fixHook ) { + this.fixHooks[ type ] = fixHook = + rmouseEvent.test( type ) ? this.mouseHooks : + rkeyEvent.test( type ) ? this.keyHooks : + {}; + } + copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; + + event = new jQuery.Event( originalEvent ); + + i = copy.length; + while ( i-- ) { + prop = copy[ i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Support: IE<9 + // Fix target property (#1925) + if ( !event.target ) { + event.target = originalEvent.srcElement || document; + } + + // Support: Safari 6-8+ + // Target should not be a text node (#504, #13143) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + // Support: IE<9 + // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) + event.metaKey = !!event.metaKey; + + return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; + }, + + // Includes some event props shared by KeyEvent and MouseEvent + props: ( "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " + + "metaKey relatedTarget shiftKey target timeStamp view which" ).split( " " ), + + fixHooks: {}, + + keyHooks: { + props: "char charCode key keyCode".split( " " ), + filter: function( event, original ) { + + // Add which for key events + if ( event.which == null ) { + event.which = original.charCode != null ? original.charCode : original.keyCode; + } + + return event; + } + }, + + mouseHooks: { + props: ( "button buttons clientX clientY fromElement offsetX offsetY " + + "pageX pageY screenX screenY toElement" ).split( " " ), + filter: function( event, original ) { + var body, eventDoc, doc, + button = original.button, + fromElement = original.fromElement; + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && original.clientX != null ) { + eventDoc = event.target.ownerDocument || document; + doc = eventDoc.documentElement; + body = eventDoc.body; + + event.pageX = original.clientX + + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - + ( doc && doc.clientLeft || body && body.clientLeft || 0 ); + event.pageY = original.clientY + + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - + ( doc && doc.clientTop || body && body.clientTop || 0 ); + } + + // Add relatedTarget, if necessary + if ( !event.relatedTarget && fromElement ) { + event.relatedTarget = fromElement === event.target ? + original.toElement : + fromElement; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && button !== undefined ) { + event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); + } + + return event; + } + }, + + special: { + load: { + + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + focus: { + + // Fire native event if possible so blur/focus sequence is correct + trigger: function() { + if ( this !== safeActiveElement() && this.focus ) { + try { + this.focus(); + return false; + } catch ( e ) { + + // Support: IE<9 + // If we error on focus to hidden element (#1486, #12518), + // let .trigger() run the handlers + } + } + }, + delegateType: "focusin" + }, + blur: { + trigger: function() { + if ( this === safeActiveElement() && this.blur ) { + this.blur(); + return false; + } + }, + delegateType: "focusout" + }, + click: { + + // For checkbox, fire native event so checked state will be right + trigger: function() { + if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { + this.click(); + return false; + } + }, + + // For cross-browser consistency, don't fire native .click() on links + _default: function( event ) { + return jQuery.nodeName( event.target, "a" ); + } + }, + + beforeunload: { + postDispatch: function( event ) { + + // Support: Firefox 20+ + // Firefox doesn't alert if the returnValue field is not set. + if ( event.result !== undefined && event.originalEvent ) { + event.originalEvent.returnValue = event.result; + } + } + } + }, + + // Piggyback on a donor event to simulate a different one + simulate: function( type, elem, event ) { + var e = jQuery.extend( + new jQuery.Event(), + event, + { + type: type, + isSimulated: true + + // Previously, `originalEvent: {}` was set here, so stopPropagation call + // would not be triggered on donor event, since in our own + // jQuery.event.stopPropagation function we had a check for existence of + // originalEvent.stopPropagation method, so, consequently it would be a noop. + // + // Guard for simulated events was moved to jQuery.event.stopPropagation function + // since `originalEvent` should point to the original event for the + // constancy with other events and for more focused logic + } + ); + + jQuery.event.trigger( e, null, elem ); + + if ( e.isDefaultPrevented() ) { + event.preventDefault(); + } + } +}; + +jQuery.removeEvent = document.removeEventListener ? + function( elem, type, handle ) { + + // This "if" is needed for plain objects + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle ); + } + } : + function( elem, type, handle ) { + var name = "on" + type; + + if ( elem.detachEvent ) { + + // #8545, #7054, preventing memory leaks for custom events in IE6-8 + // detachEvent needed property on element, by name of that event, + // to properly expose it to GC + if ( typeof elem[ name ] === "undefined" ) { + elem[ name ] = null; + } + + elem.detachEvent( name, handle ); + } + }; + +jQuery.Event = function( src, props ) { + + // Allow instantiation without the 'new' keyword + if ( !( this instanceof jQuery.Event ) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = src.defaultPrevented || + src.defaultPrevented === undefined && + + // Support: IE < 9, Android < 4.0 + src.returnValue === false ? + returnTrue : + returnFalse; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || jQuery.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + constructor: jQuery.Event, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse, + + preventDefault: function() { + var e = this.originalEvent; + + this.isDefaultPrevented = returnTrue; + if ( !e ) { + return; + } + + // If preventDefault exists, run it on the original event + if ( e.preventDefault ) { + e.preventDefault(); + + // Support: IE + // Otherwise set the returnValue property of the original event to false + } else { + e.returnValue = false; + } + }, + stopPropagation: function() { + var e = this.originalEvent; + + this.isPropagationStopped = returnTrue; + + if ( !e || this.isSimulated ) { + return; + } + + // If stopPropagation exists, run it on the original event + if ( e.stopPropagation ) { + e.stopPropagation(); + } + + // Support: IE + // Set the cancelBubble property of the original event to true + e.cancelBubble = true; + }, + stopImmediatePropagation: function() { + var e = this.originalEvent; + + this.isImmediatePropagationStopped = returnTrue; + + if ( e && e.stopImmediatePropagation ) { + e.stopImmediatePropagation(); + } + + this.stopPropagation(); + } +}; + +// Create mouseenter/leave events using mouseover/out and event-time checks +// so that event delegation works in jQuery. +// Do the same for pointerenter/pointerleave and pointerover/pointerout +// +// Support: Safari 7 only +// Safari sends mouseenter too often; see: +// https://code.google.com/p/chromium/issues/detail?id=470258 +// for the description of the bug (it existed in older Chrome versions as well). +jQuery.each( { + mouseenter: "mouseover", + mouseleave: "mouseout", + pointerenter: "pointerover", + pointerleave: "pointerout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var ret, + target = this, + related = event.relatedTarget, + handleObj = event.handleObj; + + // For mouseenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +} ); + +// IE submit delegation +if ( !support.submit ) { + + jQuery.event.special.submit = { + setup: function() { + + // Only need this for delegated form submit events + if ( jQuery.nodeName( this, "form" ) ) { + return false; + } + + // Lazy-add a submit handler when a descendant form may potentially be submitted + jQuery.event.add( this, "click._submit keypress._submit", function( e ) { + + // Node name check avoids a VML-related crash in IE (#9807) + var elem = e.target, + form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? + + // Support: IE <=8 + // We use jQuery.prop instead of elem.form + // to allow fixing the IE8 delegated submit issue (gh-2332) + // by 3rd party polyfills/workarounds. + jQuery.prop( elem, "form" ) : + undefined; + + if ( form && !jQuery._data( form, "submit" ) ) { + jQuery.event.add( form, "submit._submit", function( event ) { + event._submitBubble = true; + } ); + jQuery._data( form, "submit", true ); + } + } ); + + // return undefined since we don't need an event listener + }, + + postDispatch: function( event ) { + + // If form was submitted by the user, bubble the event up the tree + if ( event._submitBubble ) { + delete event._submitBubble; + if ( this.parentNode && !event.isTrigger ) { + jQuery.event.simulate( "submit", this.parentNode, event ); + } + } + }, + + teardown: function() { + + // Only need this for delegated form submit events + if ( jQuery.nodeName( this, "form" ) ) { + return false; + } + + // Remove delegated handlers; cleanData eventually reaps submit handlers attached above + jQuery.event.remove( this, "._submit" ); + } + }; +} + +// IE change delegation and checkbox/radio fix +if ( !support.change ) { + + jQuery.event.special.change = { + + setup: function() { + + if ( rformElems.test( this.nodeName ) ) { + + // IE doesn't fire change on a check/radio until blur; trigger it on click + // after a propertychange. Eat the blur-change in special.change.handle. + // This still fires onchange a second time for check/radio after blur. + if ( this.type === "checkbox" || this.type === "radio" ) { + jQuery.event.add( this, "propertychange._change", function( event ) { + if ( event.originalEvent.propertyName === "checked" ) { + this._justChanged = true; + } + } ); + jQuery.event.add( this, "click._change", function( event ) { + if ( this._justChanged && !event.isTrigger ) { + this._justChanged = false; + } + + // Allow triggered, simulated change events (#11500) + jQuery.event.simulate( "change", this, event ); + } ); + } + return false; + } + + // Delegated event; lazy-add a change handler on descendant inputs + jQuery.event.add( this, "beforeactivate._change", function( e ) { + var elem = e.target; + + if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "change" ) ) { + jQuery.event.add( elem, "change._change", function( event ) { + if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { + jQuery.event.simulate( "change", this.parentNode, event ); + } + } ); + jQuery._data( elem, "change", true ); + } + } ); + }, + + handle: function( event ) { + var elem = event.target; + + // Swallow native change events from checkbox/radio, we already triggered them above + if ( this !== elem || event.isSimulated || event.isTrigger || + ( elem.type !== "radio" && elem.type !== "checkbox" ) ) { + + return event.handleObj.handler.apply( this, arguments ); + } + }, + + teardown: function() { + jQuery.event.remove( this, "._change" ); + + return !rformElems.test( this.nodeName ); + } + }; +} + +// Support: Firefox +// Firefox doesn't have focus(in | out) events +// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 +// +// Support: Chrome, Safari +// focus(in | out) events fire after focus & blur events, +// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order +// Related ticket - https://code.google.com/p/chromium/issues/detail?id=449857 +if ( !support.focusin ) { + jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler on the document while someone wants focusin/focusout + var handler = function( event ) { + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); + }; + + jQuery.event.special[ fix ] = { + setup: function() { + var doc = this.ownerDocument || this, + attaches = jQuery._data( doc, fix ); + + if ( !attaches ) { + doc.addEventListener( orig, handler, true ); + } + jQuery._data( doc, fix, ( attaches || 0 ) + 1 ); + }, + teardown: function() { + var doc = this.ownerDocument || this, + attaches = jQuery._data( doc, fix ) - 1; + + if ( !attaches ) { + doc.removeEventListener( orig, handler, true ); + jQuery._removeData( doc, fix ); + } else { + jQuery._data( doc, fix, attaches ); + } + } + }; + } ); +} + +jQuery.fn.extend( { + + on: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn ); + }, + one: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + var handleObj, type; + if ( types && types.preventDefault && types.handleObj ) { + + // ( event ) dispatched jQuery.Event + handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace ? + handleObj.origType + "." + handleObj.namespace : + handleObj.origType, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + + // ( types-object [, selector] ) + for ( type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each( function() { + jQuery.event.remove( this, types, fn, selector ); + } ); + }, + + trigger: function( type, data ) { + return this.each( function() { + jQuery.event.trigger( type, data, this ); + } ); + }, + triggerHandler: function( type, data ) { + var elem = this[ 0 ]; + if ( elem ) { + return jQuery.event.trigger( type, data, elem, true ); + } + } +} ); + + +var rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, + rnoshimcache = new RegExp( "<(?:" + nodeNames + ")[\\s/>]", "i" ), + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi, + + // Support: IE 10-11, Edge 10240+ + // In IE/Edge using regex groups here causes severe slowdowns. + // See https://connect.microsoft.com/IE/feedback/details/1736512/ + rnoInnerhtml = /\s*$/g, + safeFragment = createSafeFragment( document ), + fragmentDiv = safeFragment.appendChild( document.createElement( "div" ) ); + +// Support: IE<8 +// Manipulating tables requires a tbody +function manipulationTarget( elem, content ) { + return jQuery.nodeName( elem, "table" ) && + jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? + + elem.getElementsByTagName( "tbody" )[ 0 ] || + elem.appendChild( elem.ownerDocument.createElement( "tbody" ) ) : + elem; +} + +// Replace/restore the type attribute of script elements for safe DOM manipulation +function disableScript( elem ) { + elem.type = ( jQuery.find.attr( elem, "type" ) !== null ) + "/" + elem.type; + return elem; +} +function restoreScript( elem ) { + var match = rscriptTypeMasked.exec( elem.type ); + if ( match ) { + elem.type = match[ 1 ]; + } else { + elem.removeAttribute( "type" ); + } + return elem; +} + +function cloneCopyEvent( src, dest ) { + if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { + return; + } + + var type, i, l, + oldData = jQuery._data( src ), + curData = jQuery._data( dest, oldData ), + events = oldData.events; + + if ( events ) { + delete curData.handle; + curData.events = {}; + + for ( type in events ) { + for ( i = 0, l = events[ type ].length; i < l; i++ ) { + jQuery.event.add( dest, type, events[ type ][ i ] ); + } + } + } + + // make the cloned public data object a copy from the original + if ( curData.data ) { + curData.data = jQuery.extend( {}, curData.data ); + } +} + +function fixCloneNodeIssues( src, dest ) { + var nodeName, e, data; + + // We do not need to do anything for non-Elements + if ( dest.nodeType !== 1 ) { + return; + } + + nodeName = dest.nodeName.toLowerCase(); + + // IE6-8 copies events bound via attachEvent when using cloneNode. + if ( !support.noCloneEvent && dest[ jQuery.expando ] ) { + data = jQuery._data( dest ); + + for ( e in data.events ) { + jQuery.removeEvent( dest, e, data.handle ); + } + + // Event data gets referenced instead of copied if the expando gets copied too + dest.removeAttribute( jQuery.expando ); + } + + // IE blanks contents when cloning scripts, and tries to evaluate newly-set text + if ( nodeName === "script" && dest.text !== src.text ) { + disableScript( dest ).text = src.text; + restoreScript( dest ); + + // IE6-10 improperly clones children of object elements using classid. + // IE10 throws NoModificationAllowedError if parent is null, #12132. + } else if ( nodeName === "object" ) { + if ( dest.parentNode ) { + dest.outerHTML = src.outerHTML; + } + + // This path appears unavoidable for IE9. When cloning an object + // element in IE9, the outerHTML strategy above is not sufficient. + // If the src has innerHTML and the destination does not, + // copy the src.innerHTML into the dest.innerHTML. #10324 + if ( support.html5Clone && ( src.innerHTML && !jQuery.trim( dest.innerHTML ) ) ) { + dest.innerHTML = src.innerHTML; + } + + } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { + + // IE6-8 fails to persist the checked state of a cloned checkbox + // or radio button. Worse, IE6-7 fail to give the cloned element + // a checked appearance if the defaultChecked value isn't also set + + dest.defaultChecked = dest.checked = src.checked; + + // IE6-7 get confused and end up setting the value of a cloned + // checkbox/radio button to an empty string instead of "on" + if ( dest.value !== src.value ) { + dest.value = src.value; + } + + // IE6-8 fails to return the selected option to the default selected + // state when cloning options + } else if ( nodeName === "option" ) { + dest.defaultSelected = dest.selected = src.defaultSelected; + + // IE6-8 fails to set the defaultValue to the correct value when + // cloning other types of input fields + } else if ( nodeName === "input" || nodeName === "textarea" ) { + dest.defaultValue = src.defaultValue; + } +} + +function domManip( collection, args, callback, ignored ) { + + // Flatten any nested arrays + args = concat.apply( [], args ); + + var first, node, hasScripts, + scripts, doc, fragment, + i = 0, + l = collection.length, + iNoClone = l - 1, + value = args[ 0 ], + isFunction = jQuery.isFunction( value ); + + // We can't cloneNode fragments that contain checked, in WebKit + if ( isFunction || + ( l > 1 && typeof value === "string" && + !support.checkClone && rchecked.test( value ) ) ) { + return collection.each( function( index ) { + var self = collection.eq( index ); + if ( isFunction ) { + args[ 0 ] = value.call( this, index, self.html() ); + } + domManip( self, args, callback, ignored ); + } ); + } + + if ( l ) { + fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); + first = fragment.firstChild; + + if ( fragment.childNodes.length === 1 ) { + fragment = first; + } + + // Require either new content or an interest in ignored elements to invoke the callback + if ( first || ignored ) { + scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); + hasScripts = scripts.length; + + // Use the original fragment for the last item + // instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + for ( ; i < l; i++ ) { + node = fragment; + + if ( i !== iNoClone ) { + node = jQuery.clone( node, true, true ); + + // Keep references to cloned scripts for later restoration + if ( hasScripts ) { + + // Support: Android<4.1, PhantomJS<2 + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( scripts, getAll( node, "script" ) ); + } + } + + callback.call( collection[ i ], node, i ); + } + + if ( hasScripts ) { + doc = scripts[ scripts.length - 1 ].ownerDocument; + + // Reenable scripts + jQuery.map( scripts, restoreScript ); + + // Evaluate executable scripts on first document insertion + for ( i = 0; i < hasScripts; i++ ) { + node = scripts[ i ]; + if ( rscriptType.test( node.type || "" ) && + !jQuery._data( node, "globalEval" ) && + jQuery.contains( doc, node ) ) { + + if ( node.src ) { + + // Optional AJAX dependency, but won't run scripts if not present + if ( jQuery._evalUrl ) { + jQuery._evalUrl( node.src ); + } + } else { + jQuery.globalEval( + ( node.text || node.textContent || node.innerHTML || "" ) + .replace( rcleanScript, "" ) + ); + } + } + } + } + + // Fix #11809: Avoid leaking memory + fragment = first = null; + } + } + + return collection; +} + +function remove( elem, selector, keepData ) { + var node, + elems = selector ? jQuery.filter( selector, elem ) : elem, + i = 0; + + for ( ; ( node = elems[ i ] ) != null; i++ ) { + + if ( !keepData && node.nodeType === 1 ) { + jQuery.cleanData( getAll( node ) ); + } + + if ( node.parentNode ) { + if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { + setGlobalEval( getAll( node, "script" ) ); + } + node.parentNode.removeChild( node ); + } + } + + return elem; +} + +jQuery.extend( { + htmlPrefilter: function( html ) { + return html.replace( rxhtmlTag, "<$1>" ); + }, + + clone: function( elem, dataAndEvents, deepDataAndEvents ) { + var destElements, node, clone, i, srcElements, + inPage = jQuery.contains( elem.ownerDocument, elem ); + + if ( support.html5Clone || jQuery.isXMLDoc( elem ) || + !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { + + clone = elem.cloneNode( true ); + + // IE<=8 does not properly clone detached, unknown element nodes + } else { + fragmentDiv.innerHTML = elem.outerHTML; + fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); + } + + if ( ( !support.noCloneEvent || !support.noCloneChecked ) && + ( elem.nodeType === 1 || elem.nodeType === 11 ) && !jQuery.isXMLDoc( elem ) ) { + + // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 + destElements = getAll( clone ); + srcElements = getAll( elem ); + + // Fix all IE cloning issues + for ( i = 0; ( node = srcElements[ i ] ) != null; ++i ) { + + // Ensure that the destination node is not null; Fixes #9587 + if ( destElements[ i ] ) { + fixCloneNodeIssues( node, destElements[ i ] ); + } + } + } + + // Copy the events from the original to the clone + if ( dataAndEvents ) { + if ( deepDataAndEvents ) { + srcElements = srcElements || getAll( elem ); + destElements = destElements || getAll( clone ); + + for ( i = 0; ( node = srcElements[ i ] ) != null; i++ ) { + cloneCopyEvent( node, destElements[ i ] ); + } + } else { + cloneCopyEvent( elem, clone ); + } + } + + // Preserve script evaluation history + destElements = getAll( clone, "script" ); + if ( destElements.length > 0 ) { + setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); + } + + destElements = srcElements = node = null; + + // Return the cloned set + return clone; + }, + + cleanData: function( elems, /* internal */ forceAcceptData ) { + var elem, type, id, data, + i = 0, + internalKey = jQuery.expando, + cache = jQuery.cache, + attributes = support.attributes, + special = jQuery.event.special; + + for ( ; ( elem = elems[ i ] ) != null; i++ ) { + if ( forceAcceptData || acceptData( elem ) ) { + + id = elem[ internalKey ]; + data = id && cache[ id ]; + + if ( data ) { + if ( data.events ) { + for ( type in data.events ) { + if ( special[ type ] ) { + jQuery.event.remove( elem, type ); + + // This is a shortcut to avoid jQuery.event.remove's overhead + } else { + jQuery.removeEvent( elem, type, data.handle ); + } + } + } + + // Remove cache only if it was not already removed by jQuery.event.remove + if ( cache[ id ] ) { + + delete cache[ id ]; + + // Support: IE<9 + // IE does not allow us to delete expando properties from nodes + // IE creates expando attributes along with the property + // IE does not have a removeAttribute function on Document nodes + if ( !attributes && typeof elem.removeAttribute !== "undefined" ) { + elem.removeAttribute( internalKey ); + + // Webkit & Blink performance suffers when deleting properties + // from DOM nodes, so set to undefined instead + // https://code.google.com/p/chromium/issues/detail?id=378607 + } else { + elem[ internalKey ] = undefined; + } + + deletedIds.push( id ); + } + } + } + } + } +} ); + +jQuery.fn.extend( { + + // Keep domManip exposed until 3.0 (gh-2225) + domManip: domManip, + + detach: function( selector ) { + return remove( this, selector, true ); + }, + + remove: function( selector ) { + return remove( this, selector ); + }, + + text: function( value ) { + return access( this, function( value ) { + return value === undefined ? + jQuery.text( this ) : + this.empty().append( + ( this[ 0 ] && this[ 0 ].ownerDocument || document ).createTextNode( value ) + ); + }, null, value, arguments.length ); + }, + + append: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.appendChild( elem ); + } + } ); + }, + + prepend: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.insertBefore( elem, target.firstChild ); + } + } ); + }, + + before: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this ); + } + } ); + }, + + after: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this.nextSibling ); + } + } ); + }, + + empty: function() { + var elem, + i = 0; + + for ( ; ( elem = this[ i ] ) != null; i++ ) { + + // Remove element nodes and prevent memory leaks + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + } + + // Remove any remaining nodes + while ( elem.firstChild ) { + elem.removeChild( elem.firstChild ); + } + + // If this is a select, ensure that it displays empty (#12336) + // Support: IE<9 + if ( elem.options && jQuery.nodeName( elem, "select" ) ) { + elem.options.length = 0; + } + } + + return this; + }, + + clone: function( dataAndEvents, deepDataAndEvents ) { + dataAndEvents = dataAndEvents == null ? false : dataAndEvents; + deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; + + return this.map( function() { + return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); + } ); + }, + + html: function( value ) { + return access( this, function( value ) { + var elem = this[ 0 ] || {}, + i = 0, + l = this.length; + + if ( value === undefined ) { + return elem.nodeType === 1 ? + elem.innerHTML.replace( rinlinejQuery, "" ) : + undefined; + } + + // See if we can take a shortcut and just use innerHTML + if ( typeof value === "string" && !rnoInnerhtml.test( value ) && + ( support.htmlSerialize || !rnoshimcache.test( value ) ) && + ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && + !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { + + value = jQuery.htmlPrefilter( value ); + + try { + for ( ; i < l; i++ ) { + + // Remove element nodes and prevent memory leaks + elem = this[ i ] || {}; + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + elem.innerHTML = value; + } + } + + elem = 0; + + // If using innerHTML throws an exception, use the fallback method + } catch ( e ) {} + } + + if ( elem ) { + this.empty().append( value ); + } + }, null, value, arguments.length ); + }, + + replaceWith: function() { + var ignored = []; + + // Make the changes, replacing each non-ignored context element with the new content + return domManip( this, arguments, function( elem ) { + var parent = this.parentNode; + + if ( jQuery.inArray( this, ignored ) < 0 ) { + jQuery.cleanData( getAll( this ) ); + if ( parent ) { + parent.replaceChild( elem, this ); + } + } + + // Force callback invocation + }, ignored ); + } +} ); + +jQuery.each( { + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" +}, function( name, original ) { + jQuery.fn[ name ] = function( selector ) { + var elems, + i = 0, + ret = [], + insert = jQuery( selector ), + last = insert.length - 1; + + for ( ; i <= last; i++ ) { + elems = i === last ? this : this.clone( true ); + jQuery( insert[ i ] )[ original ]( elems ); + + // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() + push.apply( ret, elems.get() ); + } + + return this.pushStack( ret ); + }; +} ); + + +var iframe, + elemdisplay = { + + // Support: Firefox + // We have to pre-define these values for FF (#10227) + HTML: "block", + BODY: "block" + }; + +/** + * Retrieve the actual display of a element + * @param {String} name nodeName of the element + * @param {Object} doc Document object + */ + +// Called only from within defaultDisplay +function actualDisplay( name, doc ) { + var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), + + display = jQuery.css( elem[ 0 ], "display" ); + + // We don't have any data stored on the element, + // so use "detach" method as fast way to get rid of the element + elem.detach(); + + return display; +} + +/** + * Try to determine the default display value of an element + * @param {String} nodeName + */ +function defaultDisplay( nodeName ) { + var doc = document, + display = elemdisplay[ nodeName ]; + + if ( !display ) { + display = actualDisplay( nodeName, doc ); + + // If the simple way fails, read from inside an iframe + if ( display === "none" || !display ) { + + // Use the already-created iframe if possible + iframe = ( iframe || jQuery( "